Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-831

Return value of getAssociationMapping in class Doctrine\ORM\Mapping\ClassMetadataInfo

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      The problem is in the comment of function return value is Doctrine\ORM\Mapping\AssociationMapping.
      My code expected to work with object of this type and normal situation is Fatal error: Call to a member function isOneToOne() on a non-object in /home/vis/projects/crm/trunk/library/Viscomp/Doctrine/Repository.php on line 371.

      In my mind I suppose is normal to return object of Doctrine\ORM\Mapping\AssociationMapping, because in comment return value have this type.

      I will be grateful if have fast answer because this is blocking issue for my project.

       /**
           * Gets the mapping of an association.
           *
           * @param string $fieldName  The field name that represents the association in
           *                           the object model.
           * @return Doctrine\ORM\Mapping\AssociationMapping  The mapping.
           */
          public function getAssociationMapping($fieldName)
          {
              if ( ! isset($this->associationMappings[$fieldName])) {
                  throw MappingException::mappingNotFound($this->name, $fieldName);
              }
              return $this->associationMappings[$fieldName];
          }
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        That is out of date, Association Mappings are now arrays. See the public $associationMappings definition how this array is structured.

        Show
        Benjamin Eberlei added a comment - That is out of date, Association Mappings are now arrays. See the public $associationMappings definition how this array is structured.
        Hide
        victor Velkov added a comment -

        Could you please change the comment of return value of this method.

        Show
        victor Velkov added a comment - Could you please change the comment of return value of this method.
        Hide
        Benjamin Eberlei added a comment -

        fixed

        Show
        Benjamin Eberlei added a comment - fixed

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            victor Velkov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: