ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilECSEvent.php
Go to the documentation of this file.
1 <?php
2 
18 declare(strict_types=1);
19 
24 {
25  public const CREATED = 'created';
26  public const UPDATED = 'updated';
27  public const DESTROYED = 'destroyed';
28  public const NEW_EXPORT = 'new_export';
29 
30  protected object $json_obj;
31  public string $status = '';
32  public string $ressource = '';
33  public int $ressource_id = 0;
34  public ?string $ressource_type = '';
35 
39  public function __construct($json_obj)
40  {
41  $this->json_obj = $json_obj;
42  $this->read();
43  }
44 
48  public function getStatus(): string
49  {
50  return $this->status;
51  }
52 
56  public function getRessource(): string
57  {
58  return $this->ressource;
59  }
60 
64  public function getRessourceId(): int
65  {
66  return $this->ressource_id;
67  }
68 
69 
73  public function getRessourceType(): ?string
74  {
75  return $this->ressource_type;
76  }
77 
78 
82  private function read(): void
83  {
84  $this->status = $this->json_obj->status;
85  $this->ressource = $this->json_obj->ressource;
86 
87  $res_arr = (array) explode('/', $this->getRessource());
88 
89  $this->ressource_id = (int) array_pop($res_arr);
90  $this->ressource_type = array_pop($res_arr);
91  }
92 }
getStatus()
get title
getRessourceType()
Get ressource type.
read()
Read community entries and participants.
getRessourceId()
Get ressource id.
__construct($json_obj)
getRessource()
getDescription
string $ressource_type