[icinga-checkins] icinga.org: icingaweb2-module-director/master: ObjectsController: API should ship full objects

git at icinga.org git at icinga.org
Thu Feb 18 14:51:08 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: 23325d96f4ffd0784d6353747a109df3e2789620
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=23325d96f4ffd0784d6353747a109df3e2789620

Author: Thomas Gelf <thomas at gelf.net>
Date:   Thu Feb 18 14:41:05 2016 +0100

ObjectsController: API should ship full objects

---

 library/Director/Web/Controller/ObjectsController.php |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php
index dafb714..f7559b6 100644
--- a/library/Director/Web/Controller/ObjectsController.php
+++ b/library/Director/Web/Controller/ObjectsController.php
@@ -106,10 +106,10 @@ abstract class ObjectsController extends ActionController
         $this->view->filterEditor = $table->getFilterEditor($this->getRequest());
 
         if ($this->getRequest()->isApiRequest()) {
-
-            $objects = $this->db()->getDbAdapter()->fetchAll(
-                $table->getBaseQuery()->columns(array('object_name', 'object_type', 'disabled'))
-            );
+            $objects = array();
+            foreach ($dummy::loadAll($this->db) as $object) {
+                $objects[] = $object->toPlainObject(false, true);
+            }
             return $this->sendJson((object) array('objects' => $objects));
         }
 



More information about the icinga-checkins mailing list