Determine if the current AccountControl object contains the given UAC flag(s).

@param int $flag

@return bool
5555
public function has($flag)
    {
        // We'll extract the given flag into an array of possible flags, and
        // see if our AccountControl object contains any of them.
        $flagsUsed = array_intersect($this->extractFlags($flag), $this->values);

        return in_array($flag, $flagsUsed);
    }
585039
public function isIpAddress($flags = 0)
    {
        $this->isString();

        return $this->doCheck(function ($value) use ($flags) {
            $this->throwExceptionIfFalse(
                filter_var($value, FILTER_VALIDATE_IP, $flags),
                '"%s" is not a valid IP address.', $value
            );
        });
    }
801293
public function contains($item)
    {
        if ($item instanceof AbstractEntity) {
            $item = $item->id;
        }
        foreach ($this->value as $entity) {
            $eId = $entity->id;
            if (!$this->isNull($eId) && $eId == $item) {
                return true;
            }
        }

        return false;
    }
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);
        }
        
    }
1249760
protected function contains($token)
    {
        return stripos($this->whois, sprintf($token, $this->domain)) !== false;
    }
678806
public static function isBitSet( int $target, int $flag, int $mode ) : bool
    {
        switch($mode){
        case self::BITTEST_MODE_ALL:
            return ($target & $flag) === $flag;
            break;
        case self::BITTEST_MODE_ANY:
            return ($target & $flag) != 0;
        }

        return false;
    }
325553
private static function getImageFlag(array $flags): int
    {
        $res = 0;
        foreach ($flags as $flag) {
            $res |= constant(Image::class . '::' . $flag);
        }
        return $res;
    }
347763
public function hasFlag($flag)
    {
        $returnValue = (bool) false;

        
        foreach ($this->getFlags() as $f){
            if ($f == $flag){
                $returnValue = true;
                break;
            }
        }
        

        return (bool) $returnValue;
    }
647111
public static function userFlagExists($flag, $action, $module_id = null) : bool {
		if (\Helper\Cmd::isCli()) return false;
		if (!isset($module_id)) {
			$module_id = \Application::$controller->module_id;
		}
		// load all actions from datasource
		if (is_null(\Object\Controller::$cached_actions) && !\Object\Error\Base::$flag_database_tenant_not_found) {
			\Object\Controller::$cached_actions = \Object\ACL\Resources::getStatic('actions', 'primary');
		}
		// load all flags
		if (is_null(\Object\Controller::$cached_flags) && !\Object\Error\Base::$flag_database_tenant_not_found) {
			\Object\Controller::$cached_flags = \Object\ACL\Resources::getStatic('flags', 'primary');
		}
		if (is_string($flag)) {
			$flag = \Object\Controller::$cached_flags[$flag]['id'];
		}
		if (is_string($action)) {
			$action = \Object\Controller::$cached_actions[$action]['id'];
		}
		// user first
		$flags = \User::get('flags');
		if (!empty($flags)) {
			$result = self::userFlagExistsOne($flags, $flag, $action, $module_id);
			if ($result == 1) {
				return true;
			} else if ($result == 2) { // disabled feature
				return false;
			}
		}
		// roles second
		if (is_null(\Object\Controller::$cached_roles) && !\Object\Error\Base::$flag_database_tenant_not_found) {
			\Object\Controller::$cached_roles = \Object\ACL\Resources::getStatic('roles', 'primary');
		}
		foreach (\User::roles() as $v) {
			$result = self::userFlagExistsRole($v, $flag, $action, $module_id);
			if ($result == 1) {
				return true;
			} else if ($result == 2) { // disabled feature
				return false;
			}
		}
		// teams last
		if (is_null(\Object\Controller::$cached_teams) && !\Object\Error\Base::$flag_database_tenant_not_found) {
			\Object\Controller::$cached_teams = \Object\ACL\Resources::getStatic('roles', 'teams');
		}
		foreach (\User::teams() as $v) {
			$flags = \Object\Controller::$cached_teams[$v]['flags'] ?? null;
			if (!empty($features)) {
				$result = self::userFeatureExistsOne($flags, $flag, $action, $module_id);
				if ($result == 1) {
					return true;
				} else if ($result == 2) { // disabled feature
					return false;
				}
			}
		}
		return false;
	}
1349517
protected function setFlag($flag, $enable = true)
    {
        if ($enable) {
            $this->flags[$flag] = true;
        } else {
            unset($this->flags[$flag]);
        }
    }
1025825
public function setFlagStatus($flag, $status)
    {
        if (is_array($flag)) {
            foreach ($flag as $singleFeature) {
                $this->flags[$singleFeature] = $status;
            }
        } else {
            $this->flags[$flag] = $status;
        }
    }
651438
public function pasv($flag = true)
    {
        return ($this->isConnected() === true) ? ftp_pasv($this->getConnection(), $flag) : false;
    }
1022711
public function renderExceptions($flag = null)
    {
        if (null !== $flag)
        {
            $this->_renderExceptions = $flag ? true : false;
        }

        return $this->_renderExceptions;
    }
594105
public function log($message, $flag)
    {
        $headers = [
            'token' => $this->token,
        ];

        $query = $this->processLog($message, $flag);

        $response = $this->curl::post($this->missionControlUrl, $headers, $query);

        if ($response->code != 200) {
            $this->error('Unable to message Mission Control, please confirm your token');
        }

        return true;
    }
1164774
public function isSelected($flag = null)
    {
        if ($flag !== null) {
            $this->isSelected = !!$flag;

            $this->setCollapsed(!$flag);
        }

        return $this->isSelected;
    }
168792
public function getFlag($flag) {
		if ($flag instanceOf Argument) {
			$obj  = $flag;
			$flag = $flag->value;
		}

		if (isset($this->_flags[$flag])) {
			return $this->_flags[$flag];
		}

		foreach ($this->_flags as $master => $settings) {
			if (in_array($flag, (array)$settings['aliases'])) {
				if (isset($obj)) {
					$obj->key = $master;
				}

				$cache[$flag] =& $settings;
				return $settings;
			}
		}
	}
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;
    }