Created models for all database objects
This commit is contained in:
@@ -81,20 +81,24 @@ abstract class AbstractCommonClubsModelFactory
|
||||
}
|
||||
|
||||
private $joins = null;
|
||||
/**
|
||||
* @return AbstractCommonClubsModelJoin[]
|
||||
*/
|
||||
public function getJoins($force = False)
|
||||
{
|
||||
if($this->joins === null || $force)
|
||||
$this->joins = $this->fetchJoins();
|
||||
|
||||
return $this->joins;
|
||||
return $this->joins;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $condition
|
||||
* @param string|array $sorting
|
||||
* @return array
|
||||
*/
|
||||
public function loadElements($condition = null)
|
||||
public function loadElements($condition = null, $sorting = null, $callback = null)
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$q = $db->getQuery(true);
|
||||
@@ -109,11 +113,17 @@ abstract class AbstractCommonClubsModelFactory
|
||||
$q->select('main.id AS id');//->select($columns);
|
||||
$q->from($this->getTableName() . ' AS main');
|
||||
|
||||
// TODO Joins
|
||||
|
||||
if($condition !== null)
|
||||
$q->where($condition);
|
||||
|
||||
if($sorting !== null)
|
||||
$q->order($sorting);
|
||||
|
||||
if($callback !== null)
|
||||
{
|
||||
$callback($q);
|
||||
}
|
||||
|
||||
$db->setQuery($q);
|
||||
$db->execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user