Made user controller working mostly. Not everything is tested but seems good

This commit is contained in:
2019-06-05 16:02:36 +02:00
parent 16e7ed0bc0
commit fc85e6b322
8 changed files with 170 additions and 51 deletions

View File

@@ -141,10 +141,16 @@ abstract class AbstractCommonClubsModelFactory
* @param int $id
* @return AbstractCommonClubsModel
*/
public function loadById($id) {
public function loadById($id, $throwErr = true)
{
$arr = $this->loadElements("main.id = " . ((int)$id) );
if(sizeof($arr) == 0)
throw new ElementNotFoundException();
{
if($throwErr)
throw new ElementNotFoundException();
else
return null;
}
return $arr[0];
}