Skip to content

Commit

Permalink
Merge pull request #11 from reuhtte/master
Browse files Browse the repository at this point in the history
i18n "audittrail" category configuration fixed.
  • Loading branch information
Sammaye committed Apr 13, 2015
2 parents 7a0435d + d0f9263 commit 222f84a
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions AuditTrail.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
class AuditTrail extends ActiveRecord
{
private $_message_category = 'audittrail';

/**
* @return string the associated database table name
*/
Expand All @@ -31,17 +33,27 @@ public static function tableName()
}
}

/**
* @return \yii\db\Connection the database connection used by this AR class.
*/
public static function getDb() {
if (isset(Yii::$app->params['audittrail.db'])) {
return Yii::$app->get(Yii::$app->params['audittrail.db']);
} else {
return parent::getDb();
}
// return Yii::$app->get('dbUser');
/**
* @return \yii\db\Connection the database connection used by this AR class.
*/
public static function getDb()
{
if (isset(Yii::$app->params['audittrail.db'])) {
return Yii::$app->get(Yii::$app->params['audittrail.db']);
} else {
return parent::getDb();
}
// return Yii::$app->get('dbUser');
}

public function init()
{
parent::init();

\Yii::$app->i18n->translations[$this->_message_category] = [
'class' => 'yii\i18n\PhpMessageSource',
];
}

/**
* @return array customized attribute labels (name=>label)
Expand Down

0 comments on commit 222f84a

Please sign in to comment.