Example #1
0
 /**
  * set the collection
  *
  * @access public
  * @param Ibrams_CmsExtended_Model_Resource_Page_Collection $collection
  * @return Ibrams_CmsExtended_Model_Resource_Page_Tree
  */
 public function setCollection($collection)
 {
     if (!is_null($this->_collection)) {
         destruct($this->_collection);
     }
     $this->_collection = $collection;
     return $this;
 }
Example #2
0
/**
 * Object destructor
 *
 * @param mixed $object
 */
function destruct($object)
{
    if (is_array($object)) {
        foreach ($object as $obj) {
            destruct($obj);
        }
    }
    unset($object);
}
Example #3
0
/**
 * Object destructor
 *
 * @param mixed $object
 */
function destruct($object)
{
    if (is_array($object)) {
        foreach ($object as $obj) {
            destruct($obj);
        }
    } elseif (is_object($object)) {
        if (in_array('__destruct', get_class_methods($object))) {
            $object->__destruct();
        }
    }
    unset($object);
}