mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
add validation to single task controller::new
This commit is contained in:
@@ -8,11 +8,17 @@ use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Chill\MainBundle\Entity\HasScopeInterface;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
|
||||
|
||||
/**
|
||||
* AbstractTask
|
||||
*
|
||||
* @ORM\MappedSuperclass()
|
||||
* @UserCircleConsistency(
|
||||
* "CHILL_TASK_TASK_SHOW",
|
||||
* getUserFunction="getAssignee"
|
||||
* )
|
||||
*/
|
||||
abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
{
|
||||
@@ -35,6 +41,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="title", type="text")
|
||||
* @Assert\NotBlank()
|
||||
*/
|
||||
private $title = '';
|
||||
|
||||
@@ -60,6 +67,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\PersonBundle\Entity\Person"
|
||||
* )
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $person;
|
||||
|
||||
@@ -69,6 +77,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\MainBundle\Entity\Scope"
|
||||
* )
|
||||
* @Assert\NotNull()
|
||||
*/
|
||||
private $circle;
|
||||
|
||||
@@ -81,7 +90,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->type = (string) $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -129,7 +138,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
$this->title = (string) $title;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -153,7 +162,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
$this->description = $description;
|
||||
$this->description = (string) $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user