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(); }
/** * @depends testCreateStatic */ public function testCreateStaticWithPositionInstance() { $data = array('position' => array('latitude' => 10, 'longitude' => 20)); $place = Place::create($data, null); $this->assertInstanceOf('Domain\\Position', $place->getPosition()); }