Sokil\Mongo\Expression::toArray PHP Метод

toArray() публичный Метод

public toArray ( )
    public function toArray()
    {
        return $this->_expression;
    }

Usage Example

Пример #1
0
 /**
  * Used to get hash that uniquely identifies current query
  */
 public function getHash()
 {
     $hash = array();
     // expression
     $hash[] = json_encode($this->expression->toArray());
     // sorts
     if ($this->sort) {
         $sort = $this->sort;
         ksort($sort);
         $hash[] = implode('', array_merge(array_keys($sort), array_values($sort)));
     }
     // fields
     if ($this->fields) {
         $fields = $this->fields;
         ksort($fields);
         $hash[] = implode('', array_merge(array_keys($fields), array_values($fields)));
     }
     // skip and limit
     $hash[] = $this->skip;
     $hash[] = $this->limit;
     // get hash
     return md5(implode(':', $hash));
 }
All Usage Examples Of Sokil\Mongo\Expression::toArray