Пример #1
0
 private function addKey($em, $user, $label)
 {
     if (empty($label)) {
         return;
     }
     $key = new ApiKey();
     $key->setId();
     $key->setLabel($label);
     $key->setOwner($user);
     $id = $key->getId();
     $credential = $key->setCredential();
     $em->persist($key);
     $this->messenger()->addSuccess('Key created.');
     $this->messenger()->addSuccess("ID: {$id}, Credential: {$credential}");
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function setCredential()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCredential', array());
     return parent::setCredential();
 }