, , .
, Doctrine. Doctrine ORM .
, , PHP, , Doctrine. , PHP- getters/seters , (, Kotlin, #).
? . extend .
:
class Product
{
protected $id;
protected $name;
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function setName($name)
{
$this->name = $name;
}
}
:
class Product extends \YourNamespace\Product implements \Doctrine\ORM\Proxy\Proxy
{
public function getId(): int
{
if ($this->__isInitialized__ === false) {
return (int) parent::getId();
}
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', []);
return parent::getId();
}
public function getName(): string
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getName', []);
return parent::getName();
}
}
(, , , , Doctrine ORM)
, Proxy - Doctrine. - . . . , Doctrine.