mac ?: $this->activationCode); } /** * @return int */ public function getId() { return $this->id; } /** * @return int */ public function getClientId() { return $this->clientId; } /** * @return string */ public function getMac() { return $this->mac; } /** * @return string */ public function getActivationCode() { return $this->activationCode; } /** * @return Node */ public function getNode() { return $this->node; } /** * @return Profile */ public function getProfile() { return $this->profile; } /** * @return CablemodemModel */ public function getModel() { return $this->model; } /** * @return \DateTime */ public function getCreated() { return $this->created; } /** * @return \DateTime */ public function getUpdated() { return $this->updated; } /** * @param int $clientId * * @return $this */ public function setClientId($clientId) { $this->clientId = $clientId; return $this; } /** * @param string $mac * * @return $this */ public function setMac($mac) { $this->mac = $mac; return $this; } /** * @param string $activationCode * * @return $this */ public function setActivationCode($activationCode) { $this->activationCode = $activationCode; return $this; } /** * @param Node $node * * @return $this */ public function setNode($node) { $this->node = $node; return $this; } /** * @param Profile $profile * * @return $this */ public function setProfile($profile) { $this->profile = $profile; return $this; } /** * @param CablemodemModel $model * * @return $this */ public function setModel($model) { $this->model = $model; return $this; } /** * @param \DateTime $created * * @return $this */ public function setCreated($created) { $this->created = $created; return $this; } /** * @param \DateTime $updated * * @return $this */ public function setUpdated($updated) { $this->updated = $updated; return $this; } /** * @return array */ public function getDeviceData() { $extraData = [ 'mac' => $this->mac, 'activationCode' => $this->activationCode, 'clientId' => $this->clientId, 'modelId' => $this->model ? $this->model->getId() : null, 'nodeId' => $this->node ? $this->node->getId() : null, 'profileId' => $this->profile ? $this->profile->getId() : null, ]; return [ 'deviceType' => get_class($this), 'deviceId' => $this->id, 'tenancy' => $this->tenancyId, 'extraData' => json_encode($extraData), ]; } /** * @return array */ public function getSoftDeleteCriteria() { return array('mac' => $this->mac); } /** * @return boolean */ public function getMtaEnabled() { return $this->mtaEnabled; } /** * @param boolean $mtaEnabled * * @return Cablemodem */ public function setMtaEnabled($mtaEnabled) { $this->mtaEnabled = $mtaEnabled; return $this; } /** * @return string */ public function getDHCPOptions() { $options = [ 'filename' => $this->mac . '.bin', ]; if ($this->mtaEnabled) { $options['option122_dhcp_server'] = "255.255.255.255"; $options['option122_provisioning_type'] = "BASIC.1"; } return $options; } }