Basic model of club created according to abstact model

This commit is contained in:
2019-05-17 14:56:29 +02:00
parent 03df8c8f1a
commit c459e1d332
2 changed files with 44 additions and 123 deletions

View File

@@ -74,9 +74,13 @@ abstract class AbstractClubsModel
$obj = new $className();
$obj->loadData($row);
$obj->loadCustomData($row);
return $obj;
}
protected function loadCustomData($assoc)
{}
public function save()
{
if($this->id === 'new')
@@ -146,16 +150,15 @@ abstract class AbstractClubsModel
$dbo->execute();
}
protected function prepareDelete(){}
protected function prepareDelete($dbo){}
public function delete()
{
if($this->id === 'new')
return;
$this->prepareDelete();
$dbo = Factory::getDbo();
$this->prepareDelete($dbo);
$q = $dbo->getQuery(true);
$q->delete($this->getTableName())