/** * @param Request $request * * @return Response */ public function deleteAction(Request $request) { $this->mapper->delete($this->mapper->getResource($request->get('id'))); return new Response('', 204); }
/** * @param MapperInterface $mapper */ public function rollback(MapperInterface $mapper) { $writeAdapter = $mapper->getWriteAdapter(); $writeAdapter->rollback(); }
/** * 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; }
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()); }