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 discriminator map.
  *
  * @return array|Boolean The discriminator map.
  *
  * @api
  */
 public function getDiscriminatorMap()
 {
     return Archive::get($this, 'discriminatorMap');
 }
Exemplo n.º 3
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.º 4
0
 protected function tearDown()
 {
     Archive::clear();
     IdGeneratorContainer::reset();
     TypeContainer::reset();
 }
Exemplo n.º 5
0
 /**
  * Clear the query hashes.
  */
 public function clearQueryHashes()
 {
     Archive::remove($this, 'query_hashes');
 }
Exemplo n.º 6
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.º 7
0
 /**
  * Returns the reference field.
  *
  * @return string The reference field.
  *
  * @api
  */
 public function getField()
 {
     return Archive::get($this, 'field');
 }
Exemplo n.º 8
0
 /**
  * Clears the remove queue of the group.
  *
  * @api
  */
 public function clearRemove()
 {
     Archive::remove($this, 'remove');
 }
Exemplo n.º 9
0
 /**
  * Returns the discriminator field.
  *
  * @return string The discriminator field.
  *
  * @api
  */
 public function getDiscriminatorField()
 {
     return Archive::get($this, 'discriminatorField');
 }
Exemplo n.º 10
0
 /**
  * Clear the embedded ones changed, that is, they will not be changed apart from here.
  *
  * @api
  */
 public function clearEmbeddedsOneChanged()
 {
     if (isset($this->data['embeddedsOne'])) {
         foreach ($this->data['embeddedsOne'] as $name => $embedded) {
             Archive::remove($this, 'embedded_one.' . $name);
         }
     }
 }
Exemplo n.º 11
0
Arquivo: Group.php Projeto: hybr/jpm
 /**
  * Returns the document class.
  *
  * @api
  */
 public function getDocumentClass()
 {
     return Archive::get($this, 'document_class');
 }