コード例 #1
0
 public function update($id, $data)
 {
     $current = $this->findOne($id);
     if (!$this->v->validate($data)) {
         throw new ValidationException($this->v);
     }
     $mongo = $this->app['mongo.dm'];
     $mongo->persist(Place::create($data, $current));
     $mongo->flush();
 }
コード例 #2
0
 /**
  * @depends testCreateStatic
  */
 public function testCreateStaticWithPositionInstance()
 {
     $data = array('position' => array('latitude' => 10, 'longitude' => 20));
     $place = Place::create($data, null);
     $this->assertInstanceOf('Domain\\Position', $place->getPosition());
 }