private function smartIncludeMenuItems($main, $config) { foreach ($this->aujaConfigurator->getModels() as $model) { if ($this->aujaConfigurator->shouldSmartIncludeInMain($model, $config)) { $item = new Item(); $item->setTitle($model->getName()); $item->setIcon($this->aujaConfigurator->getIcon($model, $config)); $item->setTarget(Url::route($this->aujaRouter->getMenuName($model->getName()))); $main->addItem($item); } } }
/** * @Then /^I should get a configuration with the following models:$/ */ public function iShouldGetAConfigurationWithTheFollowingModels(TableNode $table) { if (sizeof($table->getHash()) != sizeof($this->aujaConfigurator->getModels())) { throw new Exception('Invalid model count'); } foreach ($table->getHash() as $modelHash) { $name = $modelHash['name']; $model = $this->aujaConfigurator->getModel($name); if (is_null($model)) { throw new Exception(sprintf('Returned model for %s is null', $name)); } } }
/** * @return Model[] the array of Model instances. */ public function getModels() { return $this->aujaConfigurator->getModels(); }