本文整理汇总了PHP中app\models\Activity::key方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::key方法的具体用法?PHP Activity::key怎么用?PHP Activity::key使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Activity
的用法示例。
在下文中一共展示了Activity::key方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: transform
/**
* @param Client $client
* @return array
*/
public function transform(Activity $activity)
{
return ['id' => $activity->key(), 'activity_type_id' => $activity->activity_type_id, 'client_id' => $activity->client->public_id, 'user_id' => $activity->user->public_id + 1, 'invoice_id' => $activity->invoice ? $activity->invoice->public_id : null, 'payment_id' => $activity->payment ? $activity->payment->public_id : null, 'credit_id' => $activity->credit ? $activity->credit->public_id : null, 'updated_at' => $this->getTimestamp($activity->updated_at)];
}
示例2: transform
/**
* @param Activity $activity
* @return array
*/
public function transform(Activity $activity)
{
return ['id' => $activity->key(), 'activity_type_id' => $activity->activity_type_id, 'client_id' => $activity->client ? $activity->client->public_id : null, 'user_id' => $activity->user->public_id + 1, 'invoice_id' => $activity->invoice ? $activity->invoice->public_id : null, 'payment_id' => $activity->payment ? $activity->payment->public_id : null, 'credit_id' => $activity->credit ? $activity->credit->public_id : null, 'updated_at' => $this->getTimestamp($activity->updated_at), 'expense_id' => $activity->expense_id ? $activity->expense->public_id : null, 'is_system' => (bool) $activity->is_system ? $activity->is_system : null, 'contact_id' => $activity->contact_id ? $activity->contact->public_id : null];
}