本文整理汇总了PHP中Reply::selectAdd方法的典型用法代码示例。如果您正苦于以下问题:PHP Reply::selectAdd方法的具体用法?PHP Reply::selectAdd怎么用?PHP Reply::selectAdd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reply
的用法示例。
在下文中一共展示了Reply::selectAdd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getNoticeIds
function getNoticeIds($offset, $limit, $since_id, $max_id)
{
$reply = new Reply();
$reply->selectAdd();
$reply->selectAdd('notice_id');
$reply->whereAdd(sprintf('reply.profile_id = %u', $this->userId));
Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'reply.modified');
Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'reply.modified');
if (!empty($this->selectVerbs)) {
$reply->joinAdd(array('notice_id', 'notice:id'));
$reply->whereAddIn('notice.verb', $this->selectVerbs, 'string');
}
$reply->orderBy('reply.modified DESC, reply.notice_id DESC');
if (!is_null($offset)) {
$reply->limit($offset, $limit);
}
$ids = array();
if ($reply->find()) {
while ($reply->fetch()) {
$ids[] = $reply->notice_id;
}
}
return $ids;
}
示例2: getReplies
/**
* Pull the complete list of @-reply targets for this notice.
*
* @return array of integer profile ids
*/
function getReplies()
{
// XXX: cache me
$ids = array();
$reply = new Reply();
$reply->selectAdd();
$reply->selectAdd('profile_id');
$reply->notice_id = $this->id;
if ($reply->find()) {
while ($reply->fetch()) {
$ids[] = $reply->profile_id;
}
}
$reply->free();
return $ids;
}
示例3: getReplies
/**
* Pull the complete list of @-reply targets for this notice.
*
* @return array of integer profile ids
*/
function getReplies()
{
$keypart = sprintf('notice:reply_ids:%d', $this->id);
$idstr = self::cacheGet($keypart);
if ($idstr !== false) {
$ids = explode(',', $idstr);
} else {
$ids = array();
$reply = new Reply();
$reply->selectAdd();
$reply->selectAdd('profile_id');
$reply->notice_id = $this->id;
if ($reply->find()) {
while ($reply->fetch()) {
$ids[] = $reply->profile_id;
}
}
self::cacheSet($keypart, implode(',', $ids));
}
return $ids;
}