public function deleteAction(Request $request, $id)
        {

            /** @var RemoteApp $oRemoteApp */
            $oRemoteApp = RemoteAppQuery::create()->findOneById($id);

            if ($oRemoteApp === null) {
                throw $this->createNotFoundException('Unable to find RemoteApp entity.');

            }

            // get history-entries for remoteapp to delete
            $aHistories = RemoteHistoryContaoQuery::create()->findByRemoteAppId($oRemoteApp->getId());
            foreach ($aHistories as $oHistory) {
                $oHistory->delete();
            }
            $oRemoteApp->delete();

            return $this->redirect($this->generateUrl('remote_app'));
        }