Skip to content

Commit

Permalink
Dev Increased separation by making Dynamic::tableName private.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Sep 3, 2013
1 parent 253f5be commit 018f0d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/models/Dynamic.php
Expand Up @@ -9,7 +9,7 @@ class Dynamic extends CActiveRecord

private $_md; // meta data

protected $tableName;
private $tableName;

/**
* @param string $scenario
Expand Down
12 changes: 11 additions & 1 deletion application/models/Token.php
Expand Up @@ -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))
Expand Down Expand Up @@ -41,7 +50,8 @@ public function summary()
}

public function tableName() {
return "{{tokens_{$this->tableName}}}";
$tableName = parent::tableName();
return "{{tokens_{$tableName}}}";
}

}
Expand Down

0 comments on commit 018f0d9

Please sign in to comment.