Generate merged entity class files with symfony2 -



Generate merged entity class files with symfony2 -

i'm little bit stuck poor knowledge of symfony2 , doctrine. here i'm trying do: have 2 different files containing class definition of same class. want merge these 2 new class file.

i have existing entity class file foo.php:

/** * @orm\entity * @orm\table(name="foo") */ class foo { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue * * @var int */ protected $id; /** * @orm\column(type="string") * * @var string */ protected $name; /** * @param string $name * @return void */ public function setname($name) { $this->name = (string) $name; } /** * @return string name */ public function getname() { homecoming $this->name; } protected function somemagic($in) { die('no magic happens.'); } }

and sec entity class file same name foo.php:

/** * @orm\entity * @orm\table(name="foo") */ class foo { /** * @orm\column(type="string") * * @var string */ protected $color; /** * @param string $name * @return void */ public function setcolor($color) { $this->color = $this->somecolormagic($color); } /** * @return string name */ public function getcolor() { homecoming $this->color; } protected function somemagic($in) { homecoming 'magic: ' . $out; } }

how can merge these 2 (not @ runtime, during installation of symfony application - done symfony console command foobar:install) merged class foo written file fooextended.php contains properties , methods of both classes , doctrine annotations preserved?

does symfony (or doctrinebundle within) back upwards stuff out of box? or can point me right direction how can achieved?

it turned out changes in design can solve problem simple class inheritance. there no need class merging @ design time.

class symfony2 doctrine2

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -