public function endEditKollektion() { $this->kollektion = new Kollektion($this->request->id); $this->kollektion->save($this->request); $this->request->clear(); $this->request->id = $this->kollektion->id; FlashMessage::success(Strings::GESPEICHERT); }
public function preSave() { $this->ca_lastedit = date("d.m.Y"); if ($this->id <= 0) { $this->ca_geschrieben_am = date("d.m.Y"); $this->ca_autor = $_SESSION['id']; $this->generatePos(); } if ($this->ca_kollektion <= 0) { $this->kollektion = new Kollektion(); $this->kollektion->ko_bezeichnung = $this->ca_bezeichnung; $this->kollektion->save(); $this->ca_kollektion = $this->kollektion->id; } if ($this->ca_kollektion > 0) { if (count($this->getKollektion()->getMedien()) > 0) { $medien = $this->getKollektion()->getMedien(); $this->ca_hauptbild = $medien[0]->getResizeUrl(); } else { $this->ca_hauptbild = ''; } } }