src/Server/Resource/DoctrineResource.php
/**
     * Fetch a resource
     *
     * If the extractCollections array contains a collection for this resource
     * expand that collection instead of returning a link to the collection
     *
     * @param mixed $id
     * @return ApiProblem|mixed
     */
Fetch a resource
If the extractCollections array contains a collection for this resource
expand that collection instead of returning a link to the collection

@param mixed $id
@return ApiProblem|mixed
Fetch a resource If the extractCollections array contains a collection for this resource expand that collection instead of returning a link to the collection @param mixed $id @return ApiProblem|mixed
public function fetch($id)
    {
        $event = new DoctrineResourceEvent(DoctrineResourceEvent::EVENT_FETCH_PRE, $this);
        $event->setEntityClassName($this->getEntityClass());
        $event->setResourceEvent($this->getEvent());
        $event->setEntityId($id);
        $eventManager = $this->getEventManager();
        $response = $eventManager->triggerEvent($event);
        if ($response->last() instanceof ApiProblem) {
            return $response->last();
        }
        $entity = $this->findEntity($id, 'fetch');
        if ($entity instanceof ApiProblem) {
            return $entity;
        }
        $results = $this->triggerDoctrineEvent(DoctrineResourceEvent::EVENT_FETCH_POST, $entity);
        if ($results->last() instanceof ApiProblem) {
            return $results->last();
        }
        return $entity;
    }
public function fetch ( $ id ) { $ event = new DoctrineResourceEvent ( DoctrineResourceEvent :: EVENT_FETCH_PRE , $ this ) ; $ event -> setEntityClassName ( $ this -> getEntityClass ( ) ) ; $ event -> setResourceEvent ( $ this -> getEvent ( ) ) ; $ event -> setEntityId ( $ id ) ; $ eventManager = $ this -> getEventManager ( ) ; $ response = $ eventManager -> triggerEvent ( $ event ) ; if ( $ response -> last ( ) instanceof ApiProblem ) { return $ response -> last ( ) ; } $ entity = $ this -> findEntity ( $ id , 'fetch' ) ; if ( $ entity instanceof ApiProblem ) { return $ entity ; } $ results = $ this -> triggerDoctrineEvent ( DoctrineResourceEvent :: EVENT_FETCH_POST , $ entity ) ; if ( $ results -> last ( ) instanceof ApiProblem ) { return $ results -> last ( ) ; } return $ entity ; }
Fetch a resource
 If the extractCollections array contains a collection for this resource
 expand that collection instead of returning a link to the collection
Fetch a resource If the extractCollections array contains a collection for this resource expand that collection instead of returning a link to the collection