Added first association of clubs. Current structure does not allow for joins.
This commit is contained in:
@@ -29,12 +29,18 @@ abstract class AbstractClubsModel
|
||||
$this->$m = $data[$m];
|
||||
}
|
||||
|
||||
protected static function loadElements(string $tableName, string $className)
|
||||
protected static function loadElements(string $tableName, string $className, $where = null)
|
||||
{
|
||||
$dbo = Factory::getDbo();
|
||||
$q = $dbo->getQuery(true);
|
||||
$q->select('*')
|
||||
->from($tableName);
|
||||
|
||||
if(isset($where))
|
||||
{
|
||||
$q->where($where);
|
||||
}
|
||||
|
||||
$dbo->setQuery($q);
|
||||
$dbo->execute();
|
||||
$list = $dbo->loadAssocList();
|
||||
@@ -60,7 +66,10 @@ abstract class AbstractClubsModel
|
||||
{
|
||||
$dbo = Factory::getDbo();
|
||||
$q = $dbo->getQuery(true);
|
||||
$q->select('*')->from($tableName)->where('id=' . (int) $id);
|
||||
|
||||
$q->select('*')->from($tableName);
|
||||
|
||||
$q->where('id=' . (int) $id);
|
||||
$dbo->setQuery($q);
|
||||
$dbo->execute();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user