本文整理汇总了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));
}
}