protected $connection = null;
protected $primaryKey = 'id';
+ protected $_operations = [];
public $timestamps = true;
public $clonable = true;
protected $_syncDbSchema = true;
return $this->_baseController;
}
+ protected function _getUse()
+ {
+ $res = '';
+ foreach ($this->_operations as $operation) {
+ $res .= 'use ' . $operation . ';' . "\n";
+ }
+ return $res;
+ }
+
protected function _replaceInCode($stub, $dest)
{
$vars = ['CONTROLLERCLASS' => $this->getControllerClass(),
'EXTENDS' => '\\' . $this->_getBaseController(),
'CLONABLE' => $this->clonable ? 'true' : 'false',
'BULK' => $this->getOption('bulk', true) ? 'true' : 'false',
- 'ONEINSTANCE' => $this->getOption('oneinstance', false) ? 'true' : 'false'];
+ 'ONEINSTANCE' => $this->getOption('oneinstance', false) ? 'true' : 'false',
+ 'USE' => $this->_getUse()];
$res = file_get_contents($stub);
foreach ($vars as $name => $value) {