If softdeletes are enabled, store the deleted time
542224
public function postDelete()
    {
        if ((!isset($this->revisionEnabled) || $this->revisionEnabled)
            && $this->isSoftDelete()
            && $this->isRevisionable($this->getDeletedAtColumn())) {
            $revisions[] = array(
                'revisionable_type' => $this->getMorphClass(),
                'revisionable_id' => $this->getKey(),
                'key' => $this->getDeletedAtColumn(),
                'old_value' => null,
                'new_value' => $this->{$this->getDeletedAtColumn()},
                'user_id' => $this->getSystemUserId(),
                'created_at' => new \DateTime(),
                'updated_at' => new \DateTime(),
            );
            $revision = static::newModel();
            \DB::table($revision->getTable())->insert($revisions);
        }
    }
120314
protected function setSoftDelete()
    {
        $softDelete = $this->config["database.softDelete"];
        $this->softDelete = $softDelete["enabled"] ?? false;
        $this->delCol = $softDelete["column"] ?? "";
        $this->delValType = $softDelete["value"] ?? 0;
    }
1218010
def _do_perform_delete_on_model(self):
        
        if self._force_deleting:
            return self.with_trashed().where(self.get_key_name(), self.get_key()).force_delete()

        return self._run_soft_delete()
1012624
def getTimeSinceLastUpdate(IOType):
    """"""
    global last_update_times
    # assert(IOType in ['net', 'disk', 'process_disk'])
    current_time = time()
    last_time = last_update_times.get(IOType)
    if not last_time:
        time_since_update = 1
    else:
        time_since_update = current_time - last_time
    last_update_times[IOType] = current_time
    return time_since_update
681496
def capture_delete_records(records):
    """"""
    for r in records:
        model = create_delete_model(r)
        if model:
            try:
                model.delete(eventTime__le=r['detail']['eventTime'])
            except DeleteError as e:
                log.warning('Unable to delete {{cookiecutter.technology_name}}. {{cookiecutter.technology_name}} does not exist. Record: {record}'.format(
                    record=r
                ))
        else:
            log.warning('Unable to delete {{cookiecutter.technology_name}}. {{cookiecutter.technology_name}} does not exist. Record: {record}'.format(
                record=r
            ))
877923
def modified_on(self):
    """"""
    timestamp = self._info.get('lastModifiedTime')
    return _parser.Parser.parse_timestamp(timestamp)
545822
def logged_delete(self, user):
        """"""

        self.delete()

        # Log the change
        entry = ChangeLogEntry({
            'type': 'DELETED',
            'documents': [self],
            'user': user
            })
        entry.insert()

        return entry
127880
def trigger_deleted(self, filepath):
        """"""
        if not os.path.exists(filepath):
            self._trigger('deleted', filepath)
398247
function softDelete(callback) {
  if(this[this.primaryKey]) {
    flowsync.series([
      (next) => {
        this[symbols.callDeep]("delete", (associationDetails) => {
          return (associationDetails.type !== "belongsTo"
            && associationDetails.dependent === true);
        }, next);
      },
      (next) => {
        let now = new Datetime();
        let attributesToUpdate = {};
        attributesToUpdate[inflect("deletedAt").snake.toString()] = now.toDate();
        this[symbols.getDatabase]()
          .update(attributesToUpdate)
          .into(this.tableName)
          .where(this.primaryKey, "=", this[this.primaryKey])
          .results((error, results) => {
            if(error) {
              next(error);
            } else if (results === 0) {
              next(new Error(`${this.constructor.name} with ${this.primaryKey} ${this[this.primaryKey]} cannot be soft deleted because it doesn't exists.`));
            } else {
              next();
            }
          });
      }
    ], (errors, results) => {
      callback(errors, results);
    });
  } else {
    callback(new Error(`Cannot delete the ${this.constructor.name} because the primary key is not set.`));
  }
}
766989
def deleted(self):
        ''
        _d = self.folder.attrib.get('deleted', None)
        if _d is None: return None
        return dateutil.parser.parse(str(_d))
79186
protected function handleMediableDeletion()
    {
        // only cascade soft deletes when configured
        if (static::hasGlobalScope(SoftDeletingScope::class) && ! $this->forceDeleting) {
            if (config('mediable.detach_on_soft_delete')) {
                $this->media()->detach();
            }
            // always cascade for hard deletes
        } else {
            $this->media()->detach();
        }
    }
1369308
function _handleDataReset() {
    storage.removeDataByKey(savedDataKey);

    let data = getCurrentData();

    dataEditor.setValue(prettifyJson(data));
}
1059478
public function onDeleted()
    {
        // Get the directory of an output
        if (($sources = (array) $this->outputs)      // Convert sources to an array
            && count($sources)                         // If there are sources
            && ($first = array_pop($sources))          // Get the last source
            && preg_match('#^/(?!/)#', $first)         // Make sure it's a local path
            && ($dir = public_path().dirname($first))  // Get the path of the filename
            && is_dir($dir)) {                         // Make sure it's a directory
            File::deleteDir($dir);
        }
    }
133803
def cli(env, snapshot_id):
    """"""
    block_manager = SoftLayer.BlockStorageManager(env.client)
    deleted = block_manager.delete_snapshot(snapshot_id)

    if deleted:
        click.echo('Snapshot %s deleted' % snapshot_id)
1163605
protected function executeDestroy()
    {
        if ($this->reallyDestroy) {
            parent::executeDestroy();
        } else {
            $this->saveData([
                $this->deletedAtColumn => date('Y-m-d H:i:s'),
                $this->deletedByColumn => $this->curUser['id'],
            ]);
        }
    }
1350060
function isDeleted(type, id) {
    var typeInfo = getTypeInfo(type);

    return db.get(serialize(typeInfo.documentType, id))
      .then(function (doc) { return !!doc._deleted; })
      .catch(function (err) { return err.reason === "deleted" ? true : null; });
  }
753243
public function eventAfterDelete()
    {
        $this->updateNavItemTimesamp();
        if (!empty($this->_olds)) {
            $this->reindex($this->_olds['nav_item_page_id'], $this->_olds['placeholder_var'], $this->_olds['prev_id']);
        }
    }