mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
first implementation of controller
This commit is contained in:
@@ -6,13 +6,15 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\HasScopeInterface;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
|
||||
/**
|
||||
* AbstractTask
|
||||
*
|
||||
* @ORM\MappedSuperclass()
|
||||
*/
|
||||
abstract class AbstractTask
|
||||
abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -27,7 +29,7 @@ abstract class AbstractTask
|
||||
*
|
||||
* @ORM\Column(name="current_states", type="json")
|
||||
*/
|
||||
private $currentStates = '';
|
||||
private $currentStates = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
@@ -165,5 +167,55 @@ abstract class AbstractTask
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function getAssignee(): ?User
|
||||
{
|
||||
return $this->assignee;
|
||||
}
|
||||
|
||||
public function getPerson(): ?Person
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
public function getCircle(): ?Scope
|
||||
{
|
||||
return $this->circle;
|
||||
}
|
||||
|
||||
public function setAssignee(User $assignee)
|
||||
{
|
||||
$this->assignee = $assignee;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPerson(Person $person)
|
||||
{
|
||||
$this->person = $person;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCircle(Scope $circle)
|
||||
{
|
||||
$this->circle = $circle;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCenter(): ?\Chill\MainBundle\Entity\Center
|
||||
{
|
||||
if ($this->getPerson() instanceof Person) {
|
||||
return $this->getPerson()->getCenter();
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public function getScope(): ?\Chill\MainBundle\Entity\Scope
|
||||
{
|
||||
return $this->getCircle();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@@ -130,9 +130,21 @@ class SingleTask extends AbstractTask
|
||||
*
|
||||
* @return \DateInterval
|
||||
*/
|
||||
public function getWarningInterval(): ?\DateInterval
|
||||
public function getWarningInterval()
|
||||
{
|
||||
return $this->warningInterval;
|
||||
}
|
||||
|
||||
function getRecurringTask(): RecurringTask
|
||||
{
|
||||
return $this->recurringTask;
|
||||
}
|
||||
|
||||
function setRecurringTask(RecurringTask $recurringTask)
|
||||
{
|
||||
$this->recurringTask = $recurringTask;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user