mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
Added method addForm to DB_Model
This commit is contained in:
@@ -429,6 +429,29 @@ class DB_Model extends FHC_Model
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Add a table in the from clause
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addFrom($table, $alias = null)
|
||||
{
|
||||
$tmpTable = trim($table);
|
||||
|
||||
// Check parameters
|
||||
if (empty($tmpTable))
|
||||
return error(FHC_MODEL_ERROR, FHC_MODEL_ERROR);
|
||||
|
||||
if (!empty($alias))
|
||||
{
|
||||
$tmpTable .= ' AS ' . $alias;
|
||||
}
|
||||
|
||||
$this->db->from($tmpTable);
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
/** ---------------------------------------------------------------
|
||||
* Reset the query builder state
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user