Add multiple flags at once. The input array should be keyed with the
primary flag character, and the values should be the settings array
used by {addFlag}.

@param array  $flags  An array of flags to add
@return $this
977550
public function addFlags($flags) {
		foreach ($flags as $flag => $settings) {
			if (is_numeric($flag)) {
				$this->_warn('No flag character given');
				continue;
			}

			$this->addFlag($flag, $settings);
		}

		return $this;
	}
975678
public function set(array $tags)
    {
        if (!empty($tags)) {
            foreach ($tags as $_tag) {
                $this->add($_tag);
            }
        }
        return $this;
    }
34364
public function flag()
    {
        $args = func_get_args();
        $num = count($args);

        if ($num > 1) {
            $this->flags[$args[0]] = $args[1];

            return $this;
        }

        if (array_key_exists($args[0], $this->flags)) {
            return $this->flags[$args[0]];
        }
    }
243125
public function setValues(array $values)
    {
        $this->values = array();
        foreach ($values as $value) {
            $this->addValue($value);
        }
        return $this;
    }
966511
private function getBitflags(array $flags)
    {
        $val = null;
        foreach ($flags as $flag) {
            $val = $val | $flag;
        }

        return $val;
    }
1358056
public function setTags(array $tags) {
        if($this->setModified('tags', $tags)->isModified()) {
            $this->tags = $tags;
        }

        return $this;
    }
1176656
public function addHeaders(array $headers)
    {
        foreach ($headers as $name => $value) {
            if (is_numeric($name)) {
                $this->parseHeaderLine($value);
            } else {
                $this->addHeader($name, $value);
            }
        }
        return $this;
    }
125194
public function withFlag($flag)
    {
        $flagValue = (is_string($flag)) ? $this->flagsFromText($flag) : $flag;

        if ($flagValue) {
            $this->getDbCriteria()->mergeWith(array(
                'condition' => $this->getTableAlias() . '.' . $this->flagsField . '&' . $flagValue . '<>0', //:flag<>0',
            ));
        }
        return $this;
    }
492907
public AceObjectFlags addFlag(final Flag flag) {
        if (!flags.contains(flag)) {
            flags.add(flag);
        }
        return this;
    }
528761
public function removeFlag($flag)
    {
        
        $currentFlags = $this->getFlags();
        for ($i = 0; $i < count($currentFlags); $i++){
            if ($currentFlags[$i] == $flag){
                break;
            }
        }
        
        if ($i <= count($currentFlags)){
            // The flag is found.
            unset($currentFlags[$i]);
            $this->setFlags($currentFlags);
        }
        
    }
589001
public function addFlag($flags)
    {
        $this->bitmask = $this->bitmask | $this->getMaskFromFlags($flags);

        return $this;
    }
1280546
public function setFlags($flags)
    {
        if (!is_int($flags)) {
            throw new InvalidArgumentException('integer', 0);
        }

        if (($flags & FORCE_USE_PROC_OPEN) && ($flags & FORCE_USE_EXEC)) {
            throw new DomainException("Invalid flags: FORCE_USE_PROC_OPEN and FORCE_USE_EXEC cannot be set at the same time");
        }

        $this->flags = $flags;

        return $this;
    }
313926
def Flags(*params)
      if params.size==1 && params.first.kind_of?(Flags)
        params.first
      else
        Flags.new(*params)
      end
    end
918765
public function hasFlag($flags)
    {
        $mask = $this->getMaskFromFlags($flags);

        return ($this->bitmask & $mask) === $mask;
    }
77216
function addFlag($name, $options = array(), $callback = null)
    {
        $flag = new Flag($name, $options, $callback);

        foreach ($flag->aliases as $alias) {
            $this->flags[$alias] = $flag;
        }

        return $this;
    }
1248173
public function mergeWith(self $flags, bool $override = true): self
    {
        if ($override) {
            $clone = clone ($this);
            foreach ($flags as $stringFlag => $flag) {
                /** @var FlagInterface $flag */
                $clone->flags[$flag->__toString()] = clone ($flag);
            }
        } else {
            $clone = clone ($flags);
            $clone->key = $this->key;
            foreach ($this as $stringFlag => $flag) {
                /** @var FlagInterface $flag */
                $clone->flags[$flag->__toString()] = clone ($flag);
            }
        }

        return $clone;
    }
1237904
protected function __add( array $tokens )
	{
		$updated = false;

		foreach ( $tokens as $token ) {
			if ( ! $this->__contains( $token ) ) {
				$this->tokens[] = $token;
				$updated = true;
			}
		}

		if ( $updated ) {
			$this->__update();
		}

		return $this;
	}