/** * {@inheritdoc} */ public function __construct($configuration) { parent::__construct($configuration); $this->id = $configuration['id']; $this->name = $configuration['name']; $this->subject = $configuration['subject']; $this->fromEmail = $configuration['from_email']; $this->fromName = $configuration['from_name']; $this->status = $configuration['status']; $this->statusId = $configuration['status_id']; $this->statusLabel = $configuration['status_label']; $this->sentAt = $configuration['sent_at']; $this->sendTime = $configuration['send_time']; $this->created = new \DateTime($configuration['created']); $this->updated = new \DateTime($configuration['updated']); $this->numRecipients = $configuration['num_recipients']; $this->isSegmented = $configuration['is_segmented']; $this->campaignType = $configuration['campaign_type']; $this->template = is_subclass_of($configuration['template'], BaseModel::class) ? $configuration['template'] : TemplateModel::create($configuration['template']); $this->loadLists($configuration['lists']); }