createdAt = new \DateTimeImmutable('now'); } /** * @return \DateTimeImmutable * * @since 1.0.0 */ public function getCreatedAt() : \DateTimeImmutable { return $this->createdAt ?? new \DateTimeImmutable(); } /** * Set cost center * * @param string $costCenter Cost center * * @return void * * @since 1.0.0 */ public function setCostCenter(string $costCenter) : void { $this->costCenter = $costCenter; } /** * Get cost center * * @return string * * @since 1.0.0 */ public function getCostCenter() : string { return $this->costCenter; } /** * Get id * * @return int * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'createdBy' => $this->createdBy, 'createdAt' => $this->createdAt, 'description' => $this->description, 'costcenter' => $this->costCenter, ]; } /** * {@inheritdoc} */ public function jsonSerialize() { return $this->toArray(); } }