protected function _findRecord($id, Subject $subject)
    {
        $repository = $this->_table();
        $this->_configIndex($repository, $this->_request());

        if ($this->_request()->query('type')) {
            $repository->name($this->_request()->query('type'));
        }

        $query = $repository->find($this->findMethod());
        $query->where(['_id' => $id]);
        $subject->set([
            'repository' => $repository,
            'query' => $query
        ]);
        $this->_trigger('beforeFind', $subject);
        $entity = $query->first();
        if (!$entity) {
            return $this->_notFound($id, $subject);
        }
        $subject->set(['entity' => $entity, 'success' => true]);
        $this->_trigger('afterFind', $subject);

        return $entity;
    }
protected function _findRecord($id, Subject $subject)
    {
        $repository = $this->_table();
        $this->_configIndex($repository, $this->_request());

        if ($this->_request()->query('type')) {
            $repository->name($this->_request()->query('type'));
        }

        $query = $repository->find($this->findMethod());
        $query->where(['_id' => $id]);
        $subject->set([
            'repository' => $repository,
            'query' => $query
        ]);
        $this->_trigger('beforeFind', $subject);
        $entity = $query->first();
        if (!$entity) {
            return $this->_notFound($id, $subject);
        }
        $subject->set(['entity' => $entity, 'success' => true]);
        $this->_trigger('afterFind', $subject);

        return $entity;
    }
protected function _findRecord ( $ id , Subject $ subject ) { $ repository = $ this -> _table ( ) ; $ this -> _configIndex ( $ repository , $ this -> _request ( ) ) ; if ( $ this -> _request ( ) -> query ( 'type' ) ) { $ repository -> name ( $ this -> _request ( ) -> query ( 'type' ) ) ; } $ query = $ repository -> find ( $ this -> findMethod ( ) ) ; $ query -> where ( [ '_id' => $ id ] ) ; $ subject -> set ( [ 'repository' => $ repository , 'query' => $ query ] ) ; $ this -> _trigger ( 'beforeFind' , $ subject ) ; $ entity = $ query -> first ( ) ; if ( ! $ entity ) { return $ this -> _notFound ( $ id , $ subject ) ; } $ subject -> set ( [ 'entity' => $ entity , 'success' => true ] ) ; $ this -> _trigger ( 'afterFind' , $ subject ) ; return $ entity ; }
Find a audit log by id.

@param string $id Record id
@param \Crud\Event\Subject $subject Event subject
@return \AuditStash\Model\Document\AuditLog
Find a audit log by id .