function insert(&$record, $force = false, $updateOnlyChanged = false) { if ($record->isNew()) { $record->set('com_created', time()); } else { $record->set('com_modified', time()); } return parent::insert($record, $force, $updateOnlyChanged); }
function insert(&$record, $force = false, $updateOnlyChanged = false) { if ($result = parent::insert($record, $force, $updateOnlyChanged)) { $id = $record->get('tpl_id'); $tplSourceHandler =& NBFrame::getHandler('NBFrame.xoops.TplSource', $this->mEnvironment); if (!($tplSourceObject =& $tplSourceHandler->get($id))) { $tplSourceObject =& $tplSourceHandler->create(); $tplSourceObject->set('tpl_id', $id); } $tplSourceObject->set('tpl_source', $record->get('tpl_source')); $result = $tplSourceHandler->insert($tplSourceObject, $force); } return $result; }
function insert($bid, $modules, $force = false) { $this->deleteBlock($bid); foreach ($modules as $mid) { $object =& $this->create(); $object->set('block_id', $bid); $object->set('module_id', $mid); $result = parent::insert($object, $force); unset($object); if (!$result) { break; } } }
function _insert(&$object, $caption) { if (class_exists('XoopsMultiTokenHandler') && !XoopsMultiTokenHandler::quickValidate($this->mName . '_' . $this->mOp)) { if (is_object($object)) { return $this->_showForm($object, $caption, $this->__e('Token Error')); } else { $this->mErrorMsg = $this->__e('Token Error'); return NBFRAME_ACTION_ERROR; } } if (is_object($object)) { $this->mObject =& $object; if (is_object($this->mObjectForm)) { $this->mObjectForm->bindAction($this, 1); $this->mObjectForm->prepare(); $this->mObjectForm->setupRequests('POST'); if ($this->mObjectForm->canVerify()) { $object->enableVerify(); } } if ($this->mRequest->hasError()) { return $this->_showForm($object, $caption, $this->mRequest->getErrors()); } $object->SetRequestVars($this->mRequest); if (!$object->checkGroupPerm('write', $this->mBypassAdminCheck)) { $this->mErrorMsg = $this->__e('Permission Error'); return NBFRAME_ACTION_ERROR; } if ($this->mObjectHandler->insert($object, false, true)) { return NBFRAME_ACTION_SUCCESS; } else { return $this->_showForm($object, $caption, $this->mObjectHandler->getErrors()); } } else { $this->mErrorMsg = $this->__e('No Record is found'); return NBFRAME_ACTION_ERROR; } }
function insert(&$object, $force = false, $updateOnlyChanged = false) { if ($object->isNew()) { $object->set('isactive', 1); } $modules = $object->get('modules'); $object->set('last_modified', time()); $result = parent::insert($object, $force, $updateOnlyChanged); if ($result) { if ($modules !== null) { $blockModuleLinkHandler =& NBFrame::getHandler('NBFrame.xoops.BlockModuleLink', $this->mEnvironment); $blockModuleLinkHandler->insert($object->get('bid'), $modules, $force); } } return $result; }
/** * レコードの保存 * * @param object &$record {@link NBFrameObject} object * @param bool $force POSTメソッド以外で強制更新する場合はture * * @return bool 成功の時は TRUE */ function insert(&$record, $force = false, $updateOnlyChanged = false) { $GLOBALS['_NBFrameTableCache']->reset($this->mTableName, $record->cacheKey()); $this->mFullCached = false; return parent::insert($record, $force, $updateOnlyChanged); }