Exemplo n.º 1
0
 public function testGetOrDefault()
 {
     $object = new \DateTime();
     $this->assertSame('foobar', Archive::getOrDefault($object, 'field1', 'foobar'));
     Archive::set($object, 'field2', 'ups');
     $this->assertSame('ups', Archive::getOrDefault($object, 'field2', 'foobar'));
 }
Exemplo n.º 2
0
 /**
  * Returns the root and path of the embedded document.
  *
  * @return array An array with the root and path (root and path keys) or null if they do not exist.
  *
  * @api
  */
 public function getRootAndPath()
 {
     return Archive::getOrDefault($this, 'root_and_path', null);
 }
Exemplo n.º 3
0
 /**
  * Returns the query hashes.
  *
  * @return array The query hashes.
  */
 public function getQueryHashes()
 {
     return Archive::getOrDefault($this, 'query_hashes', array());
 }
Exemplo n.º 4
0
 /**
  * Returns the saved data.
  *
  * @return array|null The saved data or null if it does not exist.
  */
 public function getSavedData()
 {
     return Archive::getOrDefault($this, 'saved_data', null);
 }
Exemplo n.º 5
0
 /**
  * Returns the remove queue of the group.
  *
  * @api
  */
 public function getRemove()
 {
     return Archive::getOrDefault($this, 'remove', array());
 }