芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/clients/canaldegap.fr/lib/classes/class.bookmark.inc.php
SetInitialValues(); } /** * Sets object to some sane initial values * */ function SetInitialValues() { $this->bookmark_id = -1; $this->title = ''; $this->url = ''; $this->user_id = -1; } /** * Saves the bookmark to the database. If no id is set, then a new record * is created. If the id is set, then the record is updated to all values * in the Bookmark object. * * @returns mixed If successful, true. If it fails, false. */ function Save() { $result = false; global $gCms; $bookops =& $gCms->GetBookmarkOperations(); if ($this->bookmark_id > -1) { $result = $bookops->UpdateBookmark($this); } else { $newid = $bookops->InsertBookmark($this); if ($newid > -1) { $this->bookmark_id = $newid; $result = true; } } return $result; } /** * Delete the record for this Bookmark from the database and resets * all values to their initial values. * * @returns mixed If successful, true. If it fails, false. */ function Delete() { $result = false; global $gCms; $bookops =& $gCms->GetBookmarkOperations(); if ($this->bookmark_id > -1) { $result = $bookops->DeleteBookmarkByID($this->bookmark_id); if ($result) { $this->SetInitialValues(); } } return $result; } } # vim:ts=4 sw=4 noet ?>