Skip to content

Loading…

DDC-831: Return value of getAssociationMapping in class Doctrine\ORM\Mapping\ClassMetadataInfo #5351

Closed
doctrinebot opened this Issue · 4 comments

1 participant

@doctrinebot

Jira issue originally created by user vigor_bg:

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];
    }
@doctrinebot

Comment created by @beberlei:

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

@doctrinebot

Comment created by vigor_bg:

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

@doctrinebot

Comment created by @beberlei:

fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-RC1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.