protected function splitForOrder(array $validationTypes)
    {
        // pre-assume every item is sortable
        $sortable = $validationTypes;

        // hols temporary removed items
        $nonsortable = [];

        // types to be removed before ordering
        $removeTypes = [
            Doozr_Form_Service_Validator_Constant::VALIDATE_VALUE,
            Doozr_Form_Service_Validator_Constant::VALIDATE_MINLENGTH,
            Doozr_Form_Service_Validator_Constant::VALIDATE_MAXLENGTH,
            Doozr_Form_Service_Validator_Constant::VALIDATE_POSTCODE,
            Doozr_Form_Service_Validator_Constant::VALIDATE_USTID,
        ];

        // iterate over non-sortable validation-types and split
        foreach ($removeTypes as $removeType) {
            if (isset($sortable[$removeType])) {
                $nonsortable[$removeType] = $sortable[$removeType];
                // remove for sorting
                unset($sortable[$removeType]);
            }
        }

        // return prepared items
        return [
            'sortable'    => $sortable,
            'nonsortable' => $nonsortable,
        ];
    }
protected function splitForOrder(array $validationTypes)
    {
        // pre-assume every item is sortable
        $sortable = $validationTypes;

        // hols temporary removed items
        $nonsortable = [];

        // types to be removed before ordering
        $removeTypes = [
            Doozr_Form_Service_Validator_Constant::VALIDATE_VALUE,
            Doozr_Form_Service_Validator_Constant::VALIDATE_MINLENGTH,
            Doozr_Form_Service_Validator_Constant::VALIDATE_MAXLENGTH,
            Doozr_Form_Service_Validator_Constant::VALIDATE_POSTCODE,
            Doozr_Form_Service_Validator_Constant::VALIDATE_USTID,
        ];

        // iterate over non-sortable validation-types and split
        foreach ($removeTypes as $removeType) {
            if (isset($sortable[$removeType])) {
                $nonsortable[$removeType] = $sortable[$removeType];
                // remove for sorting
                unset($sortable[$removeType]);
            }
        }

        // return prepared items
        return [
            'sortable'    => $sortable,
            'nonsortable' => $nonsortable,
        ];
    }
protected function splitForOrder ( array $ validationTypes ) { // pre-assume every item is sortable $ sortable = $ validationTypes ; // hols temporary removed items $ nonsortable = [ ] ; // types to be removed before ordering $ removeTypes = [ Doozr_Form_Service_Validator_Constant :: VALIDATE_VALUE , Doozr_Form_Service_Validator_Constant :: VALIDATE_MINLENGTH , Doozr_Form_Service_Validator_Constant :: VALIDATE_MAXLENGTH , Doozr_Form_Service_Validator_Constant :: VALIDATE_POSTCODE , Doozr_Form_Service_Validator_Constant :: VALIDATE_USTID , ] ; // iterate over non-sortable validation-types and split foreach ( $ removeTypes as $ removeType ) { if ( isset ( $ sortable [ $ removeType ] ) ) { $ nonsortable [ $ removeType ] = $ sortable [ $ removeType ] ; // remove for sorting unset ( $ sortable [ $ removeType ] ) ; } } // return prepared items return [ 'sortable' => $ sortable , 'nonsortable' => $ nonsortable , ] ; }
Splits the validation-types into sortable and non-sortable parts.

@param array $validationTypes The validation-types to split

@author Benjamin Carl <opensource@clickalicious.de>

@return array The splitted list of validation-types
Splits the validation - types into sortable and non - sortable parts .