[AUTOGENERATED][Poll] Add auto generated code for poll entity and new route

This commit is contained in:
Daniel
2020-10-29 18:32:35 +00:00
committed by Hugo Sales
parent b860c6bbb0
commit a9c35def3f
4 changed files with 109 additions and 19 deletions

View File

@@ -22,6 +22,9 @@ namespace Plugin\PollPlugin;
use App\Core\Event;
use App\Core\Module;
use Plugin\PollPlugin\Entity\Poll;
const ID_FMT = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
class PollPlugin extends Module
{
@@ -61,16 +64,8 @@ class PollPlugin extends Module
public function onAddRoute($r)
{
$r->connect('newpoll', 'main/poll/new', [Controller\NewPoll::class, 'newpoll']);
$r->connect('showpoll', 'main/poll/{id<' . ID_FMT . '>}' , [Controller\ShowPoll::class, 'showpoll']);
return Event::next;
}
/*
public function onCheckSchema()
{
$schema = Schema::get();
$schema->ensureTable('poll', Poll::schemaDef());
return Event::next;
}
*/
}