name; } /** * @param array $props Key is each property of the entity */ public static function fromArray(array $props): self { $category = new self($props['name']); if ($props['id']) { $category->setId($props['id']); } if ($props['createdAt']) { $category->setCreatedAt($props['createdAt']); } if ($props['updatedAt']) { $category->setUpdatedAt($props['updatedAt']); } return $category; } }