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 )); } + + + } 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); } }