本文整理匯總了PHP中KunenaAttachmentHelper::getById方法的典型用法代碼示例。如果您正苦於以下問題:PHP KunenaAttachmentHelper::getById方法的具體用法?PHP KunenaAttachmentHelper::getById怎麽用?PHP KunenaAttachmentHelper::getById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類KunenaAttachmentHelper
的用法示例。
在下文中一共展示了KunenaAttachmentHelper::getById方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _getList
protected function _getList($query, $limitstart = 0, $limit = 0)
{
$this->_db->setQuery($query, $limitstart, $limit);
$ids = $this->_db->loadColumn();
$results = KunenaAttachmentHelper::getById($ids);
$userids = array();
$mesids = array();
foreach ($results as $result) {
$userids[$result->userid] = $result->userid;
$mesids[$result->mesid] = $result->mesid;
}
KunenaUserHelper::loadUsers($userids);
KunenaForumMessageHelper::getMessages($mesids);
return $results;
}
示例2: getAttachments
/**
* @param bool|array $ids
* @param string $action
*
* @return KunenaAttachment[]
*/
public function getAttachments($ids = false, $action = 'read')
{
if ($ids === false) {
$attachments = KunenaAttachmentHelper::getByMessage($this->id, $action);
} else {
$attachments = KunenaAttachmentHelper::getById($ids, $action);
foreach ($attachments as $id => $attachment) {
if ($attachment->mesid && $attachment->mesid != $this->id) {
unset($attachments[$id]);
}
}
}
return $attachments;
}