/** * @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; }
/** * Get chunk content * @param $chunkId string chunk Id * @return string|null */ public function get($chunkId) { $row = $this->model->ofId($chunkId); return $row ? $row['content'] : null; }
/** * Get node meta * @param $nodeId int Node Id * @return mixed */ public function get($nodeId) { return $this->model->ofId($nodeId); }