Neomerx\JsonApi\Document\Document::addToIncluded PHP Method

addToIncluded() public method

public addToIncluded ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource )
$resource Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface
    public function addToIncluded(ResourceObjectInterface $resource)
    {
        $idx = $resource->getId();
        $type = $resource->getType();
        if (isset($this->hasBeenMetAlready[$type][$idx]) === false) {
            $this->bufferForIncluded[$type][$idx] = $this->presenter->convertIncludedResourceToArray($resource);
            $this->hasBeenMetAlready[$type][$idx] = true;
        }
    }