public function add($type, $key, $settings = null, $pkg = null)
 {
     /**
      * @var $key Key
      */
     $key = parent::add($type, $key, $settings, $pkg);
     $key->setAttributeCategoryEntity($this->getCategoryEntity());
     $this->entityManager->persist($key);
     $this->entityManager->flush();
     return $key;
 }
 public function addFromRequest(Type $type, Request $request)
 {
     $key = parent::addFromRequest($type, $request);
     /*
      * @var ExpressKey
      */
     $key->setEntity($this->expressEntity);
     return $key;
 }