本文整理匯總了PHP中Memcached_DataObject::pivotGet方法的典型用法代碼示例。如果您正苦於以下問題:PHP Memcached_DataObject::pivotGet方法的具體用法?PHP Memcached_DataObject::pivotGet怎麽用?PHP Memcached_DataObject::pivotGet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Memcached_DataObject
的用法示例。
在下文中一共展示了Memcached_DataObject::pivotGet方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: prefill
function prefill($notices)
{
// XXX: this should probably only be in the scoping one.
Notice::fillGroups($notices);
Notice::fillReplies($notices);
if (common_config('notice', 'hidespam')) {
$profiles = Notice::getProfiles($notices);
foreach ($profiles as $profile) {
$pids[] = $profile->id;
}
Memcached_DataObject::pivotGet('Profile_role', 'profile_id', $pids, array('role' => Profile_role::SILENCED));
}
}
示例2: getNotices
function getNotices($offset, $limit, $sinceId, $maxId)
{
$all = array();
do {
$ids = $this->getNoticeIds($offset, $limit, $sinceId, $maxId);
$notices = Memcached_DataObject::pivotGet('Notice', 'id', $ids);
// By default, takes out false values
$notices = array_filter($notices);
$all = array_merge($all, $notices);
if (count($notices < count($ids))) {
$offset += $limit;
$limit -= count($notices);
}
} while (count($notices) < count($ids) && count($ids) > 0);
return new ArrayWrapper($all);
}
示例3: fillAttachments
static function fillAttachments(&$notices)
{
$ids = self::_idsOf($notices);
$f2pMap = Memcached_DataObject::listGet('File_to_post', 'post_id', $ids);
$fileIds = array();
foreach ($f2pMap as $noticeId => $f2ps) {
foreach ($f2ps as $f2p) {
$fileIds[] = $f2p->file_id;
}
}
$fileIds = array_unique($fileIds);
$fileMap = Memcached_DataObject::pivotGet('File', 'id', $fileIds);
foreach ($notices as $notice) {
$files = array();
$f2ps = $f2pMap[$notice->id];
foreach ($f2ps as $f2p) {
$files[] = $fileMap[$f2p->file_id];
}
$notice->_setAttachments($files);
}
}
示例4: pivotGet
static function pivotGet($key, $values, $otherCols = array())
{
return Memcached_DataObject::pivotGet('Profile', $key, $values, $otherCols);
}
示例5: pivotGet
static function pivotGet($keyCol, $keyVals, $otherCols)
{
return Memcached_DataObject::pivotGet('Avatar', $keyCol, $keyVals, $otherCols);
}
示例6: prefill
static function prefill(&$notices, $avatarSize = AVATAR_STREAM_SIZE)
{
if (Event::handle('StartNoticeListPrefill', array(&$notices, $avatarSize))) {
// Prefill attachments
Notice::fillAttachments($notices);
// Prefill attachments
Notice::fillFaves($notices);
// Prefill repeat data
Notice::fillRepeats($notices);
// Prefill the profiles
$profiles = Notice::fillProfiles($notices);
// Prefill the avatars
Profile::fillAvatars($profiles, $avatarSize);
$p = Profile::current();
if (!empty($p)) {
$ids = array();
foreach ($notices as $notice) {
$ids[] = $notice->id;
}
Memcached_DataObject::pivotGet('Fave', 'notice_id', $ids, array('user_id' => $p->id));
Memcached_DataObject::pivotGet('Notice', 'repeat_of', $ids, array('profile_id' => $p->id));
}
Event::handle('EndNoticeListPrefill', array(&$notices, &$profiles, $avatarSize));
}
}