From 018f0d9e319094679a80f6d1774e95021d309520 Mon Sep 17 00:00:00 2001 From: Sam Mousa Date: Tue, 3 Sep 2013 14:41:22 +0200 Subject: [PATCH] Dev Increased separation by making Dynamic::tableName private. --- application/models/Dynamic.php | 2 +- application/models/Token.php | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/application/models/Dynamic.php b/application/models/Dynamic.php index ceb47d5d480..da22185a7e2 100644 --- a/application/models/Dynamic.php +++ b/application/models/Dynamic.php @@ -9,7 +9,7 @@ class Dynamic extends CActiveRecord private $_md; // meta data - protected $tableName; + private $tableName; /** * @param string $scenario diff --git a/application/models/Token.php b/application/models/Token.php index 558095cea82..fd0b2014d38 100644 --- a/application/models/Token.php +++ b/application/models/Token.php @@ -6,6 +6,15 @@ public function __construct($scenario = 'insert', $surveyId = null) { parent::__construct($scenario, $surveyId); } + + /** + * The model factory. Standard argument $className is not used but I kept + * it to keep it compatible with the normal signature. + * @param type $className + * @param int $surveyId SurveyId must be passed otherwise an exception will be thrown. + * @return type + * @throws Exception + */ public static function model($className = null, $surveyId = null) { if (!is_numeric($surveyId)) @@ -41,7 +50,8 @@ public function summary() } public function tableName() { - return "{{tokens_{$this->tableName}}}"; + $tableName = parent::tableName(); + return "{{tokens_{$tableName}}}"; } }