IcingaObjectDatafieldTable: cast to int when...

...comparing ids

fixes #726
This commit is contained in:
Thomas Gelf 2017-07-20 15:19:57 +02:00
parent 8e0235a7e1
commit 28f322a107

View File

@ -12,9 +12,13 @@ class IcingaObjectDatafieldTable extends QuickTable
{ {
protected $object; protected $object;
/** @var int */
protected $objectId;
public function setObject(IcingaObject $object) public function setObject(IcingaObject $object)
{ {
$this->object = $object; $this->object = $object;
$this->objectId = (int) $object->id;
$this->setConnection($object->getConnection()); $this->setConnection($object->getConnection());
return $this; return $this;
} }
@ -41,7 +45,7 @@ class IcingaObjectDatafieldTable extends QuickTable
protected function getActionUrl($row) protected function getActionUrl($row)
{ {
if ($row->object_id !== $this->object->id) { if ((int) $row->object_id !== $this->objectId) {
return null; return null;
} }
@ -50,7 +54,7 @@ class IcingaObjectDatafieldTable extends QuickTable
protected function getRowClasses($row) protected function getRowClasses($row)
{ {
if ($row->object_id !== $this->object->id) { if ((int) $row->object_id !== $this->objectId) {
return array('disabled'); return array('disabled');
} }
} }