$mStatus
$mStatus : int
Status flags.
This data member holds the status flags in a bitfield value
Status trait
The main purpose of this trait is to add status management to classes, this is done by adding a bitfield {@link $mStatus} data member and a set of methods that handle this bitfield.
This trait defines the common methods for managing the bitfield data member and handles the following flags:
All the flag accessor methods are protected, since they provide access to the internal workings of the object, if you need to provide status information you should do so by using these methods in a public interface.
isInited(mixed $theState) : boolean
Manage inited status
This method can be used to get or set the object's inited state.
An object becomes inited when it has all the required elements necessary for it to be correctly used or persistently stored. Such a state indicates that at least the minimum required information was initialised in the object.
The counterpart state indicates that the object still lacks the necessary elements to successfully operate the object.
This method operates by setting or clearing the {@link kFLAG_STATE_INITED} flag.
The method features a single parameter:
In all cases the method will return the state after it was eventually modified.
mixed | $theState | TRUE, FALSE or
|
TRUE inited, FALSE idle.
isDirty(mixed $theState) : boolean
Manage dirty status
This method can be used to get or set the object's dirty state.
A dirty object is one that was modified since the last time this state was probed. In general, this state should be set whenever the persistent properties of the object are modified.
In this class we automatically set this state when setting or unsetting offsets.
The method features a single parameter:
In all cases the method will return the state after it was eventually modified.
mixed | $theState | TRUE, FALSE or
|
TRUE dirty, FALSE clean.
isCommitted(mixed $theState) : boolean
Manage committed status
This method can be used to get or set the object's committed state.
A committed object is one that has either been loaded from a container or committed to a container, this state can be used in conjunction with the {@link kFLAG_STATE_DIRTY} flag to determine whether an object needs to be committed.
The method features a single parameter:
In all cases the method will return the state after it was eventually modified.
mixed | $theState | TRUE, FALSE or
|
TRUE committed, FALSE uncommitted.
isAlias(mixed $theState) : boolean
Manage alias status
This method can be used to get or set the object's alias state.
This flag determines whether the object is an alias or not, alias objects hold a reference to their master object in the {@link kTAG_MASTER} offset.
The method features a single parameter:
In all cases the method will return the state after it was eventually modified.
mixed | $theState | TRUE, FALSE or
|
TRUE is an alias, FALSE not an alias.
manageBitField(\OntologyWrapper\traits\reference $theField, \OntologyWrapper\traits\bitfield $theMask, mixed $theState) : \OntologyWrapper\traits\bitfield
Manage a bit-field property
This method can be used to manage a bitfield property, it accepts the following parameters:
In all cases the method will return the status after it was eventually modified.
\OntologyWrapper\traits\reference | $theField | Bit-field reference. |
\OntologyWrapper\traits\bitfield | $theMask | Bit-field mask. |
mixed | $theState | Value or operator. |
Current masked status.