\PhoolModifiable

This abstract class allows to know whether an object has been modified or not since it was created or read from persistent storage

Each time a property is modified, the descendant class must call the \Phool\setModified() method.

When it is saved, \Phool\clearModified() must be called

The current state can be retrieved via the \Phool\modified() method.

When the instance is created, the state is set to 'not-modified'

Summary

Methods
Properties
Constants
modified()
No public properties found
No constants found
__construct()
setModified()
clearModified()
No protected properties found
N/A
No private methods found
$modified_flag
N/A

Properties

$modified_flag

$modified_flag : boolean

Type

boolean — True if the object was modified since creation/load/save

Methods

modified()

modified() : boolean

Returns the modified state

Returns

boolean —

the current state

__construct()

__construct() : void

Class constructor

Ensures that the instance is in 'non-modified' state at creation time

setModified()

setModified(boolean  $toggle = true) : void

Set the 'modified' state depending on an input toggle

The input toggle allows to pass a boolean return code as argument

Parameters

boolean $toggle

If true, set the state, if false, do nothing

clearModified()

clearModified() : void

Set the 'not-modified' state Should be called only when the instance is transferred to persistent storage