Counts the number of role policies using section with $id in their limitations.

@param int $id

@return int
334290
public function countPoliciesUsingSection($id)
    {
        try {
            return $this->innerGateway->countPoliciesUsingSection($id);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1230249
public static function findPostsCount($id)
    {
        $cache = Podium::getInstance()->podiumCache->getElement('user.postscount', $id);
        if ($cache === false) {
            $cache = (new Query)->from(Post::tableName())->where(['author_id' => $id])->count();
            Podium::getInstance()->podiumCache->setElement('user.postscount', $id, $cache);
        }
        return $cache;
    }
463977
public function position(string $id): int
    {
        $i = 0;
        foreach ($this->all() as $item) {
            if ($item->id() === $id) {
                return $i;
            }

            ++$i;
        }

        return $this->notFound($id);
    }
979723
public function findAssociationPerformancelevelByID($id)
    {
        $performancelevels = $this->findAssociationPerformancelevels()->getPerformancelevels();

        $performancelevels->rewind();

        while ($performancelevels->valid()) {
            $performancelevel = $performancelevels->current();
            if ($performancelevel->getID() == $id) {
                return $performancelevel;
            }

            $performancelevels->next();
        }
    }
314801
public function check_access($id) {
        global $USER;

        try {
            $entry = $this->get_entry($id);
            $cminfo = $this->get_cm('glossary', $entry->glossaryid, $entry->course);
        } catch (\dml_missing_record_exception $ex) {
            return \core_search\manager::ACCESS_DELETED;
        } catch (\dml_exception $ex) {
            return \core_search\manager::ACCESS_DENIED;
        }

        if (!glossary_can_view_entry($entry, $cminfo)) {
            return \core_search\manager::ACCESS_DENIED;
        }

        return \core_search\manager::ACCESS_GRANTED;
    }
391088
public function loadOneById($id)
    {
        $stmt = $this->getMatchOneByIdCypher($id);
        $result = $this->_em->getDatabaseDriver()->run($stmt->text(), $stmt->parameters());
        $hydrator = $this->_em->getEntityHydrator($this->_className);
        $entities = $hydrator->hydrateAll($result);

        return count($entities) === 1 ? $entities[0] : null;
    }
137992
public function findByRoleID($id)
    {
        $usersWithRepo = [];
        $users = $this->model->all();

        foreach ($users as $user) {
            if ($user->roles->first()->id == $id) {
                $usersWithRepo[] = $user;
            }
        }

        return $usersWithRepo;
    }
707536
public function block($id)
    {
        $this->loadModel('User.Users');
        $user = $this->Users->get($id, [
            'fields' => ['id', 'name', 'email'],
            'contain' => ['Roles'],
        ]);

        if (!in_array(ROLE_ID_ADMINISTRATOR, $user->role_ids)) {
            if ($this->Users->updateAll(['status' => 0], ['id' => $user->id])) {
                $this->Flash->success(__d('user', 'User {0} was successfully blocked!', $user->name));
                $user->updateToken();
                NotificationManager::blocked($user)->send();
            } else {
                $this->Flash->danger(__d('user', 'User could not be blocked, please try again.'));
            }
        } else {
            $this->Flash->warning(__d('user', 'Administrator users cannot be blocked.'));
        }

        $this->title(__d('user', 'Block User Account'));
        $this->redirect($this->referer());
    }
255212
public function socialsCount($id)
    {
        // I know eloquent does this, but having trouble so hand crafting using DB
        $record =  DB::table('socials')->where('social_type_id', '=', $id)->get();
        return count($record);
    }
1347229
public function show($id)
    {
        // get role by id
        $role = Role::find($id);

        if (!$role) {
            return response()->json(null, 404);
        }

        return response()->json(arrayView('phpsoft.users::role/read', [
            'role' => $role
        ]), 200);
    }
98816
public function delPermission($id = 0)
    {
        $model = new Permission($this->db);
        try {
            return $model->delPermission($id);
        } catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
1335509
private function _checkIdArgument($id)
    {
        $id = strtoupper($id);
        $length = strlen($id);

        if ($length === 15) {
            return $this->_generateShortType($id);
        } elseif ($length === 18) {
            return $this->_generatelongType($id);
        }

        return false;
    }
745094
public function getPermissionForId($id)
    {
        $permission = $this->permissionsDataSource->getPermissionForId($id);
        
        if ($permission instanceof \Zepi\Core\AccessControl\Entity\Permission) {
            $accessEntity = $this->getAccessEntityForUuid($permission->getAccessEntityClass(), $permission->getAccessEntityUuid());
            
            if ($accessEntity instanceof \Zepi\Core\AccessControl\Entity\AccessEntity) {
                $permission->setAccessEntity($accessEntity);
            }
        }
        
        return $permission;
    }
113913
public function childCount($id, array $options = [])
	{
		$options['for'] = $id;

		$query = $this->findChildren($this->_table->find(), $options);

		return $query->count();
	}
191223
public function isBlockedBy($id): bool
    {
        if (is_array($id)) {
            return count($id) === $this->blockerUsers()->whereIn('blocker_id', $id)->count();
        }

        return $this->blockerUsers()->where('blocker_id', $id)->exists();
    }
113873
public static function plan_stop_review($id) {
        $params = self::validate_parameters(self::plan_stop_review_parameters(), array(
            'id' => $id
        ));

        $plan = api::read_plan($id);
        self::validate_context($plan->get_context());

        return api::plan_stop_review($plan);
    }
66360
public function stopSection($id)
    {
        $this->stop('__section__');

        if (1 == \count($this->activeSections)) {
            throw new \LogicException('There is no started section to stop.');
        }

        $this->sections[$id] = array_pop($this->activeSections)->setId($id);
        $this->stop('__section__.child');
    }