createdAt = new \DateTime('now'); $this->location = new Location(); $this->schedule = new Schedule(); } /** * @return int * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * @return string * * @since 1.0.0 */ public function getName() : string { return $this->name; } /** * @return Account[] * * @since 1.0.0 */ public function getPeople() : array { return $this->people; } /** * @param int $id Account id * * @return Account * * @since 1.0.0 */ public function getPerson(int $id) : Account { return $this->people[$id] ?? new NullAccount(); } /** * @param Account $person Person to add * * @return int Account id/position * * @since 1.0.0 */ public function addPerson(Account $person) { $this->people[] = $person; \end($this->people); $key = \key($this->people); \reset($this->people); return $key; } /** * Remove Element from list. * * @param int $id Task element * * @return bool * * @since 1.0.0 */ public function removePerson(int $id) : bool { if (isset($this->people[$id])) { unset($this->people[$id]); return true; } return false; } /** * @param string $name Event name/title * * @since 1.0.0 */ public function setName(string $name) { $this->name = $name; } /** * @return string * * @since 1.0.0 */ public function getDescription() : string { return $this->description; } /** * @param string $desc Event description * * @since 1.0.0 */ public function setDescription(string $desc) { $this->description = $desc; } /** * @return \DateTime * * @since 1.0.0 */ public function getCreatedAt() : \DateTime { return $this->createdAt; } /** * @return int * * @since 1.0.0 */ public function getCreatedBy() : int { return $this->createdBy; } /** * @param int $createdBy Creator * * @since 1.0.0 */ public function setCreatedBy(int $createdBy) { $this->createdBy = $createdBy; $this->schedule->setCreatedBy($this->createdBy); } /** * @param Location $location Event location * * @since 1.0.0 */ public function setLocation(Location $location) { $this->location = $location; } /** * @return Location * * @since 1.0.0 */ public function getLocation() : Location { return $this->location; } /** * @return int * * @since 1.0.0 */ public function getCalendar() : int { return $this->calendar; } /** * @return int * * @since 1.0.0 */ public function getType() : int { return $this->type; } /** * @return int * * @since 1.0.0 */ public function getStatus() : int { return $this->status; } /** * @param int $calendar Calendar * * @since 1.0.0 */ public function setCalendar(int $calendar) { $this->calendar = $calendar; } /** * @return Schedule * * @since 1.0.0 */ public function getSchedule() : Schedule { return $this->schedule; } }