/**
  *
  * @param  MapOf      $roleMap
  * @param  int        $right
  * @throws \Exception
  * @return bool
  */
 public static function hasRight($roleMap, $right)
 {
     global $WEBSITE;
     if ($roleMap->offsetExists($WEBSITE->domain)) {
         return self::_hasRight(self::$_rights, $roleMap[$WEBSITE->domain], $right);
     }
     return false;
 }
 public function __construct()
 {
     parent::__construct('_LanguageFunctor');
     if (is_null(self::$_data)) {
         $this->read();
         self::$_data = $this->getArrayCopy();
     } else {
         $this->exchangeArray(self::$_data);
     }
 }
 /**
  * @param string $key
  * @param MapOf $model
  * @param array $data
  * @throws \Exception
  */
 public function decodeMapOf($key, $model, $data)
 {
     if (is_null($data) || !is_array($data) && get_class($data) == 'stdClass') {
         $data = array();
     }
     CodeGuard::checkTypeAndThrow($data, 'array');
     $propertiesToKeep = array();
     // check if array item class has any private, read-only or recursive properties
     if (get_class($this) != 'Api\\Model\\Shared\\Mapper\\MongoDecoder' && $model->hasGenerator()) {
         foreach ($data as $itemKey => $item) {
             $mapItem = $model->generate($item);
             $propertiesToKeep = $this->getPrivateAndReadOnlyProperties($mapItem, $propertiesToKeep);
             $propertiesToKeep = $this->getRecursiveProperties($mapItem, $propertiesToKeep);
         }
     }
     $oldModelArray = $model->exchangeArray(array());
     foreach ($data as $itemKey => $item) {
         if ($model->hasGenerator()) {
             $object = $model->generate($item);
             // put back private, read-only and recursive properties into new object that was just generated
             foreach ($propertiesToKeep as $property) {
                 if (array_key_exists($itemKey, $oldModelArray) && property_exists($oldModelArray[$itemKey], $property)) {
                     $object->{$property} = $oldModelArray[$itemKey]->{$property};
                 }
             }
             $this->_decode($object, $item, $itemKey);
             $model[$itemKey] = $object;
         } else {
             if (is_array($item)) {
                 throw new \Exception("Must not decode array for value type '{$key}'");
             }
             $model[$itemKey] = $item;
         }
     }
 }
 public function __construct()
 {
     parent::__construct('Api\\Model\\Languageforge\\Lexicon\\generateLexValue');
 }