/** * Enregistre le Torrent */ public function store() { $oMysqli = Database::getInstance(); //On ajoute au besoin la release $this->oRelease->storeIfNotExists(); //On récupère l'ID de la release $iReleaseId = $this->oRelease->getId(); //On ajoute le torrent $this->create($iReleaseId); }
private function createTagsEdit() { //Suppression d'un tag $sTags = ''; foreach ($this->oRelease->getTags() as $iTagId => $oRegex) { $oButton = new View('button'); $oButton->addData('link', 'index.php?p=modrelease&a=deletetag&id=' . $this->oRelease->getId() . '&tag=' . $iTagId); $oButton->addData('icon', 'fa-times'); $oButton->addData('style', 'info'); $oButton->addData('text', $oRegex->getName()); $oButton->create(); $sTags .= $oButton->getCode() . ' '; } //Ajout d'un tag $aRegex = Regex::getSelectRegex(); $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'addtag'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', 'Ajouter'); $oPopupAdd->addData('title', 'Ajouter un tag'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=modrelease&a=addtag&id=' . $this->oRelease->getId()); $oFormAdd->addSelect('Tag', 'tag', $aRegex); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); $sTags .= $oPopupAdd->getCode(); $this->oView->addData('tagsdelete', $sTags); }
public static function idSorter(Release $a, Release $b) { return strnatcmp($a->getId(), $b->getId()); }