Skip to content

Commit

Permalink
CodeFile constructor fixed to call the parent one.
Browse files Browse the repository at this point in the history
  • Loading branch information
klimov-paul committed Sep 5, 2016
1 parent 09243fe commit d31f016
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CodeFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ class CodeFile extends Object
* Constructor.
* @param string $path the file path that the new code should be saved to.
* @param string $content the newly generated code content.
* @param array $config name-value pairs that will be used to initialize the object properties
*/
public function __construct($path, $content)
public function __construct($path, $content, $config = [])
{
parent::__construct($config);

$this->path = strtr($path, '/\\', DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR);
$this->content = $content;
$this->id = md5($this->path);
Expand Down
3 changes: 3 additions & 0 deletions TypeAheadAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use yii\web\AssetBundle;

/**
* This declares the asset files for jQuery 'typeahead' plugin.
*
* @see http://twitter.github.io/typeahead.js/
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
Expand Down
2 changes: 2 additions & 0 deletions generators/model/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,11 @@ protected function checkJunctionTable($table)
protected function generateRelationName($relations, $table, $key, $multiple)
{
static $baseModel;
/* @var $baseModel \yii\db\ActiveRecord */
if ($baseModel === null) {
$baseClass = $this->baseClass;
$baseModel = new $baseClass();
$baseModel->setAttributes([]);
}
if (!empty($key) && strcasecmp($key, 'id')) {
if (substr_compare($key, 'id', -2, 2, true) === 0) {
Expand Down

0 comments on commit d31f016

Please sign in to comment.