original_string: public function delete($slug)
      {
          $this->loadModel('Content.ContentTypes');
          $type = $this->ContentTypes->find()
              ->where(['slug' => $slug])
              ->first();
  
          if (!$type) {
              throw new NotFoundException(__d('content', 'Content type was not found!'));
          }
  
          if ($this->ContentTypes->delete($type)) {
              $this->Flash->success(__d('content', 'Content was deleted!'));
          } else {
              $$this->Flash->danger(__d('content', 'Content type could not be deleted, please try again.'));
          }
  
          $this->title(__d('content', 'Delete Content Type'));
          $this->redirect($this->referer());
      }
code: public function delete($slug)
      {
          $this->loadModel('Content.ContentTypes');
          $type = $this->ContentTypes->find()
              ->where(['slug' => $slug])
              ->first();
  
          if (!$type) {
              throw new NotFoundException(__d('content', 'Content type was not found!'));
          }
  
          if ($this->ContentTypes->delete($type)) {
              $this->Flash->success(__d('content', 'Content was deleted!'));
          } else {
              $$this->Flash->danger(__d('content', 'Content type could not be deleted, please try again.'));
          }
  
          $this->title(__d('content', 'Delete Content Type'));
          $this->redirect($this->referer());
      }
code_tokens: public function delete ( $ slug ) { $ this -> loadModel ( 'Content.ContentTypes' ) ; $ type = $ this -> ContentTypes -> find ( ) -> where ( [ 'slug' => $ slug ] ) -> first ( ) ; if ( ! $ type ) { throw new NotFoundException ( __d ( 'content' , 'Content type was not found!' ) ) ; } if ( $ this -> ContentTypes -> delete ( $ type ) ) { $ this -> Flash -> success ( __d ( 'content' , 'Content was deleted!' ) ) ; } else { $ $ this -> Flash -> danger ( __d ( 'content' , 'Content type could not be deleted, please try again.' ) ) ; } $ this -> title ( __d ( 'content' , 'Delete Content Type' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
docstring: Remove content type.
  
  All existing contents will not be removed.
  
  @param string $slug Content type's slug
  @return void
  @throws \Cake\Network\Exception\NotFoundException When content type was not
  found.
docstring_tokens: Remove content type .