コード例 #1
0
ファイル: LeanObjectTest.php プロジェクト: wpxun/leanCloud
 public function testSetGeoPoint()
 {
     $obj = new LeanObject("TestObject");
     $obj->set("location", new GeoPoint(39.9, 116.4));
     $obj->save();
     $obj2 = new LeanObject("TestObject", $obj->getObjectId());
     $obj2->fetch();
     $loc = $obj2->get("location");
     $this->assertTrue($loc instanceof GeoPoint);
     $this->assertEquals(39.9, $loc->getLatitude());
     $this->assertEquals(116.4, $loc->getLongitude());
 }
コード例 #2
0
ファイル: LeanObjectTest.php プロジェクト: jysperm/php-sdk
 public function testDestroyObject()
 {
     $obj = new LeanObject("TestObject");
     $obj->set("tags", array("frontend"));
     $obj->save();
     $this->assertNotEmpty($obj->getObjectId());
     $obj->destroy();
     $this->setExpectedException("LeanCloud\\LeanException");
     $obj->fetch();
 }
コード例 #3
0
ファイル: Controller.php プロジェクト: wpxun/leanCloud
 public function fetch()
 {
     $object = new LeanObject("TestObject", '5655637160b2febec4a56259');
     $object->fetch();
     var_dump($object);
 }