Factory/JsFormValidatorFactory.php
protected function parseConstraints(array $constraints)
    {
        $result = array();
        foreach ($constraints as $item) {
            // Translate messages if need and add to result
            foreach ($item as $propName => $propValue) {
                if (false !== strpos(strtolower($propName), 'message')) {
                    $item->{$propName} = $this->translateMessage($propValue);
                }
            }

            if ($item instanceof \Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity) {
                $item = new UniqueEntity($item, $this->currentElement->getConfig()->getDataClass());
            }

            $result[get_class($item)][] = $item;
        }

        return $result;
    }
protected function parseConstraints(array $constraints)
    {
        $result = array();
        foreach ($constraints as $item) {
            // Translate messages if need and add to result
            foreach ($item as $propName => $propValue) {
                if (false !== strpos(strtolower($propName), 'message')) {
                    $item->{$propName} = $this->translateMessage($propValue);
                }
            }

            if ($item instanceof \Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity) {
                $item = new UniqueEntity($item, $this->currentElement->getConfig()->getDataClass());
            }

            $result[get_class($item)][] = $item;
        }

        return $result;
    }
protected function parseConstraints ( array $ constraints ) { $ result = array ( ) ; foreach ( $ constraints as $ item ) { // Translate messages if need and add to result foreach ( $ item as $ propName => $ propValue ) { if ( false !== strpos ( strtolower ( $ propName ) , 'message' ) ) { $ item -> { $ propName } = $ this -> translateMessage ( $ propValue ) ; } } if ( $ item instanceof \ Symfony \ Bridge \ Doctrine \ Validator \ Constraints \ UniqueEntity ) { $ item = new UniqueEntity ( $ item , $ this -> currentElement -> getConfig ( ) -> getDataClass ( ) ) ; } $ result [ get_class ( $ item ) ] [ ] = $ item ; } return $ result ; }
Converts list of constraints objects to a data array

@param array $constraints

@return array
Converts list of constraints objects to a data array