public convertDataResourceToArray ( Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface $resource, boolean $isShowAttributes ) : array | ||
$resource | Neomerx\JsonApi\Contracts\Schema\ResourceObjectInterface | |
$isShowAttributes | boolean | |
리턴 | array |
public function convertDataResourceToArray(ResourceObjectInterface $resource, $isShowAttributes)
{
return $this->convertResourceToArray($resource, $resource->getResourceLinks(), $resource->getPrimaryMeta(), $isShowAttributes);
}
/** * @inheritdoc */ public function addToData(ResourceObjectInterface $resource) { // check if 'not-arrayed' data were added you cannot add to 'non-array' data section anymore assert('$this->isDataArrayed === null || $this->isDataArrayed === true'); $this->isDataArrayed !== null ?: ($this->isDataArrayed = $resource->isInArray()); // check all resources have the same isInArray flag assert('$this->isDataArrayed === $resource->isInArray()'); $idx = $resource->getId(); $type = $resource->getType(); assert('isset($this->bufferForData[$type][$idx]) === false'); $this->bufferForData[$type][$idx] = $this->presenter->convertDataResourceToArray($resource, true); }