コード例 #1
0
ファイル: ArchiveTest.php プロジェクト: hybr/jpm
 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'));
 }
コード例 #2
0
 /**
  * Returns the discriminator map.
  *
  * @return array|Boolean The discriminator map.
  *
  * @api
  */
 public function getDiscriminatorMap()
 {
     return Archive::get($this, 'discriminatorMap');
 }
コード例 #3
0
ファイル: EmbeddedDocument.php プロジェクト: hybr/jpm
 /**
  * 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);
 }
コード例 #4
0
ファイル: TestCase.php プロジェクト: robo47/mandango
 protected function tearDown()
 {
     Archive::clear();
     IdGeneratorContainer::reset();
     TypeContainer::reset();
 }
コード例 #5
0
ファイル: Document.php プロジェクト: gtunes/mandango
 /**
  * Clear the query hashes.
  */
 public function clearQueryHashes()
 {
     Archive::remove($this, 'query_hashes');
 }
コード例 #6
0
ファイル: EmbeddedGroup.php プロジェクト: robo47/mandango
 /**
  * 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);
 }
コード例 #7
0
ファイル: ReferenceGroup.php プロジェクト: robo47/mandango
 /**
  * Returns the reference field.
  *
  * @return string The reference field.
  *
  * @api
  */
 public function getField()
 {
     return Archive::get($this, 'field');
 }
コード例 #8
0
ファイル: AbstractGroup.php プロジェクト: robo47/mandango
 /**
  * Clears the remove queue of the group.
  *
  * @api
  */
 public function clearRemove()
 {
     Archive::remove($this, 'remove');
 }
コード例 #9
0
ファイル: PolymorphicGroup.php プロジェクト: hybr/jpm
 /**
  * Returns the discriminator field.
  *
  * @return string The discriminator field.
  *
  * @api
  */
 public function getDiscriminatorField()
 {
     return Archive::get($this, 'discriminatorField');
 }
コード例 #10
0
ファイル: AbstractDocument.php プロジェクト: hybr/jpm
 /**
  * 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);
         }
     }
 }
コード例 #11
0
ファイル: Group.php プロジェクト: hybr/jpm
 /**
  * Returns the document class.
  *
  * @api
  */
 public function getDocumentClass()
 {
     return Archive::get($this, 'document_class');
 }