示例#1
0
 /**
  * @param $fid
  * @return InputFile
  */
 public function decrFileRefCountById($fid)
 {
     /** @var static $row */
     $row = $this->model->ofId($fid);
     $row->refCount--;
     $fileInfo = InputFile::initWithFileMeta($row);
     if ($row->refCount == 0) {
         $this->model->deleteById($row->id);
     } else {
         $this->model->updateOne($row->id, ['refCount' => $row->refCount]);
     }
     return $fileInfo;
 }
示例#2
0
 /**
  * Remove a chunk
  * @param $chunkId string chunk Id
  * @return mixed
  */
 public function remove($chunkId)
 {
     return $this->model->deleteById($chunkId);
 }