From f25b22dc608939d7c08b11f1b8e0096f299cc83e Mon Sep 17 00:00:00 2001 From: Mark Friedrich Date: Thu, 6 Sep 2018 20:23:25 +0200 Subject: [PATCH] - improved signature "updated" timestamp used in combination with the signature reader, closed #436 --- app/main/model/systemsignaturemodel.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/main/model/systemsignaturemodel.php b/app/main/model/systemsignaturemodel.php index 0482c746..323d49d3 100644 --- a/app/main/model/systemsignaturemodel.php +++ b/app/main/model/systemsignaturemodel.php @@ -241,6 +241,22 @@ class SystemSignatureModel extends AbstractMapTrackingModel { $self->logActivity('signatureCreate'); } + /** + * Event "Hook" function + * can be overwritten + * return false will stop any further action + * @param self $self + * @param $pkeys + * @return bool + */ + public function beforeUpdateEvent($self, $pkeys){ + // "updated" column should always be updated if no changes made this signature + // -> makes it easier to see what signatures have not been updated + $this->touch('updated'); + + return parent::beforeUpdateEvent($self, $pkeys); + } + /** * Event "Hook" function * return false will stop any further action @@ -278,6 +294,7 @@ class SystemSignatureModel extends AbstractMapTrackingModel { * @param null $table * @param null $fields * @return bool + * @throws \Exception */ public static function setup($db=null, $table=null, $fields=null){ $status = parent::setup($db,$table,$fields);