-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix db getter of fixture command closes #33
- Loading branch information
Showing
3 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ | |
/** | ||
* Generate Fixtures. | ||
* | ||
* @property Connection $db The db component. | ||
* | ||
* @since 1.0.25 | ||
* @author Basil Suter <[email protected]> | ||
*/ | ||
|
@@ -48,13 +50,27 @@ class GenerateFixtureController extends Command | |
*/ | ||
public $data; | ||
|
||
private $_db = 'db'; | ||
|
||
|
||
/** | ||
* {@inheritDoc} | ||
* DB Component Setter | ||
* | ||
* @param string $db | ||
*/ | ||
public function setDb($db) | ||
{ | ||
$this->_db = $db; | ||
} | ||
|
||
/** | ||
* DB Component Getter | ||
* | ||
* @return Connection | ||
*/ | ||
public function init() | ||
public function getDb() | ||
{ | ||
parent::init(); | ||
$this->db = Instance::ensure($this->db, Connection::class); | ||
return Instance::ensure($this->_db, Connection::class); | ||
} | ||
|
||
/** | ||
|