Last active
August 29, 2015 14:22
-
-
Save vivekragunathan/382d73fcdec196ed7069 to your computer and use it in GitHub Desktop.
PHP PropertyBag Excerpt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| abstract class PropertyBag implements ArrayAccess { | |
| protected $_store = null; | |
| protected $_readOnly = false; | |
| protected function __construct(&$source, $readOnly = false); | |
| public static function fromArray(array &$source, $readOnly = false); | |
| public static function fromObject($source, $readOnly = false); | |
| public function isReadOnly(); | |
| public function __get($name); | |
| public function __set($name, $value); | |
| } | |
| class ArrayBasedPropertyBag extends PropertyBag { | |
| public function __construct(array &$source = null, $readOnly = false); | |
| #region ArrayAccess Interface Implementation | |
| ... | |
| #endregion | |
| } | |
| class ObjectBasedPropertyBag extends PropertyBag { | |
| public function __construct(&$source = null, $readOnly = false); | |
| #region ArrayAccess Interface Implementation | |
| ... | |
| #endregion | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment