original_string: protected function validateField($field = null)
      {
          $field = $field ?: post(self::PARAM_FIELD);
  
          if ($field && $field != $this->field) {
              $this->initRelation($this->model, $field);
          }
  
          if (!$field && !$this->field) {
              throw new ApplicationException(Lang::get('backend::lang.relation.missing_definition', compact('field')));
          }
  
          return $field ?: $this->field;
      }
code: protected function validateField($field = null)
      {
          $field = $field ?: post(self::PARAM_FIELD);
  
          if ($field && $field != $this->field) {
              $this->initRelation($this->model, $field);
          }
  
          if (!$field && !$this->field) {
              throw new ApplicationException(Lang::get('backend::lang.relation.missing_definition', compact('field')));
          }
  
          return $field ?: $this->field;
      }
code_tokens: protected function validateField ( $ field = null ) { $ field = $ field ? : post ( self :: PARAM_FIELD ) ; if ( $ field && $ field != $ this -> field ) { $ this -> initRelation ( $ this -> model , $ field ) ; } if ( ! $ field && ! $ this -> field ) { throw new ApplicationException ( Lang :: get ( 'backend::lang.relation.missing_definition' , compact ( 'field' ) ) ) ; } return $ field ? : $ this -> field ; }
docstring: Validates the supplied field and initializes the relation manager.
  @param string $field The relationship field.
  @return string The active field name.
docstring_tokens: Validates the supplied field and initializes the relation manager .