|
@@ -6,6 +6,9 @@ use Doctrine\ORM\Mapping as ORM;
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
use JMS\Serializer\Annotation as JMS;
|
|
|
+use Base\AdminBundle\Traits\TenancyIdTrait;
|
|
|
+use Base\AdminBundle\Traits\TenancyIdTraitInterface;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @ORM\Table
|
|
@@ -13,8 +16,9 @@ use JMS\Serializer\Annotation as JMS;
|
|
|
* @UniqueEntity(fields={"deviceServer", "oltDeviceId", "ponSerialNumber"}, message="errors.duplicate_key")
|
|
|
* @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="unique_idx", columns={"device_server_id", "olt_device_id", "pon_serial_number"})})
|
|
|
*/
|
|
|
-class Onu
|
|
|
+class Onu implements TenancyIdTraitInterface
|
|
|
{
|
|
|
+ use TenancyIdTrait;
|
|
|
|
|
|
/**
|
|
|
* @var int
|
|
@@ -24,7 +28,7 @@ class Onu
|
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
|
*/
|
|
|
private $id;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* @var string
|
|
|
*
|
|
@@ -53,13 +57,7 @@ class Onu
|
|
|
*/
|
|
|
private $deviceId;
|
|
|
|
|
|
- /**
|
|
|
- * @var int
|
|
|
- *
|
|
|
- * @ORM\Column(type="integer", nullable=false, options={"default":1})
|
|
|
- */
|
|
|
- protected $tenancyId = 1;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* @var string
|
|
|
*
|
|
@@ -329,29 +327,7 @@ class Onu
|
|
|
return str_replace("FTTHBundle\\Entity\\", "", $this->deviceType);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Set tenancyId
|
|
|
- *
|
|
|
- * @param int $tenancyId
|
|
|
- *
|
|
|
- * @return ONU
|
|
|
- */
|
|
|
- public function setTenancyId($tenancyId)
|
|
|
- {
|
|
|
- $this->tenancyId = $tenancyId;
|
|
|
-
|
|
|
- return $this;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Get tenancyId
|
|
|
- *
|
|
|
- * @return int
|
|
|
- */
|
|
|
- public function getTenancyId()
|
|
|
- {
|
|
|
- return $this->tenancyId;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* Set updated
|