@param string|int $flag

@return int
424423
private function parseFlag($flag)
    {
        if (!isset($this->flags)) {
            $this->flags = 0;
        }

        if (is_string($flag) && defined("static::${flag}")) {
            $flag = constant("static::${flag}");
        }

        if (!is_int($flag)) {
            return 0;
        }

        return $flag;
    }
1120784
public function union(Query $query, $flag = null) {
        if ($flag === Dialect::ALL || $flag === Dialect::DISTINCT) {
            $query->attribute('flag', $flag);
        }

        return $this->_addCompound(Dialect::UNION, $query);
    }
1302177
public function getOption($flag) {
        return isset($this->options[$flag]) ? $this->options[$flag] : null;
    }
738504
final public function option($flag)
    {
        $result = null;

        if (array_key_exists($flag, $this->shellOptions)) {
            $result = $this->shellOptions[$flag];
        }

        return $result;
    }
221983
public function getStat(string $path, int $flags)
    {
        $entity = $this->getEntity($path);

        if (null === $entity) {
            $path = null;
        } elseif ($entity instanceof DeletedInterface) {
            $path = null;
        } elseif (!$entity->file_exists()) {
            $path = null;
        } else {
            $path = $entity->path();
        }

        if (null === $path) {
            $stat = false;
        } elseif ($flags & STREAM_URL_STAT_QUIET) {
            $stat = @stat($path);
        } else {
            $stat = stat($path);
        }

        return $stat;
    }
23185
public function grant($flag)
    {
        if (is_string($flag) && defined('static::' . strtoupper($flag))) {
            $flag = constant('static::' . strtoupper($flag));
        }

        $this->mask |= $flag;

        return $this;
    }
312731
public function has($flag)
    {
        $values = $this->getValuesFromFlagOrEnum($flag);

        if (empty($values)) {
            return false;
        }

        foreach ($values as $value) {
            if (!(bool) ($this->value & $value)) {
                return false;
            }
        }

        return true;
    }
619125
public function hasTax($flag = null)
    {
        if (null === $flag) {
            return $this->sessionManager->get('hasTax');
        }
        $this->sessionManager->put('hasTax', $flag);
        return $this;
    }
773853
public static function fromInt($int){
		
		if(!\is_int($int)){
			throw new \InvalidArgumentException('$int must be an integer');
		}
		
		$flags = new static();
		
		foreach(static::getEnumValues() as $const){			
			if(($int & $const) === $const){
				$flags->addFlag($const);
			}
		}

		return $flags;
		
	}
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;
    }
794696
public function url_stat(string $url, int $flags)
    {
        $partition = static::getPartition($url);
        $path = static::getRelativePath($url);

        return $partition->getStat($path, $flags);
    }
1291800
public function isLIFO($flag = null)
    {
        if ($flag !== null) {
            $isLifo = $flag === true ? 1 : -1;

            if ($isLifo !== $this->isLIFO) {
                $this->isLIFO = $isLifo;
                $this->sorted = false;
            }
        }

        return 1 === $this->isLIFO;
    }
104557
public function url_stat($path, $flag)
    {
        $path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);

        $this->_path = $this->resolveFilePath($path);
        if (is_file($this->_path) && is_readable($this->_path)) {
            $fd = fopen($this->_path, 'rb');
            $this->_stat = fstat($fd);
            fclose($fd);

            return $this->_stat;
        }

        return;
    }
1102521
public function isForceInitialization($flag = null)
    {
        if ($flag === null) {
            return $this->forceInit;
        }
        $this->forceInit = $flag;
        return $this;
    }
562954
public function get_setting_flag_value(admin_setting_flag $flag) {
        $value = $this->config_read($this->name . '_' . $flag->get_shortname());
        if (!isset($value)) {
            $value = $flag->get_default();
        }

        return !empty($value);
    }
922670
public function isFlagSet($flag)
    {
        if (in_array($flag, $this->flags->all()->toArray())) {
            return true;
        }
        return false;
    }
43767
public function clearFlag(string $flag): bool
    {
        $result = \imap_clearflag_full($this->resource->getStream(), (string) $this->getNumber(), $flag, \ST_UID);

        $this->clearHeaders();

        return $result;
    }