original_string: 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'
          ]);
      }
code: 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'
          ]);
      }
code_tokens: 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' ] ) ; }
docstring: Deletes a Profile
  
  @param int $id
docstring_tokens: Deletes a Profile