mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
parent
53432c6d5c
commit
33f04d9e52
@ -7,15 +7,19 @@ use Icinga\Module\Director\Db;
|
|||||||
|
|
||||||
abstract class PropertyModifierHook
|
abstract class PropertyModifierHook
|
||||||
{
|
{
|
||||||
protected $settings = array();
|
/** @var array */
|
||||||
|
protected $settings = [];
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
private $targetProperty;
|
private $targetProperty;
|
||||||
|
|
||||||
|
/** @var Db */
|
||||||
private $db;
|
private $db;
|
||||||
|
|
||||||
/**
|
/** @var bool */
|
||||||
* @var \stdClass
|
private $rejected = false;
|
||||||
*/
|
|
||||||
|
/** @var \stdClass */
|
||||||
private $row;
|
private $row;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,7 +27,7 @@ abstract class PropertyModifierHook
|
|||||||
*
|
*
|
||||||
* Your custom property modifier needs to implement this method.
|
* Your custom property modifier needs to implement this method.
|
||||||
*
|
*
|
||||||
* @return value
|
* @return mixed $value
|
||||||
*/
|
*/
|
||||||
abstract public function transform($value);
|
abstract public function transform($value);
|
||||||
|
|
||||||
@ -55,6 +59,21 @@ abstract class PropertyModifierHook
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reject this whole row
|
||||||
|
*
|
||||||
|
* Allows your property modifier to reject specific rows
|
||||||
|
*
|
||||||
|
* @param bool $reject
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function rejectRow($reject = true)
|
||||||
|
{
|
||||||
|
$this->rejected = (bool) $reject;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this PropertyModifier wants access to the current row
|
* Whether this PropertyModifier wants access to the current row
|
||||||
*
|
*
|
||||||
@ -67,6 +86,16 @@ abstract class PropertyModifierHook
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this modifier wants to reject the current row
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function rejectsRow()
|
||||||
|
{
|
||||||
|
return $this->rejected;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current row
|
* Get the current row
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user