Get all of the exact attribute values for a given wildcard attribute.

@param  array  $masterData
@param  array  $data
@param  string  $attribute
@return array
8853
protected static function extractValuesForWildcards($masterData, $data, $attribute)
    {
        $keys = [];

        $pattern = str_replace('\*', '[^\.]+', preg_quote($attribute));

        foreach ($data as $key => $value) {
            if ((bool) preg_match('/^'.$pattern.'/', $key, $matches)) {
                $keys[] = $matches[0];
            }
        }

        $keys = array_unique($keys);

        $data = [];

        foreach ($keys as $key) {
            $data[$key] = Arr::get($masterData, $key);
        }

        return $data;
    }
1308858
def attribute(attr)
      return super unless self.class.metadata_column_fields.include?(attr.to_sym)

      options = self.class.metadata_column_fields[attr.to_sym] || {}
      default = options.include?(:default) ? options[:default] : nil
      _metadata_hash.include?(attr) ? HasMetadataColumn.metadata_typecast(_metadata_hash[attr], options[:type]) : default
    end
13269
static function metaDataArray( &$attributes, $skipRelationAttributes = false )
    {
        $metaDataArray = array();
        if ( !is_array( $attributes ) )
            return false;
        foreach( $attributes as $attribute )
        {
            $classAttribute = $attribute->contentClassAttribute();
            if ( !$classAttribute->attribute( 'is_searchable' ) )
            {
                continue;
            }

            $datatype = $attribute->dataType();
            if ( $skipRelationAttributes && $datatype->isRelationType() )
            {
                continue;
            }

            $attributeMetaData = $datatype->metaData($attribute);
            if ( $attributeMetaData !== false )
            {
                if ( !is_array( $attributeMetaData ) )
                {
                    $attributeMetaData = array( array( 'id' => '',
                                                       'text' => $attributeMetaData ) );
                }
                $metaDataArray = array_merge( $metaDataArray, $attributeMetaData );
            }
        }
        return $metaDataArray;
    }
176105
public function extractValuesForWildcards( $data, $attribute )
	{
		$keys = [];

		$pattern = str_replace( '\*', '[^\.]+', preg_quote( $attribute ) );

		foreach ( $data as $key => $value )
		{
			if ( (bool) preg_match( '/^' . $pattern . '/', $key, $matches ) )
			{
				$keys[] = $matches[0];
			}
		}

		$keys = array_unique( $keys );

		$data = [];

		foreach ( $keys as $key )
		{
			$data[$key] = array_get( $this->data, $key );
		}

		return $data;
	}
1162880
protected function extractDistinctValues($attribute)
    {
        $attributeData = ValidationData::extractDataFromPath(
            ValidationData::getLeadingExplicitAttributePath($attribute), $this->data
        );

        $pattern = str_replace('\*', '[^.]+', preg_quote($attribute, '#'));

        return Arr::where(Arr::dot($attributeData), function ($value, $key) use ($pattern) {
            return (bool) preg_match('#^'.$pattern.'\z#u', $key);
        });
    }
462079
private function updateData(array $data, string $attribute, $attributeValue, string $class, ?string $format, array $context): array
    {
        if (null === $attributeValue && ($context[self::SKIP_NULL_VALUES] ?? $this->defaultContext[self::SKIP_NULL_VALUES] ?? false)) {
            return $data;
        }

        if ($this->nameConverter) {
            $attribute = $this->nameConverter->normalize($attribute, $class, $format, $context);
        }

        $data[$attribute] = $attributeValue;

        return $data;
    }
1302455
public static function getMasteryIconO( StaticMasteryDto $mastery, array $attributes = [] ): Html
	{
		return self::getMasteryIcon($mastery->id, $attributes);
	}
861412
protected function getInternalValues(AttributeInterface $attribute = null, array $context = null)
    {
        if ($context) {
            $context = array_merge($this->getCurrentContext(), $context);
        } else {
            $context = $this->getCurrentContext();
        }

        if (null === $attribute) {
            $values = new ArrayCollection();
            foreach ($this->values as $value) {
                if (!$this->getFamily()->hasAttribute($value->getAttributeCode())) {
                    $this->removeValue($value);
                    continue;
                }
                $attribute = $this->getFamily()->getAttribute($value->getAttributeCode());
                if ($attribute->isContextMatching($value, $context)) {
                    $values->add($value);
                }
            }

            return $values;
        }
        $this->checkAttribute($attribute);

        $values = new ArrayCollection();
        foreach ($this->getValuesByAttribute($attribute) as $value) {
            if ($value instanceof ContextualValueInterface) {
                if ($attribute->isContextMatching($value, $context)) {
                    $values->add($value);
                }
            } else {
                $values->add($value);
            }
        }

        return $values;
    }
1368346
protected function extractAttributes(array $data, EntityMetadata $metadata)
    {
        $flattened = [];
        if (!isset($data['attributes']) || !is_array($data['attributes'])) {
            return $data['attributes'] = [];
        }

        $keyMap = array_flip(array_keys($data['attributes']));
        foreach ($metadata->getProperties() as $key => $propMeta) {
            if (!isset($keyMap[$key])) {
                continue;
            }
            if (true === $metadata->hasAttribute($key) || true === $metadata->hasEmbed($key)) {
                $flattened[$key] = $data['attributes'][$key];
            }
        }
        return $flattened;
    }
1186298
public function getSetterCodeDocumentationParameterLines(JavaAttribute $attribute)
    {
        $lines = [];

        $lines[] = '@param ' . $attribute->getType() . ' ' . $attribute->getLowerFullName();

        return $lines;
    }
1237236
public static function getAttributes($onlyAttributesOfSimpleDatatypes = false)
    {
        $oSelfReflection = new \ReflectionClass(static::$m__sClassName);
        $oPropertyArray = $oSelfReflection->getProperties(
            \ReflectionProperty::IS_PUBLIC |
            \ReflectionProperty::IS_PROTECTED |
            \ReflectionProperty::IS_PRIVATE);

        $count = 0;
        while ($count < count($oPropertyArray)) {
            $sAttributeName = $oPropertyArray[$count]->getName();
            if (
                // TODO generalize attribute prefix (sample "m_-s-", (start 2, length 1) )
                substr($sAttributeName, 1, 1) != "_" ||
                substr($sAttributeName, 2, 1) == "_" ||
                ($onlyAttributesOfSimpleDatatypes && substr($sAttributeName, 2, 1) == "o")
            ) {
                unset($oPropertyArray[$count]);
            }
            $count++;
        }
        return $oPropertyArray;
    }
1053215
private function filterAttributes(AnnotationMetadata $metadata, $attributes)
    {
        foreach ($attributes as $name => $value) {
            if (!is_string($name)) {
                unset($attributes[ $name ]);
                $attributes[ $metadata->defaultAttribute ] = $value;
            }
        }
        $unsetRequiredAttributes = $metadata->attributes;
        foreach ($attributes as $name => $value) {
            if (!isset($metadata->attributes[ $name ])) {
                throw new AnnotationException("Unknown attribute: {$name}");
            }
            unset($unsetRequiredAttributes[ $name ]);
            $attribute = $metadata->attributes[ $name ];
            if (!($value === null && $attribute->nullable)) {
                Attribute::checkType($name, $value, $attribute->type);
            }
        }

        //Filter for required attributes
        $unsetRequiredAttributes = array_filter($unsetRequiredAttributes, function (Attribute $attribute) {
            return $attribute->required;
        });

        if (empty($unsetRequiredAttributes)) {
            return $attributes;
        }

        //get attribute names
        $unsetRequiredAttributeNames = array_map(function (Attribute $attribute) {
            return $attribute->name;
        }, $unsetRequiredAttributes);

        if (count($unsetRequiredAttributes) === 1) {
            throw new AnnotationException("Required parameter {$unsetRequiredAttributeNames[0]} is not set");
        } else {
            $joined = implode(', ', $unsetRequiredAttributeNames);
            throw new AnnotationException("Required parameters {$joined} are not set");
        }
    }
795600
private function processSerializeTypeCollectionObject($objectType, $object, array $data, string $attribute): array
    {
        $subData = $object->{$objectType->getter()}();
        if ($this->checkNullForAttribute($subData, $attribute) === true) {
            return $data;
        }

        foreach ($subData as $key => $subObject) {
            $data = $this->setArrayAndCheckNullWithKey($data, $subObject, $key, $attribute);
        }

        return $data;
    }
1290905
public function getConfigurationRaw($configData, array $customAttributes=[])
    {

        $getConfig = new \SimpleXMLElement(
            "<get-configuration>".
                "{$configData}".
            "</get-configuration>"

        );

        foreach ($customAttributes as $attrName => $attrValue) {

            $getConfig->addAttribute($attrName, $attrValue);

        }

        return $this->netConf()->sendRPC($getConfig->asXML());

    }
768448
protected function getOptionEnumValue(array $attributes, array $columnData): array
    {
        $match = null;
        $pattern = '/enum\((.*)\)/';
        if (preg_match($pattern, $columnData['COLUMN_TYPE'], $match) === 1) {
            $values = str_getcsv($match[1], ',', "'", '\\');
            $attributes['values'] = $values;
        }

        return $attributes;
    }
615814
private function getAttributeValues($attribute, $attributeValues)
    {
        $values = [];
        foreach ($attributeValues as $attributeValue) {
            if ($attribute['id'] == $attributeValue['attributeId']) {
                $values[] = $attributeValue;
            }
        }

        return $values;
    }
1104007
protected function getSuccessData($attributes = null)
    {
        $rawData = $this->decodeResponseJson()['data'];

        if (is_null($attributes)) {
            return $rawData;
        } elseif (is_string($attributes)) {
            return array_get($rawData, $attributes);
        }

        $data = [];

        foreach ($attributes as $attribute) {
            $data[] = array_get($rawData, $attribute);
        }

        return $data;
    }