Jamm\Memory\RedisObject::__construct PHP Метод

__construct() публичный Метод

public __construct ( $ID = '', Jamm\Memory\IRedisServer $RedisServer = NULL )
$RedisServer Jamm\Memory\IRedisServer
    public function __construct($ID = '', IRedisServer $RedisServer = NULL)
    {
        if (!empty($RedisServer)) {
            $this->redis = $RedisServer;
        } else {
            $this->setDefaultRedisServer();
        }
        $this->set_ID($ID);
    }

Usage Example

Пример #1
0
 /**
  * Constructor.
  *
  * @param string                    $host
  * @param \Jamm\Memory\IRedisServer $port
  *
  */
 public function __construct($host, $port)
 {
     $redisServer = new RedisServer($host, $port);
     parent::__construct('webiny', $redisServer);
 }