yii\console\controllers\FixtureController::actionUnload PHP Метод

actionUnload() публичный Метод

For example, # unload the fixture data specified by User and UserProfile. yii fixture/unload "User, UserProfile" # unload all fixtures found under 'tests\unit\fixtures' yii fixture/unload "*" # unload all fixtures except User and UserProfile yii fixture/unload "*, -User, -UserProfile"
public actionUnload ( array $fixturesInput = [] ) : integer
$fixturesInput array
Результат integer return code
    public function actionUnload(array $fixturesInput = [])
    {
        $filtered = $this->filterFixtures($fixturesInput);
        $except = $filtered['except'];
        if (!$this->needToApplyAll($fixturesInput[0])) {
            $fixtures = $filtered['apply'];
            $foundFixtures = $this->findFixtures($fixtures);
            $notFoundFixtures = array_diff($fixtures, $foundFixtures);
            if ($notFoundFixtures) {
                $this->notifyNotFound($notFoundFixtures);
            }
        } else {
            $foundFixtures = $this->findFixtures();
        }
        $fixturesToUnload = array_diff($foundFixtures, $except);
        if (!$foundFixtures) {
            throw new Exception("No files were found for: \"" . implode(', ', $fixturesInput) . "\".\n" . "Check that files exist under fixtures path: \n\"" . $this->getFixturePath() . "\".");
        }
        if (!$fixturesToUnload) {
            $this->notifyNothingToUnload($foundFixtures, $except);
            return static::EXIT_CODE_NORMAL;
        }
        if (!$this->confirmUnload($fixturesToUnload, $except)) {
            return static::EXIT_CODE_NORMAL;
        }
        $fixtures = $this->getFixturesConfig(array_merge($this->globalFixtures, $fixturesToUnload));
        if (!$fixtures) {
            throw new Exception('No fixtures were found in namespace: ' . $this->namespace . '".');
        }
        $this->unloadFixtures($this->createFixtures($fixtures));
        $this->notifyUnloaded($fixtures);
    }