private function getSelectFromParent(&$klassInfo)
    {
        foreach ($klassInfo['related_klass_infos'] as &$relatedKlassInfo) {
            // get fields from parent and add them to the related class.
            if ($relatedKlassInfo['from_parent']) {
                $relatedKlassInfo['select_fields'] = array_merge(
                    $klassInfo['select_fields'],
                    $relatedKlassInfo['select_fields']
                );
            }

            // do the same for the related class fields incase it has own children.
            $this->getSelectFromParent($relatedKlassInfo);
        }
    }
private function getSelectFromParent(&$klassInfo)
    {
        foreach ($klassInfo['related_klass_infos'] as &$relatedKlassInfo) {
            // get fields from parent and add them to the related class.
            if ($relatedKlassInfo['from_parent']) {
                $relatedKlassInfo['select_fields'] = array_merge(
                    $klassInfo['select_fields'],
                    $relatedKlassInfo['select_fields']
                );
            }

            // do the same for the related class fields incase it has own children.
            $this->getSelectFromParent($relatedKlassInfo);
        }
    }
private function getSelectFromParent ( & $ klassInfo ) { foreach ( $ klassInfo [ 'related_klass_infos' ] as & $ relatedKlassInfo ) { // get fields from parent and add them to the related class. if ( $ relatedKlassInfo [ 'from_parent' ] ) { $ relatedKlassInfo [ 'select_fields' ] = array_merge ( $ klassInfo [ 'select_fields' ] , $ relatedKlassInfo [ 'select_fields' ] ) ; } // do the same for the related class fields incase it has own children. $ this -> getSelectFromParent ( $ relatedKlassInfo ) ; } }
For each related klass, if the klass extends the model whose info we get, we need to add the models class to
the select_fields of the related class.

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
For each related klass if the klass extends the model whose info we get we need to add the models class to the select_fields of the related class .