protected function _getOrThrow($id, $conditions = [])
    {
        $this->loadModel('Field.FieldInstances');
        $conditions = array_merge(['id' => $id], $conditions);
        $instance = $this->FieldInstances
            ->find()
            ->where($conditions)
            ->limit(1)
            ->first();

        if (!$instance) {
            throw new RecordNotFoundException(__d('field', 'The requested field does not exists.'));
        }

        return $instance;
    }
protected function _getOrThrow($id, $conditions = [])
    {
        $this->loadModel('Field.FieldInstances');
        $conditions = array_merge(['id' => $id], $conditions);
        $instance = $this->FieldInstances
            ->find()
            ->where($conditions)
            ->limit(1)
            ->first();

        if (!$instance) {
            throw new RecordNotFoundException(__d('field', 'The requested field does not exists.'));
        }

        return $instance;
    }
protected function _getOrThrow ( $ id , $ conditions = [ ] ) { $ this -> loadModel ( 'Field.FieldInstances' ) ; $ conditions = array_merge ( [ 'id' => $ id ] , $ conditions ) ; $ instance = $ this -> FieldInstances -> find ( ) -> where ( $ conditions ) -> limit ( 1 ) -> first ( ) ; if ( ! $ instance ) { throw new RecordNotFoundException ( __d ( 'field' , 'The requested field does not exists.' ) ) ; } return $ instance ; }
Gets the given field instance by ID or throw if not exists.

@param int $id Field instance ID
@param array $conditions Additional conditions for the WHERE query
@return \Field\Model\Entity\FieldInstance The instance
@throws \Cake\ORM\Exception\RecordNotFoundException When instance
was not found
Gets the given field instance by ID or throw if not exists .