src/Genesis/API/Request.php
protected function verifyGroupRequirements()
    {
        if (isset($this->requiredFieldsGroups)) {
            $fields = $this->requiredFieldsGroups->getArrayCopy();

            $emptyFlag = false;
            $groupsFormatted = [];

            foreach ($fields as $group => $groupFields) {
                $groupsFormatted[] = sprintf(
                    '%s (%s)',
                    ucfirst($group),
                    implode(', ', $groupFields)
                );

                foreach ($groupFields as $field) {
                    if (!empty($this->$field)) {
                        $emptyFlag = true;
                    }
                }
            }

            if (!$emptyFlag) {
                throw new \Genesis\Exceptions\ErrorParameter(
                    sprintf(
                        'One of the following group/s of field/s must be filled in: %s%s',
                        PHP_EOL,
                        implode(
                            PHP_EOL,
                            $groupsFormatted
                        )
                    ),
                    true
                );
            }
        }
    }
protected function verifyGroupRequirements()
    {
        if (isset($this->requiredFieldsGroups)) {
            $fields = $this->requiredFieldsGroups->getArrayCopy();

            $emptyFlag = false;
            $groupsFormatted = [];

            foreach ($fields as $group => $groupFields) {
                $groupsFormatted[] = sprintf(
                    '%s (%s)',
                    ucfirst($group),
                    implode(', ', $groupFields)
                );

                foreach ($groupFields as $field) {
                    if (!empty($this->$field)) {
                        $emptyFlag = true;
                    }
                }
            }

            if (!$emptyFlag) {
                throw new \Genesis\Exceptions\ErrorParameter(
                    sprintf(
                        'One of the following group/s of field/s must be filled in: %s%s',
                        PHP_EOL,
                        implode(
                            PHP_EOL,
                            $groupsFormatted
                        )
                    ),
                    true
                );
            }
        }
    }
protected function verifyGroupRequirements ( ) { if ( isset ( $ this -> requiredFieldsGroups ) ) { $ fields = $ this -> requiredFieldsGroups -> getArrayCopy ( ) ; $ emptyFlag = false ; $ groupsFormatted = [ ] ; foreach ( $ fields as $ group => $ groupFields ) { $ groupsFormatted [ ] = sprintf ( '%s (%s)' , ucfirst ( $ group ) , implode ( ', ' , $ groupFields ) ) ; foreach ( $ groupFields as $ field ) { if ( ! empty ( $ this -> $ field ) ) { $ emptyFlag = true ; } } } if ( ! $ emptyFlag ) { throw new \ Genesis \ Exceptions \ ErrorParameter ( sprintf ( 'One of the following group/s of field/s must be filled in: %s%s' , PHP_EOL , implode ( PHP_EOL , $ groupsFormatted ) ) , true ) ; } } }
Verify that the group fields in the request are populated

@throws \Genesis\Exceptions\ErrorParameter
Verify that the group fields in the request are populated