/**
  * @param Request $request
  *
  * @return Response
  */
 public function deleteAction(Request $request)
 {
     $this->mapper->delete($this->mapper->getResource($request->get('id')));
     return new Response('', 204);
 }
Пример #2
0
 /**
  * @param MapperInterface $mapper
  */
 public function rollback(MapperInterface $mapper)
 {
     $writeAdapter = $mapper->getWriteAdapter();
     $writeAdapter->rollback();
 }
Пример #3
0
 /**
  * Unserialize an embedded collection
  *
  * Return a collection of serialized objects (arrays)
  *
  * @param MapperInterface $mapper
  * @param array           $data
  *
  * @return array
  */
 protected function unserializeEmbeddedCollection(MapperInterface $mapper, array $data)
 {
     $collection = array();
     foreach ($data as $document) {
         $collection[] = $mapper->unserialize($document);
     }
     return $collection;
 }
Пример #4
0
 public function testSendReturnsFluentInterfaceOnSuccess()
 {
     $this->transport->expects($this->once())->method('write')->will($this->returnSelf());
     $this->mapper->expects($this->once())->method('mapOut')->will($this->returnValue('{"bar":1}'));
     $this->assertInstanceOf('Chippyash\\SDO\\AbstractSDO', $this->sut->send());
 }