/** * @return string */ public function toHtml() { $this->setEntity($this->kommentar); $this->setVar('imgsrc', $this->kommentar->getImageUrl()); $this->setVar('id', $this->kommentar->id); return $this->renderBySkin(); }
public function deleteKommentar() { $this->kommentar = new Model\Kommentar($this->request->id); $this->kommentar->delete(); $this->request->entity = $this->kommentar->ko_element_tabelle; $this->request->id = $this->kommentar->ko_element_id; $this->kommentar->updateEntityCount(); $this->kommentare = Model\Kommentar::loadFuer($this->request->entity, $this->request->id); }
public function updateEntityCount() { $neueAnzahl = Kommentar::count(['tabelle' => $this->ko_element_tabelle, 'element_id' => $this->ko_element_id]); // hier muss man jetzt eigentlich den Count ehöhen /** @var KommentarInterface $entity */ $entity = new $this->ko_element_tabelle($this->ko_element_id); if ($entity instanceof KommentarInterface) { $entity->updateKommentarCount($neueAnzahl); } }