0
如何在php中使用FetchOptions函數?如何在谷歌應用引擎數據中使用FetchOptions
我想知道如何使用限制和在下面的查詢碼偏移的功能呢?
<?php
import com.google.appengine.api.datastore;
import com.google.appengine.api.datastore.Query;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.FetchOptions;
$q = new Query('test');
//http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Query.html
//http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/FetchOptions.html
$q->addFilter('field1','EQUAL' ,'value1');
$dataService = DatastoreServiceFactory::getDatastoreService();
$prepared = $dataService->prepare($q);
foreach($prepared->asIterable() as $i) {
echo $field1 = $i->getProperty('field1');
echo $field2 = $i->getProperty('field2');
}
?>