/**
  * @Route("/insert", name="project_links_insert")
  */
 public function insertAction(Request $request)
 {
     $entity = new Link();
     $entity->setProject($this->getActiveProject());
     $action = new InsertAction($this->crudInfo, $entity, LinkForm::class, ['type' => LinkForm::PROJECT_SPECIFIC]);
     $action->slug($this->getSlug());
     return $action->run($this, $request);
 }
Example #2
0
 private function createChoices($type)
 {
     if ($type == self::PROJECT_SPECIFIC) {
         return [Link::PRESENT_PROJECT => Link::presentedToText(Link::PRESENT_PROJECT), Link::PRESENT_GROUP => Link::presentedToText(Link::PRESENT_GROUP), Link::PRESENT_AREA => Link::presentedToText(Link::PRESENT_AREA)];
     } else {
         return [Link::PRESENT_ADMIN => Link::presentedToText(Link::PRESENT_ADMIN), Link::PRESENT_USER => Link::presentedToText(Link::PRESENT_USER)];
     }
 }
Example #3
0
 public function remove(Link $item)
 {
     $this->transaction->requestTransaction();
     try {
         return $item->remove($this->conn);
     } catch (Exception $ex) {
         $this->transaction->requestRollback();
         throw $ex;
     }
 }