Updated abstract controller to allow common CRUD operations, errors not yet testet

This commit is contained in:
2019-06-03 15:29:08 +02:00
parent 319911d52f
commit 1b43ab8356
5 changed files with 70 additions and 125 deletions

View File

@@ -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');