[icinga-checkins] icinga.org: icingaweb2/feature/announce-banner-11198: AnnouncementIniRepository: get rid of the overridden constructor

git at icinga.org git at icinga.org
Fri Nov 4 10:50:05 CET 2016


Module: icingaweb2
Branch: feature/announce-banner-11198
Commit: 7673ee6e7fd65e3353134700b2e3fc51605d557f
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=7673ee6e7fd65e3353134700b2e3fc51605d557f

Author: Alexander A. Klimov <alexander.klimov at icinga.com>
Date:   Fri Nov  4 10:49:17 2016 +0100

AnnouncementIniRepository: get rid of the overridden constructor

refs #11198

---

 .../Repository/AnnouncementIniRepository.php       |   23 +++++++-------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/library/Icinga/Repository/AnnouncementIniRepository.php b/library/Icinga/Repository/AnnouncementIniRepository.php
index d64bbdc..a47d95a 100644
--- a/library/Icinga/Repository/AnnouncementIniRepository.php
+++ b/library/Icinga/Repository/AnnouncementIniRepository.php
@@ -15,21 +15,6 @@ class AnnouncementIniRepository extends IniRepository
     /**
      * {@inheritDoc}
      */
-    public function __construct($ds = null)
-    {
-        if ($ds === null) {
-            $ds = Config::app('announcements');
-        }
-        $config = $ds->getConfigObject();
-        if ($config->getKeyColumn() === null) {
-            $config->setKeyColumn('id');
-        }
-        parent::__construct($ds);
-    }
-
-    /**
-     * {@inheritDoc}
-     */
     protected $queryColumns = array('announcement' => array('id', 'author', 'message', 'hash', 'start', 'end'));
 
     /**
@@ -46,6 +31,14 @@ class AnnouncementIniRepository extends IniRepository
     protected $triggers = array('announcement');
 
     /**
+     * {@inheritDoc}
+     */
+    protected $configs = array('announcement' => array(
+        'name'      => 'announcements',
+        'keyColumn' => 'id'
+    ));
+
+    /**
      * Create a DateTime from a *nix timestamp
      *
      * @param   string  $timestamp



More information about the icinga-checkins mailing list