本文整理汇总了PHP中app\models\Client::updating方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::updating方法的具体用法?PHP Client::updating怎么用?PHP Client::updating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Client
的用法示例。
在下文中一共展示了Client::updating方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrencyId
{
$token = $this->getGatewayToken();
return $token ? "https://dashboard.stripe.com/customers/{$token}" : false;
}
public function getCurrencyId()
{
if ($this->currency_id) {
return $this->currency_id;
}
if (!$this->account) {
$this->load('account');
}
return $this->account->currency_id ?: DEFAULT_CURRENCY;
}
}
/*
Client::created(function($client)
{
Activity::createClient($client);
});
*/
Client::updating(function ($client) {
Activity::updateClient($client);
});
Client::deleting(function ($client) {
Activity::archiveClient($client);
});
/*Client::restoring(function ($client) {
Activity::restoreClient($client);
});
*/
示例2: getCounter
$this->load('account');
}
return $this->account->currency ? $this->account->currency->code : 'USD';
}
/**
* @param $isQuote
* @return mixed
*/
public function getCounter($isQuote)
{
return $isQuote ? $this->quote_number_counter : $this->invoice_number_counter;
}
public function markLoggedIn()
{
$this->last_login = Carbon::now()->toDateTimeString();
$this->save();
}
/**
* @return bool
*/
public function hasAutoBillConfigurableInvoices()
{
return $this->invoices()->whereIn('auto_bill', [AUTO_BILL_OPT_IN, AUTO_BILL_OPT_OUT])->count() > 0;
}
}
Client::creating(function ($client) {
$client->setNullValues();
});
Client::updating(function ($client) {
$client->setNullValues();
});