コード例 #1
0
ファイル: Builder.php プロジェクト: ssttevee/datastore-helper
 /**
  * @return \Google_Service_Datastore_Query
  */
 public function build()
 {
     $query = new \Google_Service_Datastore_Query();
     if (!empty($this->projections)) {
         $query->setProjection($this->projections);
     }
     if (!empty($this->kinds)) {
         $query->setKinds($this->kinds);
     }
     if (!is_null($this->filter)) {
         $query->setFilter($this->filter);
     }
     if (!empty($this->orders)) {
         $query->setOrder($this->orders);
     }
     if (!empty($this->groupBys)) {
         $query->setGroupBy($this->groupBys);
     }
     if (!is_null($this->startCursor)) {
         $query->setStartCursor($this->startCursor);
     }
     if (!is_null($this->endCursor)) {
         $query->setEndCursor($this->endCursor);
     }
     if (!is_null($this->offset)) {
         $query->setOffset($this->offset);
     }
     if (!is_null($this->limit)) {
         $query->setLimit($this->limit);
     }
     return $query;
 }