Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-47

@AlsoLoad annotation, used on method causes fatal error

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0BETA1
    • Component/s: Mapping Drivers
    • Labels:
      None

      Description

      Getting following errors when using @AlsoLoad annotation on method:

      Notice: Undefined index: isCascadePersist in library\Doctrine\ODM\MongoDB\UnitOfWork.php on line 1661
      
      Notice: Undefined index: fieldName in library\Doctrine\ODM\MongoDB\UnitOfWork.php on line 362
      
      Notice: Undefined index: in library\Doctrine\ODM\MongoDB\Mapping\ClassMetadata.php on line 923
      
      Fatal error: Call to a member function getValue() on a non-object in library\Doctrine\ODM\MongoDB\Mapping\ClassMetadata.php on line 923
      

      Test Case:

      /** @Document(db="tests", collection="tests") */
      class a
      {
          /** @Id */
          protected $id;
      
          /** @String */
          protected $b = 'tmp';
      
          /** @AlsoLoad("c") */
          function renameC($c) {$this->b = $c;}
          function getId() {return $this->id;}
      }
      
      $a = new a();
      $dm->persist($a);
      $dm->flush();
      $dm->getUnitOfWork()->clear();
      
      $a = $dm->loadByID('a', $a->getId());
      

        Activity

        Show
        Jonathan H. Wage added a comment - Thanks for all the issues Fixed here http://github.com/doctrine/mongodb-odm/commit/6e7610ac99dcc4cab92cd01bd66e0a2c9ffda1ce

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Vladimir Razuvaev
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: