/** * Adds a database table * * @version 1.0 * @since 1.0 * @return bool | Exception on failure. True on success. */ public function install() { if ($this->debug_on) { extract($this->debug_handler->event(array('pid' => $this->process_id, 'text' => "method_start", 'file' => __FILE__, 'class' => __CLASS__, 'function' => __FUNCTION__, 'line' => __LINE__, 'parent' => $this, 'vars' => compact(array_keys(get_defined_vars()))))); } $db = new FOX_db(array('pid' => $this->process_id)); try { $db->runAddTable($this->_struct()); } catch (FOX_exception $child) { throw new FOX_exception(array('numeric' => 1, 'text' => "Failed to create table", 'data' => array('struct' => $this->_struct()), 'file' => __FILE__, 'class' => __CLASS__, 'function' => __FUNCTION__, 'line' => __LINE__, 'child' => $child)); } if ($this->debug_on) { extract($this->debug_handler->event(array('pid' => $this->process_id, 'text' => "method_end", 'file' => __FILE__, 'class' => __CLASS__, 'function' => __FUNCTION__, 'line' => __LINE__, 'parent' => $this, 'vars' => compact(array_keys(get_defined_vars()))))); } return true; }