Updated abstract controller to allow common CRUD operations, errors not yet testet
This commit is contained in:
@@ -96,7 +96,7 @@ abstract class AbstractCommonClubsModelFactory
|
||||
*
|
||||
* @param string $condition
|
||||
* @param string|array $sorting
|
||||
* @return array
|
||||
* @return AbstractCommonClubsModel[]
|
||||
*/
|
||||
public function loadElements($condition = null, $sorting = null, $callback = null)
|
||||
{
|
||||
@@ -138,8 +138,8 @@ abstract class AbstractCommonClubsModelFactory
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $id
|
||||
* @return AbstractCommonClubsModel
|
||||
*/
|
||||
public function loadById($id) {
|
||||
$arr = $this->loadElements("main.id = " . ((int)$id) );
|
||||
@@ -159,6 +159,10 @@ abstract class AbstractCommonClubsModelFactory
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $row
|
||||
* @return AbstractCommonClubsModel
|
||||
*/
|
||||
protected function generateObject($row)
|
||||
{
|
||||
$obj = $this->generatePlainObject($row['id']);
|
||||
@@ -173,6 +177,9 @@ abstract class AbstractCommonClubsModelFactory
|
||||
return $obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AbstractCommonClubsModel
|
||||
*/
|
||||
public function createNew()
|
||||
{
|
||||
$obj = $this->generatePlainObject('new');
|
||||
|
||||
Reference in New Issue
Block a user