public function deleteAction($id)
    {
        $profile = Profiles::findFirstById($id);
        if (!$profile) {

            $this->flash->error("Profile was not found");

            return $this->dispatcher->forward([
                'action' => 'index'
            ]);
        }

        if (!$profile->delete()) {
            $this->flash->error($profile->getMessages());
        } else {
            $this->flash->success("Profile was deleted");
        }

        return $this->dispatcher->forward([
            'action' => 'index'
        ]);
    }
public function deleteAction($id)
    {
        $profile = Profiles::findFirstById($id);
        if (!$profile) {

            $this->flash->error("Profile was not found");

            return $this->dispatcher->forward([
                'action' => 'index'
            ]);
        }

        if (!$profile->delete()) {
            $this->flash->error($profile->getMessages());
        } else {
            $this->flash->success("Profile was deleted");
        }

        return $this->dispatcher->forward([
            'action' => 'index'
        ]);
    }
public function deleteAction ( $ id ) { $ profile = Profiles :: findFirstById ( $ id ) ; if ( ! $ profile ) { $ this -> flash -> error ( "Profile was not found" ) ; return $ this -> dispatcher -> forward ( [ 'action' => 'index' ] ) ; } if ( ! $ profile -> delete ( ) ) { $ this -> flash -> error ( $ profile -> getMessages ( ) ) ; } else { $ this -> flash -> success ( "Profile was deleted" ) ; } return $ this -> dispatcher -> forward ( [ 'action' => 'index' ] ) ; }
Deletes a Profile

@param int $id
Deletes a Profile