当前位置: 首页>>代码示例>>PHP>>正文


PHP BaseModel::delete方法代码示例

本文整理汇总了PHP中BaseModel::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::delete方法的具体用法?PHP BaseModel::delete怎么用?PHP BaseModel::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BaseModel的用法示例。


在下文中一共展示了BaseModel::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete($id)
 {
     //调用父类add方法
     $result = parent::delete($id);
     //删除文件夹
     $this->deldir('./Uploads/' . $id);
     return $result;
 }
开发者ID:vimalmistry,项目名称:Exam,代码行数:8,代码来源:CourseModel.class.php

示例2: delete

 public function delete()
 {
     if ($this->getCashAccount()->getBalanceInCent() != 0) {
         throw new Exception_BuisnessLogic("Das Konto von " . $this->getName() . " ist nicht ausgeglichen.");
     }
     if ($this->getCashAccount()->delete() > 0) {
         parent::delete();
     }
 }
开发者ID:h-xx,项目名称:wg-organizer,代码行数:9,代码来源:Resident.php

示例3: delete

 public function delete($id)
 {
     $this->mapping->table = 'users_roles';
     $this->mapping->criterias['id'] = new stdclass();
     $this->mapping->criterias['id']->field = 'userID';
     $this->mapping->criterias['id']->operator = '=';
     $this->mapping->criterias['id']->value = $id;
     try {
         parent::delete($id);
     } catch (PDOException $exception) {
         $this->dbh->rollback();
         $this->modelException(get_called_class() . "::" . __FUNCTION__, Text::read('message.model.error.delete'), $exception);
     }
 }
开发者ID:sohflp,项目名称:Hooked,代码行数:14,代码来源:class.RoleModel.php

示例4: delete

 public function delete($id)
 {
     $this->mapping->criterias['id'] = new stdclass();
     $this->mapping->criterias['id']->field = 'featureID';
     $this->mapping->criterias['id']->operator = '=';
     $this->mapping->criterias['id']->value = $id;
     try {
         $this->dbh->beginTransaction();
         parent::delete($id);
         $this->dbh->commit();
     } catch (PDOException $exception) {
         $this->dbh->rollback();
         $this->modelException(Text::read('message.model.error.delete'), $exception);
     }
 }
开发者ID:sohflp,项目名称:Hooked,代码行数:15,代码来源:class.FeatureModel.php

示例5: deleteResponse

 public function deleteResponse($id)
 {
     $id = (int) $id;
     $url = 'canned_responses/' . $id;
     return parent::delete($url);
 }
开发者ID:invit,项目名称:livechat-api-client-php,代码行数:6,代码来源:CannedResponses.php

示例6: delete

 public function delete($pb_delete_related = false, $pa_options = null, $pa_fields = null, $pa_table_list = null)
 {
     $vb_web_set_change_log_unit_id = BaseModel::setChangeLogUnitID();
     $o_trans = null;
     if (!$this->inTransaction()) {
         $o_trans = new Transaction($this->getDb());
         $this->setTransaction($o_trans);
     }
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     $vn_id = $this->getPrimaryKey();
     if (($vn_rc = parent::delete($pb_delete_related, $pa_options, $pa_fields, $pa_table_list)) && (!$this->hasField('deleted') || caGetOption('hard', $pa_options, false))) {
         // Delete any associated attributes and attribute_values
         if (!($qr_res = $this->getDb()->query("\n\t\t\t\t\tDELETE FROM ca_attribute_values \n\t\t\t\t\tUSING ca_attributes \n\t\t\t\t\tINNER JOIN ca_attribute_values ON ca_attribute_values.attribute_id = ca_attributes.attribute_id \n\t\t\t\t\tWHERE ca_attributes.table_num = ? AND ca_attributes.row_id = ?\n\t\t\t\t", array((int) $this->tableNum(), (int) $vn_id)))) {
             $this->errors = $this->getDb()->errors();
             if ($o_trans) {
                 $o_trans->rollback();
             }
             if ($vb_web_set_change_log_unit_id) {
                 BaseModel::unsetChangeLogUnitID();
             }
             return false;
         }
         if (!($qr_res = $this->getDb()->query("\n\t\t\t\t\tDELETE FROM ca_attributes\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttable_num = ? AND row_id = ?\n\t\t\t\t", array((int) $this->tableNum(), (int) $vn_id)))) {
             $this->errors = $this->getDb()->errors();
             if ($o_trans) {
                 $o_trans->rollback();
             }
             if ($vb_web_set_change_log_unit_id) {
                 BaseModel::unsetChangeLogUnitID();
             }
             return false;
         }
         //
         // Remove any authority attributes that reference this row
         //
         if ($vn_element_type = (int) AuthorityAttributeValue::tableToElementType($this->tableName())) {
             if ($qr_res = $this->getDb()->query("\n\t\t\t\t\t\tSELECT ca.table_num, ca.row_id FROM ca_attributes ca\n\t\t\t\t\t\tINNER JOIN ca_attribute_values AS cav ON cav.attribute_id = ca.attribute_id \n\t\t\t\t\t\tINNER JOIN ca_metadata_elements AS cme ON cav.element_id = cme.element_id \n\t\t\t\t\t\tWHERE cme.datatype = ? AND cav.value_integer1 = ?\n\t\t\t\t\t", array($vn_element_type, (int) $vn_id))) {
                 $va_ids = array();
                 while ($qr_res->nextRow()) {
                     $va_ids[$qr_res->get('table_num')][] = $qr_res->get('row_id');
                 }
                 if (!($qr_res = $this->getDb()->query("\n\t\t\t\t\t\t\tDELETE FROM ca_attribute_values \n\t\t\t\t\t\t\tUSING ca_metadata_elements \n\t\t\t\t\t\t\tINNER JOIN ca_attribute_values ON ca_attribute_values.element_id = ca_metadata_elements.element_id \n\t\t\t\t\t\t\tWHERE ca_metadata_elements.datatype = ? AND ca_attribute_values.value_integer1 = ?\n\t\t\t\t\t\t", array($vn_element_type, (int) $vn_id)))) {
                     $this->errors = $this->getDb()->errors();
                     if ($o_trans) {
                         $o_trans->rollback();
                     }
                     if ($vb_web_set_change_log_unit_id) {
                         BaseModel::unsetChangeLogUnitID();
                     }
                     return false;
                 } else {
                     $o_indexer = new SearchIndexer($this->getDb());
                     foreach ($va_ids as $vs_table => $va_ids) {
                         $o_indexer->reindexRows($vs_table, $va_ids, array('transaction' => $o_trans));
                     }
                 }
             }
         }
         if ($o_trans) {
             $o_trans->commit();
         }
         if ($vb_web_set_change_log_unit_id) {
             BaseModel::unsetChangeLogUnitID();
         }
         return $vn_rc;
     }
     if ($o_trans) {
         $vn_rc ? $o_trans->commit() : $o_trans->rollback();
     }
     if ($vb_web_set_change_log_unit_id) {
         BaseModel::unsetChangeLogUnitID();
     }
     return $vn_rc;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:76,代码来源:BaseModelWithAttributes.php

示例7: delete

 public function delete($id)
 {
     $id = (int) $id;
     $url = 'groups/' . $id;
     return parent::delete($url);
 }
开发者ID:invit,项目名称:livechat-api-client-php,代码行数:6,代码来源:Groups.php

示例8: delete

 public function delete()
 {
     $this->limit()->delete();
     return parent::delete();
 }
开发者ID:guilhermefilippo,项目名称:access-manager,代码行数:5,代码来源:Plan.php

示例9: delete

 public function delete()
 {
     if ($this->hasDefaultProfileImage() == false) {
         $this->profileImage->delete();
     }
     foreach ($this->createdTasks as $task) {
         $task->delete();
     }
     foreach ($this->notificationEvents as $events) {
         $events->delete();
     }
     parent::delete();
 }
开发者ID:vanderlin,项目名称:halp,代码行数:13,代码来源:User.php

示例10: delete

 public function delete($id)
 {
     $data = $this->selectPhoto($id);
     $this->mapping->criterias['id'] = new stdclass();
     $this->mapping->criterias['id']->field = 'photoID';
     $this->mapping->criterias['id']->operator = '=';
     $this->mapping->criterias['id']->value = $id;
     try {
         $this->dbh->beginTransaction();
         parent::delete($id);
         $this->dbh->commit();
         // Elimina foto
         foreach (Config::read('upload.thumbnails')["types"] as $description) {
             $file = new File(Config::read('path.photos') . '/' . $data->album . '/' . $description . '-' . $data->url);
             $file->removeFile();
         }
     } catch (PDOException $exception) {
         $this->dbh->rollback();
         $this->modelException(Text::read('message.model.error.delete'), $exception);
     }
 }
开发者ID:sohflp,项目名称:Hooked,代码行数:21,代码来源:trait.PhotoModel.php

示例11: delete

 /**
  * delete user
  *
  * @param int
  */
 public function delete($id)
 {
     // check rights - client can delete only users who he created
     if (!$this->user->isAllowed(new UserResource($id), Acl::PRIVILEGE_DELETE)) {
         throw new OperationNotAllowedException();
     }
     parent::delete($id);
     dibi::query('CALL usersAfterDelete(%i)', $id);
 }
开发者ID:radypala,项目名称:maga-website,代码行数:14,代码来源:UsersModel.php

示例12: delete

 public function delete($login)
 {
     $url = 'agents/' . $login;
     return parent::delete($url);
 }
开发者ID:invit,项目名称:livechat-api-client-php,代码行数:5,代码来源:Agents.php

示例13: delete

 public function delete($pb_delete_related = false, $pa_options = null, $pa_fields = null, $pa_table_list = null)
 {
     $vb_web_set_change_log_unit_id = BaseModel::setChangeLogUnitID();
     if (!$this->inTransaction()) {
         $o_trans = new Transaction($this->getDb());
         $this->setTransaction($o_trans);
     }
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     $vn_id = $this->getPrimaryKey();
     if (parent::delete($pb_delete_related, $pa_options, $pa_fields, $pa_table_list)) {
         // Delete any associated attributes and attribute_values
         if (!($qr_res = $this->getDb()->query("\n\t\t\t\t\tDELETE FROM ca_attribute_values \n\t\t\t\t\tUSING ca_attributes \n\t\t\t\t\tINNER JOIN ca_attribute_values ON ca_attribute_values.attribute_id = ca_attributes.attribute_id \n\t\t\t\t\tWHERE ca_attributes.table_num = ? AND ca_attributes.row_id = ?\n\t\t\t\t", (int) $this->tableNum(), (int) $vn_id))) {
             $this->errors = $this->getDb()->errors();
             if ($o_trans) {
                 $o_trans->rollback();
             }
             if ($vb_web_set_change_log_unit_id) {
                 BaseModel::unsetChangeLogUnitID();
             }
             return false;
         }
         if (!($qr_res = $this->getDb()->query("\n\t\t\t\t\tDELETE FROM ca_attributes\n\t\t\t\t\tWHERE\n\t\t\t\t\t\ttable_num = ? AND row_id = ?\n\t\t\t\t", (int) $this->tableNum(), (int) $vn_id))) {
             $this->errors = $this->getDb()->errors();
             if ($o_trans) {
                 $o_trans->rollback();
             }
             if ($vb_web_set_change_log_unit_id) {
                 BaseModel::unsetChangeLogUnitID();
             }
             return false;
         }
         if ($o_trans) {
             $o_trans->commit();
         }
         if ($vb_web_set_change_log_unit_id) {
             BaseModel::unsetChangeLogUnitID();
         }
         return true;
     }
     if ($o_trans) {
         $o_trans->rollback();
     }
     if ($vb_web_set_change_log_unit_id) {
         BaseModel::unsetChangeLogUnitID();
     }
     return false;
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:49,代码来源:BaseModelWithAttributes.php

示例14: delete

 function delete($o = null, $log = true)
 {
     // Remove all entry comments
     $this->comment->get();
     $this->comment->delete_all();
     parent::delete($o, $log);
 }
开发者ID:broofa,项目名称:socipedia,代码行数:7,代码来源:entry.php

示例15: delete

 public function delete($pb_delete_related = false, $pa_options = NULL, $pa_fields = NULL, $pa_table_list = NULL)
 {
     $vn_rc = parent::delete($pb_delete_related, $pa_options, $pa_fields, $pa_table_list);
     $this->flushLocaleListCache();
     return $vn_rc;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:6,代码来源:ca_locales.php


注:本文中的BaseModel::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。