$_component
$_component : string
The name of the component, e.g. net.nehmer.static. Should be used whenever the component's name is required instead of hardcoding it.
This is the base class used for all jobs run by MidCOM CRON.
It gives you an easy to use way of building cron jobs. You should rely only on the two event handlers _on_initialize and execute, which are called by the cron service.
See the main cron service class for details.
get_workflow(string $identifier, array $options = array()) : \midcom\workflow\dialog
string | $identifier | |
array | $options |
_on_initialize() : boolean
This callback is executed immediately after object construction. You can initialize your class here.
If you return false here, the handler is not executed, the system skips it.
All class members are already initialized when this event handler is called.
Returns true, if initialization was successful, false if anything went wrong.
execute()
This is the actual handler operation, it is called only after successful operation.
You should use the print_error() helper of this class in case you need to notify the user of any errors. As long as everything goes fine, you should not print anything to avoid needless cron mailings.
print_error(string $message, mixed $var = null)
Echo the error message to the client, automatically appending the classname to the prefix. Passed messages are also written to the error log.
string | $message | The error message to print. |
mixed | $var | A variable you want to print, if any. |