code/view/json.php
protected function _includeResource(ModelEntityInterface $entity)
    {
        $cache  = $entity->getIdentifier()->name.'-'.$entity->getHandle();

        if (!isset($this->_included_resources[$cache])) {
            $this->_included_resources[$cache] = $this->_createResource($entity, array('relationships' => false));
        }

        $resource = $this->_included_resources[$cache];

        return array(
            'data' => array(
                'type' => $resource['type'],
                'id'   => $resource['id']
            )
        );
    }
protected function _includeResource(ModelEntityInterface $entity)
    {
        $cache  = $entity->getIdentifier()->name.'-'.$entity->getHandle();

        if (!isset($this->_included_resources[$cache])) {
            $this->_included_resources[$cache] = $this->_createResource($entity, array('relationships' => false));
        }

        $resource = $this->_included_resources[$cache];

        return array(
            'data' => array(
                'type' => $resource['type'],
                'id'   => $resource['id']
            )
        );
    }
protected function _includeResource ( ModelEntityInterface $ entity ) { $ cache = $ entity -> getIdentifier ( ) -> name . '-' . $ entity -> getHandle ( ) ; if ( ! isset ( $ this -> _included_resources [ $ cache ] ) ) { $ this -> _included_resources [ $ cache ] = $ this -> _createResource ( $ entity , array ( 'relationships' => false ) ) ; } $ resource = $ this -> _included_resources [ $ cache ] ; return array ( 'data' => array ( 'type' => $ resource [ 'type' ] , 'id' => $ resource [ 'id' ] ) ) ; }
Creates a resource object and returns a resource identifier object specified by JSON API

@see   http://jsonapi.org/format/#document-resource-identifier-objects
@param ModelEntityInterface $entity
@return array
Creates a resource object and returns a resource identifier object specified by JSON API