From c279b14b0bbbf1bc0d24eefe60562ae4330aede6 Mon Sep 17 00:00:00 2001 From: Timo Proescholdt Date: Tue, 25 Nov 2014 18:50:03 +0100 Subject: [PATCH 1/2] adapted method signature to new PHP strict warning --- Model/DatabaseLoggerAppModel.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Model/DatabaseLoggerAppModel.php b/Model/DatabaseLoggerAppModel.php index bafbf45..d5cf408 100644 --- a/Model/DatabaseLoggerAppModel.php +++ b/Model/DatabaseLoggerAppModel.php @@ -51,16 +51,16 @@ public function delete($id = null, $cascade = true) { * - last : find last record by created date * @param array of options */ - function find($type = 'first', $options = array()){ + function find($type = 'first', $options = array(), $order = NULL, $recursive = NULL){ switch($type){ case 'last': $options = array_merge( $options, array('order' => "{$this->alias}.{$this->primaryKey} DESC") ); - return parent::find('first', $options); + return parent::find('first', $options, $order, $recursive); default: - return parent::find($type, $options); + return parent::find($type, $options, $order, $recursive); } } From baee434b390ae5f6eb812bc2b93ce5307001f9cf Mon Sep 17 00:00:00 2001 From: Timo Proescholdt Date: Wed, 4 Nov 2015 19:43:38 +0100 Subject: [PATCH 2/2] DatabaseLog extends Baselog so as to inherit config method. We can now work with scopes --- Lib/Log/Engine/DatabaseLog.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Lib/Log/Engine/DatabaseLog.php b/Lib/Log/Engine/DatabaseLog.php index 5c68021..5489ade 100755 --- a/Lib/Log/Engine/DatabaseLog.php +++ b/Lib/Log/Engine/DatabaseLog.php @@ -15,10 +15,12 @@ )); */ +App::uses('BaseLog', 'Log/Engine'); App::uses('ClassRegistry', 'Utility'); App::uses('CakeLogInterface','Log'); App::uses('Log', 'DatabaseLogger.Model'); -class DatabaseLog implements CakeLogInterface{ + +class DatabaseLog extends BaseLog { /** * Model name placeholder @@ -34,6 +36,7 @@ class DatabaseLog implements CakeLogInterface{ * Contruct the model class */ function __construct($options = array()){ + parent::__construct($options); $this->model = isset($options['model']) ? $options['model'] : 'DatabaseLogger.Log'; $this->Log = ClassRegistry::init($this->model); } @@ -48,4 +51,7 @@ function write($type, $message){ 'message' => $message )); } + + + }