From efe6fd35ab74b5a14e04056f39b2ec5f72cca40c Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 28 Dec 2016 12:44:51 +0100 Subject: [PATCH] IcingaObject: remove code loading fields... ...we now have a dedicated class for this --- library/Director/Objects/IcingaObject.php | 56 ----------------------- 1 file changed, 56 deletions(-) diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index c725b785..1341eeac 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -933,26 +933,6 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer return $this->resolve('Properties'); } - public function getResolvedFields() - { - return $this->getResolved('Fields'); - } - - public function getInheritedFields() - { - return $this->getInherited('Fields'); - } - - public function getOriginsFields() - { - return $this->getOrigins('Fields'); - } - - public function resolveFields() - { - return $this->resolve('Fields'); - } - public function getResolvedVars() { return $this->getResolved('Vars'); @@ -1252,42 +1232,6 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer return $this->getShortTableName() . '_id'; } - public function getFields() - { - $fields = (object) array(); - - if (! $this->supportsFields()) { - return $fields; - } - - $db = $this->getDb(); - - $query = $db->select()->from( - array('df' => 'director_datafield'), - array( - 'datafield_id' => 'f.datafield_id', - 'is_required' => 'f.is_required', - 'varname' => 'df.varname', - 'description' => 'df.description', - 'datatype' => 'df.datatype', - 'format' => 'df.format', - ) - )->join( - array('f' => $this->getTableName() . '_field'), - 'df.id = f.datafield_id', - array() - )->where('f.' . $this->getShortTableName() . '_id = ?', (int) $this->get('id')) - ->order('df.caption ASC'); - - $res = $db->fetchAll($query); - - foreach ($res as $r) { - $fields->{$r->varname} = $r; - } - - return $fields; - } - public function hasProperty($key) { if ($this->propertyIsRelatedSet($key)) {