protected function validateFormatCountry()
    {
        $field = 'format';
        $format = $this->getSubmitted($field);

        if (!isset($format)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Format');

        if (!is_array($format)) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        $default = $this->country->getDefaultFormat();

        if (!array_intersect_key($format, $default)) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        foreach ($format as $key => $value) {

            if (!is_array($value) || !array_intersect_key($value, $default[$key])) {
                $this->setErrorInvalid($field, $label);
                return false;
            }

            foreach ($value as $v) {
                if (!in_array(gettype($v), array('string', 'integer', 'boolean'))) {
                    $this->setErrorInvalid($field, $label);
                    return false;
                }
            }
        }

        return true;
    }
protected function validateFormatCountry()
    {
        $field = 'format';
        $format = $this->getSubmitted($field);

        if (!isset($format)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Format');

        if (!is_array($format)) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        $default = $this->country->getDefaultFormat();

        if (!array_intersect_key($format, $default)) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        foreach ($format as $key => $value) {

            if (!is_array($value) || !array_intersect_key($value, $default[$key])) {
                $this->setErrorInvalid($field, $label);
                return false;
            }

            foreach ($value as $v) {
                if (!in_array(gettype($v), array('string', 'integer', 'boolean'))) {
                    $this->setErrorInvalid($field, $label);
                    return false;
                }
            }
        }

        return true;
    }
protected function validateFormatCountry ( ) { $ field = 'format' ; $ format = $ this -> getSubmitted ( $ field ) ; if ( ! isset ( $ format ) ) { $ this -> unsetSubmitted ( $ field ) ; return null ; } $ label = $ this -> translation -> text ( 'Format' ) ; if ( ! is_array ( $ format ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } $ default = $ this -> country -> getDefaultFormat ( ) ; if ( ! array_intersect_key ( $ format , $ default ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } foreach ( $ format as $ key => $ value ) { if ( ! is_array ( $ value ) || ! array_intersect_key ( $ value , $ default [ $ key ] ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } foreach ( $ value as $ v ) { if ( ! in_array ( gettype ( $ v ) , array ( 'string' , 'integer' , 'boolean' ) ) ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } } } return true ; }
Validates country format
@return boolean
Validates country format