code: public function delete()
      {
          $app = App::getInstance();
  
          // update model
          if ($this->pk && $this->getPk()->getValue()) {
              $this->setDeleted(true)->save();
  
              // clear cache
              $item = $this->getCache($this->getPk());
              $item->clear();
  
              // clear model
              $this->constructorId = null;
              $this->pk = null;
              $this->initialFields = null;
          } else {
              throw new InternalException(
                  'Trying to delete a model that does not yet exist'
              );
          }
  
          return true;
      }
docs: Public: Delete the model. Restores instance of model back to if it was created with no ID