AdapterInterface.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Serializer
  17. * @subpackage Adapter
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @category Zend
  24. * @package Zend_Serializer
  25. * @subpackage Adapter
  26. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  27. * @license http://framework.zend.com/license/new-bsd New BSD License
  28. */
  29. interface Zend_Serializer_Adapter_AdapterInterface
  30. {
  31. /**
  32. * Constructor
  33. *
  34. * @param array|Zend_Config $opts Serializer options
  35. * @return void
  36. */
  37. public function __construct($opts = array());
  38. /**
  39. * Set serializer options
  40. *
  41. * @param array|Zend_Config $opts Serializer options
  42. * @return Zend_Serializer_Adapter_AdapterInterface
  43. */
  44. public function setOptions($opts);
  45. /**
  46. * Set a serializer option
  47. *
  48. * @param string $name Option name
  49. * @param mixed $value Option value
  50. * @return Zend_Serializer_Adapter_AdapterInterface
  51. */
  52. public function setOption($name, $value);
  53. /**
  54. * Get serializer options
  55. *
  56. * @return array
  57. */
  58. public function getOptions();
  59. /**
  60. * Get a serializer option
  61. *
  62. * @param string $name
  63. * @return mixed
  64. * @throws Zend_Serializer_Exception
  65. */
  66. public function getOption($name);
  67. /**
  68. * Generates a storable representation of a value.
  69. *
  70. * @param mixed $value Data to serialize
  71. * @param array $options Serialize options
  72. * @return string
  73. * @throws Zend_Serializer_Exception
  74. */
  75. public function serialize($value, array $options = array());
  76. /**
  77. * Creates a PHP value from a stored representation.
  78. *
  79. * @param string $serialized Serialized string
  80. * @param array $options Unserialize options
  81. * @return mixed
  82. * @throws Zend_Serializer_Exception
  83. */
  84. public function unserialize($serialized, array $options = array());
  85. }