parent::update();
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
// participants
if (!empty($this->parameters['participants']) || !empty($this->parameters['invisibleParticipants'])) {
// get current participants
AND conversationID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
WCF::getDB()->beginTransaction();
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
$statement->execute([
$this->parameters['visitTime'],
WCF::getUser()->userID,
// check participation
$conversationIDs = [];
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
$conversationIDs[] = $conversation->conversationID;
}
}
// validate ownership
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
if ($conversation->isClosed || ($conversation->userID != WCF::getUser()->userID)) {
throw new PermissionDeniedException();
}
* @return mixed[][]
*/
public function close() {
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
$conversation->update(['isClosed' => 1]);
$this->addConversationData($conversation->getDecoratedObject(), 'isClosed', 1);
}
// validate ownership
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
if (!$conversation->isClosed || ($conversation->userID != WCF::getUser()->userID)) {
throw new PermissionDeniedException();
}
* @return mixed[][]
*/
public function open() {
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
$conversation->update(['isClosed' => 0]);
$this->addConversationData($conversation->getDecoratedObject(), 'isClosed', 0);
if ($this->parameters['hideConversation'] == Conversation::STATE_LEFT) {
if (empty($this->objects)) $this->readObjects();
- foreach ($this->objects as $conversation) {
+ foreach ($this->getObjects() as $conversation) {
ConversationModificationLogHandler::getInstance()->leave($conversation->getDecoratedObject());
}
}
}
// create message
+ /** @var ConversationMessage $message */
$message = parent::create();
$messageEditor = new ConversationMessageEditor($message);
// update search index / embedded objects
if (isset($this->parameters['data']) && isset($this->parameters['data']['message'])) {
- foreach ($this->objects as $message) {
+ foreach ($this->getObjects() as $message) {
$conversation = $message->getConversation();
SearchIndexManager::getInstance()->update('com.woltlab.wcf.conversation.message', $message->messageID, $this->parameters['data']['message'], ($conversation->firstMessageID == $message->messageID ? $conversation->subject : ''), $message->time, $message->userID, $message->username);
$count = parent::delete();
$attachmentMessageIDs = $conversationIDs = [];
- foreach ($this->objects as $message) {
+ foreach ($this->getObjects() as $message) {
if (!in_array($message->conversationID, $conversationIDs)) {
$conversationIDs[] = $message->conversationID;
}