PluginFlyvemdmPolicyBase - btry/glpi-plugin GitHub Wiki
- Class name: PluginFlyvemdmPolicyBase
- Namespace:
- This is an abstract class
- This class implements: PluginFlyvemdmPolicyInterface
protected boolean $unicityRequired = true
- Visibility: protected
protected string $symbol
- Visibility: protected
protected string $group
- Visibility: protected
protected \PluginFlyvemdmPolicy $policyData
- Visibility: protected
mixed PluginFlyvemdmPolicyInterface::__construct(\PluginFlyvemdmPolicy $policy)
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $policy PluginFlyvemdmPolicy
array PluginFlyvemdmPolicyBase::jsonDecodeProperties(string $properties, array $defaultProperties)
JSON decode properties for the policy and merges them with default values
- Visibility: protected
- $properties string
- $defaultProperties array
mixed PluginFlyvemdmPolicyInterface::canApply(\PluginFlyvemdmFleet $fleet, string $value, string $itemtype, integer $itemId)
Check the policy may apply with respect of unicity constraint
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $fleet PluginFlyvemdmFleet
- $value string
- $itemtype string - <p>the itemtype of an item</p>
- $itemId integer - <p>the id of an item</p>
mixed PluginFlyvemdmPolicyInterface::unicityCheck(string $value, string $itemtype, integer $itemId, \PluginFlyvemdmFleet $fleet)
Check the unicity of the policy
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $value string
- $itemtype string
- $itemId integer
- $fleet PluginFlyvemdmFleet
mixed PluginFlyvemdmPolicyInterface::conflictCheck(string $value, string $itemtype, integer $itemId, \PluginFlyvemdmFleet $fleet)
Check there is not a conflict with an already applied policy
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $value string
- $itemtype string
- $itemId integer
- $fleet PluginFlyvemdmFleet
mixed PluginFlyvemdmPolicyInterface::integrityCheck(string $value, string $itemtype, integer $itemId)
Check the value used to apply a policy is valid, and check the the item to link
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $value string
- $itemtype string - <p>the itemtype of an item</p>
- $itemId integer - <p>the id of an item</p>
mixed PluginFlyvemdmPolicyInterface::translateData()
Translate type_data field
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
string PluginFlyvemdmPolicyInterface::getGroup()
get the group the policy belongs to
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
mixed PluginFlyvemdmPolicyInterface::apply(\PluginFlyvemdmFleet $fleet, string $value, $itemtype, $itemId)
Actions done before a policy is applied to a fleet
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $fleet PluginFlyvemdmFleet
- $value string
- $itemtype mixed
- $itemId mixed
mixed PluginFlyvemdmPolicyInterface::unapply(\PluginFlyvemdmFleet $fleet, string $value, $itemtype, $itemId)
Actions done after a policy is unapplied to a fleet
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $fleet PluginFlyvemdmFleet
- $value string
- $itemtype mixed
- $itemId mixed
mixed PluginFlyvemdmPolicyInterface::showValueInput()
return HTML input to set policy value
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
mixed PluginFlyvemdmPolicyInterface::showValue(\PluginFlyvemdmTask $task)
return policy value for display
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $task PluginFlyvemdmTask
array PluginFlyvemdmPolicyInterface::preprocessFormData(array $input)
Transforms form data to match the format expected by the API
When using GLPI the form data send in a different structure comapred to the API This method converts it back to the format used in the API
Does nothing by default, override if needed
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $input array
mixed PluginFlyvemdmPolicyBase::filterStatus(string $status)
get a status from a device and filters it to update a task
- Visibility: public
- $status string
array PluginFlyvemdmPolicyInterface::getMqttMessage(string $value, string $itemtype, integer $itemId)
Returns an array describing the policy applied vith the given value and item
- Visibility: public
- This method is defined by PluginFlyvemdmPolicyInterface
- $value string
- $itemtype string - <p>the itemtype of an item</p>
- $itemId integer - <p>the id of an item</p>