Beispiel #1
0
 public function testGetByRef()
 {
     $object = new \DateTime();
     $fieldKey =& Archive::getByRef($object, 'field1', array());
     $this->assertSame(array(), $fieldKey);
     $fieldKey['foo'] = 'bar';
     $this->assertSame($fieldKey, Archive::get($object, 'field1'));
 }
Beispiel #2
0
 /**
  * Adds document/s to the remove queue of the group.
  *
  * @param Mandango\Document\AbstractDocument|array $documents One of more documents.
  *
  * @api
  */
 public function remove($documents)
 {
     if (!is_array($documents)) {
         $documents = array($documents);
     }
     $remove =& Archive::getByRef($this, 'remove', array());
     foreach ($documents as $document) {
         $remove[] = $document;
     }
 }
Beispiel #3
0
 /**
  * Removes a query hash.
  *
  * @param string $hash The query hash.
  */
 public function removeQueryHash($hash)
 {
     $queryHashes =& Archive::getByRef($this, 'query_hashes', array());
     unset($queryHashes[array_search($hash, $queryHashes)]);
     $queryHashes = array_values($queryHashes);
 }