$poll->pollID,
WCF::getUser()->userID
]);
- $alreadyVoted = false;
- $optionIDs = [];
- while ($row = $statement->fetchArray()) {
- $alreadyVoted = true;
- $optionIDs[] = $row['optionID'];
- }
+ $optionIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
+ $alreadyVoted = !empty($optionIDs);
// calculate the difference
foreach ($this->parameters['optionIDs'] as $index => $optionID) {
ORDER BY count DESC";
$statement = WCF::getDB()->prepareStatement($sql, ARTICLE_RELATED_ARTICLES);
$statement->execute($conditionBuilder->getParameters());
- $articleContentIDs = [];
- while ($row = $statement->fetchArray()) {
- $articleContentIDs[] = $row['objectID'];
- }
+ $articleContentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($articleContentIDs)) {
$conditionBuilder = new PreparedStatementConditionBuilder();
" . $conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $articleIDs = [];
- while ($row = $statement->fetchArray()) {
- $articleIDs[] = $row['articleID'];
- }
+ $articleIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
$this->relatedArticles = new AccessibleArticleList();
$this->relatedArticles->getConditionBuilder()->add('article.articleID IN (?)', [$articleIDs]);
$objectTypeID,
$objectID
]);
- $userIDs = [];
- while ($row = $statement->fetchArray()) {
- $userIDs[] = $row['userID'];
- }
+ $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
$sql = "SELECT groupID
FROM wcf".WCF_N."_acl_simple_to_group
$objectTypeID,
$objectID
]);
- $groupIDs = [];
- while ($row = $statement->fetchArray()) {
- $groupIDs[] = $row['groupID'];
- }
+ $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
if (!empty($userIDs) || !empty($groupIDs)) {
$data['allowAll'] = false;
AND controllerCustomURL <> ''";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
- $rows = [];
- while ($row = $statement->fetchArray()) {
- $rows[] = $row;
- }
+ $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
// fetch content pages using the common page controller
$sql = "SELECT page_content.customURL AS controllerCustomURL, page_content.pageID, page_content.languageID, page.applicationPackageID
$known = explode("\n", $row['aliases']);
}
$known[] = $row['smileyCode'];
-
+
foreach ($known as $smileyCode) {
$this->knownCodes[mb_strtolower($smileyCode)] = $row['smileyID'];
}
$this->installation->queue->processNo,
$node
]);
- $data = [];
- while ($row = $statement->fetchArray()) {
- $data[] = $row;
- }
- return $data;
+ return $statement->fetchAll(\PDO::FETCH_ASSOC);
}
/**
}
// fetch ordered pips
- $pips = [];
$sql = "SELECT pluginName, className,
CASE pluginName WHEN 'packageinstallationplugin' THEN 1 WHEN 'file' THEN 2 ELSE 0 END AS pluginOrder
FROM wcf".WCF_N."_package_installation_plugin
ORDER BY pluginOrder, priority";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
- while ($row = $statement->fetchArray()) {
- $pips[] = $row;
- }
+ $pips = $statement->fetchAll(\PDO::FETCH_ASSOC);
// insert pips
$sql = "INSERT INTO wcf".WCF_N."_package_installation_node
}
// get versions
- $versions = [];
$sql = "SELECT puv.*, pu.*, pus.loginUsername, pus.loginPassword
FROM wcf".WCF_N."_package_update_version puv
LEFT JOIN wcf".WCF_N."_package_update pu
$version,
0
]);
- while ($row = $statement->fetchArray()) {
- $versions[] = $row;
- }
+ $versions = $statement->fetchAll(\PDO::FETCH_ASSOC);
if (empty($versions)) {
throw new SystemException("Cannot find package '".$package."' in version '".$version."'");
}
// get installed languages
- $installedLanguages = [];
$sql = "SELECT *
FROM wcf".WCF_N."_language
ORDER BY isDefault DESC";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
- while ($row = $statement->fetchArray()) {
- $installedLanguages[] = $row;
- }
+ $installedLanguages = $statement->fetchAll(\PDO::FETCH_ASSOC);
// install language
foreach ($installedLanguages as $installedLanguage) {
ORDER BY sqlIndex DESC, sqlColumn DESC";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->installation->getPackageID()]);
- $entries = [];
- while ($row = $statement->fetchArray()) {
- $entries[] = $row;
- }
+ $entries = $statement->fetchAll(\PDO::FETCH_ASSOC);
// get all tablenames from database
$existingTableNames = WCF::getDB()->getEditor()->getTableNames();
ORDER BY showOrder ASC";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->poll->pollID]);
+ // TODO?: $this->pollOptions = $statement->fetchAll(\PDO::FETCH_ASSOC);
while ($row = $statement->fetchArray()) {
$this->pollOptions[] = $row;
}