set() public method

Store value to specified selector in local cache
public set ( string $selector, mixed $value ) : Document
$selector string point-delimited field selector
$value mixed value
return Document
Beispiel #1
0
 public function bitwiceXor($field, $value)
 {
     $oldFieldValue = (int) $this->get($field);
     $newValue = $oldFieldValue ^ $value;
     parent::set($field, $newValue);
     if ($this->getId()) {
         if (version_compare($this->getCollection()->getDatabase()->getClient()->getDbVersion(), '2.6', '>=')) {
             $this->operator->bitwiceXor($field, $value);
         } else {
             $this->operator->set($field, $newValue);
         }
     }
     return $this;
 }