20 declare(strict_types=1);
    63         $names = self::getAllOrguNames();
    65         return array_keys($names);
    70         if (self::where(array(
'ref_id' => $this->
getRefId()))->hasSets()) {
    85     public static function getTextRepresentationOfUsersOrgUnits(
    87         string $separator = self::ORG_SEPARATOR,
    88         bool $using_tmp_table = 
true    90         if ($using_tmp_table === 
true) {
    99                 "SELECT " . 
$ilDB->groupConcat(
   102                 ) . 
" AS orgus FROM orgu_usr_assignements WHERE user_id = %s GROUP BY user_id;",
   108             return (isset($dat->orgus) && $dat->orgus) ? $dat->orgus : 
'-';
   112             if (!$array_of_org_ids) {
   117             return implode($separator, $paths);
   128         if ($sort_by_title) {
   134     public static function writePathByRefId(
int $ref_id): 
void   137         $names = self::getAllOrguNames();
   140         $path = array($names[$ref_id]);
   141         if ($ref_id == $root_ref_id || !$ref_id) {
   144         while ($ref_id != $root_ref_id && $ref_id) {
   145             $ref_id = $tree->getParent($ref_id);
   146             if ($ref_id != $root_ref_id && isset($names[$ref_id]) && $names[$ref_id]) {
   151         if (
count($path) > 2) {
   152             $first = array_shift($path);
   153             $last = array_pop($path);
   154             $middle = implode(self::GLUE_SIMPLE, $path);
   155             if (mb_strlen($middle) > self::MAX_MIDDLE_PATH_LENGTH) {
   156                 $middle = mb_substr($middle, 0, self::MAX_MIDDLE_PATH_LENGTH) . 
" ...";
   158             $expression = implode(self::GLUE_SIMPLE, [$first, $middle, $last]);
   160             $expression = implode(self::GLUE_SIMPLE, $path);
   165         $ilOrgUnitPathStorage = self::findOrGetInstance($original_ref_id);
   166         $ilOrgUnitPathStorage->setRefId($original_ref_id);
   168         $ilOrgUnitPathStorage->setPath($expression);
   169         $ilOrgUnitPathStorage->store();
   172     public static function clearDeleted(): 
void   178         $ilDB = $DIC[
'ilDB'];
   179         $ref_ids = self::getAllOrguRefIds();
   180         $q = 
"DELETE FROM " . self::TABLE_NAME . 
" WHERE  " . 
$ilDB->in(
'ref_id', $ref_ids, 
true, 
'integer');
   185     public static function getAllOrguNames(array $lng_key = null): array
   187         if (
count(self::$orgu_names) == 0) {
   192             $ilDB = $DIC[
'ilDB'];
   193             $res = 
$ilDB->queryF(
'SELECT * FROM object_reference   194                         JOIN object_data ON object_reference.obj_id = object_data.obj_id AND deleted IS NULL   195                         WHERE object_data.type = %s', array(
'text'), array(
'orgu'));
   197                 self::$orgu_names[
$data->ref_id] = 
$data->title;
   201         return self::$orgu_names;
   206         return self::TABLE_NAME;
 
static getArray(?string $key=null, $values=null)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static orderBy(string $orderBy, string $orderDirection='ASC')
 
Class ilOrgUnitPathStorage. 
 
static where($where, $operator=null)
 
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array. 
 
static _lookupObjectId(int $ref_id)
 
getConnectorContainerName()
 
static getAllOrguRefIds()
 
const MAX_MIDDLE_PATH_LENGTH