I use Quercus to run php on google app engine and use GAE LowLevel Api to connect datastore. I need sample php code to CRUD ( Create, Read, Update, Delete ) in datastore. I have Create and Read sample php code.
Datastore'una giriş oluşturun
<?php
import com.google.appengine.api.datastore;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
$entity = new Entity("test");
$entity->setProperty('field1','value1');
$entity->setProperty('field2','value2');
$dataService = DatastoreServiceFactory::getDatastoreService();
$dataService->put($entity);
?>
Datastore'una sorgula
<?php
import com.google.appengine.api.datastore;
import com.google.appengine.api.datastore.Query;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
$q = new Query('test');
//http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Query.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');
}
?>
Herkes herhangi bir fikir var mı nasıl Delete ve php ile veri deposuna Update girişleri?