本文整理汇总了PHP中DBUtil::deleteObjectById方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtil::deleteObjectById方法的具体用法?PHP DBUtil::deleteObjectById怎么用?PHP DBUtil::deleteObjectById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBUtil
的用法示例。
在下文中一共展示了DBUtil::deleteObjectById方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Generic delete handler for an object.
*
* @return array|boolean The Object Data.
*/
public function delete()
{
if ($this->hasID()) {
if (!$this->deletePreProcess()) {
return false;
}
$res = DBUtil::deleteObjectById($this->_objType, $this->_objData[$this->_objField], $this->_objField);
if ($res) {
$this->deletePostProcess();
return $this->_objData;
}
}
return false;
}
示例2: delete
/**
* Generic delete handler for an object.
*
* @return array|boolean The Object Data.
*/
public function delete()
{
if (!$this->deletePreProcess()) {
return false;
}
$res = true;
foreach ($this->_objData as $k => $v) {
$res = $res && DBUtil::deleteObjectById($this->_objType, $v[$this->_objField], $this->_objField);
}
if ($res) {
$this->deletePostProcess();
return $this->_objData;
}
return false;
}
示例3: delmodule
public function delmodule($args)
{
$this->throwForbiddenUnless(SecurityUtil::checkPermission('Scribite::', '::', ACCESS_ADMIN), LogUtil::getErrorMsgPermission());
// Argument check
if (!isset($args['mid'])) {
return LogUtil::registerError($this->__('Error! Could not do what you wanted. Please check your input.'));
}
// check for existing module
if (!DBUtil::deleteObjectById('scribite', $args['mid'], 'mid')) {
return LogUtil::registerError($this->__('Configuration not updated'));
}
return true;
}
示例4: upgrade
//.........这里部分代码省略.........
if (!ModUtil::registerHook('zikula', 'systeminit', 'GUI', 'scribite', 'user', 'run')) {
LogUtil::registerError($this->__('Error creating Hook!'));
return '2.2';
}
ModUtil::apiFunc('Modules', 'admin', 'enablehooks', array('callermodname' => 'zikula', 'hookmodname' => 'scribite'));
LogUtil::registerStatus($this->__('<strong>scribite!</strong> was activated as core hook. You can check settings <a href="index.php?module=Modules&type=admin&func=hooks&id=0">here</a>!<br />The template plugin from previous versions of scribite! can be removed from templates.'));
case '3.0':
//create new module vars for Newsletter and Web_Links
$record = array(array('modname' => 'Newsletter', 'modfuncs' => 'a:1:{i:0;s:11:"add_message";}', 'modareas' => 'a:1:{i:0;s:7:"message";}', 'modeditor' => '-'), array('modname' => 'crpVideo', 'modfuncs' => 'a:2:{i:0;s:3:"new";i:1;s:6:"modify";}', 'modareas' => 'a:1:{i:0;s:13:"video_content";}', 'modeditor' => '-'), array('modname' => 'Web_Links', 'modfuncs' => 'a:3:{i:0;s:8:"linkview";i:1;s:7:"addlink";i:2;s:17:"modifylinkrequest";}', 'modareas' => 'a:1:{i:0;s:11:"description";}', 'modeditor' => '-'));
DBUtil::insertObjectArray($record, 'scribite', 'mid');
// set vars for YUI Rich Text Editor
if (!$this->getVar('yui_type')) {
$this->setVar('yui_type', 'Simple');
}
if (!$this->getVar('yui_width')) {
$this->setVar('yui_width', 'auto');
}
if (!$this->getVar('yui_height')) {
$this->setVar('yui_height', '300');
}
if (!$this->getVar('yui_dombar')) {
$this->setVar('yui_dombar', true);
}
if (!$this->getVar('yui_animate')) {
$this->setVar('yui_animate', true);
}
if (!$this->getVar('yui_collapse')) {
$this->setVar('yui_collapse', true);
}
case '3.1':
// modify Profile module
$originalconfig = ModUtil::apiFunc('Scribite', 'user', 'getModuleConfig', array('modulename' => "Profile"));
$newconfig = array('mid' => $originalconfig['mid'], 'modulename' => 'Profile', 'modfuncs' => "modify", 'modareas' => "prop_signature,prop_extrainfo,prop_yinterests", 'modeditor' => $originalconfig['modeditor']);
$modupdate = ModUtil::apiFunc('Scribite', 'admin', 'editmodule', $newconfig);
case '3.2':
// set new editors folder
$this->setVar('editors_path', 'modules/scribite/pnincludes');
LogUtil::registerStatus($this->__('<strong>Caution!</strong><br />All editors have moved to /modules/scribite/pnincludes in preparation for upcoming features of Zikula. Please check all your settings!<br />If you have adapted files from editors you have to check them too.<br /><br /><strong>Dropped support for FCKeditor and TinyMCE</strong><br />For security reasons these editors will not be supported anymore. Please change editors to an other editor.'));
case '4.0':
case '4.1':
case '4.2':
$this->setVar('nicedit_xhtml', 1);
case '4.2.1':
if (!$this->getVar('ckeditor_language')) {
$this->setVar('ckeditor_language', 'en');
}
if (!$this->getVar('ckeditor_barmode')) {
$this->setVar('ckeditor_barmode', 'Full');
}
if (!$this->getVar('ckeditor_width')) {
$this->setVar('ckeditor_width', '"70%"');
}
if (!$this->getVar('ckeditor_height')) {
$this->setVar('ckeditor_height', '400');
}
case '4.2.2':
// this renames the table and the columns per new z1.3.0 standards
$this->renameColumns();
EventUtil::registerPersistentModuleHandler('Scribite', 'core.postinit', array('Scribite_Listeners', 'coreinit'));
$this->setVar('editors_path', 'modules/Scribite/includes');
LogUtil::registerStatus($this->__('<strong>Caution!</strong><br />All editors have moved to /modules/Scribite/includes.<br />If you have adapted files from editors you have to check them too.'));
case '4.2.3':
//set vars for markitup
if (!$this->getVar('markitup_width')) {
$this->setVar('markitup_width', '650px');
}
if (!$this->getVar('markitup_height')) {
$this->setVar('markitup_height', '400px');
}
// remove fckeditor (was deprecated in 4.1)
$this->delVar('fckeditor_language');
$this->delVar('fckeditor_barmode');
$this->delVar('fckeditor_width');
$this->delVar('fckeditor_height');
$this->delVar('fckeditor_autolang');
// update module assignments to correct removed and deprecated editors
$dbtable = DBUtil::getTables();
$columns = $dbtable['scribite_column'];
$sql = "UPDATE `{$dbtable['scribite']}` SET `{$columns['modeditor']}`='-' WHERE `{$columns['modeditor']}`='fckeditor' OR `{$columns['modeditor']}`='tinymce' OR `{$columns['modeditor']}`='openwysiwyg'";
DBUtil::executeSQL($sql);
// reset modules
$this->resetModuleConfig('News');
$this->resetModuleConfig('Pages');
$this->resetModuleConfig('ContentExpress');
$this->resetModuleConfig('Mediashare');
// correct possible serialized data corruption
if (!DataUtil::is_serialized($this->getVar('xinha_activeplugins'))) {
$this->delVar('xinha_activeplugins');
}
// relocate xinha styles
$this->setVar('xinha_style', 'modules/Scribite/style/xinha/editor.css');
// remove content settings
DBUtil::deleteObjectById('scribite', 'content', 'modname');
case '4.3.0':
/* reimplement TinyMCE */
// future updates
// notice - remove openwysiwyg vars @>4.3.0
}
return true;
}