X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModel.php;h=2c952888b2e54edb766856756e7124252d70ced7;hb=d4e836855bffb49c23f2d59f55b892080fc39559;hp=791d6887c1702d088308bed27a4870b9c1766e0b;hpb=443e106105b7d4ff9b97d21491a3d0eb89aa9dfe;p=friendica.git diff --git a/src/BaseModel.php b/src/BaseModel.php index 791d6887c1..2c952888b2 100644 --- a/src/BaseModel.php +++ b/src/BaseModel.php @@ -12,7 +12,7 @@ use Psr\Log\LoggerInterface; * * @property int id */ -abstract class BaseModel +abstract class BaseModel extends BaseEntity { /** @var Database */ protected $dba; @@ -48,23 +48,9 @@ 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->mapFields($this->originalData); + return $this->originalData; } public function resetOriginalData() @@ -131,7 +117,7 @@ abstract class BaseModel public function toArray() { - return $this->mapFields($this->data); + return $this->data; } protected function checkValid()