-
New Feature Request
-
Resolution: Unresolved
-
Minor
-
None
-
2.1.0
-
None
Implementation example:
CZBXAPI.php:
/**
- Add writable status field to result.
* - @param array $result
- @param array $options
*/
protected function addWritableInfo($result, $options) {
if (empty($options['is_writable'])) { return $result; }
$pk = $this->pk($this->tableName);
$objs = $this->get(array(
$pk.'s' => zbx_objectValues($result, $pk),
'editable' => true
));
$objs = zbx_toHash($objs, $pk);
foreach ($result as $id => $value)
{ $result[$id]['is_writable'] = isset($objs[$id]); } return $result;
}
Example usage:
CTrigger->get()
$result = $this->addWritableInfo($result, $options);