public function destroy($recursive = true)
{
if ($recursive) {
foreach ($this->elements as $el) {
if ($el instanceof self) {
$el->destroy();
}
}
}
/*
if (@$this->model && $this->model instanceof AbstractObject) {
$this->model->destroy();
unset($this->model);
}
if (@$this->controller && $this->controller instanceof AbstractObject) {
$this->controller->destroy();
unset($this->controller);
}
*/
$this->owner->_removeElement($this->short_name);
}