public function setUpConstraints(&$options)
    {
        $constraints = $this->validator->arrayGet($options, 'constraints');
        $model       = $this->config->getDataModel();

        //set up and check the constraints
        if (is_array($constraints) && sizeof($constraints)) {
            $validConstraints = array();

            //iterate over the constraints and only include the valid ones
            foreach ($constraints as $field => $rel) {
                //check if the supplied values are strings and that their methods exist on their respective models
                if (is_string($field) && is_string($rel) && method_exists($model, $field)) {
                    $validConstraints[$field] = $rel;
                }
            }

            $options['constraints'] = $validConstraints;
        }
    }
public function setUpConstraints(&$options)
    {
        $constraints = $this->validator->arrayGet($options, 'constraints');
        $model       = $this->config->getDataModel();

        //set up and check the constraints
        if (is_array($constraints) && sizeof($constraints)) {
            $validConstraints = array();

            //iterate over the constraints and only include the valid ones
            foreach ($constraints as $field => $rel) {
                //check if the supplied values are strings and that their methods exist on their respective models
                if (is_string($field) && is_string($rel) && method_exists($model, $field)) {
                    $validConstraints[$field] = $rel;
                }
            }

            $options['constraints'] = $validConstraints;
        }
    }
public function setUpConstraints ( & $ options ) { $ constraints = $ this -> validator -> arrayGet ( $ options , 'constraints' ) ; $ model = $ this -> config -> getDataModel ( ) ; //set up and check the constraints if ( is_array ( $ constraints ) && sizeof ( $ constraints ) ) { $ validConstraints = array ( ) ; //iterate over the constraints and only include the valid ones foreach ( $ constraints as $ field => $ rel ) { //check if the supplied values are strings and that their methods exist on their respective models if ( is_string ( $ field ) && is_string ( $ rel ) && method_exists ( $ model , $ field ) ) { $ validConstraints [ $ field ] = $ rel ; } } $ options [ 'constraints' ] = $ validConstraints ; } }
Sets up the constraints for a relationship field if provided. We do this so we can assume later that it will just work.

@param array $options
Sets up the constraints for a relationship field if provided . We do this so we can assume later that it will just work .