Controller_Validator_Abstract::fail PHP Метод

fail() публичный Метод

{{{ Methods which are called by the rules
public fail ( )
    public function fail()
    {
        $args = func_get_args();
        $str = ucfirst($this->prefix . ($this->caption ?: str_replace('_', ' ', $this->active_field)) . ' ' . lcfirst(array_shift($args)));
        // Insert any args into placeholders
        if (count($args) > 0) {
            $n = 1;
            foreach ($args as $arg) {
                $tag = sprintf('{{arg%s}}', $n);
                $str = str_replace($tag, $arg, $str);
                ++$n;
            }
        }
        /** @type Exception_ValidityCheck $e */
        $e = $this->exception((string) ($this->custom_error ?: $str));
        throw $e->setField($this->active_field);
    }