public function permissionFetchById($permission_id)
    {
        $multi = is_array($permission_id);
        if (!$multi) {
            $permission_id = [$permission_id];
        }
        $in_query = join(',', $permission_id);
        $query = "
            SELECT
                permission_id, `name`, description, added_on, updated_on
            FROM
                auth_permission
            WHERE
                permission_id IN ($in_query)
            ";
        $cur = $this->db->prepare($query);
        try {
            $cur->execute();
            if ($multi) {
                $permissions = $cur->fetchAll(PDO::FETCH_CLASS, self::CLASS_PERMISSION);
            } else {
                $permissions = $cur->fetchObject(self::CLASS_PERMISSION);
            }
        } catch (PDOException $db_err) {
            if ($this->logger) {
                $this->logger->error("Error trying to fetch permission by ID", ['exception' => $db_err]);
            }
            $permissions = ($multi) ? [] : false;
        }
        return $permissions;
    }
public function permissionFetchById($permission_id)
    {
        $multi = is_array($permission_id);
        if (!$multi) {
            $permission_id = [$permission_id];
        }
        $in_query = join(',', $permission_id);
        $query = "
            SELECT
                permission_id, `name`, description, added_on, updated_on
            FROM
                auth_permission
            WHERE
                permission_id IN ($in_query)
            ";
        $cur = $this->db->prepare($query);
        try {
            $cur->execute();
            if ($multi) {
                $permissions = $cur->fetchAll(PDO::FETCH_CLASS, self::CLASS_PERMISSION);
            } else {
                $permissions = $cur->fetchObject(self::CLASS_PERMISSION);
            }
        } catch (PDOException $db_err) {
            if ($this->logger) {
                $this->logger->error("Error trying to fetch permission by ID", ['exception' => $db_err]);
            }
            $permissions = ($multi) ? [] : false;
        }
        return $permissions;
    }
public function permissionFetchById ( $ permission_id ) { $ multi = is_array ( $ permission_id ) ; if ( ! $ multi ) { $ permission_id = [ $ permission_id ] ; } $ in_query = join ( ',' , $ permission_id ) ; $ query = "
            SELECT
                permission_id, `name`, description, added_on, updated_on
            FROM
                auth_permission
            WHERE
                permission_id IN ($in_query)
            " ; $ cur = $ this -> db -> prepare ( $ query ) ; try { $ cur -> execute ( ) ; if ( $ multi ) { $ permissions = $ cur -> fetchAll ( PDO :: FETCH_CLASS , self :: CLASS_PERMISSION ) ; } else { $ permissions = $ cur -> fetchObject ( self :: CLASS_PERMISSION ) ; } } catch ( PDOException $ db_err ) { if ( $ this -> logger ) { $ this -> logger -> error ( "Error trying to fetch permission by ID" , [ 'exception' => $ db_err ] ) ; } $ permissions = ( $ multi ) ? [ ] : false ; } return $ permissions ; }
Fetch a permission by is ID, returning false if it doesn't exist.

@param $permission_id

@return bool|Permission|Permission[]
Fetch a permission by is ID returning false if it doesn t exist .