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

Closed
opened 2026-01-22 12:59:14 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 7, 2010).

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];
    }
Originally created by @doctrinebot on GitHub (Oct 7, 2010). 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]; } ```
admin added the Bug label 2026-01-22 12:59:14 +01:00
admin closed this issue 2026-01-22 12:59:14 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 7, 2010):

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 commented on GitHub (Oct 7, 2010): Comment created by @beberlei: That is out of date, Association Mappings are now arrays. See the public $associationMappings definition how this array is structured.
Author
Owner

@doctrinebot commented on GitHub (Oct 8, 2010):

Comment created by vigor_bg:

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

@doctrinebot commented on GitHub (Oct 8, 2010): Comment created by vigor_bg: Could you please change the comment of return value of this method.
Author
Owner

@doctrinebot commented on GitHub (Oct 10, 2010):

Comment created by @beberlei:

fixed

@doctrinebot commented on GitHub (Oct 10, 2010): Comment created by @beberlei: fixed
Author
Owner

@doctrinebot commented on GitHub (Oct 10, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Oct 10, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1025