public function processEagerLoading($entities, $resourceDefinition, Context $context)
    {
        $definition = ResourceDefinitionLibrary::make($resourceDefinition);

        // Now check for query parameters
        foreach ($definition->getFields() as $field) {

            $this->currentPath->push($field);

            if (
                $field instanceof RelationshipField &&
                $this->shouldInclude($field, $context) &&
                $this->shouldExpand($field, $context)
            ) {
                $this->propertyResolver->eagerLoadRelationship($this, $entities, $field, $context);
            }

            $this->currentPath->pop();
        }
    }
public function processEagerLoading($entities, $resourceDefinition, Context $context)
    {
        $definition = ResourceDefinitionLibrary::make($resourceDefinition);

        // Now check for query parameters
        foreach ($definition->getFields() as $field) {

            $this->currentPath->push($field);

            if (
                $field instanceof RelationshipField &&
                $this->shouldInclude($field, $context) &&
                $this->shouldExpand($field, $context)
            ) {
                $this->propertyResolver->eagerLoadRelationship($this, $entities, $field, $context);
            }

            $this->currentPath->pop();
        }
    }
public function processEagerLoading ( $ entities , $ resourceDefinition , Context $ context ) { $ definition = ResourceDefinitionLibrary :: make ( $ resourceDefinition ) ; // Now check for query parameters foreach ( $ definition -> getFields ( ) as $ field ) { $ this -> currentPath -> push ( $ field ) ; if ( $ field instanceof RelationshipField && $ this -> shouldInclude ( $ field , $ context ) && $ this -> shouldExpand ( $ field , $ context ) ) { $ this -> propertyResolver -> eagerLoadRelationship ( $ this , $ entities , $ field , $ context ) ; } $ this -> currentPath -> pop ( ) ; } }
Given a querybuilder or a list of items, process eager loading for each relationship that should be visible.
This method should be called before calling toEntities, and is also called for each relationship that needs
to be loaded.
@param $entities
@param $resourceDefinition
@param ContextContract $context
Given a querybuilder or a list of items process eager loading for each relationship that should be visible . This method should be called before calling toEntities and is also called for each relationship that needs to be loaded .