Example #1
0
 /**
  * getter checks TTL of data and retrieves it from data storage
  * We try to find user-specific key in DataProvider, if none - try to find key for default user in DataProvider,
  * if none - try to read protected properties, if none - throw exception
  * @param string $key key of data to retrieve (key does not contain userPwd prefix)
  * @return mixed value of a key or null
  */
 public function __get($key)
 {
     if ($this->getRedis()->exists($key)) {
     }
     $redisDataProvider = new RedisDataProvider($this);
     $existsMapper = new RedisExistsMapper($key);
     $val = $redisDataProvider->exists($existsMapper);
     if (1 !== intval($val)) {
         $res = null;
     } else {
         $getMapper = new RedisGetMapper($key);
         $res = $redisDataProvider->get($getMapper);
     }
     return $res;
 }