/
WorkflowProgressNotification.php
63 lines (52 loc) · 1.5 KB
/
WorkflowProgressNotification.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace Concrete\Core\Entity\Notification;
use Concrete\Core\Entity\User\UserSignup;
use Concrete\Core\Notification\Subject\SubjectInterface;
use Concrete\Core\Notification\View\UserSignupListView;
use Concrete\Core\Notification\View\WorkflowProgressListView;
use Concrete\Core\Workflow\Progress\Progress;
use Concrete\Core\Workflow\Progress\SiteProgressInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(
* name="WorkflowProgressNotifications"
* )
*/
class WorkflowProgressNotification extends Notification
{
protected $progressObject;
/**
* @ORM\Column(type="integer", options={"unsigned":true})
*/
protected $wpID;
/**
* @param $signup Progress
*/
public function __construct(Progress $progress)
{
$this->wpID = $progress->getWorkflowProgressID();
parent::__construct($progress);
}
public function getListView()
{
return new WorkflowProgressListView($this);
}
public function getNotificationDateTimeZone()
{
$progress = $this->getWorkflowProgressObject();
if ($progress instanceof SiteProgressInterface) {
$site = $progress->getSite();
if ($site) {
return $site->getTimezone();
}
}
}
public function getWorkflowProgressObject()
{
if (!isset($this->progressObject)) {
$this->progressObject = Progress::getByID($this->wpID);
}
return $this->progressObject;
}
}