src/Slashworks/AppBundle/Controller/RemoteAppController.php
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'));
        }
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'));
        }
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' ) ) ; }
Delete remote app

@param \Symfony\Component\HttpFoundation\Request $request
@param                                           $id

@return \Symfony\Component\HttpFoundation\RedirectResponse
@throws \Exception
@throws \PropelException
Delete remote app