original_string: public function delete(array $criteria = [])
      {
          $this->viewCheck(__FUNCTION__);
  
          $query = $this->buildDelete($criteria);
  
          $old = clone $this;
          if (!$this->beforeDelete($criteria))
              return false;
  
          if ($result = $this->run($query, $criteria))
              $this->next();
  
          if (!$this->afterDelete($old))
              return false;
  
          return $result;
      }
code: public function delete(array $criteria = [])
      {
          $this->viewCheck(__FUNCTION__);
  
          $query = $this->buildDelete($criteria);
  
          $old = clone $this;
          if (!$this->beforeDelete($criteria))
              return false;
  
          if ($result = $this->run($query, $criteria))
              $this->next();
  
          if (!$this->afterDelete($old))
              return false;
  
          return $result;
      }
code_tokens: public function delete ( array $ criteria = [ ] ) { $ this -> viewCheck ( __FUNCTION__ ) ; $ query = $ this -> buildDelete ( $ criteria ) ; $ old = clone $ this ; if ( ! $ this -> beforeDelete ( $ criteria ) ) return false ; if ( $ result = $ this -> run ( $ query , $ criteria ) ) $ this -> next ( ) ; if ( ! $ this -> afterDelete ( $ old ) ) return false ; return $ result ; }
docstring: delete, only when there is primary key
docstring_tokens: delete only when there is primary key