From 6ddd592297be16a39d77b5d435633213fc2d8e15 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 10 Jan 2016 22:29:39 +0100 Subject: [PATCH] Added countable --- Asset/AssetManager.php | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/Asset/AssetManager.php b/Asset/AssetManager.php index c0360830d..290b6d357 100644 --- a/Asset/AssetManager.php +++ b/Asset/AssetManager.php @@ -15,8 +15,6 @@ */ namespace phpOMS\Asset; -use phpOMS\DataStorage\Database\Pool; - /** * Asset manager class. * @@ -30,7 +28,7 @@ use phpOMS\DataStorage\Database\Pool; * @link http://orange-management.com * @since 1.0.0 */ -class AssetManager +class AssetManager implements \Countable { /** @@ -44,12 +42,10 @@ class AssetManager /** * Constructor. * - * @param Pool $dbPool Database pool - * * @since 1.0.0 * @author Dennis Eichhorn */ - public function __construct(Pool $dbPool) + public function __construct() { } @@ -116,4 +112,17 @@ class AssetManager return null; } + /** + * Get asset count. + * + * @return int + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function count() : \int + { + return count($this->assets); + } + }