WHERE banned = ?";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute(array(1));
- $this->matches = $statement->fetchColumns();
+ $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
break;
case 'newest':
ORDER BY user_table.registrationDate DESC";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute();
- $this->matches = $statement->fetchColumns();
+ $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
break;
case 'disabled':
ORDER BY user_table.registrationDate DESC";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute(array(0));
- $this->matches = $statement->fetchColumns();
+ $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
break;
case 'disabledAvatars':
WHERE disableAvatar = ?";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute(array(1));
- $this->matches = $statement->fetchColumns();
+ $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
break;
case 'disabledSignatures':
WHERE disableSignature = ?";
$statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
$statement->execute(array(1));
- $this->matches = $statement->fetchColumns();
+ $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
break;
}
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $this->pageIDs = $statement->fetchColumns();
+ $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
// validate images
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $this->pageIDs = $statement->fetchColumns();
+ $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
}
FROM wcf".WCF_N."_style_variable";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
- $variables = $statement->fetchColumns();
+ $variables = $statement->fetchAll(\PDO::FETCH_COLUMN);
$lines = explode("\n", StringUtil::unifyNewlines($this->variables['overrideScss']));
$regEx = new Regex('^@([a-zA-Z]+): ?([@a-zA-Z0-9 ,\.\(\)\%\#-]+);$');
ORDER BY ".(($this->sortField != 'email' && isset($this->options[$this->sortField])) ? 'user_option_value.userOption'.$this->options[$this->sortField]->optionID : $this->sortField)." ".$this->sortOrder;
$statement = WCF::getDB()->prepareStatement($sql, $this->itemsPerPage, ($this->pageNo - 1) * $this->itemsPerPage);
$statement->execute($this->conditions->getParameters());
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// get user data
if (!empty($userIDs)) {
".(!empty($this->sqlOrderBy) ? "ORDER BY ".$this->sqlOrderBy : '');
$statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset);
$statement->execute($this->getConditionBuilder()->getParameters());
- $this->objectIDs = $statement->fetchColumns();
+ $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
/**
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $attachmentIDs = $statement->fetchColumns();
+ $attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
foreach ($this->parameters['attachmentIDs'] as $attachmentID) {
if (!in_array($attachmentID, $attachmentIDs)) {
WHERE optionType = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array('BBCodeSelect'));
- $optionIDs = $statement->fetchColumns();
+ $optionIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($optionIDs)) {
$conditionBuilder = new PreparedStatementConditionBuilder();
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->boxID]);
- $this->pageIDs = $statement->fetchColumns();
+ $this->pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
return $this->pageIDs;
ORDER BY time ASC, responseID ASC";
$statement = WCF::getDB()->prepareStatement($sql, 5);
$statement->execute(array($this->commentID));
- $responseIDs = $statement->fetchColumns();
+ $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
$this->update(array(
'responseIDs' => serialize($responseIDs)
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $languageItemIDs = $statement->fetchColumns();
+ $languageItemIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
$objectAction = new LanguageItemAction($languageItemIDs, 'delete');
$objectAction->executeAction();
ORDER BY moderation_queue.lastChangeTime DESC";
$statement = WCF::getDB()->prepareStatement($sql, 5);
$statement->execute($conditions->getParameters());
- $queueIDs = $statement->fetchColumns();
+ $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
$queues = array();
if (!empty($queueIDs)) {
WHERE pageID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->pageID]);
- $this->boxIDs = $statement->fetchColumns();
+ $this->boxIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
return $this->boxIDs;
WHERE templateGroupID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$style->templateGroupID]);
- $knownTemplates = $statement->fetchColumns();
+ $knownTemplates = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
// copy templates
ORDER BY user_group.priority DESC".(!empty($this->sqlOrderBy) ? ", ".$this->sqlOrderBy : '');
$statement = WCF::getDB()->prepareStatement($sql, $this->sqlLimit, $this->sqlOffset);
$statement->execute();
- $this->objectIDs = $statement->fetchColumns();
+ $this->objectIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
/**
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->userID]);
- $this->groupIDs = $statement->fetchColumns();
+ $this->groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update storage data
if (!$skipCache) {
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->userID]);
- $this->languageIDs = $statement->fetchColumns();
+ $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update storage data
UserStorageHandler::getInstance()->update($this->userID, 'languageIDs', serialize($this->languageIDs));
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $groupIDs = $statement->fetchColumns();
+ $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!UserGroup::isAccessibleGroup($groupIDs)) {
throw new PermissionDeniedException();
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->userID]);
- $this->followingUserIDs = $statement->fetchColumns();
+ $this->followingUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update storage data
UserStorageHandler::getInstance()->update($this->userID, 'followingUserIDs', serialize($this->followingUserIDs));
WHERE followUserID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->userID]);
- $this->followerUserIDs = $statement->fetchColumns();
+ $this->followerUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update storage data
UserStorageHandler::getInstance()->update($this->userID, 'followerUserIDs', serialize($this->followerUserIDs));
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->userID]);
- $this->ignoredUserIDs = $statement->fetchColumns();
+ $this->ignoredUserIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update storage data
UserStorageHandler::getInstance()->update($this->userID, 'ignoredUserIDs', serialize($this->ignoredUserIDs));
WHERE followUserID = ?";
$statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
$statement->execute(array($this->parameters['userID']));
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// create group
$group = new GroupedUserList();
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
$statement->execute(array($this->parameters['userID']));
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// create group
$group = new GroupedUserList();
<?php
namespace wcf\data\user\group;
+use wcf\data\ITitledObject;
use wcf\data\user\User;
use wcf\data\DatabaseObject;
use wcf\system\cache\builder\UserGroupCacheBuilder;
* @property-read string $userOnlineMarking
* @property-read integer $showOnTeamPage
*/
-class UserGroup extends DatabaseObject {
+class UserGroup extends DatabaseObject implements ITitledObject {
/**
* group type everyone user group
* @var integer
return null;
}
+
+ /**
+ * @inheritDoc
+ */
+ public function getTitle() {
+ return WCF::getLanguage()->get($this->groupName);
+ }
}
ORDER BY time DESC";
$statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
$statement->execute(array($this->parameters['userID']));
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// create group
$group = new GroupedUserList();
WHERE username ".($this->nameExactly ? "= ?" : "LIKE ?");
$statement = WCF::getDB()->prepareStatement($sql, 100);
$statement->execute(array($this->username.(!$this->nameExactly ? '%' : '')));
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (empty($userIDs)) {
$this->throwNoMatchesException();
// do search
$statement = WCF::getDB()->prepareStatement($sql.$this->conditions, $this->maxResults);
$statement->execute($this->conditions->getParameters());
- $this->matches = $statement->fetchColumns();
+ $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
/**
0,
(TIME_NOW - 86400)
));
- $attachmentIDs = $statement->fetchColumns();
+ $attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($attachmentIDs)) {
AttachmentEditor::deleteAll($attachmentIDs);
TIME_NOW - 3600 * 23,
0
));
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (empty($userIDs)) return;
// get users
ModerationQueue::STATUS_DONE,
(TIME_NOW - (86400 * 30))
));
- $queueIDs = $statement->fetchColumns();
+ $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($queueIDs)) {
$conditions = new PreparedStatementConditionBuilder();
0,
(TIME_NOW - 7 * 24 * 3600)
));
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($userIDs)) {
$action = new UserAction($userIDs, 'delete');
*
* @method boolean closeCursor()
* @method mixed fetch($fetch_style, $cursor_orientation = \PDO::FETCH_ORI_NEXT, $cursor_offset = 0)
+ * @method array fetchAll($fetch_style = \PDO::ATTR_DEFAULT_FETCH_MODE, $fetch_argument = null, $ctor_args = [])
* @method mixed fetchColumn($column_number = 0)
*/
class PreparedStatement {
return $column;
}
- /**
- * Returns a specific column for all of the remaining rows.
- *
- * @param integer $columnNumber
- * @return array
- */
- public function fetchColumns($columnNumber = 0) {
- $columns = [];
- while ($column = $this->fetchColumn($columnNumber)) {
- $columns[] = $column;
- }
-
- return $columns;
- }
-
/**
* Fetches the next row from a result set in a database object.
*
$userIDs
));
- $entryIDs = $statement->fetchColumns();
+ $entryIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (empty($entryIDs)) return;
$list = new EditHistoryEntryList();
ORDER BY time ASC, responseID ASC";
$statement = WCF::getDB()->prepareStatement($sql, 5);
$statement->execute(array($response->commentID));
- $responseIDs = $statement->fetchColumns();
+ $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update parent comment
$sql = "UPDATE wcf".WCF_N."_comment
WHERE preset = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array(1));
- $this->eventIDs = $statement->fetchColumns();
+ $this->eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
$userOptionList = new UserOptionList();
$userOptionList->readObjects();
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $queueIDs = $statement->fetchColumns();
+ $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($queueIDs)) {
$queueAction = new ModerationQueueAction($queueIDs, 'delete');
$package->package,
$match[1].'%'
));
- $packageVersions = $statement->fetchColumns();
+ $packageVersions = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (count($packageVersions) > 1) {
// sort by version number
".$conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $pageIDs = $statement->fetchColumns();
+ $pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// save page ids
foreach ($pageIDs as $pageID) {
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $pageIDs = $statement->fetchColumns();
+ $pageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// save page ids
foreach ($pageIDs as $pageID) {
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($this->user->userID));
- $groupIDs = $statement->fetchColumns();
+ $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
else {
$groupIDs = $this->user->getGroupIDs();
WHERE userID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(array($this->user->userID));
- $this->languageIDs = $statement->fetchColumns();
+ $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
}
else {
$this->languageIDs = $this->user->getLanguageIDs();
$objectTypeID,
WCF::getUser()->userID
));
- $this->collapsedContent[$objectTypeID] = $statement->fetchColumns();
+ $this->collapsedContent[$objectTypeID] = $statement->fetchAll(\PDO::FETCH_COLUMN);
// update storage data
UserStorageHandler::getInstance()->update(WCF::getUser()->userID, 'collapsedContent-'.$objectTypeID, serialize($this->collapsedContent[$objectTypeID]));
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $notificationIDs = $statement->fetchColumns();
+ $notificationIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// filter array of existing notifications and remove values which
// do not have a notification from this author yet (inverse logic!)
$statement->execute(array(
$objectTypeObj->objectTypeID
));
- $eventIDs = $statement->fetchColumns();
+ $eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($eventIDs)) {
$conditions = new PreparedStatementConditionBuilder();
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// reset number of notifications
if (!empty($userIDs)) {
$comment->objectID,
$objectTypeID
]);
- $recipientIDs = $statement->fetchColumns();
+ $recipientIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// make sure that all users can (still) access the moderation queue entry
if (!empty($recipientIDs)) {
".$conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $recipientIDs = $statement->fetchColumns();
+ $recipientIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
// make sure that all users (still) have permission to access moderation
if (!$recipientIDs) {
".$conditionsBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionsBuilder->getParameters());
- $userIDs = $statement->fetchColumns();
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($userIDs)) {
// reset user storage