protected function getRequiredFields(array $rules)
    {
        $requiredFields = array();
        foreach( $rules as $key => $value ) {
            if( $this->isRequired( $value ) ) {
                $requiredFields[] = $key;
            }
        }

        return $requiredFields;
    }
protected function getRequiredFields(array $rules)
    {
        $requiredFields = array();
        foreach( $rules as $key => $value ) {
            if( $this->isRequired( $value ) ) {
                $requiredFields[] = $key;
            }
        }

        return $requiredFields;
    }
protected function getRequiredFields ( array $ rules ) { $ requiredFields = array ( ) ; foreach ( $ rules as $ key => $ value ) { if ( $ this -> isRequired ( $ value ) ) { $ requiredFields [ ] = $ key ; } } return $ requiredFields ; }
Return an array of all form rules that are required

@param   array $rules            Validation rules from which the required fields are to be extracted
@return array
Return an array of all form rules that are required