#68 - finish notification class. Content notification on validate brief working
This commit is contained in:
parent
3fb043210e
commit
fa36c9ef4a
12 changed files with 246 additions and 24 deletions
36
public/site/plugins/notifications/src/location/Location.php
Normal file
36
public/site/plugins/notifications/src/location/Location.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
namespace adrienpayet\notifications\location;
|
||||
|
||||
class Location
|
||||
{
|
||||
protected PageDetails $page;
|
||||
protected ?string $dialogUri = null;
|
||||
protected ProjectDetails $project;
|
||||
protected ?FileDetails $file = null;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->page = new PageDetails($data["page"]);
|
||||
$this->dialogUri = $data["dialogUri"];
|
||||
$this->project = new ProjectDetails($data["project"]);
|
||||
|
||||
if (isset($data['file'])) {
|
||||
$this->file = new FileDetails($data["file"]);
|
||||
}
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
$array = [
|
||||
"page" => $this->page->toArray(),
|
||||
"project" => $this->project->toArray(),
|
||||
];
|
||||
|
||||
if ($this->dialogUri) {
|
||||
$array["dialogUri"] = $this->dialogUri;
|
||||
$array["file"] = $this->file;
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue