protected function hasMandatoryItem(array $definition)
    {
        foreach ($definition as $key => $node) {
            if (isset($node['required'])) {
                if ($node['required']) {
                    return true;
                }
            } else {
                if ($this->hasMandatoryItem($node)) {
                    return true;
                }
            }
        }

        return false;
    }
protected function hasMandatoryItem(array $definition)
    {
        foreach ($definition as $key => $node) {
            if (isset($node['required'])) {
                if ($node['required']) {
                    return true;
                }
            } else {
                if ($this->hasMandatoryItem($node)) {
                    return true;
                }
            }
        }

        return false;
    }
protected function hasMandatoryItem ( array $ definition ) { foreach ( $ definition as $ key => $ node ) { if ( isset ( $ node [ 'required' ] ) ) { if ( $ node [ 'required' ] ) { return true ; } } else { if ( $ this -> hasMandatoryItem ( $ node ) ) { return true ; } } } return false ; }
Traverse the definition to see if any children are required

@param array $definition

@return bool
Traverse the definition to see if any children are required