|
@@ -6,14 +6,21 @@ use Base\AdminBundle\Traits\TenancyIdTrait;
|
|
|
use Base\AdminBundle\Traits\TenancyIdTraitInterface;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
use DeviceBundle\Interfaces\DeviceInterface;
|
|
|
+use DeviceBundle\Validator\Constraints as ValidatorAssert;
|
|
|
use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
|
|
|
use MapBundle\Entity\Interfaces\LocationInterface;
|
|
|
use MapBundle\Entity\Traits\LocationTrait;
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
|
|
|
/**
|
|
|
* @ORM\Table
|
|
|
* @ORM\Entity
|
|
|
+ * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="unique_idx", columns={"host", "tenancy_id"})})
|
|
|
+ *
|
|
|
+ * @UniqueEntity(fields={"host", "tenancyId"}, message="errors.duplicate_key")
|
|
|
+ *
|
|
|
+ * @ValidatorAssert\Device
|
|
|
*/
|
|
|
class NAS implements TenancyIdTraitInterface, DeviceInterface, LocationInterface
|
|
|
{
|