Extract binary fields from given attributes.

@param  array $attributes
@return array
965205
protected function extractBinaries(&$attributes)
    {
        // If attributes contains binary field
        // extract binary fields to new array
        $binaries = [];
        if ($this->checkBinary($attributes) && $this->getConnection() instanceof Oci8Connection) {
            foreach ($attributes as $key => $value) {
                if (in_array($key, $this->binaries)) {
                    $binaries[$key] = $value;
                    unset($attributes[$key]);
                }
            }
        }

        return $this->binaryFields = $binaries;
    }
1082781
protected function prepareAttributes(array $attributes)
    {
        foreach ($attributes as $key => $attribute) {
            if (in_array($key, $this->getDates()) && ! is_null($attribute)) {
                $attribute = $this->asDateTime($attribute);
            }
            if ($attribute instanceof DateTime) {
                $attribute = $this->fromDateTime($attribute);
            }
            $attributes[$key] = (string) $attribute;
        }
        return $attributes;
    }
274158
public function toCamelCase($attributes)
    {
        $convertedAttributes = [];

        foreach ($attributes as $key => $value) {
            $key = $this->getTrueKey($key);
            $convertedAttributes[$key] = $value;
        }

        return $convertedAttributes;
    }
61218
public function raw(array $attributes = [])
    {
        if ($this->amount === null) {
            return $this->getRawAttributes($attributes);
        }

        if ($this->amount < 1) {
            return [];
        }

        return array_map(function () use ($attributes) {
            return $this->getRawAttributes($attributes);
        }, range(1, $this->amount));
    }
533202
protected function attributesArrayToText($attributes)
    {
        $text = "";

        foreach ($attributes as $name => $value)
        {
            $text .= "{$name}=\"{$value}\" ";
        }

        $text = rtrim($text);

        return $text;
    }
780630
protected function fillableFromArray(array $attributes)
    {
        if (count($this->getFillable()) > 0 && ! static::$unguarded) {
            return array_intersect_key($attributes, array_flip($this->getFillable()));
        }

        return $attributes;
    }
620581
protected function attributes($attributes)
    {
        $elementStr = '';

        foreach ($attributes as $key => $value) {
            $elementStr .= ($key !== 0) ? "{$key}='{$value}' " : $value;
        }

        return $elementStr;
    }
48022
protected function selectAttributes($attributes = ['*'])
    {
        $attributes = $attributes ?: ['*'];

        if ($attributes == ['*'] && $this->attributes != ['*']) {
            $attributes = $this->attributes;
        }

        return $attributes;
    }
1268900
public static function attributes(array $attributes = NULL)
    {
        if (!$attributes) return;

        asort($attributes);
        $h = '';
        foreach ($attributes as $k => $v) {
            $h .= " $k=\"" . self::h($v) . '"';
        }
        return $h;
    }
213987
public function formatAttributes(array $attributes) {
        foreach ($attributes as $key => $attr) {
            if ($attr instanceof Closure) {
                $attributes[$key] = call_user_func($attr, $this);

            } else if ($this->hasKeyword($attr)) {
                $attributes[$key] = $this->getKeyword($attr);

            } else if ($attr === true) {
                $attributes[$key] = $this->getKeyword($key);

            } else {
                $attributes[$key] = (string) $attr;
            }
        }

        return $attributes;
    }
804934
protected function flatten($attributes)
    {
        foreach ($attributes as $name => $value) {
            
            if (is_array($value)) {
                $attributes[$name] = implode(' ', array_filter($value));
            }
            
        }
        
        return $attributes;
    }
189521
protected function parseAttributes(array $attributes)
	{
		if (isset($attributes['icon']) && $attributes['icon'] instanceof IconInterface) {
			$this->icon = $attributes['icon'];
		} else {
			/** @var IconInterface $resolver */
			foreach (static::$iconResolvers as $key => $resolver) {
				if (array_key_exists($key, $attributes)) {
					$this->icon = $resolver::createFromAttribute($attributes[$key]);
					break;
				}
			}
		}

		if (isset($attributes['class'])) {
			if (is_string($attributes['class'])) {
				$attributes['class'] = explode(' ', $attributes['class']);
			}
		} else {
			$attributes['class'] = [];
		}

		if (isset($attributes['suffix'])) {
			$this->suffix = $attributes['suffix'];
		}
		if (isset($attributes['prefix'])) {
			$this->prefix = $attributes['prefix'];
		}

		$attributes['id'] = isset($attributes['id']) ? $attributes['id'] : StringUtils::slug($this->title);

		return array_diff_key($attributes, array_flip(static::$notHtmlAttributes));
	}
273042
public static function extractAttributes(array $attributes): array
    {
        $result = ['resource_class' => $attributes['_api_resource_class'] ?? null];
        if ($subresourceContext = $attributes['_api_subresource_context'] ?? null) {
            $result['subresource_context'] = $subresourceContext;
        }

        if (null === $result['resource_class']) {
            return [];
        }

        $hasRequestAttributeKey = false;
        foreach (OperationType::TYPES as $operationType) {
            $attribute = "_api_{$operationType}_operation_name";
            if (isset($attributes[$attribute])) {
                $result["{$operationType}_operation_name"] = $attributes[$attribute];
                $hasRequestAttributeKey = true;
                break;
            }
        }

        if (false === $hasRequestAttributeKey) {
            return [];
        }

        $result += [
            'receive' => (bool) ($attributes['_api_receive'] ?? true),
            'respond' => (bool) ($attributes['_api_respond'] ?? true),
            'persist' => (bool) ($attributes['_api_persist'] ?? true),
        ];

        return $result;
    }
1135131
protected function matchAsAttributes(array $attributes) : array
    {
        $attributesMap = $this->getAttributesDictionnary();

        // Get the subset that only the embedded object is concerned with and, convert it back
        // to embedded object attributes keys
        $originalAttributes = array_only($attributes, $attributesMap);

        $embeddedAttributes = [];

        foreach ($originalAttributes as $key => $value) {
            $embeddedKey = array_search($key, $attributesMap);
            $embeddedAttributes[$embeddedKey] = $value;
        }

        // Unset original attributes before, just in case one of the keys of the
        // original attributes is equals the relation name.
        foreach (array_keys($originalAttributes) as $key) {
            unset($attributes[$key]);
        }

        // Build object
        $attributes[$this->relation] = $this->buildEmbeddedObject($embeddedAttributes);

        return $attributes;
    }
693955
static function htmlAttributes(array $attributes = array()) {
    foreach ($attributes as $attribute => &$data) {
      $data = implode(' ', (array) $data);
      $data = $attribute . '="' . self::checkPlain($data) . '"';
    }
    return $attributes ? ' ' . implode(' ', $attributes) : '';
  }
867781
protected function matchAsArray(array $attributes) : array
    {
        // Extract the attributes with the key of the relation,
        // which should be an array.
        $key = $this->relation;

        if (!array_key_exists($key, $attributes)) {
            $attributes[$key] = $this->asJson ? json_encode([]) : [];
        }

        if ($this->asJson) {
            $attributes[$key] = json_decode($attributes[$key], true);
        }

        if (!is_array($attributes[$key])) {
            throw new MappingException("'$key' column should be an array, actual :".$attributes[$key]);
        }

        $attributes[$key] = $this->buildEmbeddedCollection($attributes[$key]);

        return $attributes;
    }
757153
public function fileExtraFields($attribute)
    {
        $fields = $this->fileBind->relations($this->owner, $attribute);
        if (!$this->fileOption($attribute, 'multiple')) {
            return array_shift($fields);
        }
        return $fields;
    }