public function setRelationshipType(array &$options, $loadRelationships)
    {
        //if this is a relationship
        if ($this->validator->arrayGet($options, 'type') === 'relationship') {
            //get the right key based on the relationship in the model
            $options['type'] = $this->getRelationshipKey($options['field_name']);

            //if we should load the relationships, set the option
            $options['load_relationships'] = $loadRelationships && !$this->validator->arrayGet($options, 'autocomplete', false);
        }
    }
public function setRelationshipType(array &$options, $loadRelationships)
    {
        //if this is a relationship
        if ($this->validator->arrayGet($options, 'type') === 'relationship') {
            //get the right key based on the relationship in the model
            $options['type'] = $this->getRelationshipKey($options['field_name']);

            //if we should load the relationships, set the option
            $options['load_relationships'] = $loadRelationships && !$this->validator->arrayGet($options, 'autocomplete', false);
        }
    }
public function setRelationshipType ( array & $ options , $ loadRelationships ) { //if this is a relationship if ( $ this -> validator -> arrayGet ( $ options , 'type' ) === 'relationship' ) { //get the right key based on the relationship in the model $ options [ 'type' ] = $ this -> getRelationshipKey ( $ options [ 'field_name' ] ) ; //if we should load the relationships, set the option $ options [ 'load_relationships' ] = $ loadRelationships && ! $ this -> validator -> arrayGet ( $ options , 'autocomplete' , false ) ; } }
Ensures that a relationship field is valid.

@param array $options
@param bool  $loadRelationships
Ensures that a relationship field is valid .