Basic model of club created according to abstact model
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user