document_category = $document_category; $this->title = $title; $this->filename = $filename; $this->internal = $internal; $this->private = $private; $this->rank = $rank; if ($upload_date == null) { $upload_date = \DateTime::createFromFormat('Y-m-d H:i:s', date('Y-m-d H:i:s', time())); } $this->localized = true; $this->upload_date = $upload_date; $this->timezone = $upload_date->getTimeZone()->getName(); } public function getId(): ?int { return $this->id; } public function setId(int $id): Document { $this->id = $id; return $this; } public function getDocument_Category(): DocumentCategory { return $this->document_category; } public function setDocument_Category(DocumentCategory $document_category): Document { $this->document_category = $document_category; return $this; } public function getFilename(): string { return $this->filename; } public function setFilename(string $filename): Document { $this->filename = $filename; return $this; } public function getInternal(): bool { return $this->internal; } public function setInternal(bool $internal): Document { $this->internal = $internal; return $this; } public function isInternal(): bool { return $this->getInternal(); } public function getPrivate(): bool { return $this->private; } public function setPrivate(bool $private): Document { $this->private = $private; return $this; } public function isPrivate(): bool { return $this->getPrivate(); } public function getRank(): ?int { return $this->rank; } public function setRank(int $rank): Document { $this->rank = $rank; return $this; } public function getTitle(): string { return $this->title; } public function setTitle(string $title): Document { $this->title = $title; return $this; } public function getUpload_Date() { if (!$this->localized) { $this->upload_date->setTimeZone(new \DateTimeZone($this->timezone)); } return $this->upload_date; } public function setUpload_Date(\DateTime $upload_date): Document { $this->upload_date = $upload_date; return $this; } }