original_string: public function delete()
  	{
  		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
  
  		// Get items to remove from the request.
  		$cid = $this->input->get('cid', array(), 'array');
  		$extension = $this->input->getCmd('extension', null);
  
  		if (!is_array($cid) || count($cid) < 1)
  		{
  			JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
  		}
  		else
  		{
  			// Get the model.
  			/** @var CategoriesModelCategory $model */
  			$model = $this->getModel();
  
  			// Make sure the item ids are integers
  			$cid = ArrayHelper::toInteger($cid);
  
  			// Remove the items.
  			if ($model->delete($cid))
  			{
  				$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
  			}
  			else
  			{
  				$this->setMessage($model->getError());
  			}
  		}
  
  		$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&extension=' . $extension, false));
  	}
code: public function delete()
  	{
  		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
  
  		// Get items to remove from the request.
  		$cid = $this->input->get('cid', array(), 'array');
  		$extension = $this->input->getCmd('extension', null);
  
  		if (!is_array($cid) || count($cid) < 1)
  		{
  			JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
  		}
  		else
  		{
  			// Get the model.
  			/** @var CategoriesModelCategory $model */
  			$model = $this->getModel();
  
  			// Make sure the item ids are integers
  			$cid = ArrayHelper::toInteger($cid);
  
  			// Remove the items.
  			if ($model->delete($cid))
  			{
  				$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
  			}
  			else
  			{
  				$this->setMessage($model->getError());
  			}
  		}
  
  		$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&extension=' . $extension, false));
  	}
code_tokens: public function delete ( ) { JSession :: checkToken ( ) or jexit ( JText :: _ ( 'JINVALID_TOKEN' ) ) ; // Get items to remove from the request. $ cid = $ this -> input -> get ( 'cid' , array ( ) , 'array' ) ; $ extension = $ this -> input -> getCmd ( 'extension' , null ) ; if ( ! is_array ( $ cid ) || count ( $ cid ) < 1 ) { JError :: raiseWarning ( 500 , JText :: _ ( $ this -> text_prefix . '_NO_ITEM_SELECTED' ) ) ; } else { // Get the model. /** @var CategoriesModelCategory $model */ $ model = $ this -> getModel ( ) ; // Make sure the item ids are integers $ cid = ArrayHelper :: toInteger ( $ cid ) ; // Remove the items. if ( $ model -> delete ( $ cid ) ) { $ this -> setMessage ( JText :: plural ( $ this -> text_prefix . '_N_ITEMS_DELETED' , count ( $ cid ) ) ) ; } else { $ this -> setMessage ( $ model -> getError ( ) ) ; } } $ this -> setRedirect ( JRoute :: _ ( 'index.php?option=' . $ this -> option . '&extension=' . $ extension , false ) ) ; }
docstring: Deletes and returns correctly.
  
  @return  void
  
  @since   3.1.2
docstring_tokens: Deletes and returns correctly .