protected function generateMorphableClasses(array &$metadata)
    {
        foreach ($metadata as $key => $entityMetadata) {
            foreach ($entityMetadata['relations'] as $relationKey => $relationMetadata) {
                // get morphable classes for morphTo relations
                if ($relationMetadata['type'] == 'morphTo') {
                    $metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
                        = $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata);
                }

                // get morphable classes for morphToMany relations
                if ($relationMetadata['type'] == 'morphToMany' && ! $relationMetadata['options']['inverse']) {
                    $metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
                        = $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata, true);
                }
            }
        }
    }
protected function generateMorphableClasses(array &$metadata)
    {
        foreach ($metadata as $key => $entityMetadata) {
            foreach ($entityMetadata['relations'] as $relationKey => $relationMetadata) {
                // get morphable classes for morphTo relations
                if ($relationMetadata['type'] == 'morphTo') {
                    $metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
                        = $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata);
                }

                // get morphable classes for morphToMany relations
                if ($relationMetadata['type'] == 'morphToMany' && ! $relationMetadata['options']['inverse']) {
                    $metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
                        = $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata, true);
                }
            }
        }
    }
protected function generateMorphableClasses ( array & $ metadata ) { foreach ( $ metadata as $ key => $ entityMetadata ) { foreach ( $ entityMetadata [ 'relations' ] as $ relationKey => $ relationMetadata ) { // get morphable classes for morphTo relations if ( $ relationMetadata [ 'type' ] == 'morphTo' ) { $ metadata [ $ key ] [ 'relations' ] [ $ relationKey ] [ 'options' ] [ 'morphableClasses' ] = $ this -> getMorphableClasses ( $ entityMetadata [ 'class' ] , $ relationMetadata [ 'options' ] [ 'morphName' ] , $ metadata ) ; } // get morphable classes for morphToMany relations if ( $ relationMetadata [ 'type' ] == 'morphToMany' && ! $ relationMetadata [ 'options' ] [ 'inverse' ] ) { $ metadata [ $ key ] [ 'relations' ] [ $ relationKey ] [ 'options' ] [ 'morphableClasses' ] = $ this -> getMorphableClasses ( $ entityMetadata [ 'class' ] , $ relationMetadata [ 'options' ] [ 'morphName' ] , $ metadata , true ) ; } } } }
Generate array of morphable classes for a morphTo or morphToMany relation.

@param array $array
@return void
Generate array of morphable classes for a morphTo or morphToMany relation .