src/Graviton/GeneratorBundle/Definition/JsonDefinitionHash.php
public function isRequired()
    {
        $isRequired = false;

        // see if on the first level of fields we have a required=true in the definition
        foreach ($this->fields as $field) {
            if ($field instanceof JsonDefinitionField &&
                $field->getDef() instanceof Field &&
                $field->getDef()->getRequired() === true
            ) {
                $isRequired = true;
            }
        }

        return $isRequired;
    }
public function isRequired()
    {
        $isRequired = false;

        // see if on the first level of fields we have a required=true in the definition
        foreach ($this->fields as $field) {
            if ($field instanceof JsonDefinitionField &&
                $field->getDef() instanceof Field &&
                $field->getDef()->getRequired() === true
            ) {
                $isRequired = true;
            }
        }

        return $isRequired;
    }
public function isRequired ( ) { $ isRequired = false ; // see if on the first level of fields we have a required=true in the definition foreach ( $ this -> fields as $ field ) { if ( $ field instanceof JsonDefinitionField && $ field -> getDef ( ) instanceof Field && $ field -> getDef ( ) -> getRequired ( ) === true ) { $ isRequired = true ; } } return $ isRequired ; }
in an 'anonymous' hash situation, we will check if any children are required

@return bool if required or not
in an anonymous hash situation we will check if any children are required