I'm specifically asking for a test case: see https://github.com/doctrine/doctrine2/tree/d3f6c5ec70aac4b029a4b61ecf1e2ba61a1a4a6d/tests/Doctrine/Tests/ORM/Functional/Ticket for examples.
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On Fri, Mar 24, 2017 at 1:13 PM, springercreative via doctrine-user < [email protected]> wrote: > Thanxs for your answer: > > 1) Is such a complex identifier really needed? > Yes the complex identifier is needed. The original database is a legacy > system, which was not generated with doctrine. And i want to reach the > target now that I make a database with the same db structure as the legacy > system with inserting some fixtures afterwards. > > 2) Are auto-increment identifiers in use? > Not in table xyzInt. In other tables there exists auto-increment > identifiers. But before i load the fixtures i'm setting > $connection->query('SET FOREIGN_KEY_CHECKS=0') to prevent the > auto-increment mechanism. Note: Fixtures for tables with simple primary key > are working already fine. > > 3) What's the entity code alike? Minimal example needed > > <?php > > namespace Entity; > > /** > * Xyzint > */ > class Xyzint > { > public function __construct($id, $language, $name) > { > $this->id = $id; > $this->language = $language; > $this->name = $name; > } > > /*********************************************************** > ******************** > * > * Doctrine2 code below! > * > * - Please add you own methods above > * - New generated code by dc2 is added at end of file > * > ************************************************************ > ******************/ > > /** > * @var integer > */ > private $id = 0; > > /** > * @var string > */ > private $language = ''; > > /** > * @var string > */ > private $name = ''; > > ... > > /** > * @var \Entity\Xyz > */ > private $Xyz; > > /** > * @var \Entity\language > */ > private $language; > > > /** > * Set id > * > * @param integer $id > * > * @return Xyzint > */ > public function setId($id) > { > $this->id = $id; > > return $this; > } > > /** > * Get id > * > * @return integer > */ > public function getId() > { > return $this->id; > } > > /** > * Set language > * > * @param string $language > * > * @return Xyzint > */ > public function setLanguage($language) > { > $this->language = $language; > > return $this; > } > > /** > * Get language > * > * @return string > */ > public function getlanguage() > { > return $this->language; > } > > /** > * Set name > * > * @param string $name > * > * @return Xyzint > */ > public function setName($name) > { > $this->name = $name; > > return $this; > } > > /** > * Get name > * > * @return string > */ > public function getName() > { > return $this->name; > } > ... > > /** > * Set xyz > * > * @param \Entity\Xyz $xyz > * > * @return Xyzint > */ > public function setXyz(\Entity\Xyz $xyz = null) > { > $this->Xyz = $xyz; > > return $this; > } > > /** > * Get xyz > * > * @return \Entity\Xyz > */ > public function getXyz() > { > return $this->Xyz; > } > > } > > 4) It would be nice to *NOT* have that example in YAML. > > Sorry for the convenience. But all(!) orm-files and fixtures are made with > yaml. The fixure loader (command) is reading the values of yaml-fixtures > and setting the values in the class-Object (with the setter functions > mentioned in (3)) , which is persisted in the database afterwards. > > 5) can you please make an example that reproduces the issue? > > Here is a yaml-example: > xyzInt1: > id: 1 > language: de > name: ian > further_field: "further field entry" > ... > > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
