[icinga-checkins] icinga.org: icingaweb2/master: Repository: Fix documentation of method getDataSource

git at icinga.org git at icinga.org
Fri Nov 4 10:38:01 CET 2016


Module: icingaweb2
Branch: master
Commit: df4702679230ddb711d6f96071ac9ec2f837c622
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=df4702679230ddb711d6f96071ac9ec2f837c622

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Fri Nov  4 09:56:53 2016 +0100

Repository: Fix documentation of method getDataSource

refs #13034

---

 library/Icinga/Repository/Repository.php |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/library/Icinga/Repository/Repository.php b/library/Icinga/Repository/Repository.php
index 73721c0..5417190 100644
--- a/library/Icinga/Repository/Repository.php
+++ b/library/Icinga/Repository/Repository.php
@@ -269,12 +269,18 @@ abstract class Repository implements Selectable
      * @param   string  $table
      *
      * @return  Selectable
+     *
+     * @throws  ProgrammingError    In case no datasource is available
      */
     public function getDataSource($table = null)
     {
         if ($this->ds === null) {
-            throw new ProgrammingError('No data source available');
+            throw new ProgrammingError(
+                'No data source available. It is required to either pass it'
+                . ' at initialization time or by overriding this method.'
+            );
         }
+
         return $this->ds;
     }
 



More information about the icinga-checkins mailing list