Adds attribute IDs for filtering

@param array|string $attrIds Attribute ID or list of IDs
@return \Aimeos\Controller\Frontend\Attribute\Iface Attribute controller for fluent interface
@since 2019.04
506032
public function attribute( $attrIds )
	{
		if( !empty( $attrIds ) ) {
			$this->conditions[] = $this->filter->compare( '==', 'attribute.id', $attrIds );
		}

		return $this;
	}
305888
protected function get_ids_byAid($aid, $sort = true, $has_keys = false)
    {
        $ret = self::$_ar_;
        if (!$has_keys) {
            $aid = self::array_select($this->attr_idx, $aid);
        }

        foreach ($aid as $aid => $aix) {
            if (!is_array($aix)) {
                $aix = array($aix => $this->ids[$aix]);
            }

            if (empty($ret)) {
                $ret = $aix;
            } else {
                foreach ($aix as $id => $e) {
                    $ret[$id] = $e;
                }
            }

        }
        if ($sort && $ret) {
            ksort($ret);
        }

        return $ret;
    }
854548
public function setAttribs(array $aAttribs)
    {
        if (!isset($aAttribs['method']))
            $aAttribs['method'] = 'POST';
        $aAttribs['class'] = isset($aAttribs['class'])
            ? $aAttribs['class'] . ' sked-form' : 'sked-form';
        $this->aAttribs = $aAttribs;
        return $this;
    }
748071
public function addAttributes($arrAttributes) {
        foreach ($arrAttributes as $key => $val) {
            $this->attributes[$key] = $val;
        }
    }
1067883
public static function merge(array $attrs=[])
  {
    $attrs = (array)$attrs;
    
    $attributes=[];
    foreach($attrs as $key => $value){
      if ( $key === 'class' && is_array($value) ){
        $value = array_unique($value);
        $value = implode(' ', $value);
        if ( empty($value) ){
          continue;
        }
      }
      
      if ( true === $value ){
        $value = 'true';
      }
      elseif ( false === $value ){
        $value = 'false';
      }
      else {
        $value = trim($value);
      }
      
      // if ( '' === $value ){
        // $value = $key;
      // }
      
      $attributes[] = $key.'="'.str_replace('"', '\"', trim($value)).'"';
    }
    
    $attrs = implode(' ', $attributes);
    if ( $attrs !== '' ){
      return ' '.$attrs;
    }
    return '';
  }
458676
public function addFilters(array $filters)
    {
        foreach ($filters as $filter) {
            if ($filter instanceof QueryDSL) {
                $this->addFilter($filter);
            }
        }
        return $this;
    }
607305
public function setAttrs($attrs)
    {
        $oldAttrs = $this->attributes;
        $oldClasses = $this->classes;

        $this->attributes = $attrs;
        $this->attributes = Generator::parseAtts($this);

        $this->attributes = array_merge($oldAttrs, $this->attributes);
        $this->classes = null;
        $this->update('classes');

        if (!empty($oldClasses) && !empty($this->classes)) {
            $this->attributes['class'] = implode(' ', array_merge($oldClasses, $this->classes));
        }
        $this->classes = null;

        if (!empty($oldAttrs['style']) && !empty($this->attributes['style'])) {
            $this->attributes['style'] = Generator::mergeStyles($this->attributes['style'], $oldAttrs['style']);
        }

        $this->update();
    }
1003076
public function assign($attrs)
    {
        foreach ($attrs as $key => $val) {
            if (property_exists($this, $key)) {
                $this->$key = $val;
            }
        }
    }
353265
public function create($pid, $attrs = [])
    {
        if (isset($attrs['constants'])) {
            $attrs['constants'] = $this->parseTsConstants($attrs['constants']);
        }

        return parent::create($pid, $attrs);
    }
403520
protected function addValidAttributes( $attrs ) {
        foreach( $attrs as $attr ) {
            //add if string
            if( is_string( $attr ) ) {
                $this->validAttributes[] = $attr;
            }
        }
    }
35914
public function type( $codes )
	{
		if( !empty( $codes ) ) {
			$this->conditions[] = $this->filter->compare( '==', 'attribute.type', $codes );
		}

		return $this;
	}
788044
public function addAttrs(array $keys, array $attr)
    {
        foreach ($keys as $key) {
            $this->addAttr($key, $attr);
        }

        return $this;
    }
877879
public function addFieldsToFilter($fields)
    {
        if ($fields) {
            foreach ($fields as $fieldByType) {
                foreach ($fieldByType as $attributeId => $condition) {
                    $attributeCode = $this->getEntity()->getAttribute($attributeId)->getAttributeCode();
                    $condition     = $this->cleanCondition($condition);

                    if (null !== $condition) {
                        $this->addFieldToFilter($attributeCode, $condition);
                    }
                }
            }
        }

        return $this;
    }
993746
public function updateAttributes(array $attrs) {
        $url = "entities/{$this->_id}/attrs";

        if ($this->_type) {
            $url .= "?type={$this->_type}";
        }

        $updateEntity = new ContextFactory($attrs);
        return $this->_orion->patch($url, $updateEntity);
    }
1128076
public function addAttrs(array $attrs)
    {
        foreach ($attrs as $attr => $val) {
            $this->addAttr($attr, $val);
        }

        return $this;
    }
225706
public int addAttribute(String attrId) {
        if (attributeMapper.containsKey(attrId)) {
            return attributeMapper.get(attrId);        // attribute-id has existed
        }

        attributeMapper.put(attrId, varIdCounter);
        varIdCounter++;
        return attributeMapper.get(attrId);
    }
693493
protected function add_autovalues(&$attrs)
    {
        if (empty($this->prop['autovalues'])) {
            return;
        }

        $attrvals = array();
        foreach ($attrs as $k => $v) {
            $attrvals['{'.$k.'}'] = is_array($v) ? $v[0] : $v;
        }

        foreach ((array)$this->prop['autovalues'] as $lf => $templ) {
            if (empty($attrs[$lf])) {
                if (strpos($templ, '(') !== false) {
                    // replace {attr} placeholders with (escaped!) attribute values to be safely eval'd
                    $code = preg_replace('/\{\w+\}/', '', strtr($templ, array_map('addslashes', $attrvals)));
                    $res  = false;

                    try {
                        $res = eval("return ($code);");
                    }
                    catch (ParseError $e) {
                        // ignore
                    }

                    if ($res === false) {
                        rcube::raise_error(array(
                            'code' => 505, 'file' => __FILE__, 'line' => __LINE__,
                            'message' => "Expression parse error on: ($code)"), true, false);
                        continue;
                    }

                    $attrs[$lf] = $res;
                }
                else {
                    // replace {attr} placeholders with concrete attribute values
                    $attrs[$lf] = preg_replace('/\{\w+\}/', '', strtr($templ, $attrvals));
                }
            }
        }
    }