/**
  * @param string $entityId
  */
 public function __construct($entityId)
 {
     Assert::notEmpty($entityId);
     Assert::string($entityId);
     Assert::notBlank($entityId);
     $this->entityId = $entityId;
 }
 public function findAllFor($userId)
 {
     Assert::string($userId, 'User ID "%s" expected to be string, type %s given.');
     Assert::notEmpty($userId, 'User ID "%s" is empty, but non empty value was expected.');
     $consentListJson = $this->apiClient->read('consent/%s', [$userId]);
     return ConsentListFactory::createListFromMetadata($consentListJson);
 }
 /**
  * @param string $nameId
  * @param AttributeSet $attributes
  * @param EntityId[] $authenticatingAuthorities
  */
 private function __construct($nameId, AttributeSet $attributes, array $authenticatingAuthorities)
 {
     Assert::string($nameId);
     Assert::allIsInstanceOf($authenticatingAuthorities, '\\OpenConext\\Profile\\Value\\EntityId');
     $this->nameId = $nameId;
     $this->attributes = $attributes;
     $this->authenticatingAuthorities = $authenticatingAuthorities;
 }
 /**
  * @param string $locale
  * @return string
  */
 public function getLocaleAwareEntityName($locale)
 {
     Assert::string($locale);
     if ($this->displayName->hasFilledTranslationForLocale($locale)) {
         return $this->displayName->getTranslation($locale);
     }
     return $this->entity->getEntityId()->getEntityId();
 }
 /**
  * @param string $locale
  * @return bool
  */
 public function hasFilledTranslationForLocale($locale)
 {
     Assert::string($locale, 'Locale must be string', 'locale');
     return array_key_exists($locale, $this->translations) && trim($this->translations[$locale]) !== '';
 }
 /**
  * @param string $returnUrl
  * @return \Symfony\Component\Form\FormView
  */
 public function getLocalePreferenceForm($returnUrl)
 {
     Assert::string($returnUrl);
     $form = $this->formFactory->create('profile_switch_locale', null, ['return_url' => $returnUrl]);
     return $form->createView();
 }
示例#7
0
 /**
  * @param string $locale
  */
 public function __construct($locale)
 {
     Assert::string($locale);
     Assert::notEmpty($locale);
     $this->locale = $locale;
 }
 /**
  * @param string $value
  */
 public function setValue($value)
 {
     Assert::string($value);
     $this->cookieValue = $value;
 }
 /**
  * @param string $emailAddress
  */
 public function __construct($emailAddress)
 {
     Assert::string($emailAddress, 'E-mail address "%s" must be a string');
     Assert::email($emailAddress);
     $this->emailAddress = $emailAddress;
 }
 /**
  * @param string $contactType
  */
 public function __construct($contactType)
 {
     Assert::string($contactType);
     Assert::choice($contactType, [self::TYPE_TECHNICAL, self::TYPE_SUPPORT, self::TYPE_ADMINISTRATIVE, self::TYPE_BILLING, self::TYPE_OTHER], '"%s" is not one of the valid ContactTypes: %s');
     $this->contactType = $contactType;
 }