public function addDefaultAdditionalActions()
 {
     $actions = array(array('edit', 'fa-pencil', 'edit', 'admin_user_action'), array('show_workspaces', 'fa-book', 'show_workspaces', 'admin_user_action'));
     foreach ($actions as $action) {
         if (count($this->repo->findBy(array('action' => $action[0], 'type' => $action[3]))) === 0) {
             $this->log("Adding action {$action[0]} {$action[3]}...");
             $aa = new AdditionalAction();
             $aa->setAction($action[0]);
             $aa->setClass($action[1]);
             $aa->setDisplayedName($action[2]);
             $aa->setType($action[3]);
             $this->om->persist($aa);
         }
     }
     $this->om->flush();
 }
Exemplo n.º 2
0
 private function createAdditonalAction(array $action, PluginBundle $pluginBundle)
 {
     $aa = new AdditionalAction();
     $aa->setClass($action['class']);
     $aa->setAction($action['action']);
     $aa->setDisplayedName($action['displayed_name']);
     $aa->setType($action['type']);
     $this->em->flush();
 }