public function delete() { // FIXME: check if status/handle unique combo already exists DB::nonQuery('LOCK TABLES ' . static::$tableName . ' WRITE'); $positions = DB::oneRecord('SELECT PosLeft, PosRight FROM `%s` WHERE ID = %u', array(static::$tableName, $this->ID)); // mark collection and all subcollections as deleted DB::nonQuery('UPDATE `%s` SET Status = "Deleted" WHERE PosLeft BETWEEN %u AND %u', array(static::$tableName, $positions['PosLeft'], $positions['PosRight'])); DB::nonQuery('UNLOCK TABLES'); // delete all files SiteFile::deleteTree($this); // clear caches static::clearCacheTree($this->_record); }
public function delete() { // mark collection and all subcollections as deleted DB::nonQuery('UPDATE `%s` SET Status = "Deleted" WHERE PosLeft BETWEEN %u AND %u', array(static::$tableName, $this->PosLeft, $this->PosRight)); // TODO: mark files and all subfiles as deleted SiteFile::deleteTree($this); }