createdAt->format('Y'), $this->createdAt->format('m'), $this->createdAt->format('d') ); } public function getFilePathPattern(): string { $idStr = str_pad((string)$this->id, 9, '0', STR_PAD_LEFT); return sprintf( '%s/%s/%s/%s', substr($idStr, 0, 3), substr($idStr, 3, 3), substr($idStr, 6, 3), $idStr ); } /** * Generiert eine eindeutige URL-freundliche ID ohne Slashes */ public function getUrlId(): string { // Kombiniert Datum und ID zu einem eindeutigen String $dateStr = $this->createdAt->format('Ymd'); $idStr = str_pad((string)$this->id, 8, '0', STR_PAD_LEFT); return $dateStr . $idStr; } }