Commit | Line | Data |
---|---|---|
dcc2332d MW |
1 | <?php |
2 | namespace wcf\data\smiley; | |
3 | use wcf\data\DatabaseObject; | |
4 | use wcf\system\WCF; | |
5 | use wcf\util\StringUtil; | |
6 | ||
7 | /** | |
8 | * Represents a smiley. | |
9 | * | |
10 | * @author Alexander Ebert | |
ca4ba303 | 11 | * @copyright 2001-2014 WoltLab GmbH |
dcc2332d | 12 | * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> |
f4f05aa5 | 13 | * @package com.woltlab.wcf |
dcc2332d MW |
14 | * @subpackage data.smiley |
15 | * @category Community Framework | |
16 | */ | |
17 | class Smiley extends DatabaseObject { | |
18 | /** | |
0ad90fc3 | 19 | * @see \wcf\data\DatabaseObject::$databaseTableName |
dcc2332d MW |
20 | */ |
21 | protected static $databaseTableName = 'smiley'; | |
22 | ||
23 | /** | |
0ad90fc3 | 24 | * @see \wcf\data\DatabaseObject::$databaseTableIndexName |
dcc2332d MW |
25 | */ |
26 | protected static $databaseTableIndexName = 'smileyID'; | |
27 | ||
28 | /** | |
29 | * Returns the url to this smiley. | |
30 | * | |
31 | * @return string | |
32 | */ | |
33 | public function getURL() { | |
34 | return WCF::getPath().$this->smileyPath; | |
35 | } | |
36 | ||
37 | /** | |
38 | * Returns all aliases for this smiley. | |
39 | * | |
40 | * @return array<string> | |
41 | */ | |
42 | public function getAliases() { | |
43 | if (!$this->aliases) return array(); | |
44 | ||
45 | return explode("\n", StringUtil::unifyNewlines($this->aliases)); | |
46 | } | |
47 | } |