diff --git a/README.md b/README.md index 439e49c..cec746c 100755 --- a/README.md +++ b/README.md @@ -137,13 +137,13 @@ The following example will only assign a `someGroupEvent` to `groups` table seed artisan iseed users,groups --postrun=,someGroupEvent ``` -### indexed -By using --indexed=0 the seed can be generated as a non-indexed array. +### noindex +By using --noindex the seed can be generated as a non-indexed array. The use case for this feature is when you need to merge two seed files. Example: ``` -artisan iseed users --indexed=0 +artisan iseed users --noindex ``` ## Usage diff --git a/src/Orangehill/Iseed/IseedCommand.php b/src/Orangehill/Iseed/IseedCommand.php old mode 100644 new mode 100755 index 21e51c0..2d9e54d --- a/src/Orangehill/Iseed/IseedCommand.php +++ b/src/Orangehill/Iseed/IseedCommand.php @@ -50,7 +50,7 @@ public function fire() $prerunEvents = explode(",", $this->option('prerun')); $postrunEvents = explode(",", $this->option('postrun')); $dumpAuto = intval($this->option('dumpauto')); - $indexed = boolval($this->option('indexed')); + $indexed = !$this->option('noindex'); if ($chunkSize < 1) { $chunkSize = null; @@ -139,7 +139,7 @@ protected function getOptions() array('prerun', null, InputOption::VALUE_OPTIONAL, 'prerun event name', null), array('postrun', null, InputOption::VALUE_OPTIONAL, 'postrun event name', null), array('dumpauto', null, InputOption::VALUE_OPTIONAL, 'run composer dump-autoload', true), - array('indexed', null, InputOption::VALUE_OPTIONAL, 'index items in the seed', true), + array('noindex', null, InputOption::VALUE_NONE, 'no indexing in the seed', null), ); }