I have a difficult doubt to explain.
Suppose I have a class in php:
file: classA.php
<?
claseA {
//mi codigo de la clase
}
and I have a factory that creates the instance:
file: myFactory.php
<? include 'claseA.php'
miFactory {
//getInstanceOfA () {
//codigo para retornar una instancia unica de A...
}
Now, to use the factory that returns class A, I must include the factory, suppose:
index.php
<? require_once 'myFactory.php';
$factory = new Factory();
$factory->getInstanceOfA(); //un codigo que funciona
THE PROBLEM:
In this index, having the require of each file, You could also do:
$instanciaDeAsinUsarFactory = new claseA(); // y tambien funciona!!!
How can I break those visibilities despite the need for include?