Fix missing notifications:

- Add namecache in enotify
- Add "unset()" in notify repository for additional field "abort"
- Add possibility for additional, non-saved fields in model
This commit is contained in:
nupplaPhil 2020-01-28 01:02:53 +01:00
parent 977248f510
commit 443e106105
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
4 changed files with 44 additions and 2 deletions

View file

@ -48,9 +48,23 @@ abstract class BaseModel
$this->originalData = $data;
}
/**
* Maps a data array (original/current) to a known field list of the chosen model
*
* This is useful to filter out additional attributes, which aren't part of the db-table (like readonly cached fields)
*
* @param array $data The data array to map to db-fields
*
* @return array the mapped data array
*/
protected function mapFields(array $data)
{
return $data;
}
public function getOriginalData()
{
return $this->originalData;
return $this->mapFields($this->originalData);
}
public function resetOriginalData()
@ -117,7 +131,7 @@ abstract class BaseModel
public function toArray()
{
return $this->data;
return $this->mapFields($this->data);
}
protected function checkValid()