createdAt = new \DateTimeImmutable('now'); $this->createdBy = new NullAccount(); } /** * Get id. * * @return int Model id * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * Get the status * * @return int * * @since 1.0.0 */ public function getStatus() : int { return $this->status; } /** * Set the status * * @param int $status Status * * @return void * * @since 1.0.0 */ public function setStatus(int $status) : void { $this->status = $status; } /** * Get tags * * @return array * * @since 1.0.0 */ public function getTags() : array { return $this->tags; } /** * Add tag * * @param Tag $tag Tag * * @return void * * @since 1.0.0 */ public function addTag(Tag $tag) : void { $this->tags[] = $tag; } /** * Get task elements. * * @param int $id Element id * * @return Tag * * @since 1.0.0 */ public function getTag(int $id) : Tag { return $this->tags[$id] ?? new NullTag(); } /** * Get the columns * * @return array * * @since 1.0.0 */ public function getColumns() : array { return $this->columns; } /** * Add a column * * @param mixed $column Column * * @return void * * @since 1.0.0 */ public function addColumn($column) : void { $this->columns[] = $column; } /** * Remove a column * * @param int $id Id to remove * * @return bool * * @since 1.0.0 */ public function removeColumn(int $id) : bool { if (isset($this->columns[$id])) { unset($this->columns[$id]); return true; } return false; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'status' => $this->status, 'columns' => $this->columns, 'tags' => $this->tags, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }