Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Filter / Compress / AbstractCompressionAlgorithm.php
blob079d083d0a988247da7a48946936a2d8ff231d2f
1 <?php
2 /**
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
8 */
10 namespace Zend\Filter\Compress;
12 use Traversable;
13 use Zend\Stdlib\ArrayUtils;
15 /**
16 * Abstract compression adapter
18 abstract class AbstractCompressionAlgorithm implements CompressionAlgorithmInterface
20 /**
21 * @var array
23 protected $options = array();
25 /**
26 * Class constructor
28 * @param null|array|Traversable $options (Optional) Options to set
30 public function __construct($options = null)
32 if ($options instanceof Traversable) {
33 $options = ArrayUtils::iteratorToArray($options);
36 if (is_array($options)) {
37 $this->setOptions($options);
41 /**
42 * Returns one or all set options
44 * @param string $option (Optional) Option to return
45 * @return mixed
47 public function getOptions($option = null)
49 if ($option === null) {
50 return $this->options;
53 if (!array_key_exists($option, $this->options)) {
54 return null;
57 return $this->options[$option];
60 /**
61 * Sets all or one option
63 * @param array $options
64 * @return self
66 public function setOptions(array $options)
68 foreach ($options as $key => $option) {
69 $method = 'set' . $key;
70 if (method_exists($this, $method)) {
71 $this->$method($option);
75 return $this;