Library/Bullhorn/FastRest/Api/Services/ControllerHelper/Show.php
private function showRecursive(\stdClass $output, Field $field, ApiInterface $entity) {
        $this->getAcl()->canRead($entity);
        $columns = $entity->getModelsMetaData()->getColumnMap($entity);
        $columns = array_merge($columns, $entity->getExtraProperties());
        foreach($field->getChildren() as $child) {
            $this->showParentsAndChildren(
                $output,
                $entity,
                $child
            );
        }
        foreach($field->getFields() as $subField) {
            if($subField == '*') { //All parts
                $lazyProperties = $entity->getLazyProperties();
                foreach(array_diff($columns, $lazyProperties) as $column) {
                    $this->showField($output, $entity, $column);
                }
            } elseif(in_array($subField, $columns)) {
                $this->showField($output, $entity, $subField);
            } elseif(in_array($subField, $entity->getChildrenRelationships()) || in_array($subField, $entity->getParentRelationships())) {
                throw new Exception('Invalid Field, child or parent: ' . $entity->getEntityName() . ' with "' . $subField . '". Please add .* to the end to get all related fields', 400);
            } else {
                throw new Exception('Invalid Field, not on the current object: ' . $entity->getEntityName() . ' with ' . $subField, 400);
            }
        }
    }
private function showRecursive(\stdClass $output, Field $field, ApiInterface $entity) {
        $this->getAcl()->canRead($entity);
        $columns = $entity->getModelsMetaData()->getColumnMap($entity);
        $columns = array_merge($columns, $entity->getExtraProperties());
        foreach($field->getChildren() as $child) {
            $this->showParentsAndChildren(
                $output,
                $entity,
                $child
            );
        }
        foreach($field->getFields() as $subField) {
            if($subField == '*') { //All parts
                $lazyProperties = $entity->getLazyProperties();
                foreach(array_diff($columns, $lazyProperties) as $column) {
                    $this->showField($output, $entity, $column);
                }
            } elseif(in_array($subField, $columns)) {
                $this->showField($output, $entity, $subField);
            } elseif(in_array($subField, $entity->getChildrenRelationships()) || in_array($subField, $entity->getParentRelationships())) {
                throw new Exception('Invalid Field, child or parent: ' . $entity->getEntityName() . ' with "' . $subField . '". Please add .* to the end to get all related fields', 400);
            } else {
                throw new Exception('Invalid Field, not on the current object: ' . $entity->getEntityName() . ' with ' . $subField, 400);
            }
        }
    }
private function showRecursive ( \ stdClass $ output , Field $ field , ApiInterface $ entity ) { $ this -> getAcl ( ) -> canRead ( $ entity ) ; $ columns = $ entity -> getModelsMetaData ( ) -> getColumnMap ( $ entity ) ; $ columns = array_merge ( $ columns , $ entity -> getExtraProperties ( ) ) ; foreach ( $ field -> getChildren ( ) as $ child ) { $ this -> showParentsAndChildren ( $ output , $ entity , $ child ) ; } foreach ( $ field -> getFields ( ) as $ subField ) { if ( $ subField == '*' ) { //All parts $ lazyProperties = $ entity -> getLazyProperties ( ) ; foreach ( array_diff ( $ columns , $ lazyProperties ) as $ column ) { $ this -> showField ( $ output , $ entity , $ column ) ; } } elseif ( in_array ( $ subField , $ columns ) ) { $ this -> showField ( $ output , $ entity , $ subField ) ; } elseif ( in_array ( $ subField , $ entity -> getChildrenRelationships ( ) ) || in_array ( $ subField , $ entity -> getParentRelationships ( ) ) ) { throw new Exception ( 'Invalid Field, child or parent: ' . $ entity -> getEntityName ( ) . ' with "' . $ subField . '". Please add .* to the end to get all related fields' , 400 ) ; } else { throw new Exception ( 'Invalid Field, not on the current object: ' . $ entity -> getEntityName ( ) . ' with ' . $ subField , 400 ) ; } } }
Adds to the output object the specified field

@param \stdClass $output
@param Field $field
@param ApiInterface $entity

@return void
@throws Exception
Adds to the output object the specified field