/**
  * Default constructor
  *
  * @param int $id
  *   Identifier
  * @param BackendInterface $backend
  *   Backend
  * @param array $subIdList
  *   Subscription identifiers list where keys are channel identifiers and
  *   values are subscriptions identifiers
  */
 public function __construct($id, BackendInterface $backend, array $subIdList = null)
 {
     parent::__construct($backend, [Field::SUBER_NAME => $id]);
     $this->id = $id;
     if (null !== $subIdList) {
         $this->idList = $subIdList;
     }
 }
 /**
  * Default constructor
  *
  * @param int $chanId
  *   Channel identifier
  * @param int $id
  *   Subscription identifier
  * @param \DateTime $createdAt
  *   Creation date
  * @param \DateTime $activatedAt
  *   Latest activation date
  * @param \DateTime $deactivatedAt
  *   Latest deactivation date
  * @param \DateTime $accessedAt
  *   Latest access time
  * @param bool $isActive
  *   Is this subscription active
  * @param string $subscriberId
  *   Subscriber identifier
  * @param BackendInterface $backend
  *   Backend
  */
 public function __construct($chanId, $id, \DateTime $createdAt, \DateTime $activatedAt, \DateTime $deactivatedAt, \DateTime $accessedAt = null, $isActive = false, $subscriberId = null, BackendInterface $backend)
 {
     parent::__construct($backend, [Field::SUB_ID => $id]);
     $this->id = $id;
     $this->chanId = $chanId;
     $this->createdAt = $createdAt;
     $this->activatedAt = $activatedAt;
     $this->deactivatedAt = $deactivatedAt;
     $this->accessedAt = $accessedAt;
     $this->active = $isActive;
     $this->subscriberId = $subscriberId;
 }
Example #3
0
 /**
  * Default constructor
  *
  * @param string $id
  *   Channel identifier
  * @param BackendInterface $backend
  *   Backend
  * @param \DateTime $createdAt
  *   Creation date
  * @param \DateTime $updatedAt
  *   Update date
  * @param string $title
  *   Human readable title
  * @param int $databaseId
  *   Arbitrary database identifier if the backend needs it for performance
  *   or consistency reasons
  */
 public function __construct($id, BackendInterface $backend, \DateTime $createdAt = null, \DateTime $updatedAt = null, $title = null, $databaseId = null)
 {
     parent::__construct($backend, [Field::CHAN_ID => $id]);
     $this->id = $id;
     $this->title = $title;
     if (null === $createdAt) {
         $this->createdAt = new \DateTime();
     } else {
         $this->createdAt = $createdAt;
     }
     if (null === $updatedAt) {
         $this->updatedAt = clone $this->createdAt;
     } else {
         $this->updatedAt = $updatedAt;
     }
     $this->databaseId = $databaseId;
 }