From 56c9abfd255533e3cadf5dffc96f9a98831aec6e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 22 Dec 2015 10:57:06 +0100 Subject: [PATCH] Add TUserContent trait --- CHANGELOG.md | 1 + .../files/lib/data/TUserContent.class.php | 35 +++++++++++++++++++ .../files/lib/data/comment/Comment.class.php | 24 ++----------- .../response/CommentResponse.class.php | 24 ++----------- 4 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 wcfsetup/install/files/lib/data/TUserContent.class.php 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() */ -- 2.20.1