コード例 #1
0
 /**
  *
  * @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;
 }
コード例 #2
0
 public function __construct()
 {
     parent::__construct('_LanguageFunctor');
     if (is_null(self::$_data)) {
         $this->read();
         self::$_data = $this->getArrayCopy();
     } else {
         $this->exchangeArray(self::$_data);
     }
 }
コード例 #3
0
 /**
  * @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');
     $model->exchangeArray(array());
     foreach ($data as $itemKey => $item) {
         if ($model->hasGenerator()) {
             $object = $model->generate($item);
             $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;
         }
     }
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct('\\Api\\Model\\Languageforge\\Lexicon\\_createLexiconField');
 }