/**
  * TestRecord constructor.
  * @param $adapter
  * @param $array
  */
 public function __construct(Adapter $adapter)
 {
     // Allow accessing properties as either array keys or object properties:
     parent::__construct(array(), ArrayObject::ARRAY_AS_PROPS);
     // http://stackoverflow.com/questions/14610307/spl-arrayobject-arrayobjectstd-prop-list
     $this->adapter = $adapter;
 }
 /**
  * Constructor
  *
  * Provide a name ('Default' if none provided) and a ManagerInterface instance.
  *
  * @param  null|string                        $name
  * @param  Manager                            $manager
  * @throws Exception\InvalidArgumentException
  */
 public function __construct($name = 'Default', Manager $manager = null)
 {
     if (!preg_match('/^[a-z0-9][a-z0-9_\\\\]+$/i', $name)) {
         throw new Exception\InvalidArgumentException('Name passed to container is invalid; must consist of alphanumerics, backslashes and underscores only');
     }
     $this->name = $name;
     $this->setManager($manager);
     // Create namespace
     parent::__construct([], ArrayObject::ARRAY_AS_PROPS);
     // Start session
     $this->getManager()->start();
 }
예제 #3
0
 /**
  * Constructor
  *
  * Instantiates storage as an ArrayObject, allowing property access.
  * Also sets the initial request access time.
  *
  * @param array  $input
  * @param int    $flags
  * @param string $iteratorClass
  */
 public function __construct($input = array(), $flags = ArrayObject::ARRAY_AS_PROPS, $iteratorClass = '\\ArrayIterator')
 {
     parent::__construct($input, $flags, $iteratorClass);
     $this->setRequestAccessTime(microtime(true));
 }
예제 #4
0
 /**
  * Overide ancestor to disallow setting up of set from construction
  */
 public function __construct()
 {
     parent::__construct();
 }
예제 #5
0
 /**
  * Constructor
  *
  * @param array $input
  * @param int $flags
  * @param string $iteratorClass
  * @throws Exception\InvalidArgumentException
  */
 public function __construct($input = [], $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator')
 {
     $this->validateData($input);
     parent::__construct($input, $flags, $iteratorClass);
 }