/** * @param array $contents * * @return \Kisma\Core\SeedBag */ public function __construct($contents = array()) { parent::__construct($contents); // Anything left, goes in the bag if (!empty($contents) && (is_array($contents) || $contents instanceof \Traversable)) { foreach ($contents as $_key => $_value) { $this->set($_key, $_value); unset($contents[$_key]); } } }
/** * @param array $settings */ public function __construct($settings = array()) { // Wire up a destructor to call when I die register_shutdown_function(function () { $this->__destruct(); static::_destruct(); }); // Phone home. Calls __wakeup() from base parent::__construct($settings); // Call static constructor and save our instance off static::_construct($this); static::$_instance = $this; }