id = $id; $this->handler = $handler; $this->suspect = $suspect; $this->reporters = $reporters; $this->category = $category; $this->snapshot = $snapshot; } /** * @return DateTime */ public function getTimeCreated() { return $this->getOldestReport()->getTime(); } /** * @return UserReport */ private function getOldestReport() { /** @var UserReport $oldestReason */ $oldestReason = null; foreach ($this->reporters as $reason) { if ($oldestReason == null || $oldestReason->getTime()->diff($reason->getTime())->invert) { $oldestReason = $reason; } } return $oldestReason; } /** * @return Int */ public function getId() { return $this->id; } /** * @return User|Null */ public function getHandler() { return $this->handler; } /** * @return User */ public function getSuspect() { return $this->suspect; } /** * @return UserReport[] */ public function getReporters() { return $this->reporters; } /** * @return Int */ public function getCategory() { return $this->category; } /** * @return Snapshot */ public function getSnapshot() { return $this->snapshot; } }