Beispiel #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);
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  *
  * @param  null|array                   $options
  * @throws \Phalcon\Mvc\Model\Exception
  */
 public function __construct($options = null)
 {
     if (is_array($options)) {
         if (!isset($options['host'])) {
             throw new Exception('No host given in options');
         }
         if (!isset($options['port'])) {
             $options['port'] = self::$defaultPort;
         }
         if (!isset($options['persistent'])) {
             $options['persistent'] = self::$defaultPersistent;
         }
     } else {
         throw new Exception('No configuration given');
     }
     parent::__construct($options);
 }