Esempio n. 1
0
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }
Esempio n. 2
0
 /**
  * Check to see if this user is linked to a given domain (does not check for super - see below)
  *
  * This function is slightly misnamed as it does not check if your are a super admin (`isSuper()`)
  * but rather whether you are linked to a domain or not. So a use case in practice would be:
  *
  *     if( $admin->isSuper() || $admin->canManageDomain( $domain ) ) ...;
  *
  *
  * @param \Entities\Domain $domain The domain object
  * @return boolean
  */
 public function canManageDomain($domain)
 {
     foreach ($this->getDomains() as $d) {
         if ($domain->getId() == $d->getId()) {
             return true;
         }
     }
     return false;
 }