src/Money/Module/Account/Controller/Account.php
protected function checkDelete()
    {
        $mapper = new AccountMapper(Database::get('money'));

        $server = Server::getInstance();
        $post   = Post::getInstance();

        if ($server->isPost() && $post->has('delete')) {
            $accountId = (int) $post->get('delete');
            $account   = $mapper->findById($accountId);

            if ($account->exists()) {

                $session = Session::getInstance();

                $mapperAccountUser = new AccountUserMapper(Database::get('money'));
                $accountUser = $mapperAccountUser->findByKeys(array('user_id' => $session->get('id'), 'account_id' => $accountId));
                $mapperAccountUser->delete($accountUser);

                $mapper->delete($account);

                $session->setEphemeral('notification', serialize(new NotificationBootstrap('Bank Account "' . $account->getName() . '"has been delete! ')));

                Server::getInstance()->redirect('/account/list');
            }
        }
    }
protected function checkDelete()
    {
        $mapper = new AccountMapper(Database::get('money'));

        $server = Server::getInstance();
        $post   = Post::getInstance();

        if ($server->isPost() && $post->has('delete')) {
            $accountId = (int) $post->get('delete');
            $account   = $mapper->findById($accountId);

            if ($account->exists()) {

                $session = Session::getInstance();

                $mapperAccountUser = new AccountUserMapper(Database::get('money'));
                $accountUser = $mapperAccountUser->findByKeys(array('user_id' => $session->get('id'), 'account_id' => $accountId));
                $mapperAccountUser->delete($accountUser);

                $mapper->delete($account);

                $session->setEphemeral('notification', serialize(new NotificationBootstrap('Bank Account "' . $account->getName() . '"has been delete! ')));

                Server::getInstance()->redirect('/account/list');
            }
        }
    }
Check & delete

@return void
@throws \Exception