private function setUpCustomVars() { foreach (Model::getScopes() as $scope) { $model = new Model($scope); $model->addCustomVariable(); $model->addCustomVariable(); $model->addCustomVariable(); } }
public static function install() { foreach (self::getScopes() as $scope) { $model = new Model($scope); try { $maxCustomVars = 5; $customVarsToAdd = $maxCustomVars - $model->getCurrentNumCustomVars(); for ($index = 0; $index < $customVarsToAdd; $index++) { $model->addCustomVariable(); } } catch (\Exception $e) { Log::warning('Failed to add custom variable: ' . $e->getMessage()); } } }
private function addCustomVar($scope) { $this->clearCache(); $model = new Model($scope); $model->addCustomVariable(); }
private function addCustomVariables(Model $model, $numberOfVarsToAdd, OutputInterface $output) { for ($index = 0; $index < $numberOfVarsToAdd; $index++) { $indexAdded = $model->addCustomVariable(); $this->progress->advance(); $output->writeln(' <info>Added a variable in scope "' . $model->getScopeName() . '" having the index ' . $indexAdded . '</info>'); } }