Example #1
0
 function addProjectEventsToJs(Entities\Project $entity)
 {
     $app = App::i();
     $ids = $entity->getChildrenIds();
     $ids[] = $entity->id;
     $in = implode(',', array_map(function ($e) {
         return '@Project:' . $e;
     }, $ids));
     $this->jsObject['entity']['events'] = $app->controller('Event')->apiQuery(['@select' => 'id,name,shortDescription,classificacaoEtaria,singleUrl,occurrences,terms,status,owner.id,owner.name,owner.singleUrl', 'project' => 'IN(' . $in . ')', '@permissions' => 'view', '@files' => '(avatar.avatarSmall):url']);
 }