Commit | Line | Data |
---|---|---|
285b1d92 MW |
1 | <?php |
2 | namespace wcf\data\comment; | |
3 | use wcf\data\DatabaseObjectEditor; | |
4 | use wcf\system\WCF; | |
5 | ||
6 | /** | |
7 | * Provides functions to edit comments. | |
8 | * | |
9 | * @author Alexander Ebert | |
9d007b40 | 10 | * @copyright 2001-2015 WoltLab GmbH |
285b1d92 | 11 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
f4f05aa5 | 12 | * @package com.woltlab.wcf |
285b1d92 MW |
13 | * @subpackage data.comment |
14 | * @category Community Framework | |
15 | */ | |
16 | class CommentEditor extends DatabaseObjectEditor { | |
17 | /** | |
0ad90fc3 | 18 | * @see \wcf\data\DatabaseObjectDecorator::$baseClass |
285b1d92 MW |
19 | */ |
20 | protected static $baseClass = 'wcf\data\comment\Comment'; | |
21 | ||
22 | /** | |
6f874ba8 | 23 | * Updates response ids. |
285b1d92 | 24 | */ |
6f874ba8 | 25 | public function updateResponseIDs() { |
285b1d92 MW |
26 | $sql = "SELECT responseID |
27 | FROM wcf".WCF_N."_comment_response | |
28 | WHERE commentID = ? | |
18b026a0 | 29 | ORDER BY time ASC, responseID ASC"; |
9d007b40 | 30 | $statement = WCF::getDB()->prepareStatement($sql, 5); |
285b1d92 | 31 | $statement->execute(array($this->commentID)); |
cd975610 | 32 | $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN); |
285b1d92 MW |
33 | |
34 | $this->update(array( | |
6f874ba8 | 35 | 'responseIDs' => serialize($responseIDs) |
285b1d92 MW |
36 | )); |
37 | } | |
38 | } |