Exemple #1
0
 protected function getEntityList()
 {
     $representer = $this->registry->getEntityRepresenter($this->entityClass);
     $listActionLink = $representer->getListAction();
     if (!$listActionLink) {
         throw new \Exception("Cannot select [{$this->entityClass}]: " . "The EntityRepresenter did not provide a ListAction.");
     }
     $actionRepresenter = $this->registry->getActionRepresenter($listActionLink->getClass());
     return $actionRepresenter->execute($actionRepresenter->create($listActionLink->getArguments()));
 }
 function testRegisterMethodAction()
 {
     $someAction = $this->registrar->addMethodAction('SomeActionHandler', 'someAction');
     $otherAction = $this->registrar->addMethodAction('SomeActionHandler', 'otherAction');
     $this->assertSame($someAction, $this->registry->getActionRepresenter($someAction->getClass()));
     $actions = $this->registrar->getRepresenter()->getActions(new \DateTime());
     $this->assertCount(2, $actions);
     $this->assertEquals($someAction->getClass(), $actions[0]->getClass());
     $this->assertEquals($otherAction->getClass(), $actions[1]->getClass());
 }
Exemple #3
0
 protected function urlOfAction(ActionLink $followUpAction)
 {
     $representer = $this->registry->getActionRepresenter($followUpAction->getClass());
     return $representer->getResourceUrl()->withParameter('action', $followUpAction->getClass())->withParameter('args', $followUpAction->getArguments());
 }