本文整理汇总了PHP中api::uuid方法的典型用法代码示例。如果您正苦于以下问题:PHP api::uuid方法的具体用法?PHP api::uuid怎么用?PHP api::uuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类api
的用法示例。
在下文中一共展示了api::uuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
*
* @param $title
* @param $description
* @param $price
* @param $sync
* @param $private
* @param $image
* @param $location
* @return unknown_type
*/
public function create($title, $description, $price, $private, $image, $location, $user_id, $sync)
{
$deal_id = api::uuid();
$setters = array('deal_id' => $deal_id, 'uid' => $user_id, 'longitude' => $location['longitude'] ? $location['longitude'] : 0, 'latitude' => $location['latitude'] ? $location['latitude'] : 0, 'price' => $price, 'private' => $private, 'created_at' => time(), 'modified_at' => time());
if ($this->db->insertData('deals', $setters)) {
$image = $this->_warp_image($image);
if ($this->_insert_mongo(array('deal_id' => $deal_id, 'uid' => $user_id, 'title' => $title, 'description' => $description, 'image' => $image, 'sync' => $sync))) {
return true;
}
}
return false;
}
示例2: send_event_mq
/**
*
* 发通知
* @param int $sender_uid
* @param int $receiver_uid
* @param int $sms_count
*/
public function send_event_mq($sender_uid, $receiver_uid, $content, $opt = array())
{
$sender = array('id' => $sender_uid, 'name' => sns::getrealname($sender_uid), 'avatar' => sns::getavatar($sender_uid));
$receiver = array(array('id' => $receiver_uid, 'name' => sns::getrealname($receiver_uid), 'avatar' => sns::getavatar($receiver_uid)));
$content = array('text' => $content);
$sms = array('kind' => 'sms', 'data' => array('id' => api::uuid(), 'sender' => $sender, 'msgtype' => 1, 'receiver' => $receiver, 'timestamp' => ceil(microtime(TRUE) * 1000), 'opt' => $opt, 'content' => $content, 'client_id' => 0));
mq::send(json_encode($sms), $receiver_uid, 'momo_event', Kohana::config('event.appid'), $this->getUid());
}