Get all attributes of given name.

@param string $name OID or attribute name
@return Attribute[]
326732
public function allOf(string $name): array
    {
        $oid = AttributeType::attrNameToOID($name);
        $attrs = array_filter($this->_attributes,
            function (Attribute $attr) use ($oid) {
                return $attr->oid() == $oid;
            });
        return array_values($attrs);
    }
1196191
public function getAttribute(string $name)
    {
        $method = 'get'.\ucfirst($name).'Attribute';
        $value = $this->menu[$name] ?? null;

        if (\method_exists($this, $method)) {
            return $this->container->call([$this, $method], ['value' => $value]);
        }

        return $value;
    }
831543
public function getParametersWithKey($name)
    {
        $parameters = array();

        /** @var Parameter $parameter */
        foreach ($this->parameters as $parameter) {
            if ($parameter->getKey() == $name) {
                $parameters[] = $parameter;
            }
        }

        return $parameters;
    }
356228
public function getAttribute(string $attribute): array
    {
        // Determine if the attribute is present
        if (! array_key_exists($attribute, $this->attributes)) {
            return [];
        }

        // Return the value of the attribute
        return $this->attributes[$attribute];
    }
78584
static public function getPresets($name = self::FULL)
    {
        if ($presets = ArrayHelper::getValue(self::$presets, $name)) {
            return (array)$presets;
        }

        return [];
    }
1300244
private function getNameAndFilters($name)
    {
        $filters = array_map('trim', explode('|', $name));
        $name    = array_shift($filters);

        return array($name, $filters);
    }
480801
public function getDataAttribute($name)
    {
        if (isset($this->dataAttributes[$name])) {
            return $this->dataAttributes[$name];
        }
        return null;
    }
815360
public function fetchParams(string $name): array
    {
        $bag = $this->request->request;

        return $bag->has($name) ? $bag->get($name, []) : $bag->all();
    }
334180
public function getAttribute($attributes, $name) {
        foreach($attributes as $a) {
            if ($a->key == $name) {
                return $a->value;
            }
        }
        return null;
    }
211999
public function getByName($name)
    {
        Types::assert(['string' => [$name]]);

        $name = strtolower($name);

        if ( ! array_key_exists($name, $this->headers))
        {
            return [];
        }

        return $this->headers[$name];
    }
374029
public function &getAttributeByName($name)
    {
        if (!isset( $this->attributes[$name] )) {
            throw new \RuntimeException( 'An attribute by the name of \'' . $name . '\' could not be located on the \'' . $this->getName() . '\' entity.' );
        }

        return $this->attributes[$name];
    }
185026
public function getFieldAsArray(string $name): array
    {
        $result = $this->getFieldDefinition($name);

        $result['name'] = $name;

        if (empty($result['caption'])) {
            $result['caption'] = $this->_($result['name']);
        }

        $value = $this->$name;
        $type = @$result['type'];

        if (($type == 'date' || $type == 'datetime' || $type == 'time') && is_object($value)) {
            $value = $value->format($this->translate('form.' . $type));
        }

        $result['value'] = $value;
        $result['uid'] = 'id' . uniqid();

        if (isset($result['options']) && is_array($result['options'])) {
            $options = array();

            foreach ($result['options'] as $option => $label) {
                $options[] = array('option' => $option, 'label' => $label);
            }

            $result['options'] = $options;
        }

        return $result;
    }
122252
public function getVocabularyByNameAsArray($name) {
    $vocabulary = $this->vocabulary->where('name', $name)->first();

    if (!is_null($vocabulary)) {
      return $vocabulary->terms->pluck('name', 'id')->toArray();
    }

    return [];
  }
718912
public function attribute( $name )
    {
        if ( isset( $this->dynamicAttributeFunctions[$name] ) )
        {
            if ( is_array( $this->dynamicAttributeFunctions[$name] ) )
            {
                return $this->dynamicAttributeFunctions[$name];
            }
            else
            {
                $attribute = call_user_func( array( $this, $this->dynamicAttributeFunctions[$name] ) );
                return $attribute;
            }
        }
        else
        {
            if ( $this->hasAttribute( $name ) )
            {
                return $this->attributes[$name];
            }
            else
            {
                $value = null;
                return $value;
            }
        }
    }
715774
protected function _findFirst(string $name)
    {
        $oid = AttributeType::attrNameToOID($name);
        foreach ($this->_attributes as $attr) {
            if ($attr->oid() == $oid) {
                return $attr;
            }
        }
        return null;
    }
529238
public function getAttribute($name)
    {
        return array_key_exists($name, $this->data['data']) ? $this->data['data'][$name] : null;
    }
1266972
public function getAttribute($name)
    {
        if (!isset($this->attrs[$name]))
        {
            return null;
        }

        return $this->attrs[$name];
    }