Ciao.
Codice PHP:
class A{
private $B= null;
public function __construct(B $b){
$this->B = $b;
}
}
class A{
private $B= null;
public function __construct(){
$this->B = singleton::getInstance('B');;
}
}
![]()
Ciao.
Codice PHP:
class A{
private $B= null;
public function __construct(B $b){
$this->B = $b;
}
}
class A{
private $B= null;
public function __construct(){
$this->B = singleton::getInstance('B');;
}
}
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it
rettifico l'aggregazione la uso in tutti
e due i casi ma è meglio passare l'oggetto
al __construct o utilizzare il singleton !
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it