Author: Nikita Vershinin (endeveit@gmail.com)
Author: Ilya Gusev (mail@igusev.ru)
Inheritance: extends Phalcon\Mvc\Model\MetaData, implements Phalcon\Mvc\Model\MetaDataInterface
示例#1
0
 /**
  * {@inheritdoc}
  *
  * @param  null|array                   $options
  * @throws \Phalcon\Mvc\Model\Exception
  */
 public function __construct($options = null)
 {
     if (is_array($options)) {
         if (!isset($options['redis'])) {
             throw new Exception('Parameter "redis" is required');
         }
     } else {
         throw new Exception('No configuration given');
     }
     parent::__construct($options);
 }
示例#2
0
 /**
  * {@inheritdoc}
  *
  * @param null|array $options options array
  *
  * @throws \Phalcon\Mvc\Model\Exception
  */
 public function __construct($options = null)
 {
     if (!is_array($options)) {
         throw new Exception('No configuration given');
     }
     if (!isset($options['host'])) {
         throw new Exception('No host given in options');
     }
     if (!isset($options['port'])) {
         $options['port'] = self::$defaultPort;
     }
     if (!isset($options['weight'])) {
         $options['weight'] = self::$defaultWeight;
     }
     parent::__construct($options);
 }
示例#3
0
 /**
  * {@inheritdoc}
  *
  * @param  string $key
  * @return string
  */
 protected function prepareKey($key)
 {
     return str_replace('\\', ':', parent::prepareKey($key));
 }
示例#4
0
 /**
  * Returns the sessionId with prefix
  *
  * @param  string $id
  * @return string
  */
 protected function getId($id)
 {
     return str_replace('\\', ':', parent::getId($id));
 }