From: Matthias Schmidt Date: Tue, 22 Dec 2015 09:57:06 +0000 (+0100) Subject: Add TUserContent trait X-Git-Tag: 3.0.0_Beta_1~2081 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=56c9abfd255533e3cadf5dffc96f9a98831aec6e;p=GitHub%2FWoltLab%2FWCF.git Add TUserContent trait --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 10abde33cd..4125baaa4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,3 +35,4 @@ * Ported the PHP-BBCode parser, massively improves accuracy and ensures validity * Show error message if poll options are given but not question instead of discarding poll options. * `parentObjectID` column added to `modification_log` and `wcf\system\log\modification\AbstractModificationLogHandler` introduced as a replacement for `wcf\system\log\modification\ModificationLogHandler`. +* `wcf\data\TUserContent` added. diff --git a/wcfsetup/install/files/lib/data/TUserContent.class.php b/wcfsetup/install/files/lib/data/TUserContent.class.php new file mode 100644 index 0000000000..603c872431 --- /dev/null +++ b/wcfsetup/install/files/lib/data/TUserContent.class.php @@ -0,0 +1,35 @@ + + * @package com.woltlab.wcf + * @subpackage data + * @category Community Framework + */ +trait TUserContent { + /** + * @see IUserContent::getTime() + */ + public function getTime() { + return $this->time; + } + + /** + * @see IUserContent::getUserID() + */ + public function getUserID() { + return $this->userID; + } + + /** + * @see IUserContent::getUsername() + */ + public function getUsername() { + return $this->username; + } +} diff --git a/wcfsetup/install/files/lib/data/comment/Comment.class.php b/wcfsetup/install/files/lib/data/comment/Comment.class.php index 90eb31ecbb..50f187962b 100644 --- a/wcfsetup/install/files/lib/data/comment/Comment.class.php +++ b/wcfsetup/install/files/lib/data/comment/Comment.class.php @@ -2,6 +2,7 @@ namespace wcf\data\comment; use wcf\data\DatabaseObject; use wcf\data\IMessage; +use wcf\data\TUserContent; use wcf\system\bbcode\SimpleMessageParser; use wcf\system\comment\CommentHandler; use wcf\util\StringUtil; @@ -17,6 +18,8 @@ use wcf\util\StringUtil; * @category Community Framework */ class Comment extends DatabaseObject implements IMessage { + use TUserContent; + /** * @see \wcf\data\DatabaseObject::$databaseTableName */ @@ -66,27 +69,6 @@ class Comment extends DatabaseObject implements IMessage { return $this->message; } - /** - * @see \wcf\data\IUserContent::getTime() - */ - public function getTime() { - return $this->time; - } - - /** - * @see \wcf\data\IUserContent::getUserID() - */ - public function getUserID() { - return $this->userID; - } - - /** - * @see \wcf\data\IUserContent::getUsername() - */ - public function getUsername() { - return $this->username; - } - /** * @see \wcf\data\ILinkableObject::getLink() */ diff --git a/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php b/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php index f8e259793e..fc04f1ee46 100644 --- a/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/CommentResponse.class.php @@ -3,6 +3,7 @@ namespace wcf\data\comment\response; use wcf\data\comment\Comment; use wcf\data\DatabaseObject; use wcf\data\IMessage; +use wcf\data\TUserContent; use wcf\system\bbcode\SimpleMessageParser; use wcf\system\comment\CommentHandler; use wcf\util\StringUtil; @@ -18,6 +19,8 @@ use wcf\util\StringUtil; * @category Community Framework */ class CommentResponse extends DatabaseObject implements IMessage { + use TUserContent; + /** * @see \wcf\data\DatabaseObject::$databaseTableName */ @@ -79,27 +82,6 @@ class CommentResponse extends DatabaseObject implements IMessage { return $this->message; } - /** - * @see \wcf\data\IUserContent::getTime() - */ - public function getTime() { - return $this->time; - } - - /** - * @see \wcf\data\IUserContent::getUserID() - */ - public function getUserID() { - return $this->userID; - } - - /** - * @see \wcf\data\IUserContent::getUsername() - */ - public function getUsername() { - return $this->username; - } - /** * @see \wcf\data\ILinkableObject::getLink() */