That's a known limitation currently.


On Sat, Feb 8, 2014 at 7:39 PM, boite <notifications@github.com> wrote:

> In lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:
>
> > +    /**
> > +     * Inline the embeddable class
> > +     *
> > +     * @param string $property
> > +     * @param ClassMetadataInfo $embeddable
> > +     */
> > +    public function inlineEmbeddable($property, ClassMetadataInfo $embeddable)
> > +    {
> > +        foreach ($embeddable->fieldMappings as $fieldMapping) {
> > +            $fieldMapping['declaredField'] = $property;
> > +            $fieldMapping['originalField'] = $fieldMapping['fieldName'];
> > +            $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName'];
> > +
> > +            $fieldMapping['columnName'] = ! empty($this->embeddedClasses[$property]['columnPrefix'])
> > +                    ? $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']
> > +                        : $this->namingStrategy->embeddedFieldToColumnName($property, $fieldMapping['columnName'], $this->reflClass->name, $embeddable->reflClass->name);
>
> $this->reflClass->name, $embeddable->reflClass->name cause PHP Notice:
> Trying to get property of non-object if either of the reflClassproperties are null. Suggest something like:
>
> if (! empty($this->embeddedClasses[$property]['columnPrefix'])) {
>     $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName'];
> } else {
>     $className = $this->reflClass ? $this->reflClass->name : null;
>     $embeddedClassName = $embeddable->reflClass ? $embeddable->reflClass->name : null;
>     $fieldMapping['columnName'] = $this->namingStrategy->embeddedFieldToColumnName($property, $fieldMapping['columnName'], $className, $embeddedClassName);
> }
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/doctrine/doctrine2/pull/835/files#r9565192>
> .
>