ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
MediaPoolTree.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 class MediaPoolTree extends \ilTree
24 {
25  public function __construct(int $mep_obj_id)
26  {
27  parent::__construct($mep_obj_id);
28  $this->setTreeTablePK("mep_id");
29  $this->setTableNames("mep_tree", "mep_item");
30  }
31 
32  public function insertInMepTree(
33  int $a_obj_id,
34  ?int $a_parent = null
35  ): void {
36  if (!$this->isInTree($a_obj_id)) {
37  $parent = (is_null($a_parent))
38  ? $this->getRootId()
39  : $a_parent;
40  $this->insertNode($a_obj_id, $parent);
41  }
42  }
43 
44 }
isInTree(?int $a_node_id)
get all information of a node.
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
__construct(VocabulariesInterface $vocabularies)
insertInMepTree(int $a_obj_id, ?int $a_parent=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertNode(int $a_node_id, int $a_parent_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deletion_date=false)
insert new node with node_id under parent node with parent_id