|
@@ -3,9 +3,15 @@
|
|
namespace IPv4Bundle\Entity;
|
|
namespace IPv4Bundle\Entity;
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Entity
|
|
|
|
+ *
|
|
|
|
+ * @UniqueEntity("name")
|
|
|
|
+ * @UniqueEntity("shortname")
|
|
|
|
+ * @UniqueEntity("opcode")
|
|
*/
|
|
*/
|
|
class HostType
|
|
class HostType
|
|
{
|
|
{
|
|
@@ -23,6 +29,8 @@ class HostType
|
|
* @var string $name
|
|
* @var string $name
|
|
*
|
|
*
|
|
* @ORM\Column(type="string", length=100, unique=true)
|
|
* @ORM\Column(type="string", length=100, unique=true)
|
|
|
|
+ *
|
|
|
|
+ * @Assert\NotBlank
|
|
*/
|
|
*/
|
|
protected $name;
|
|
protected $name;
|
|
|
|
|
|
@@ -30,6 +38,8 @@ class HostType
|
|
* @var string $shortname
|
|
* @var string $shortname
|
|
*
|
|
*
|
|
* @ORM\Column(type="string", length=100, unique=true)
|
|
* @ORM\Column(type="string", length=100, unique=true)
|
|
|
|
+ *
|
|
|
|
+ * @Assert\NotBlank
|
|
*/
|
|
*/
|
|
protected $shortname;
|
|
protected $shortname;
|
|
|
|
|
|
@@ -37,6 +47,8 @@ class HostType
|
|
* @var string $opcode
|
|
* @var string $opcode
|
|
*
|
|
*
|
|
* @ORM\Column(type="string", length=100, unique=true)
|
|
* @ORM\Column(type="string", length=100, unique=true)
|
|
|
|
+ *
|
|
|
|
+ * @Assert\NotBlank
|
|
*/
|
|
*/
|
|
protected $opcode;
|
|
protected $opcode;
|
|
|
|
|