Removes all auth items of the specified type.
@param int $type the auth item type (either Item::TYPE_PERMISSION or Item::TYPE_ROLE)
3893
protected function removeAllItems($type)
    {
        $rows = (new Query)
            ->select(['name'])
            ->from($this->itemCollection)
            ->where(['type' => $type])
            ->all($this->db);
        if (empty($rows)) {
            return;
        }

        $names = ArrayHelper::getColumn($rows, 'name');

        $this->db->getCollection($this->assignmentCollection)
            ->remove(['item_name' => $names]);

        $this->db->getCollection($this->itemCollection)
            ->remove(['type' => $type]);

        $this->db->getCollection($this->itemCollection)
            ->update(
                [],
                [
                    '$pull' => [
                        'parents' => [
                            '$in' => $names,
                        ]
                    ],
                ],
                [
                    'multi' => true
                ]
            );

        $this->invalidateCache();
    }
673207
public function clear($type = null)
    {
        if (is_null($type)) {
            $_SESSION[$this->key] = [];
        } else {
            unset($_SESSION[$this->key][$type]);
        }

        return $this;
    }
495991
public function unregisterFilter($type, $callback)
    {
        $name = $this->_get_filter_name($callback);
        if (isset($this->smarty->registered_filters[$type][$name])) {
            unset($this->smarty->registered_filters[$type][$name]);
        }
    }
1044179
public function flush($type) {
		if (isset($this->cache[$type])) $this->cache[$type]=array();
		return $this;
	}
1040476
protected function removeAllItems($type) {
        $names = [];
        $query = (new Query)
            ->select(['name'])
            ->from($this->itemTable)
            ->where(['type' => $type]);
        foreach ($query->all($this->db) as $row) {
            $names[] = $row['name'];
        }

        if (empty($names)) {
            return;
        }
        $key = $type == Item::TYPE_PERMISSION ? 'child' : 'parent';
        $this->db->getCollection($this->itemChildTable)->remove([$key => $names]);
        $this->db->getCollection($this->assignmentTable)->remove(['item_name' => $names]);
        $this->db->getCollection($this->itemTable)->remove(['type' => $type]);
    }
1366880
public function auth($type = self::AUTH_TYPE_CMD_LINE)
    {
        if ($this->accessToken !== null) {
            // Already got an auth token
            $this->getLogger()->debug('Using existing accessToken');
            $this->client->setAccessToken($this->accessToken);
            if (!$this->client->isAccessTokenExpired()) {
                return;
            }
            $this->getLogger()->info('Existing accessToken no longer valid');
            if ($this->refreshToken !== null) {
                $this->getLogger()->debug('Using refreshToken');
                $this->client->refreshToken($this->refreshToken);
                return;
            }
        }
        switch($type) {
            case self::AUTH_TYPE_CMD_LINE:
                $this->cmdLineAuth();
                break;
            default:
                throw new Exception('Auth Type not valid');
        }
    }
603112
public function disallow($type)
    {
        if (!is_array($type)) {
            $type = func_get_args();
        }
        $this->disallowedTypes = implode(',', $type);

        return $this;
    }
170680
public function whitelistType($type)
    {
        foreach (func_get_args() as $arg) {
            if (!in_array($arg, $this->types)) {
                continue;
            }
            if (isset($this->alias[$arg])) {
                call_user_func_array([$this, "whitelistType"], $this->alias[$arg]);
            }
            $this->typeWhitelist[] = $arg;

        }

    }
800138
public function deleteAuthItems() {
        foreach($this->privileges as $privilege) {
            $this->delete(
                'AuthItem',"name = '".$privilege.'::'.$this->getController()."'"
            );
        }
    }
356192
public function withType(string $type): self
    {
        $this->type = CredentialEnum::ensureValid($type);
        return $this;
    }
1096263
public function unregisterResource($type)
    {
        if (isset($this->smarty->registered_resources[$type])) {
            unset($this->smarty->registered_resources[$type]);
        }
    }
920013
public function deleteRole(string $type, string $name): WebAclRule {
        self::checkRoleType($type);
        unset($this->roles[$type][$name]);
        return $this;
    }
445580
public function unregister($identifier, $type = "")
    {
        if (!$this->isRegistered($identifier, $type)) {
            throw new RegistryException(
                RegistryException::UNKNOWN_IDENTIFIER_TEXT . '(identifier: ' . $identifier . ')',
                RegistryException::UNKNOWN_IDENTIFIER_CODE
            );
        }

        $this->getESAdaptor()->removeDocuments(array($identifier), $this->section, $type);
    }
1263837
public function removeImplementor($type)
    {
        if (isset($this->implementors[$type])) {
            unset($this->implementors[$type]);
        }

        return $this;
    }
1182625
public function removeCustomType($type)
    {
        if (!$this->hasCustomType($type)) {
            throw PlatformException::customTypeDoesNotExist($type);
        }

        unset($this->customTypes[array_search($type, $this->customTypes)]);
    }
56789
public function clear($type)
    {
        if ($type == self::TYPE_ALL) {
            $indexes = $this->getAllIndexes();
        } else {
            $indexes = $this->getIndexes($type);
        }

        foreach ($indexes as $index) {
            $index->clear();
        }
    }
998677
public function removeAllowedMimeType($type)
    {
        $key = array_search($type, $this->allowedMimeTypes);
        if ($key !== false) {
            unset($this->allowedMimeTypes[$key]);
            return true;
        }


        return false;
    }