Skip to content

Instantly share code, notes, and snippets.

@vivekragunathan
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save vivekragunathan/382d73fcdec196ed7069 to your computer and use it in GitHub Desktop.

Select an option

Save vivekragunathan/382d73fcdec196ed7069 to your computer and use it in GitHub Desktop.
PHP PropertyBag Excerpt
<?
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