예제 #1
0
 /**
  * check if a certain field exists in the mapper or
  * or is a virtual relation field
  * @param string $key
  * @param bool $relField
  * @return bool
  */
 function exists($key, $relField = false)
 {
     if (!$this->dry() && $key == '_id') {
         return true;
     }
     return $this->mapper->exists($key) || $relField && isset($this->fieldConf[$key]['relType']);
 }
예제 #2
0
 /**
  * Get mapper value
  *
  * @param  string
  * @return string
  */
 protected function value($name, $default = null)
 {
     return $this->mapper && $this->mapper->exists($name) ? $this->mapper->get($name) : $this->get($name, $default);
 }
예제 #3
0
 /**
  * Get current field value
  * @return mixed
  */
 protected function getValue()
 {
     return $this->cursor ? $this->map && $this->map->exists($this->cursor) ? $this->map->get($this->cursor) : (isset($this->lookup[$this->cursor]) ? $this->lookup[$this->cursor] : null) : null;
 }