Neomerx\JsonApi\Contracts\Document\DocumentInterface::setResourceCompleted PHP Method

setResourceCompleted() public method

Mark resource as completed (no new relations/links/etc will be added to the resource anymore).
public setResourceCompleted ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource ) : void
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
return void
    public function setResourceCompleted(ResourceObjectInterface $resource);

Usage Example

Example #1
0
 /**
  * @param Frame $current
  *
  * @return void
  */
 private function setResourceCompleted(Frame $current)
 {
     // Add resource if it is a main resource (even if it has no fields) or
     // if field set allows any fields for this type (filter out resources with no attributes and relationships)
     if ($current->getLevel() === 1 || $this->parameterAnalyzer->hasSomeFields($current->getResource()->getType()) === true) {
         $resourceObject = $current->getResource();
         $this->document->setResourceCompleted($resourceObject);
     }
 }
All Usage Examples Of Neomerx\JsonApi\Contracts\Document\DocumentInterface::setResourceCompleted