ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
ILIAS\Skill\Usage\UsageDBRepository Class Reference
+ Collaboration diagram for ILIAS\Skill\Usage\UsageDBRepository:

Public Member Functions

 __construct (\ilDBInterface $db)
 
 getUsageOfObject (int $obj_id, bool $include_titles=false)
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Definition at line 23 of file UsageDBRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Skill\Usage\UsageDBRepository::__construct ( \ilDBInterface  $db)

Definition at line 27 of file UsageDBRepository.php.

References ILIAS\Skill\Usage\UsageDBRepository\$db.

29  {
30  $this->db = $db;
31  }

Member Function Documentation

◆ getUsageOfObject()

ILIAS\Skill\Usage\UsageDBRepository::getUsageOfObject ( int  $obj_id,
bool  $include_titles = false 
)

Definition at line 33 of file UsageDBRepository.php.

References ilObject\_lookupTitle(), ILIAS\Repository\int(), and ilArrayUtil\sortArray().

33  : array
34  {
35  $set = $this->db->query(
36  "SELECT tax_id FROM tax_usage " .
37  " WHERE obj_id = " . $this->db->quote($obj_id, "integer")
38  );
39  $tax = array();
40  while ($rec = $this->db->fetchAssoc($set)) {
41  if (!$include_titles) {
42  $tax[] = (int) $rec["tax_id"];
43  } else {
44  $tax[] = array("tax_id" => (int) $rec["tax_id"],
45  "title" => \ilObject::_lookupTitle((int) $rec["tax_id"])
46  );
47  }
48  }
49  if ($include_titles) {
50  $tax = \ilArrayUtil::sortArray($tax, "title");
51  }
52  return $tax;
53  }
static _lookupTitle(int $obj_id)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ILIAS\Skill\Usage\UsageDBRepository::$db
protected

The documentation for this class was generated from the following file: