protected function addConstraints(XType $type, &$rule)
    {

        foreach ($type->constraints as $name=>$parameters) {

            if ($name == 'not_null') {
                continue;
            }

            if (isset($this->constraintToRule[$name])) {
                $constraintName = $this->constraintToRule[$name];
                $rule[] = $constraintName . ':' . implode($parameters);
            }

        }
    }
protected function addConstraints(XType $type, &$rule)
    {

        foreach ($type->constraints as $name=>$parameters) {

            if ($name == 'not_null') {
                continue;
            }

            if (isset($this->constraintToRule[$name])) {
                $constraintName = $this->constraintToRule[$name];
                $rule[] = $constraintName . ':' . implode($parameters);
            }

        }
    }
protected function addConstraints ( XType $ type , & $ rule ) { foreach ( $ type -> constraints as $ name => $ parameters ) { if ( $ name == 'not_null' ) { continue ; } if ( isset ( $ this -> constraintToRule [ $ name ] ) ) { $ constraintName = $ this -> constraintToRule [ $ name ] ; $ rule [ ] = $ constraintName . ':' . implode ( $ parameters ) ; } } }
Add the constraints as rules

@param XType $type
@param array $rule
Add the constraints as rules