Added support for optional columns in db

This commit is contained in:
2019-05-22 16:16:26 +02:00
parent 7c18f48b2a
commit d48d7eb853
3 changed files with 10 additions and 1 deletions

View File

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