original_string: public function containsOne($field, $model)
      {
          if (is_array($field) && $field[0]) {
              $field['name'] = $field[0];
              unset($field[0]);
          }
          if ($e = $this->hasElement(is_string($field) ? $field : $field['name'])) {
              $e->destroy();
          }
          $this->add('Relation_ContainsOne', $field)
              ->setModel($model);
      }
code: public function containsOne($field, $model)
      {
          if (is_array($field) && $field[0]) {
              $field['name'] = $field[0];
              unset($field[0]);
          }
          if ($e = $this->hasElement(is_string($field) ? $field : $field['name'])) {
              $e->destroy();
          }
          $this->add('Relation_ContainsOne', $field)
              ->setModel($model);
      }
code_tokens: public function containsOne ( $ field , $ model ) { if ( is_array ( $ field ) && $ field [ 0 ] ) { $ field [ 'name' ] = $ field [ 0 ] ; unset ( $ field [ 0 ] ) ; } if ( $ e = $ this -> hasElement ( is_string ( $ field ) ? $ field : $ field [ 'name' ] ) ) { $ e -> destroy ( ) ; } $ this -> add ( 'Relation_ContainsOne' , $ field ) -> setModel ( $ model ) ; }
docstring: Defines contained model for field
docstring_tokens: Defines contained model for field