From a5b9f4fdf7155fbb3b890730adfcb98e488414cf Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 24 Jan 2016 15:05:16 +0100 Subject: [PATCH] Test fixes --- Models/Collection.php | 12 +++++++++++- Models/Media.php | 37 ++++++++++++------------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Models/Collection.php b/Models/Collection.php index f0bf053..8652621 100644 --- a/Models/Collection.php +++ b/Models/Collection.php @@ -16,7 +16,6 @@ namespace Modules\Media\Models; - /** * Media class. * @@ -39,6 +38,9 @@ class Collection extends Media */ private $sources = []; + protected $extension = 'collection'; + protected $versioned = false; + /** * Constructor. * @@ -91,4 +93,12 @@ class Collection extends Media { return $this->sources; } + + public function setExtension(string $extension) + { + } + + public function setVersioned(bool $versioned) + { + } } diff --git a/Models/Media.php b/Models/Media.php index 3ba0d16..9eb419c 100644 --- a/Models/Media.php +++ b/Models/Media.php @@ -139,19 +139,6 @@ class Media return $this->id; } - /** - * @param int $id Id - * - * @return void - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function setId(int $id) - { - $this->id = $id; - } - /** * @return int * @@ -171,7 +158,7 @@ class Media */ public function getCreatedAt() : \DateTime { - return $this->createdAt; + return $this->createdAt ?? new \DateTime('now'); } /** @@ -229,6 +216,17 @@ class Media return $this->size; } + /** + * @return bool + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function isVersioned() : bool + { + return $this->versioned; + } + /** * @param int $createdBy Creator * @@ -332,15 +330,4 @@ class Media { $this->versioned = $versioned; } - - /** - * @return bool - * - * @since 1.0.0 - * @author Dennis Eichhorn - */ - public function getVersioned() : bool - { - return $this->versioned; - } }