Storage
class Storage
Class Storage
Properties
protected FileRepository | $repo | file repository instance | |
protected FilesystemHandler | $files | filesystem handler instance | |
protected GuardInterface | $auth | Authenticator instance | |
protected Keygen | $keygen | key generator instance | |
protected Distributor | $distributor | distributor instance | |
protected TempFileCreator | $tempFiles | temporary file creator instance | |
protected ResponseFactory | $response | ResponseFactory instance |
Methods
__construct(FileRepository $repo, FilesystemHandler $files, GuardInterface $auth, Keygen $keygen, Distributor $distributor, TempFileCreator $tempFiles, ResponseFactory $response)
constructor
upload(UploadedFile $uploaded, string $path, string|null $name = null, string|null $disk = null, UserInterface $user = null)
file upload to storage
create(string $content, string $path, string $name, string|null $disk = null, string|null $originId = null, UserInterface $user = null)
create file
void
unBindAll(string $fileableId, bool $remove = false)
unset all fileable's files to fileable
void
sync(string $fileableId, array $fileIds = array())
Sync fileable's files to fileable
string
makePath(string $id, string $path)
make path name
string
makeFilename(string $clientname)
make file name
getFilesystemHandler()
file system handler instance
getDistributor()
distributor instance
void
getTempFileCreator()
Returns the TempFileCreator instance
mixed
__call(string $name, array $arguments)
__call
Details
at line 98
__construct(FileRepository $repo, FilesystemHandler $files, GuardInterface $auth, Keygen $keygen, Distributor $distributor, TempFileCreator $tempFiles, ResponseFactory $response)
constructor
at line 126
File
upload(UploadedFile $uploaded, string $path, string|null $name = null, string|null $disk = null, UserInterface $user = null)
file upload to storage
at line 180
File
create(string $content, string $path, string $name, string|null $disk = null, string|null $originId = null, UserInterface $user = null)
create file
at line 217
BinaryFileResponse
download(File $file, string|null $name = null)
file download from storage
at line 247
bool
delete(File $file)
delete file
at line 270
bool
remove(File $file)
delete file. alias for delete
at line 282
void
bind(string $fileableId, File $file)
set the target be have a file
at line 300
bool
has(string $fileableId, File $file)
has
at line 316
void
unBind(string $fileableId, File $file, bool $remove = false)
set the target be not have a file
at line 337
void
unBindAll(string $fileableId, bool $remove = false)
unset all fileable's files to fileable
at line 353
void
sync(string $fileableId, array $fileIds = array())
Sync fileable's files to fileable
at line 380
private string
makePath(string $id, string $path)
make path name
at line 397
private string
makeFilename(string $clientname)
make file name
at line 407
FilesystemHandler
getFilesystemHandler()
file system handler instance
at line 417
Distributor
getDistributor()
distributor instance
at line 428
void
setDistributor(Distributor $distributor)
set distributor instance
at line 438
TempFileCreator
getTempFileCreator()
Returns the TempFileCreator instance
at line 450
mixed
__call(string $name, array $arguments)
__call