v0 ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
This commit is contained in:
175
src/Entity/Alertcategory.php
Executable file
175
src/Entity/Alertcategory.php
Executable file
@ -0,0 +1,175 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="alertcategory")
|
||||
*/
|
||||
class Alertcategory
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="label", type="string", length=100)
|
||||
*/
|
||||
private $label;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="color", type="string", nullable=true)
|
||||
*/
|
||||
private $color;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="alertcategorys")
|
||||
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
|
||||
*/
|
||||
private $icon;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Alert", mappedBy="alertcategory", cascade={"persist"}, orphanRemoval=true)
|
||||
* @ORM\JoinColumn(name="alerts", referencedColumnName="id")
|
||||
*/
|
||||
protected $alerts;
|
||||
|
||||
// A garder pour forcer l'id en init
|
||||
public function setId($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->alerts = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set label.
|
||||
*
|
||||
* @param string $label
|
||||
*
|
||||
* @return Alertcategory
|
||||
*/
|
||||
public function setLabel($label)
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get label.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLabel()
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set color.
|
||||
*
|
||||
* @param string $color
|
||||
*
|
||||
* @return Alertcategory
|
||||
*/
|
||||
public function setColor($color)
|
||||
{
|
||||
$this->color = $color;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getColor()
|
||||
{
|
||||
return $this->color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set icon.
|
||||
*
|
||||
* @param Icon $icon
|
||||
*
|
||||
* @return Alertcategory
|
||||
*/
|
||||
public function setIcon(Icon $icon = null)
|
||||
{
|
||||
$this->icon = $icon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get icon.
|
||||
*
|
||||
* @return Icon
|
||||
*/
|
||||
public function getIcon()
|
||||
{
|
||||
return $this->icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add alert.
|
||||
*
|
||||
* @return Alertcategory
|
||||
*/
|
||||
public function addAlert(Alert $alert)
|
||||
{
|
||||
$this->alerts[] = $alert;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove alert.
|
||||
*/
|
||||
public function removeAlert(Alert $alert)
|
||||
{
|
||||
$this->alerts->removeElement($alert);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get alerts.
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getAlerts()
|
||||
{
|
||||
return $this->alerts;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user