當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UUID::fromBin方法代碼示例

本文整理匯總了PHP中UUID::fromBin方法的典型用法代碼示例。如果您正苦於以下問題:PHP UUID::fromBin方法的具體用法?PHP UUID::fromBin怎麽用?PHP UUID::fromBin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UUID的用法示例。


在下文中一共展示了UUID::fromBin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: newFromDatabaseRow

 public static function newFromDatabaseRow(\stdClass $row)
 {
     $id = UUID::fromBin($row->flowthread_id);
     // This is either NULL or a binary UUID
     $parentid = $row->flowthread_parentid;
     if ($parentid !== null) {
         $parentid = UUID::fromBin($parentid);
     }
     $data = array('id' => $id, 'pageid' => intval($row->flowthread_pageid), 'userid' => intval($row->flowthread_userid), 'username' => $row->flowthread_username, 'text' => $row->flowthread_text, 'parentid' => $parentid, 'status' => intval($row->flowthread_status), 'like' => intval($row->flowthread_like), 'report' => intval($row->flowthread_report));
     return new self($data);
 }
開發者ID:moegirlwiki,項目名稱:MW-FlowThread,代碼行數:11,代碼來源:Post.php

示例2: batchGetUserAttitude

 public static function batchGetUserAttitude(\User $user, array $posts)
 {
     if (!count($posts)) {
         return array();
     }
     $dbr = wfGetDB(DB_SLAVE);
     $inExpr = self::buildPostInExpr($dbr, $posts);
     $res = $dbr->select('FlowThreadAttitude', array('flowthread_att_id', 'flowthread_att_type'), array('flowthread_att_id' . $inExpr, 'flowthread_att_userid' => $user->getId()));
     $ret = array();
     foreach ($res as $row) {
         $ret[UUID::fromBin($row->flowthread_att_id)->getHex()] = intval($row->flowthread_att_type);
     }
     foreach ($posts as $post) {
         if (!isset($ret[$post->id->getHex()])) {
             $ret[$post->id->getHex()] = Post::ATTITUDE_NORMAL;
         }
     }
     return $ret;
 }
開發者ID:nbdd0121,項目名稱:MW-FlowThread,代碼行數:19,代碼來源:Helper.php

示例3: formatPayload

 protected function formatPayload($payload, $event, $user)
 {
     switch ($payload) {
         case 'text':
             try {
                 return Post::newFromId(UUID::fromBin($event->getExtraParam('postid')))->text;
             } catch (\Exception $e) {
                 return wfMessage('notification-flowthread-payload-error');
             }
         default:
             return parent::formatPayload($payload, $event, $user);
             break;
     }
 }
開發者ID:nbdd0121,項目名稱:MW-FlowThread,代碼行數:14,代碼來源:Echo.php


注:本文中的UUID::fromBin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。