public function deleteAction($id)
    {
        $this->initializeScaffolding();

        try {
            $this->beforeRead();
            $this->view->record = $this->scaffolding->doRead($id);
            $this->afterRead();

            $this->beforeDelete();
            $this->scaffolding->doDelete($id);
            $this->flash->success($this->successMessage);
            return $this->afterDelete();
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
            return $this->afterDeleteException();
        }
    }
public function deleteAction($id)
    {
        $this->initializeScaffolding();

        try {
            $this->beforeRead();
            $this->view->record = $this->scaffolding->doRead($id);
            $this->afterRead();

            $this->beforeDelete();
            $this->scaffolding->doDelete($id);
            $this->flash->success($this->successMessage);
            return $this->afterDelete();
        } catch (Exception $e) {
            $this->flash->error($e->getMessage());
            return $this->afterDeleteException();
        }
    }
public function deleteAction ( $ id ) { $ this -> initializeScaffolding ( ) ; try { $ this -> beforeRead ( ) ; $ this -> view -> record = $ this -> scaffolding -> doRead ( $ id ) ; $ this -> afterRead ( ) ; $ this -> beforeDelete ( ) ; $ this -> scaffolding -> doDelete ( $ id ) ; $ this -> flash -> success ( $ this -> successMessage ) ; return $ this -> afterDelete ( ) ; } catch ( Exception $ e ) { $ this -> flash -> error ( $ e -> getMessage ( ) ) ; return $ this -> afterDeleteException ( ) ; } }
Deletes existing record by its ID

@ACL(name="delete", description="Delete a record")
@param $id
@return mixed
Deletes existing record by its ID