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
|
|
|
/**
|
2012-02-26 16:55:44 +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-10-16 18:16:31 +00:00
|
|
|
/**
|
2013-11-09 13:38:17 +00:00
|
|
|
* @see wcf\data\DatabaseObjectEditor::deleteAll()
|
|
|
|
*/
|
2013-10-16 18:16:31 +00:00
|
|
|
public static function deleteAll(array $objectIDs = array()) {
|
|
|
|
$count = parent::deleteAll($objectIDs);
|
2013-11-18 20:28:56 +00:00
|
|
|
|
|
|
|
if ($count) {
|
|
|
|
// delete attached files
|
|
|
|
\wcf\system\attachment\AttachmentHandler::removeAttachments('be.bastelstu.chat.message', $objectIDs);
|
|
|
|
}
|
2013-10-16 18:16:31 +00:00
|
|
|
|
|
|
|
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
|
|
|
}
|