Пример #1
0
 /**
  * @param string $type
  * @param array $options
  * @return $this
  */
 protected function addAction($type, array $options = [])
 {
     $action = $this->actionFactory->get($type, $options);
     $suffix = $action->getOptions()['route_suffix'];
     $key = empty($suffix) ? $action->getName() : $suffix;
     $this->actions->set($key, $action);
     return $this;
 }
Пример #2
0
 /**
  * @param string $type
  * @param array $options
  * @return ActionsProvider
  */
 protected function addAction(string $type, array $options = []) : self
 {
     $action = $this->actionFactory->get($type, $options);
     $suffix = $action->getOptions()['route_suffix'];
     $key = empty($suffix) ? str_replace('Action', '', substr($type, strrpos($type, '\\') + 1)) : $suffix;
     $this->actions->set(strtolower($key), $action);
     return $this;
 }
Пример #3
0
 public function testGetObjectAction()
 {
     $factory = new ActionFactory(new ActionPool());
     $this->assertInstanceOf('Vardius\\Bundle\\CrudBundle\\Actions\\Action', $factory->get(new ShowAction()));
 }