예제 #1
0
 /**
  * Return a string representation of the full query (in Mongo shell syntax)
  *
  * @return  string
  */
 public function inspect()
 {
     $query = array();
     if ($this->_query) {
         $query[] = JSON::str($this->_query);
     } else {
         $query[] = '{}';
     }
     if ($this->_fields) {
         $query[] = JSON::str($this->_fields);
     }
     $query = "db.{$this->name}.find(" . implode(',', $query) . ")";
     foreach ($this->_options as $key => $value) {
         $query .= ".{$key}(" . JSON::str($value) . ")";
     }
     return $query;
 }