get required fields for this object

@param string $variationName a variation that can alter which fields are required

@return string[]
10285
public function getRequiredFields($variationName = null)
    {
        if (is_null($variationName)) {
            return $this->schema->required;
        }

        /* compose required fields based on variation */
        $requiredFields = $this->getRequiredFields();
        foreach ($this->schema->properties as $fieldName => $fieldAttributes) {
            $onVariation = $this->getOnVariaton($fieldName);

            if (is_object($onVariation) && isset($onVariation->{$variationName}->required)) {
                $thisRequired = $onVariation->{$variationName}->required;

                if ($thisRequired === true) {
                    $requiredFields[] = $fieldName;
                }

                if ($thisRequired === false) {
                    // see if its set
                    $fieldIndex = array_search($fieldName, $requiredFields);
                    if ($fieldName !== false) {
                        unset($requiredFields[$fieldIndex]);
                    }
                }
            }
        }

        return array_values(
            array_unique(
                $requiredFields
            )
        );
    }
1283265
public function getRequired() : array {
        $required = [];

        foreach($this->required as $component) {
            $required[$component] = $this->getTargetBranch($component);
        }

        return $required;
    }
524483
protected function getRequiredFields()
    {
        $required = [];
        foreach($this->schema as $field => $fieldSchema) {
            if(isset($fieldSchema['options']['required']) && $fieldSchema['options']['required']) {
                $required[] = $field;
            }
        }
        return $required;
    }
464032
public function pluckFields($property = 'name')
    {
        $names = [];

        if ($this->hasFields()) {
            foreach ($this->getFields() as $field) {
                if (property_exists($field, $property)) {
                    $names[] = $field->{$property};
                }
            }
        }

        return $names;
    }
863085
public function getVariantSelections()
    {
        $article = $this->getProduct();
        $variantSelectionListId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("varselid");
        if (($articleParent = $this->_getParentProduct($article->oxarticles__oxparentid->value))) {
            return $articleParent->getVariantSelections($variantSelectionListId, $article->getId());
        }

        return $article->getVariantSelections($variantSelectionListId);
    }
358838
public function exportRequiredFields($fieldLayout) {
        $requiredFieldsObj = [];
        $tabs = $fieldLayout->getTabs();
        usort($tabs, function($a, $b) {
            return $a->sortOrder > $b->sortOrder;
        });
        foreach ($tabs as $tab) {
            foreach ($tab->getFields() as $field) {
                /** @var Field $field */
                if (boolval($field->required)) {
                    array_push($requiredFieldsObj, $field->handle);
                }
            }
        }
        return $requiredFieldsObj;
    }
1087016
public function getVariationFromKey($experimentKey, $variationKey)
    {
        if (isset($this->_variationKeyMap[$experimentKey])
            && isset($this->_variationKeyMap[$experimentKey][$variationKey])
        ) {
            return $this->_variationKeyMap[$experimentKey][$variationKey];
        }

        $this->_logger->log(
            Logger::ERROR,
            sprintf(
                'No variation key "%s" defined in datafile for experiment "%s".',
                $variationKey,
                $experimentKey
            )
        );
        $this->_errorHandler->handleError(new InvalidVariationException('Provided variation is not in datafile.'));
        return new Variation();
    }
453731
public function getMissingRequirements($plugin)
    {
        $requirements = $this->getRequirements($plugin);
        $bundle = $this->getBundle($plugin);

        return [
            'extensions' => $this->checkExtensionRequirements($requirements['extensions']),
            'plugins' => $this->checkPluginsRequirements($requirements['plugins']),
            'extras' => $this->checkExtraRequirements($bundle->getExtraRequirements()),
        ];
    }
257976
def get_required_fields(self):
    """"""
    return [m.name for m in self._ast_node.members if m.member_schema.required]
319658
protected function getVersionConfig(string $version): array
    {
        if (!isset($this->versions[$version])) {
            throw new UnknownVersionNameException();
        }

        return $this->versions[$version];
    }
991034
protected function getFields()
    {
        return [
          'title' => new Field('Project title', [
            'optionName' => 'title',
            'description' => 'The initial project title',
            'questionLine' => '',
            'default' => 'Untitled Project',
          ]),
          'region' => new OptionsField('Region', [
            'optionName' => 'region',
            'description' => 'The region where the project will be hosted',
            'options' => $this->getAvailableRegions(),
            'optionsCallback' => function () {
                return $this->getAvailableRegions(true);
            },
          ]),
          'plan' => new OptionsField('Plan', [
            'optionName' => 'plan',
            'description' => 'The subscription plan',
            'options' => $this->getAvailablePlans(),
            'default' => in_array('development', $this->getAvailablePlans()) ? 'development' : null,
            'allowOther' => true,
          ]),
          'environments' => new Field('Environments', [
            'optionName' => 'environments',
            'description' => 'The number of environments',
            'default' => 3,
            'validator' => function ($value) {
                return is_numeric($value) && $value > 0 && $value < 50;
            },
          ]),
          'storage' => new Field('Storage', [
            'description' => 'The amount of storage per environment, in GiB',
            'default' => 5,
            'validator' => function ($value) {
                return is_numeric($value) && $value > 0 && $value < 1024;
            },
          ]),
        ];
    }
1169222
public function getRequiredVariables() {
	    $variables = array();
	    foreach ($this->inParameters as $param) {
	        if ($param instanceof tao_models_classes_service_VariableParameter) {
	            $variables[] = $param->getVariable();
	        }
	    }
	    return $variables;
	}
1305948
public function getRequiredOptions()
    {
        if (! $this->required) {
            return null;
        }

        if ($this->required instanceof ConfigInterface) {
            return $this->required->getArrayCopy();
        }

        return (array)$this->required;
    }
1271431
public function getFields($tableName)
    {
        $fields = [];
        $rawFields = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->MetaColumns($tableName);
        if (is_array($rawFields)) {
            foreach ($rawFields as $field) {
                $fields[$field->name] = "{$tableName}.{$field->name}";
            }
        }

        return $fields;
    }
513020
public function getFieldNamesByView($objectName, $viewName)
    {
        $fieldNames = array();
        $fieldConfigurations = $this->getFieldsByView($objectName, $viewName);
        foreach ($fieldConfigurations as $fieldConfiguration) {
            array_push($fieldNames, $fieldConfiguration['name']);
        }

        return $fieldNames;
    }
754547
public function variant($variant)
    {
        $variantPath = $this->getVariantPathWithPlaceholder();

        $path = str_replace(static::VARIANT_PLACEHOLDER, $variant, $variantPath);

        if (array_key_exists($variant, $this->variantFileNames)) {
            $path = $this->replaceFileName($path, $this->variantFileNames[ $variant ]);
        }

        if (array_key_exists($variant, $this->variantExtensions)) {
            $path = $this->replaceExtension($path, $this->variantExtensions[ $variant ]);
        }

        return $path;
    }
408948
public function getRequiredFieldNames()
    {
        $results = [];
        if (!isset($this->data['fields']) || empty($this->data['fields'])) {
            return $results;
        }

        $table = $this->data['name'];
        foreach ($this->data['fields'] as $field) {
            $name = $table . '_' . $field['name'];
            if (!isset($field['validation'])) {
                continue;
            }

            foreach ($field['validation'] as $validation) {
                if ($validation['method'] === 'required') {
                    $results[] = $name;
                    break;
                }
            }
        }

        return $results;
    }