Library/Bullhorn/FastRest/Generator/ControllerBuilder.php
private function buildRelatedModels() {
        /** @var Base[] $relatedModels */
        $relatedModels = array();
        /** @var ModelBuilder[] $relatedBuilders */
        $relatedBuilders = array();
        $automaticallyUpdatedFields = $this->getModel()->getAutomaticallyUpdatedFields();
        foreach($this->getModel()->getDefaultRelationships() as $alias) {
            $relation = $this->getModel()->getModelsManager()->getRelationByAlias(get_class($this->getModel()), $alias);
            if($relation !== false) {
                if(in_array($relation->getFields(), $automaticallyUpdatedFields)) {
                    $referencedModel = $relation->getReferencedModel();
                    /** @var Base $relatedModel */
                    $relatedModel = new $referencedModel();
                    $relatedModels[$alias] = $relatedModel;
                    $relatedBuilders[$alias] = new ModelBuilder($this->getConfiguration(), $relatedModel->getSource());
                }
            }
        }
        $this->setRelatedModels($relatedModels);
        $this->setRelatedBuilders($relatedBuilders);
    }
private function buildRelatedModels() {
        /** @var Base[] $relatedModels */
        $relatedModels = array();
        /** @var ModelBuilder[] $relatedBuilders */
        $relatedBuilders = array();
        $automaticallyUpdatedFields = $this->getModel()->getAutomaticallyUpdatedFields();
        foreach($this->getModel()->getDefaultRelationships() as $alias) {
            $relation = $this->getModel()->getModelsManager()->getRelationByAlias(get_class($this->getModel()), $alias);
            if($relation !== false) {
                if(in_array($relation->getFields(), $automaticallyUpdatedFields)) {
                    $referencedModel = $relation->getReferencedModel();
                    /** @var Base $relatedModel */
                    $relatedModel = new $referencedModel();
                    $relatedModels[$alias] = $relatedModel;
                    $relatedBuilders[$alias] = new ModelBuilder($this->getConfiguration(), $relatedModel->getSource());
                }
            }
        }
        $this->setRelatedModels($relatedModels);
        $this->setRelatedBuilders($relatedBuilders);
    }
private function buildRelatedModels ( ) { /** @var Base[] $relatedModels */ $ relatedModels = array ( ) ; /** @var ModelBuilder[] $relatedBuilders */ $ relatedBuilders = array ( ) ; $ automaticallyUpdatedFields = $ this -> getModel ( ) -> getAutomaticallyUpdatedFields ( ) ; foreach ( $ this -> getModel ( ) -> getDefaultRelationships ( ) as $ alias ) { $ relation = $ this -> getModel ( ) -> getModelsManager ( ) -> getRelationByAlias ( get_class ( $ this -> getModel ( ) ) , $ alias ) ; if ( $ relation !== false ) { if ( in_array ( $ relation -> getFields ( ) , $ automaticallyUpdatedFields ) ) { $ referencedModel = $ relation -> getReferencedModel ( ) ; /** @var Base $relatedModel */ $ relatedModel = new $ referencedModel ( ) ; $ relatedModels [ $ alias ] = $ relatedModel ; $ relatedBuilders [ $ alias ] = new ModelBuilder ( $ this -> getConfiguration ( ) , $ relatedModel -> getSource ( ) ) ; } } } $ this -> setRelatedModels ( $ relatedModels ) ; $ this -> setRelatedBuilders ( $ relatedBuilders ) ; }
Builds the related required models, such as user to employee
@return void
Builds the related required models such as user to employee