Set the required fields

@return void
336137
protected function setRequiredFields()
    {
        $requiredFields = [
            'transaction_id',
            'amount',
            'currency',
            'description',
            'notification_url',
            'return_success_url',
            'return_failure_url',
            'return_cancel_url',
            'transaction_types'
        ];

        $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields);

        $requiredFieldsConditional = [
            'remember_card' => [
                true => [
                    'customer_email'
                ]
            ],
            'consumer_id'   => [
                'customer_email'
            ]
        ];

        $this->requiredFieldsConditional = CommonUtils::createArrayObject($requiredFieldsConditional);
    }
422253
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, CLASS_INFO_CLASS_NAME, 40, null, null);
        field = new FieldInfo(this, CLASS_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_FIELD_CLASS, 60, null, null);
        field = new FieldInfo(this, CLASS_FIELD_SEQUENCE, 10, null, new Integer(0));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CLASS_FIELD_NAME, 40, null, null);
        field = new FieldInfo(this, CLASS_FIELD_DESC, 30, null, null);
        field = new FieldInfo(this, CLASS_FIELD_PROTECT, 30, null, null);
        field = new FieldInfo(this, CLASS_FIELD_INITIAL, 32000, null, null);
        field = new FieldInfo(this, CLASS_FIELD_INITIAL_VALUE, 32000, null, null);
        field = new FieldInfo(this, CLASS_FIELDS_TYPE, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
1133453
protected function setRequiredFields()
    {
        $requiredFields = [
            'transaction_id',
            'amount',
            'currency',
            'customer_email',
            'account_name',
            'bank_name',
            'billing_first_name',
            'billing_last_name',
            'billing_address1',
            'billing_city',
            'billing_country',
        ];

        $this->requiredFields = \Genesis\Utils\Common::createArrayObject($requiredFields);

        $requiredFieldValues = [
            'billing_country' => [
                'AD', 'AU', 'AT', 'BH', 'BS', 'BE', 'BG', 'CA', 'CY', 'CZ', 'DK', 'EG', 'EE',
                'FI', 'FR', 'DE', 'GR', 'HK', 'HU', 'ID', 'IE', 'IL', 'IT', 'JP', 'KE', 'LV',
                'LI', 'LT', 'LU', 'MY', 'MT', 'MA', 'NL', 'NZ', 'NO', 'PK', 'PH', 'PL', 'PT',
                'RO', 'SG', 'SK', 'SI', 'ES', 'SE', 'CH', 'GB', 'US', 'VN'
            ],
            'currency'        => \Genesis\Utils\Currency::getList()
        ];

        $this->requiredFieldValues = \Genesis\Utils\Common::createArrayObject($requiredFieldValues);

        $this->setRequiredFieldValuesConditional();
    }
389522
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, PROJECT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROJECT_VERSION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ISSUE_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ISSUE_STATUS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ISSUE_PRIORITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
870886
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, END_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, DESCRIPTION, 60, null, null);
        field = new FieldInfo(this, REPEAT_INTERVAL_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REPEAT_COUNT, 5, null, null);
        field.setDataClass(Short.class);
        field = new FieldInfo(this, CALENDAR_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, HIDDEN, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
155705
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, RESOURCE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CODE, 40, null, null);
        field = new FieldInfo(this, LANGUAGE, 2, null, null);
        field = new FieldInfo(this, LOCALE, 2, null, null);
        field = new FieldInfo(this, KEY_VALUE, 80, null, null);
        field = new FieldInfo(this, OBJECT_VALUE, 32000, null, null);
    }
530938
public function setFields(array $fields)
    {
        parent::setFields($fields);
        if (empty($this->batchId)) {
            $this->batchId = null;
        }

        if (isset($fields['_embedded']['messages'])) {
            $this->messages = $fields['_embedded']['messages'];
        }
    }
1311190
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, DESCRIPTION, 50, null, null);
        field = new FieldInfo(this, CODE, 30, null, null);
        field = new FieldInfo(this, MESSAGE_CLASS, 127, null, null);
        field = new FieldInfo(this, MESSAGE_PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, MESSAGE_INFO_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(1));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REVERSE_MESSAGE_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CONTACT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REQUEST_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
125355
public function getRequiredFields()
    {
        // Generate required field validator
        $requiredNames = $this
            ->getController()
            ->data()
            ->Fields()
            ->filter('Required', true)
            ->column('Name');
        $requiredNames = array_merge($requiredNames, $this->getEmailRecipientRequiredFields());
        $required = new RequiredFields($requiredNames);
        $this->extend('updateRequiredFields', $required);
        $required->setForm($this);
        return $required;
    }
1159204
public function requireField()
    {
        $charset = Config::inst()->get(MySQLDatabase::class, 'charset');
        $collation = Config::inst()->get(MySQLDatabase::class, 'collation');

        $parts = array(
            'datatype'=>'varchar',
            'precision'=>$this->size,
            'character set'=> $charset,
            'collate'=> $collation,
            'arrayValue'=>$this->arrayValue
        );

        $values = array(
            'type' => 'varchar',
            'parts' => $parts
        );

        DB::require_field($this->tableName, $this->name, $values);
    }
632798
public function setFields( $fields )
	{
		if( is_array( $fields ) && count( $fields ) )
			$this->fields = $fields;
		else
			trigger_error( 'Field Array of Table Definition must no be empty.', E_USER_ERROR );
	}
660425
protected function setDefaultFieldDefinitions() : void
    {
        $table = $this->config->getTable();
        $field = $this->config->getField();
        $dbFieldType = $this->getDbFieldType();

        // set $options['fieldDefinitions']
        $stubFields = [
            $field => [
                'name' => $field,
                'type' => $dbFieldType,
            ],
        ];
        if ($table instanceof HasFieldsInterface) {
            $fieldDefinitions = $table->getFieldsDefinitions($stubFields);
            $this->defaultOptions['fieldDefinitions'] = new CsvField($fieldDefinitions[$field]);
        }

        // This should never be the case, except, maybe
        // for some unit test runs or custom non-CSV
        // modules.
        if (empty($this->defaultOptions['fieldDefinitions'])) {
            $this->defaultOptions['fieldDefinitions'] = new CsvField($stubFields[$field]);
        }
    }
37769
public function setFields() : void
    {
        preg_match_all('#' . self::EXP_TOKEN . '(.*?)' . self::EXP_TOKEN . '#', $this->getExpression(), $matches);
        if (empty($matches[1])) {
            throw new InvalidArgumentException("No tokens found in expression");
        }
        $this->fields = $matches[1];
    }
1037656
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_UPDATE_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_ANNIV_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, END_ANNIV_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, UPDATE_DAYS, 10, null, new Integer(1));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIV_BACK_DAYS, 10, null, new Integer(0));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIVERSARY_DAYS, 10, null, new Integer(60));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ANNIVERSARY_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, APPOINTMENT_CATEGORY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }
1046293
private function AddRequiredField()
    {
        $field = new Fields\Checkbox('Required', '1', $this->textarea->GetRequired());
        $this->AddField($field);
    }
430740
protected function setField($values)
    {
        foreach ($values as $name => $field) {
            $this->fields[$name] = $field;
        }
    }
159562
public function setRequired($required) {
		if(!empty($required))
			$this->validation[] = new Validation\Required;
		$this->_attributes["required"] = "";	
	}