本文整理汇总了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;
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例5: deleteResponse
public function deleteResponse($id)
{
$id = (int) $id;
$url = 'canned_responses/' . $id;
return parent::delete($url);
}
示例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;
}
示例7: delete
public function delete($id)
{
$id = (int) $id;
$url = 'groups/' . $id;
return parent::delete($url);
}
示例8: delete
public function delete()
{
$this->limit()->delete();
return parent::delete();
}
示例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();
}
示例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);
}
}
示例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);
}
示例12: delete
public function delete($login)
{
$url = 'agents/' . $login;
return parent::delete($url);
}
示例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;
}
示例14: delete
function delete($o = null, $log = true)
{
// Remove all entry comments
$this->comment->get();
$this->comment->delete_all();
parent::delete($o, $log);
}
示例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;
}