public function add($key, $value) { if (($this->key($key) == 'hosts' || $this->key($key) == 'hostsnotinme') && !$value instanceof Host) { $this->loadHosts(); $value = new Host($value); } // Add return parent::add($key, $value); }
public function add($key, $value) { if (($this->key($key) == 'hosts' || $this->key($key) == 'hostsnotinme') && !$value instanceof Host) { $this->loadHosts(); $value = new Host($value); } else { if ($this->key($key) == 'storageGroups' && !$value instanceof StorageGroup) { $this->loadGroups(); $value = new StorageGroup($value); } } // Add return parent::add($key, $value); }
public function add($key, $value) { if ($this->key($key) == 'additionalMACs' && !$value instanceof MACAddress) { $this->loadAdditional(); $value = new MACAddress($value); } else { if ($this->key($key) == 'pendingMACs' && !$value instanceof MACAddress) { $this->loadPending(); $value = new MACAddress($value); } else { if (($this->key($key) == 'printers' || $this->key($key) == 'printersnotinme') && !$value instanceof Printer) { $this->loadPrinters(); $value = new Printer($value); } else { if (($this->key($key) == 'snapins' || $this->key($key) == 'snapinsnotinme') && !$value instanceof Snapin) { $this->loadSnapins(); $value = new Snapin($value); } else { if ($this->key($key) == 'modules' && !$value instanceof Module) { $this->loadModules(); $value = new Module($value); } else { if ($this->key($key) == 'inventory' && !$value instanceof Inventory) { $this->loadInventory(); $value = new Inventory($value); } else { if (in_array($this->key($key), array('groups', 'groupsnotinme')) && !$value instanceof Group) { $this->loadGroups(); $value = new Group($value); } else { if ($this->key($key) == 'users' && !$value instanceof UserTracking) { $this->loadUsers(); $value = new UserTracking($value); } } } } } } } } // Add return parent::add($key, $value); }