aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/sys
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2020-11-08 17:13:51 +0100
committerLaria Carolin Chabowski <laria@laria.me>2020-11-08 17:13:51 +0100
commit743c562ac9a8d8df7a176a989ebee36ad2acbfb7 (patch)
treea36d2e7e7226d12aa55b912f77e9ac0c7e873b89 /ratatoeskr/sys
parent05b42c3327a14351692330bdc299dd011cd03dc4 (diff)
downloadratatoeskr-cms-743c562ac9a8d8df7a176a989ebee36ad2acbfb7.tar.gz
ratatoeskr-cms-743c562ac9a8d8df7a176a989ebee36ad2acbfb7.tar.bz2
ratatoeskr-cms-743c562ac9a8d8df7a176a989ebee36ad2acbfb7.zip
Move article status consts into Article class
Diffstat (limited to 'ratatoeskr/sys')
-rw-r--r--ratatoeskr/sys/models.php25
1 files changed, 11 insertions, 14 deletions
diff --git a/ratatoeskr/sys/models.php b/ratatoeskr/sys/models.php
index 74d4419..d51bb1f 100644
--- a/ratatoeskr/sys/models.php
+++ b/ratatoeskr/sys/models.php
@@ -36,18 +36,6 @@ require_once(dirname(__FILE__) . "/pluginpackage.php");
$ratatoeskr_settings = null;
/*
- * Constants: ARTICLE_STATUS_
- * Possible <Article>::$status values.
- *
- * ARTICLE_STATUS_HIDDEN - Article is hidden (Numeric: 0)
- * ARTICLE_STATUS_LIVE - Article is visible / live (Numeric: 1)
- * ARTICLE_STATUS_STICKY - Article is sticky (Numeric: 2)
- */
-define("ARTICLE_STATUS_HIDDEN", 0);
-define("ARTICLE_STATUS_LIVE", 1);
-define("ARTICLE_STATUS_STICKY", 2);
-
-/*
* Class: DoesNotExistError
* This Exception is thrown by an ::by_*-constructor or any array-like object if the desired object is not present in the database.
*/
@@ -2636,6 +2624,15 @@ class Repository extends BySQLRowEnabled
*/
class Article extends BySQLRowEnabled
{
+ /** @var int Article is hidden (Numeric: 0) */
+ public const STATUS_HIDDEN = 0;
+
+ /** @var int Article is visible / live (Numeric: 1) */
+ public const STATUS_LIVE = 1;
+
+ /** @var int Article is sticky (Numeric: 2) */
+ public const STATUS_STICKY = 2;
+
/** @var int */
private $id;
@@ -2666,7 +2663,7 @@ class Article extends BySQLRowEnabled
/** @var Image|null The article image. If none: null */
public $article_image = null;
- /** @var int One of the ARTICLE_STATUS_* constants */
+ /** @var int One of the self::STATUS_* constants */
public $status;
/** @var int Timestamp */
@@ -2750,7 +2747,7 @@ class Article extends BySQLRowEnabled
$obj->meta = "";
$obj->custom = [];
$obj->article_image = null;
- $obj->status = ARTICLE_STATUS_HIDDEN;
+ $obj->status = self::STATUS_HIDDEN;
$obj->section_id = $ratatoeskr_settings["default_section"];
$obj->timestamp = time();
$obj->allow_comments = $ratatoeskr_settings["allow_comments_default"];