Added support for optional columns in db
This commit is contained in:
@@ -117,6 +117,9 @@ abstract class AbstractCommonClubsModel
|
||||
if($v['type'] !== 'ref')
|
||||
continue;
|
||||
|
||||
if(is_null($vals[$k]))
|
||||
continue;
|
||||
|
||||
$vals[$k] = $vals[$k]->getId();
|
||||
}
|
||||
|
||||
@@ -133,6 +136,9 @@ abstract class AbstractCommonClubsModel
|
||||
if(empty($v['ref']))
|
||||
throw new Exception('External reference of unknown class found.');
|
||||
|
||||
if(empty($vals[$k]))
|
||||
continue;
|
||||
|
||||
$vals[$k] = $this->loadExternalReferenceAsObject($v['ref'], $vals[$k]);
|
||||
}
|
||||
|
||||
@@ -304,6 +310,7 @@ abstract class AbstractCommonClubsModel
|
||||
$q->where("id = {$this->id}");
|
||||
}
|
||||
|
||||
// FIXME Add additional filter to remove associations of the object
|
||||
public function delete()
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
Reference in New Issue
Block a user