Be sure that all attributes sent to DB layer are strings.

@param  array $attributes
@return array
494546
protected function normalizeQueryAttributes(array $attributes)
    {
        $result = [];

        foreach ($attributes as $attribute) {
            $result[] = $this->convertAttribute($attribute);
        }

        return $result;
    }
627618
public function attr(array $attributes)
    {
        $result = '';

        foreach ($attributes as $attribute => $value) {
            $result .= ' '.(is_int($attribute) ? $value : $attribute.'="'.str_replace('"', '&quot;', $value).'"');
        }

        return $result;
    }
196735
protected function processAttributes($attributes)
    {
        if (!$attributes) {
            return [];
        }

        $attributes = explode(',', $attributes);

        foreach ($attributes as $key => $attribute) {
            $attributes[$key] = trim($attribute);
        }

        return $attributes;
    }
17448
protected function attributes($attributes)
    {
        $html = array();
        foreach ((array) $attributes as $key => $value)
        {
            $element = $this->attributeElement($key, $value);

            if ( ! is_null($element)) $html[] = $element;
        }

        $output = count($html) > 0 ? ' '.implode(' ', $html) : '';

        return trim($output);
    }
160453
protected function attributes($attributes = [])
    {
        $ar = [];

        foreach ($attributes as $key => $value) {
            $element = $this->attribute($key, $value);
            if (!is_null($element)) {
                $ar[] = $element;
            }
        }

        return count($ar) > 0 ? ' '.implode(' ', $ar) : '';
    }
920643
protected function buildAttributes(\ArrayObject $attributes)
    {
        $strings = [];

        foreach ($attributes as $key => $value) {
            if (is_array($value)) {
                continue;
            }
            $strings[] = $key . '="' . $value . '"';
        }

        return implode(' ', $strings);
    }
1091282
protected function buildAttributes(array $attributes)
    {
        $html = [];

        foreach ($attributes as $key => $value) {
            $html[] = $key.'="'.$value.'"';
        }

        return count($html) ? ' '.implode(' ', $html) : '';
    }
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;
    }
467156
protected static function getAttributesString($attributes)
    {
        $str = '';
        if (is_array($attributes)) {
            $charset = self::getOption('charset');
            foreach ($attributes as $key => $value) {
                $str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES, $charset) . '"';
            }
        }
        return $str;
    }
221620
protected function attributes(array $attributes): string
	{
		$attr = '';

		foreach($attributes as $attribute => $value)
		{
			if(is_int($attribute))
			{
				$attribute = $value;
			}

			$attr .= ' ' . $attribute . '="' . $value . '"';
		}

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

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

        return $attributes;
    }
1287816
public static function renderAttributes(array $attributes)
    {
        $html = [];
        foreach ($attributes as $key => $value) {
            $escaped = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
            $html[] = is_numeric($key) ?
                ($escaped . '="' . $escaped . '""')
                :
                ("$key=\"$escaped\"");
        }
        return count($html) > 0 ? ' ' . implode(' ', $html) : '';
    }
952796
public function toArray(array $attributes = array())
	{
		$data = parent::toArray();

		if(count($attributes) == 0)
			return $data;

		$new = array();

		foreach($attributes as $attribute)
			$new[$attribute] = $data[$attribute];

		return $new;
	}
238774
protected function renderAttributes(array $attributes)
    {
        foreach ($attributes as $name => $value) {
            if (is_array($value)) {
                $value = implode(' ', (array) $value);
            }
            $attributes[$name] = $name . '="' . htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . '"';
        }

        return implode(' ', $attributes);
    }
430674
private function formatProductAttributes(array $attributes) {

    $formatted = [];

    foreach ($attributes as $name => $value) {
      if (is_string($value)) {
        $valueAsString = $value;
      }
      else {
        // Does the key=>value store module expect serialize?
        // (I would prefer JSON)
        // >> Yes. (But are we using the key=>value store for this?)
        // Can we pass it the object and get 'auto serialize/unserialize'?
        // >> Maybe.
        if (is_array($value) || is_object($value)) {
          $valueAsString = serialize($value);
        }
        else {
          // 'Trust' PHP's type-casting for now.
          $valueAsString = (string) $value;
        }
      }

      $formatted[] = [
        'key' => $name,
        'value' => $valueAsString,
      ];
    }

    return $formatted;
  }
1307690
protected function prepareAttributes(array $attributes)
    {
        foreach ($attributes as $key => $value) {
            if (is_numeric($key)) {
                unset($attributes[$key]);
                $attributes[$value] = true;
                continue;
            }
        }

        if (isset($attributes['null'])) {
            unset($attributes['null']);
            $attributes['notnull'] = false;
        }

        return $attributes;
    }
428833
protected function attributes($attributes)
    {
        if (!is_array($attributes)) {
            return $attributes;
        }

        $attr = '';
        foreach ($attributes as $attribute => $value) {
            if (is_int($attribute)) {
                $attribute = $value;
            }
            $attr .= ' ' . $attribute . '="' . $value . '"';
        }

        return $attr;
    }