3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Serializer\Adapter
;
12 use Zend\Serializer\Exception
;
14 class PythonPickleOptions
extends AdapterOptions
17 * Pickle protocol version to serialize data
21 protected $protocol = 0;
24 * Set pickle protocol version to serialize data
26 * Supported versions are 0, 1, 2 and 3
28 * @param int $protocol
29 * @return PythonPickleOptions
30 * @throws Exception\InvalidArgumentException
32 public function setProtocol($protocol)
34 $protocol = (int) $protocol;
35 if ($protocol < 0 ||
$protocol > 3) {
36 throw new Exception\
InvalidArgumentException(
37 "Invalid or unknown protocol version '{$protocol}'"
41 $this->protocol
= $protocol;
47 * Get pickle protocol version to serialize data
51 public function getProtocol()
53 return $this->protocol
;