Código PHP:
<?php
interface Individuos
{
static function getInstance();
function initialize( $data );
}
abstract class Personas implements Individuos
{
protected $name;
protected static $instance;
protected function __construct()
{
}
public static function getInstance() {
if ( ! self::$instance )
{
$class = get_class();
echo $class; //sale Personas
self::$instance = new $class();
}
return self::$instance;
}
public function initialize($data)
{
$this->name = $data["name"];
}
}
class Hombre extends Personas
{
}
$data = array('name' => 't');
$tb = Hombre::getInstance();
$tb->initialize( $data );
?>
Alguna solución o alternativa?
Muchas gracias