JBBCode/CodeDefinition.php
public function hasValidInputs(ElementNode $el)
    {
        if ($this->usesOption() && $this->optionValidator) {
            $att = $el->getAttribute();

            foreach ($att as $name => $value) {
                if (isset($this->optionValidator[$name]) && !$this->optionValidator[$name]->validate($value)) {
                    return false;
                }
            }
        }

        if (!$this->parseContent() && $this->bodyValidator) {
            /* We only evaluate the content if we're not parsing the content. */
            $content = "";
            foreach ($el->getChildren() as $child) {
                $content .= $child->getAsBBCode();
            }
            if (!$this->bodyValidator->validate($content)) {
                /* The content of the element is not valid. */
                return false;
            }
        }

        return true;
    }
public function hasValidInputs(ElementNode $el)
    {
        if ($this->usesOption() && $this->optionValidator) {
            $att = $el->getAttribute();

            foreach ($att as $name => $value) {
                if (isset($this->optionValidator[$name]) && !$this->optionValidator[$name]->validate($value)) {
                    return false;
                }
            }
        }

        if (!$this->parseContent() && $this->bodyValidator) {
            /* We only evaluate the content if we're not parsing the content. */
            $content = "";
            foreach ($el->getChildren() as $child) {
                $content .= $child->getAsBBCode();
            }
            if (!$this->bodyValidator->validate($content)) {
                /* The content of the element is not valid. */
                return false;
            }
        }

        return true;
    }
public function hasValidInputs ( ElementNode $ el ) { if ( $ this -> usesOption ( ) && $ this -> optionValidator ) { $ att = $ el -> getAttribute ( ) ; foreach ( $ att as $ name => $ value ) { if ( isset ( $ this -> optionValidator [ $ name ] ) && ! $ this -> optionValidator [ $ name ] -> validate ( $ value ) ) { return false ; } } } if ( ! $ this -> parseContent ( ) && $ this -> bodyValidator ) { /* We only evaluate the content if we're not parsing the content. */ $ content = "" ; foreach ( $ el -> getChildren ( ) as $ child ) { $ content .= $ child -> getAsBBCode ( ) ; } if ( ! $ this -> bodyValidator -> validate ( $ content ) ) { /* The content of the element is not valid. */ return false ; } } return true ; }
Determines if the arguments to the given element are valid based on
any validators attached to this CodeDefinition.

@param ElementNode $el  the ElementNode to validate
@return boolean true if the ElementNode's {option} and {param} are OK, false if they're not
Determines if the arguments to the given element are valid based on any validators attached to this CodeDefinition .