It may be useful that the webobjects also have functions like:
$this->constructor();
$this->destructor();
which are called by the framework after the object is created
and before it is destroyed. The destructor can be called
just before the session vars are saved, so that it has the
possibility to remove its state vars from the session by
calling WebObject::destroy(), which is the oposite of
WebObject::init(). When WebObject::destroy() is called, it
removes all the state vars from the session, so that next
time that this webObj is parsed, it will be initialized
again ($this->init() will be called again).
Probably it is better to rename:
$this->init() to $this->initState()
and
WebObject::destroy() to WebObject::destroyState()
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It may be useful that the webobjects also have functions like:
$this->constructor();
$this->destructor();
which are called by the framework after the object is created
and before it is destroyed. The destructor can be called
just before the session vars are saved, so that it has the
possibility to remove its state vars from the session by
calling WebObject::destroy(), which is the oposite of
WebObject::init(). When WebObject::destroy() is called, it
removes all the state vars from the session, so that next
time that this webObj is parsed, it will be initialized
again ($this->init() will be called again).
Probably it is better to rename:
$this->init() to $this->initState()
and
WebObject::destroy() to WebObject::destroyState()