name = $name; $this->category = $category; $this->create_at = $create_at; $this->update_at = $update_at; } /** * @return mixed */ public function getName() { return $this->name; } /** * @return mixed */ public function getCategory() { return $this->category; } /** * @return mixed */ public function getCreateAt() { return $this->create_at; } /** * @return mixed */ public function getUpdateAt() { return $this->update_at; } public function jsonSerialize() { $data = []; foreach ($this as $key => $val) { if ($val !== null) $data[$key] = $val; } return $data; } }