abstract class MediaRepository extends FileRepository

Abstract class MediaRepository

Traits

Properties

static protected array $models model class name from EloquentRepositoryTrait

Methods

Model
update(Model $item, array $data = array())

update

bool|null
delete(Model $item)

delete

int
increment(Model $item, string $column, int $amount = 1)

Increment a column's value by a given amount.

int
decrement(Model $item, string $column, int $amount = 1)

Decrement a column's value by a given amount.

static string
getModel()

The name of Category model class

static void
setModel(string $model)

Set the name of Category model

Model
createModel()

Create model instance

Builder
query()

query

mixed
__call(string $name, array $arguments)

__call

create(array $data = array(), string|null $id = null)

Save a new file model and return the instance.

Collection|File[]
fetchIn(array $ids, array $columns = array('*'))

Get files by given ids

Collection|File[]
fetchByFileable(string $fileableId, array $columns = array('*'))

Get the files for fileable

array
bytesByMime(callable $scope = null)

mime 별 파일 용량 정보 반환

array
countByMime(callable $scope = null)

mime 별 파일 갯수 반환

Details

Model update(Model $item, array $data = array())

update

Parameters

Model $item item
array $data data

Return Value

Model

bool|null delete(Model $item)

delete

Parameters

Model $item item

Return Value

bool|null

Exceptions

Exception

int increment(Model $item, string $column, int $amount = 1)

Increment a column's value by a given amount.

Parameters

Model $item item
string $column column
int $amount amount

Return Value

int

int decrement(Model $item, string $column, int $amount = 1)

Decrement a column's value by a given amount.

Parameters

Model $item item
string $column column
int $amount amount

Return Value

int

static string getModel()

The name of Category model class

Return Value

string

static void setModel(string $model)

Set the name of Category model

Parameters

string $model model class

Return Value

void

Model createModel()

Create model instance

Return Value

Model

at line 36
Builder query()

query

Return Value

Builder

mixed __call(string $name, array $arguments)

__call

Parameters

string $name method name
array $arguments arguments

Return Value

mixed

in FileRepository at line 42
File create(array $data = array(), string|null $id = null)

Save a new file model and return the instance.

Parameters

array $data attributes
string|null $id file id

Return Value

File

in FileRepository at line 63
Collection|File[] fetchIn(array $ids, array $columns = array('*'))

Get files by given ids

Parameters

array $ids file ids
array $columns columns

Return Value

Collection|File[]

in FileRepository at line 75
Collection|File[] fetchByFileable(string $fileableId, array $columns = array('*'))

Get the files for fileable

Parameters

string $fileableId fileable identifier
array $columns columns

Return Value

Collection|File[]

in FileRepository at line 95
array bytesByMime(callable $scope = null)

mime 별 파일 용량 정보 반환

Parameters

callable $scope 검색 조건

Return Value

array ex.) [mime => bytes]

in FileRepository at line 122
array countByMime(callable $scope = null)

mime 별 파일 갯수 반환

Parameters

callable $scope 검색 조건

Return Value

array ex.) [mime => count]