/** * Create a table specified in class map if not exists * @param epClassMap $cm The class map * @param bool $force Whether to force creating table * @return bool */ public function create($cm, $force = false) { // check if class is abstract if ($cm->isAbstract()) { // if so, no need to actually create return true; } // check if table exists if (!$force && $this->_tableExists($cm->getTable())) { return true; } // preapre sql statement $sql = epObj2Sql::sqlCreate($this, $cm); if (!$sql) { return false; } // execute sql return $r = $this->_execute($sql); }
/** * Create a table specified in class map if not exists * @param epClassMap * @return bool */ public function create($cm, $force = false) { // check if table exists if (!$force && $this->_tableExists($cm->getTable())) { return true; } // preapre sql statement $sql = epObj2Sql::sqlCreate($this, $cm); if (!$sql) { return false; } // execute sql return $r = $this->_execute($sql); }