/** * Dynamically load an extension when needed. * @param object $name Name of the extension (or array of extensions). * @param array $options Options for the extension * @param boolean $local If TRUE, only loads the extension into this object */ public function load_extension($name, $options = NULL, $local = FALSE) { if (!is_array($name)) { if (!is_null($options)) { $name = array($name => $options); } else { $name = array($name); } } // called individually to ensure that the array is modified directly // (and not copied instead) if ($local) { DataMapper::_load_extensions($this->extensions, $name); } else { DataMapper::_load_extensions(DataMapper::$global_extensions, $name); } }