mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
initial commit
This commit is contained in:
169
Entity/AbstractTask.php
Normal file
169
Entity/AbstractTask.php
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\TaskBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
|
||||
/**
|
||||
* AbstractTask
|
||||
*
|
||||
* @ORM\MappedSuperclass()
|
||||
*/
|
||||
abstract class AbstractTask
|
||||
{
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="type", type="string", length=255)
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var json
|
||||
*
|
||||
* @ORM\Column(name="current_states", type="json")
|
||||
*/
|
||||
private $currentStates = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="title", type="text")
|
||||
*/
|
||||
private $title = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="description", type="text")
|
||||
*/
|
||||
private $description = '';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var User
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\MainBundle\Entity\User"
|
||||
* )
|
||||
*/
|
||||
private $assignee;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Person
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\PersonBundle\Entity\Person"
|
||||
* )
|
||||
*/
|
||||
private $person;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Scope
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\MainBundle\Entity\Scope"
|
||||
* )
|
||||
*/
|
||||
private $circle;
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return AbstractTask
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set currentStates
|
||||
*
|
||||
* @param json $currentStates
|
||||
*
|
||||
* @return AbstractTask
|
||||
*/
|
||||
public function setCurrentStates($currentStates)
|
||||
{
|
||||
$this->currentStates = $currentStates;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get currentStates
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
public function getCurrentStates()
|
||||
{
|
||||
return $this->currentStates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set title
|
||||
*
|
||||
* @param string $title
|
||||
*
|
||||
* @return AbstractTask
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set description
|
||||
*
|
||||
* @param string $description
|
||||
*
|
||||
* @return AbstractTask
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
}
|
||||
|
210
Entity/RecurringTask.php
Normal file
210
Entity/RecurringTask.php
Normal file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\TaskBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* RecurringTask
|
||||
*
|
||||
* @ORM\Table(name="chill_task.recurring_task")
|
||||
* @ORM\Entity(repositoryClass="Chill\TaskBundle\Repository\RecurringTaskRepository")
|
||||
*/
|
||||
class RecurringTask extends AbstractTask
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="first_occurence_end_date", type="date")
|
||||
*/
|
||||
private $firstOccurenceEndDate;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="last_occurence_end_date", type="date")
|
||||
*/
|
||||
private $lastOccurenceEndDate;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="occurence_frequency", type="string", length=255)
|
||||
*/
|
||||
private $occurenceFrequency;
|
||||
|
||||
/**
|
||||
* @var dateinterval
|
||||
*
|
||||
* @ORM\Column(name="occurence_start_date", type="dateinterval")
|
||||
*/
|
||||
private $occurenceStartDate;
|
||||
|
||||
/**
|
||||
* @var dateinterval
|
||||
*
|
||||
* @ORM\Column(name="occurence_warning_interval", type="dateinterval", nullable=true)
|
||||
*/
|
||||
private $occurenceWarningInterval;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var Collection
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="SingleTask",
|
||||
* mappedBy="recurringTask"
|
||||
* )
|
||||
*/
|
||||
private $singleTasks;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->singleTasks = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set firstOccurenceEndDate
|
||||
*
|
||||
* @param \DateTime $firstOccurenceEndDate
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
public function setFirstOccurenceEndDate($firstOccurenceEndDate)
|
||||
{
|
||||
$this->firstOccurenceEndDate = $firstOccurenceEndDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get firstOccurenceEndDate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getFirstOccurenceEndDate()
|
||||
{
|
||||
return $this->firstOccurenceEndDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set lastOccurenceEndDate
|
||||
*
|
||||
* @param \DateTime $lastOccurenceEndDate
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
public function setLastOccurenceEndDate($lastOccurenceEndDate)
|
||||
{
|
||||
$this->lastOccurenceEndDate = $lastOccurenceEndDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lastOccurenceEndDate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getLastOccurenceEndDate()
|
||||
{
|
||||
return $this->lastOccurenceEndDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set occurenceFrequency
|
||||
*
|
||||
* @param string $occurenceFrequency
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
public function setOccurenceFrequency($occurenceFrequency)
|
||||
{
|
||||
$this->occurenceFrequency = $occurenceFrequency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get occurenceFrequency
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOccurenceFrequency()
|
||||
{
|
||||
return $this->occurenceFrequency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set occurenceStartDate
|
||||
*
|
||||
* @param dateinterval $occurenceStartDate
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
public function setOccurenceStartDate($occurenceStartDate)
|
||||
{
|
||||
$this->occurenceStartDate = $occurenceStartDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get occurenceStartDate
|
||||
*
|
||||
* @return dateinterval
|
||||
*/
|
||||
public function getOccurenceStartDate()
|
||||
{
|
||||
return $this->occurenceStartDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set occurenceWarningInterval
|
||||
*
|
||||
* @param dateinterval $occurenceWarningInterval
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
public function setOccurenceWarningInterval($occurenceWarningInterval)
|
||||
{
|
||||
$this->occurenceWarningInterval = $occurenceWarningInterval;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get occurenceWarningInterval
|
||||
*
|
||||
* @return dateinterval
|
||||
*/
|
||||
public function getOccurenceWarningInterval()
|
||||
{
|
||||
return $this->occurenceWarningInterval;
|
||||
}
|
||||
}
|
||||
|
138
Entity/SingleTask.php
Normal file
138
Entity/SingleTask.php
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\TaskBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* SingleTask
|
||||
*
|
||||
* @ORM\Table("chill_task.single_task")
|
||||
* @ORM\Entity(repositoryClass="Chill\TaskBundle\Repository\SingleTaskRepository")
|
||||
*/
|
||||
class SingleTask extends AbstractTask
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="start_date", type="date", nullable=true)
|
||||
*/
|
||||
private $startDate;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(name="end_date", type="date", nullable=true)
|
||||
*/
|
||||
private $endDate;
|
||||
|
||||
/**
|
||||
* @var \DateInterval
|
||||
*
|
||||
* @ORM\Column(name="warning_interval", type="dateinterval", nullable=true)
|
||||
*/
|
||||
private $warningInterval;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var RecurringTask
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="RecurringTask",
|
||||
* inversedBy="singleTasks"
|
||||
* )
|
||||
*/
|
||||
private $recurringTask;
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set startDate
|
||||
*
|
||||
* @param \DateTime $startDate
|
||||
*
|
||||
* @return SingleTask
|
||||
*/
|
||||
public function setStartDate($startDate)
|
||||
{
|
||||
$this->startDate = $startDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get startDate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getStartDate()
|
||||
{
|
||||
return $this->startDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set endDate
|
||||
*
|
||||
* @param \DateTime $endDate
|
||||
*
|
||||
* @return SingleTask
|
||||
*/
|
||||
public function setEndDate($endDate)
|
||||
{
|
||||
$this->endDate = $endDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get endDate
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getEndDate()
|
||||
{
|
||||
return $this->endDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set warningInterval
|
||||
*
|
||||
* @param string $warningInterval
|
||||
*
|
||||
* @return SingleTask
|
||||
*/
|
||||
public function setWarningInterval($warningInterval)
|
||||
{
|
||||
$this->warningInterval = $warningInterval;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get warningInterval
|
||||
*
|
||||
* @return \DateInterval
|
||||
*/
|
||||
public function getWarningInterval(): ?\DateInterval
|
||||
{
|
||||
return $this->warningInterval;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user