/** * Processes entities from the response object if not in silent mode or error is received. * * @param Response $response Response object which includes entities * @param bool $silentMode If set to true then the events, mapped (in config or by default) * to the entities in the result will not be triggered * * @return Response */ protected function processResponse(Response $response, $silentMode = false) { if (!empty($response->getEntities()) && ($silentMode === false || $response->isErrorReceived())) { $this->processEntities($response->getEntities()); } return $response; }