Get a permission key given its ID.

@param int $pkID

@return \Concrete\Core\Permission\Key\Key|null
544195
public static function getByID($pkID)
    {
        $keys = null;
        $app = Application::getFacadeApplication();
        $cache = $app->make('cache/request');
        if ($cache->isEnabled()) {
            $item = $cache->getItem('permission_keys');
            if (!$item->isMiss()) {
                $keys = $item->get();
            }
        }
        if ($keys === null) {
            $keys = self::loadAll();
        }

        return isset($keys[$pkID]) ? $keys[$pkID] : null;
    }
1173924
public function getById(int $id)
	{
		return $this->setAuthorizer($this->getModel()->where('id', '=', $id)->first());
	}
892477
private function getLockID()
    {
        if ($this->lockID) {
            return $this->lockID;
        }

        $id = uniqid('thumbnail_thread_', true);

        $this->lockID = $id;
        return $id;
    }
1150448
private function getPermission($code)
    {
        if (isset($this->permissions[$code])) {
            return $this->permissions[$code];
        }

        try {
            return $this->permissionProvider->getPermission($code);
        } catch (PermissionNotFoundException $exception) {
            return null;
        }
    }
850048
public function my_getUidInfo($uid)
    {
        $node_name = $this->searchUid($uid);
        if ($node_name) {
            if (!isset($this->client[$node_name])) return null;
            $token = $this->client[$node_name]->getUidInfo($uid);
            $fdInfo = $this->client[$node_name]->getTokenResult($token);
            return $fdInfo;
        }
        return null;
    }
1287162
public function getPermission($role)
    {
        if ($role instanceof RoleInterface || $role instanceof \Symfony\Component\Security\Core\Role\Role) {
            $role = $role->getRole();
        }
        if (isset($this->permissions[$role])) {
            return $this->permissions[$role];
        }

        return null;
    }
1123333
protected function check_post_id( $pid ) {
		if ( is_numeric($pid) && $pid === 0 ) {
			$pid = get_the_ID();
			return $pid;
		}
		if ( !is_numeric($pid) && is_string($pid) ) {
			$pid = PostGetter::get_post_id_by_name($pid);
			return $pid;
		}
		if ( !$pid ) {
			return null;
		}
		return $pid;
	}
1196459
public static function getByID($btsID)
    {
        $result = null;
        $btsID = (int) $btsID;
        if ($btsID !== 0) {
            $app = Application::getFacadeApplication();
            $cache = $app->make('cache/request');
            $identifier = sprintf('block/type/set/%s', $btsID);
            $item = $cache->getItem($identifier);
            if ($item->isMiss()) {
                $item->lock();
                $db = $app->make(Connection::class);
                $row = $db->fetchAssoc('select btsID, btsHandle, pkgID, btsName from BlockTypeSets where btsID = ?', [$btsID]);
                if ($row !== false) {
                    $result = new static();
                    $result->setPropertiesFromArray($row);
                }
                $item->set($result)->save();
            } else {
                $result = $item->get();
            }
        }

        return $result;
    }
313766
protected function iblockGetIdByCode($code, $siteId = null)
    {
        $siteId = $siteId ?: $this->iblockGetDefaultSiteId();
        $res = CIBlock::getList([], [
            'CODE' => $code,
            'CHECK_PERMISSIONS' => 'N',
            'SITE_ID' => $siteId,
        ]);
        $iblock = $res->fetch();

        return !empty($iblock['ID']) ? $iblock['ID'] : null;
    }
960746
private function getSharedItemKey(int $id): int
    {
        if ($id <= 0) {
            throw new \InvalidArgumentException('ID cannot be less or equals zero');
        }

        $st = @stat(__FILE__);
        if (!$st) {
            return -1;
        }

        //@TODO collisions? need more unique key
        $key = (int)sprintf("%u",
            (
                ($st['ino'] & 0xffff) |
                (($st['dev'] & 0xff) << 16) |
                (($id & 0xff) << 24)
            )
        );

        return $key;
    }
0
protected function parentId()
	{
		switch ( $this->position )
		{
			case 'root':
				return null;

			case 'child':
				return $this->target->getKey();

			default:
				return $this->target->getParentId();
		}
	}
38226
public function permissionGetNameById($permid)
  {
    foreach($this->permissionList() as $name => $perm)
    {
      if($perm["permid"] == $permid) return new TeamSpeak3_Helper_String($name);
    }

    throw new TeamSpeak3_Adapter_ServerQuery_Exception("invalid permission ID", 0xA02);
  }
15389
public function getPermissions($user_id = null)
    {
        static $permissions = array();

        if (!isset($user_id)) {
            $user_id = $this->uid;
        }

        if (isset($permissions[$user_id])) {
            return $permissions[$user_id];
        }

        $user = $this->get($user_id);

        if (empty($user['role_id'])) {
            return $permissions[$user_id] = array();
        }

        $role = array();
        if (isset($user['role_permissions'])) {
            $role['permissions'] = $user['role_permissions'];
        } else {
            $role = $this->role->get($user['role_id']);
        }

        if (empty($role['permissions'])) {
            return $permissions[$user_id] = array();
        }

        return $permissions[$user_id] = (array) $role['permissions'];
    }
146591
public function permissionFind($permid)
  {
    if(!is_array($permid))
    {
      $permident = (is_numeric($permid)) ? "permid" : "permsid";
    }
    else
    {
      $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
    }

    return $this->execute("permfind", array($permident => $permid))->toArray();
  }
1360186
public function getPrivateKeyPassphrase()
    {
        if (isset($this->raw->{'key-pass'})
            && is_string($this->raw->{'key-pass'})) {
            return $this->raw->{'key-pass'};
        }

        return null;
    }
32154
public function getId($key = null)
    {
        return (isset($this->index[$key]) && !is_null($key)) ?
            $this->index[$key] :
            $this->index[$this->getKeyName()];
    }
1260526
protected function get_info( $pid ) {
		$post = $this->prepare_post_info($pid);
		if ( !isset($post->post_status) ) {
			return null;
		}

		do_action_ref_array('the_post', array(&$post, &$GLOBALS['wp_query']));

		$post->status = $post->post_status;
		$post->id = $post->ID;
		$post->slug = $post->post_name;
		$customs = $this->get_post_custom($post->ID);
		if ( $this->is_previewing() ) {
			global $wp_query;
			$rev_id = $this->get_post_preview_id($wp_query);
			$customs = $this->get_post_custom($rev_id);
		}
		$post->custom = $customs;
		$post = (object) array_merge((array) $customs, (array) $post);
		return $post;
	}