CommunicationException.php 801 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /*
  3. * This file is part of the Predis package.
  4. *
  5. * (c) Daniele Alessandri <suppakilla@gmail.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Predis;
  11. use Predis\Network\IConnectionSingle;
  12. abstract class CommunicationException extends PredisException
  13. {
  14. private $_connection;
  15. public function __construct(IConnectionSingle $connection, $message = null, $code = null, \Exception $innerException = null)
  16. {
  17. parent::__construct($message, $code, $innerException);
  18. $this->_connection = $connection;
  19. }
  20. public function getConnection()
  21. {
  22. return $this->_connection;
  23. }
  24. public function shouldResetConnection()
  25. {
  26. return true;
  27. }
  28. }