concrete/src/Permission/Key/Key.php
public static function getListByPackage($pkg)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);

        $kina = ['-1'];
        $rs = $db->executeQuery('select pkCategoryID from PermissionKeyCategories where pkgID = ?', [$pkg->getPackageID()]);
        while (($pkCategoryID = $rs->fetchColumn()) !== false) {
            $kina[] = $pkCategoryID;
        }
        $kinstr = implode(',', $kina);

        $categories = [];
        /* @var \Concrete\Core\Permission\Category[] $categories */
        $list = [];
        $r = $db->executeQuery('select pkID, pkCategoryID from PermissionKeys where (pkgID = ? or pkCategoryID in (' . $kinstr . ')) order by pkID asc', [$pkg->getPackageID()]);
        while (($row = $r->fetch(PDO::FETCH_ASSOC)) !== false) {
            if (!isset($categories[$row['pkCategoryID']])) {
                $categories[$row['pkCategoryID']] = PermissionKeyCategory::getByID($row['pkCategoryID']);
            }
            $pkc = $categories[$row['pkCategoryID']];
            $pk = $pkc->getPermissionKeyByID($row['pkID']);
            $list[] = $pk;
        }

        return $list;
    }
public static function getListByPackage($pkg)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);

        $kina = ['-1'];
        $rs = $db->executeQuery('select pkCategoryID from PermissionKeyCategories where pkgID = ?', [$pkg->getPackageID()]);
        while (($pkCategoryID = $rs->fetchColumn()) !== false) {
            $kina[] = $pkCategoryID;
        }
        $kinstr = implode(',', $kina);

        $categories = [];
        /* @var \Concrete\Core\Permission\Category[] $categories */
        $list = [];
        $r = $db->executeQuery('select pkID, pkCategoryID from PermissionKeys where (pkgID = ? or pkCategoryID in (' . $kinstr . ')) order by pkID asc', [$pkg->getPackageID()]);
        while (($row = $r->fetch(PDO::FETCH_ASSOC)) !== false) {
            if (!isset($categories[$row['pkCategoryID']])) {
                $categories[$row['pkCategoryID']] = PermissionKeyCategory::getByID($row['pkCategoryID']);
            }
            $pkc = $categories[$row['pkCategoryID']];
            $pk = $pkc->getPermissionKeyByID($row['pkID']);
            $list[] = $pk;
        }

        return $list;
    }
public static function getListByPackage ( $ pkg ) { $ app = Application :: getFacadeApplication ( ) ; $ db = $ app -> make ( Connection :: class ) ; $ kina = [ '-1' ] ; $ rs = $ db -> executeQuery ( 'select pkCategoryID from PermissionKeyCategories where pkgID = ?' , [ $ pkg -> getPackageID ( ) ] ) ; while ( ( $ pkCategoryID = $ rs -> fetchColumn ( ) ) !== false ) { $ kina [ ] = $ pkCategoryID ; } $ kinstr = implode ( ',' , $ kina ) ; $ categories = [ ] ; /* @var \Concrete\Core\Permission\Category[] $categories */ $ list = [ ] ; $ r = $ db -> executeQuery ( 'select pkID, pkCategoryID from PermissionKeys where (pkgID = ? or pkCategoryID in (' . $ kinstr . ')) order by pkID asc' , [ $ pkg -> getPackageID ( ) ] ) ; while ( ( $ row = $ r -> fetch ( PDO :: FETCH_ASSOC ) ) !== false ) { if ( ! isset ( $ categories [ $ row [ 'pkCategoryID' ] ] ) ) { $ categories [ $ row [ 'pkCategoryID' ] ] = PermissionKeyCategory :: getByID ( $ row [ 'pkCategoryID' ] ) ; } $ pkc = $ categories [ $ row [ 'pkCategoryID' ] ] ; $ pk = $ pkc -> getPermissionKeyByID ( $ row [ 'pkID' ] ) ; $ list [ ] = $ pk ; } return $ list ; }
Get the list of permission keys defined by a package.
Note, this queries both the pkgID found on the PermissionKeys table AND any permission keys of a special type
installed by that package, and any in categories by that package.

@param \Concrete\Core\Entity\Package|\Concrete\Core\Package\Package $pkg

@return \Concrete\Core\Permission\Key\Key[]
Get the list of permission keys defined by a package . Note this queries both the pkgID found on the PermissionKeys table AND any permission keys of a special type installed by that package and any in categories by that package .