Created
June 15, 2019 08:13
-
-
Save alvaro-canepa/2defa70766a8429c931804fc9f3f5a33 to your computer and use it in GitHub Desktop.
PHP OctoberCMS plugin seeder for PHPStorm file template
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
<?php | |
#if (${NAMESPACE}) namespace ${NAMESPACE}; | |
#end | |
use October\Rain\Database\Updates\Seeder; | |
use Symfony\Component\Console\Helper\ProgressBar; | |
/** | |
* Class ${NAME} | |
* | |
* @package ${NAMESPACE} | |
* @mixin \Illuminate\Database\Seeder | |
* | |
*/ | |
class ${NAME} extends Seeder | |
{ | |
/** | |
* @var \Symfony\Component\Console\Helper\ProgressBar | |
*/ | |
protected ${DS}bar; | |
public function run() | |
{ | |
ProgressBar::setFormatDefinition('custom', ' %current%/%max% [%bar%] %percent:3s%% -- %message%'); | |
${DS}this->bar = new ProgressBar(${DS}this->command->getOutput(), 'REPLACE WITH COUNTER'); | |
${DS}this->bar->setFormat('custom'); | |
${DS}this->bar->setMessage('Starting seed migration'); | |
${DS}this->bar->start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment