public function updatePlayer($aData) { $this->id = $aData['id']; $this->fname = Webbers_Normalize::Name($aData['fname']); $this->sname = Webbers_Normalize::Name($aData['sname']); $this->mailadr = Webbers_Normalize::Email($aData['mailadr']); $this->gender = $aData['gender']; $this->save(); }
public function updateActual($aData) { if (isset($aData['id'])) { $this->id = $aData['id']; $this->edited = new Doctrine_Expression('NOW()'); } else { $this->created = new Doctrine_Expression('NOW()'); $this->edited = new Doctrine_Expression('NOW()'); } $aTags = Tag::checkTags(Tag::makeTags($aData['tags'])); $this->title = $aData['title']; $this->shortcontent = trim(stripslashes($aData['shortcontent'])); $this->fullcontent = trim(stripslashes($aData['fullcontent'])); $this->tags = $aData['tags']; $this->active = $aData['active']; $this->link = Webbers_Normalize::Link($aData['title']); $this->AktualsTags->delete(); $this->AktualsLabels->delete(); $this->save(); if (sizeof($aTags) > 0) { foreach ($aTags as $tag) { $aktualTags = new AktualsTag(); $aktualTags->Aktuals_id = $this->id; $aktualTags->Tags_id = $tag->id; $aktualTags->save(); } } $labels = array(); if (isset($aData['newlabel']) and $aData['newlabel'] != '') { $newLabel = Webbers_Normalize::Name($aData['newlabel']); $label = Label::getLabel($newLabel); if ($label != false) { $labelID = $label->id; } else { $label = new Label(); $label->Gname = $newLabel; $label->save(); $labelID = $label->getIncremented(); } $labels = array($labelID); } if (isset($aData['labels']) and sizeof($aData['labels']) > 0) { $labels = array_unique(array_merge($aData['labels'], $labels)); foreach ($labels as $lab) { $al = new AktualsLabel(); $al->Labels_id = $lab; $al->Aktuals_id = $this->id; $al->save(); } } return $this->id; }