1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00
Tims-Chat/file/lib/data/message/MessageEditor.class.php

42 lines
1.1 KiB
PHP
Raw Normal View History

2011-11-27 11:21:58 +00:00
<?php
2013-01-19 19:36:40 +00:00
namespace chat\data\message;
2011-11-27 11:21:58 +00:00
/**
* Provides functions to edit chat messages.
*
* @author Tim Düsterhus
2014-02-27 22:05:09 +00:00
* @copyright 2010-2014 Tim Düsterhus
2011-11-27 11:21:58 +00:00
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
2013-01-19 19:36:40 +00:00
* @package be.bastelstu.chat
* @subpackage chat.message
2011-11-27 11:21:58 +00:00
*/
2013-01-19 19:36:40 +00:00
class MessageEditor extends \wcf\data\DatabaseObjectEditor {
2011-11-27 11:21:58 +00:00
/**
* @see \wcf\data\DatabaseObjectDecorator::$baseClass
2011-11-27 11:21:58 +00:00
*/
2013-01-19 19:36:40 +00:00
protected static $baseClass = '\chat\data\message\Message';
2011-11-27 11:21:58 +00:00
/**
2013-11-09 13:38:17 +00:00
* @see wcf\data\DatabaseObjectEditor::deleteAll()
*/
public static function deleteAll(array $objectIDs = array()) {
$count = parent::deleteAll($objectIDs);
if ($count) {
// delete attached files
\wcf\system\attachment\AttachmentHandler::removeAttachments('be.bastelstu.chat.message', $objectIDs);
}
return $count;
}
2012-04-27 17:33:28 +00:00
/**
* Notify the Push-Server.
*/
public static function create(array $parameters = array()) {
2014-09-19 21:34:17 +00:00
\wcf\system\push\PushHandler::getInstance()->sendMessage('be.bastelstu.chat.newMessage');
2012-04-27 17:33:28 +00:00
return parent::create($parameters);
}
2011-11-27 11:21:58 +00:00
}