123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?php
- namespace Cube\Application\Resource;
- abstract class AbstractResource implements ResourceInterface
- {
-
- protected $_options = array();
-
- public function getOptions()
- {
- return $this->_options;
- }
-
- public function setOptions(array $options)
- {
- if (is_array($this->_options)) {
- $this->_options = array_merge($this->_options, $options);
- }
- else {
- $this->_options = $options;
- }
- return $this;
- }
-
- public function getOption($key)
- {
- if (isset($this->_options[$key])) {
- return $this->_options[$key];
- }
- return null;
- }
-
- public function setOption($key, $value = null)
- {
- if ($value === null && isset($this->_options[$key])) {
- unset($this->_options[$key]);
- }
- else {
- $this->_options[$key] = $value;
- }
- return $this;
- }
- }
|