Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2659

Notice: Undefined index: sourceToTargetKeyColumns in /doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister .php line 1180

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
    • Environment:
      Symfony2 With PHP 5.5 on Ubuntu 12.04 LTS using Apache 2

      Description

      I am getting this error:

       Notice: Undefined index: sourceToTargetKeyColumns
      

      When I try to load my data fixture. There are two ordered fixtures that I'm dealing with: Clients and Users. The client datafixture looks like:

          	/**
          	 * {@inheritDoc}
          	 */
          	 public function load(ObjectManager $manager)
          	 {
          
          		for($index = 0; $index < 224; $index ++)
          		{
          			$client = new Client();
          			$manager->persist($client);
                              $this->addReference($index . 'Client', $client);
          		}
          
          		$manager->flush();
          		$manager->clear();
          	 }
          
          	 public function getOrder()
          	 {
          	 	return 0;
          	 }
      

      While the user data fixture looks like:

           $user = New User();
           $client = $this->getReference($index . 'Client');
      
           // This line is causing the problem
           $client->setUser($user);
      

      For whatever reason, I don't seem to be having issues with any of my other fixtures. Just this one. I've doubled check the entity relationships which are shown bellow.

      My Client.php entity:

          /**
           * @ORM\ OneToOne(targetEntity="User", mappedBy="clientAccount")
           */
          protected $user;
      

      My User.php entity:

          /**
           * @ORM\ OneToOne(targetEntity="Client", inversedBy="user")
           */
          protected $clientAccount;
      

      There seems to be a bug with the return value of getAssociationMapping() for special conditions when implemented in BasicEntityPersister. The files for my fixtures and entities for this project have been attached.

      1. Client.php
        7 kB
        Taylor Kaplan
      2. ClientFixtures.php
        1 kB
        Taylor Kaplan
      3. User.php
        23 kB
        Taylor Kaplan
      4. UserFixtures.php
        5 kB
        Taylor Kaplan

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Taylor Kaplan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: