original_string: protected function _getInstance($name)
      {
          $this->loadModel('Field.FieldInstances');
          $instance = $this->FieldInstances
              ->find()
              ->contain(['EavAttribute'])
              ->where(['EavAttribute.name' => $name])
              ->first();
  
          if (!$instance) {
              $this->_error(__d('field', 'Invalid field instance.'), 504);
          }
  
          return $instance;
      }
code: protected function _getInstance($name)
      {
          $this->loadModel('Field.FieldInstances');
          $instance = $this->FieldInstances
              ->find()
              ->contain(['EavAttribute'])
              ->where(['EavAttribute.name' => $name])
              ->first();
  
          if (!$instance) {
              $this->_error(__d('field', 'Invalid field instance.'), 504);
          }
  
          return $instance;
      }
code_tokens: protected function _getInstance ( $ name ) { $ this -> loadModel ( 'Field.FieldInstances' ) ; $ instance = $ this -> FieldInstances -> find ( ) -> contain ( [ 'EavAttribute' ] ) -> where ( [ 'EavAttribute.name' => $ name ] ) -> first ( ) ; if ( ! $ instance ) { $ this -> _error ( __d ( 'field' , 'Invalid field instance.' ) , 504 ) ; } return $ instance ; }
docstring: Get field instance information.
  
  @param string $name EAV attribute name
  @return \Field\Model\Entity\FieldInstance
  @throws \Cake\Network\Exception\NotFoundException When invalid attribute name
  is given
docstring_tokens: Get field instance information .