$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
$conversations = [];
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$conversations[$row['conversationID']] = new Conversation(null, $row);
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$index = array_search($row['conversationID'], $conversationIDs);
unset($conversationIDs[$index]);
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$index = array_search($row['conversationID'], $conversationIDs);
unset($conversationIDs[$index]);
}
$statement->execute($conditionBuilder->getParameters());
$objectIDs = [];
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
if (!$row['messages']) {
continue;
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$usernames[$row['userID']] = $row['username'];
}
}
* Updates the participant summary of this conversation.
*/
public function updateParticipantSummary() {
- $users = [];
$sql = "SELECT participantID AS userID, hideConversation, username
FROM wcf".WCF_N."_conversation_to_user
WHERE conversationID = ?
ORDER BY username";
$statement = WCF::getDB()->prepareStatement($sql, 5);
$statement->execute([$this->conversationID, $this->userID]);
- while ($row = $statement->fetchArray()) {
- $users[] = $row;
- }
- $this->update(['participantSummary' => serialize($users)]);
+ $this->update(['participantSummary' => serialize($statement->fetchAll(\PDO::FETCH_ASSOC))]);
}
/**
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$this->conversationID]);
$i = 0;
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
// create fake user profiles
$this->objects['x'.(++$i)] = UserProfile::getGuestUserProfile($row['username']);
$this->indexToObject[] = 'x'.$i;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$data = [];
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
if (!isset($data[$row['conversationID']])) {
$data[$row['conversationID']] = [];
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$conversation->assignLabel($labels[$row['labelID']]);
}
}
".$conditions;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$index = array_search($row['conversationID'], $conversationIDs);
unset($conversationIDs[$index]);
}
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditions->getParameters());
$lastVisitTime = [];
- while ($row = $statement->fetchArray()) {
+ while (($row = $statement->fetchArray())) {
$lastVisitTime[$row['conversationID']] = $row['lastVisitTime'];
}
// get participant summary
$participantStatement->execute([$conversation->conversationID, $conversation->userID, 0]);
$users = [];
- while ($row = $participantStatement->fetchArray()) {
+ while (($row = $participantStatement->fetchArray())) {
$users[] = $row;
}
$data['participantSummary'] = serialize($users);