ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PRGProgressId.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public const DELIMITER = '_';
24 
25  protected int $ass_id;
26  protected int $usr_id;
27  protected int $node_obj_id;
28 
29  public function __construct(int $ass_id, int $usr_id, int $node_obj_id)
30  {
31  $this->ass_id = $ass_id;
32  $this->usr_id = $usr_id;
33  $this->node_obj_id = $node_obj_id;
34  }
35 
36  public static function createFromString(string $id): self
37  {
38  $id = array_map('intval', explode(self::DELIMITER, $id));
39  return new self(...$id);
40  }
41 
42  public function getAssignmentId(): int
43  {
44  return $this->ass_id;
45  }
46 
47  public function getUsrId(): int
48  {
49  return $this->usr_id;
50  }
51 
52  public function getNodeId(): int
53  {
54  return $this->node_obj_id;
55  }
56 
57  public function __toString(): string
58  {
59  return implode(self::DELIMITER, [$this->ass_id, $this->usr_id, $this->node_obj_id]);
60  }
61 }
static createFromString(string $id)
__construct(int $ass_id, int $usr_id, int $node_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23