本文整理汇总了PHP中Adherent::update_end_date方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::update_end_date方法的具体用法?PHP Adherent::update_end_date怎么用?PHP Adherent::update_end_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::update_end_date方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Delete a subscription
*
* @param User $user User that delete
* @return int <0 if KO, 0 if not found, >0 if OK
*/
function delete($user)
{
// It subscription is linked to a bank transaction, we get it
if ($this->fk_bank) {
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
$accountline = new AccountLine($this->db);
$result = $accountline->fetch($this->fk_bank);
}
$this->db->begin();
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "cotisation WHERE rowid = " . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->affected_rows($resql);
if ($num) {
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
$member = new Adherent($this->db);
$result = $member->fetch($this->fk_adherent);
$result = $member->update_end_date($user);
if ($accountline->rowid > 0) {
$result = $accountline->delete($user);
// Return false if refused because line is conciliated
if ($result > 0) {
$this->db->commit();
return 1;
} else {
$this->error = $accountline->error;
$this->db->rollback();
return -1;
}
} else {
$this->db->commit();
return 1;
}
} else {
$this->db->commit();
return 0;
}
} else {
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
}
}