class Image extends Media

image 객체

Traits

Trait MimeTypeFilter

Constants

CREATED_AT

column nam of created at

UPDATED_AT

column nam of updated at

DELETED_AT

column nam of deleted at

TYPE_IMAGE

TYPE_VIDEO

TYPE_AUDIO

Properties

static protected Keygen $keyGenerator from DynamicModel
static protected ConnectionResolverInterface $resolver The connection resolver instance. from DynamicModel
static protected array $macros The registered macros. from DynamicModel
protected array $proxyOptions from DynamicModel
protected bool $dynamic from DynamicModel
protected array $dynamicAttributes dynamic mode 애서 사용될 attributes from DynamicModel
protected string $table The table associated with the model. from File
protected string $fileableTable The table associated with the model for morph. from File
protected array $fillable The attributes that are mass assignable. from File
bool $incrementing Indicates if the IDs are auto-incrementing. from File
static protected callable $reader The file content reader from File
static protected UrlMaker $urls Storage UrlMaker instance from File
int $id int$id
string $originId string$originId from File
string $userId string$userId from File
string $disk string$disk from File
string $path string$path from File
string $filename string$filename from File
string $clientname string$clientname from File
string $mime string$mime from File
int $size int$size from File
int $useCount int$useCount from File
int $downloadCount int$downloadCount from File
static protected MimeTypeScope $mimeTypeScope MimeTypeScope instance from MimeTypeFilter
static protected array $mimes Available mime type
string $fileId string$fileId
string $type string$type
string $code string$code
int $width int$width
int $height int$height

Methods

array
filter(array $args, array $columns = array())

$args 로 넘어온 데이터와 $columns 를 비교해서 $args 값을 거른다.

array
schema()

get table schema

void
fill(array $attributes)

fill

getKeyGen()

get key generator

static void
setKeyGen(Keygen $keyGenerator)

Set key generator

static Connection
resolveConnection(string|null $connection = null)

Resolve a connection instance.

static ConnectionResolverInterface
getConnectionResolver()

Get the connection resolver instance.

static void
setConnectionResolver(ConnectionResolverInterface $resolver)

Set the connection resolver instance.

static void
unsetConnectionResolver()

Unset the connection resolver for models.

$this
setDynamic(bool $use)

dynamic query 사용하도록 설정

$this
setProxyOptions(array $options)

proxy option 설정

array
getProxyOptions()

get proxy option

array
getDynamicAttributes()

get dynamic attributes

newEloquentBuilder(DynamicQuery $query)

Create a new Eloquent query builder for the model.

newBaseQueryBuilder()

Illuminate Model 의 newBaseQueryBuilder 변경 VirtualConnection 을 통해 DynamicQuery 를 사용하도록 처리

bool
performInsert(Builder $query, array $options = array())

No description

bool
save(array $options = array())

Save the model to the database.

static void
macro(string $name, callable $macro)

Register a custom macro.

static bool
hasMacro(string $name)

Checks if macro is registered.

mixed
callMacro(string $name, array $parameters = array())

call macro

mixed
getMacroValue(string $name)

get macro value

mixed
__call(string $method, array $parameters)

Handle dynamic method calls into the model.

mixed
__get(string $key)

Dynamically retrieve attributes on the model.

string
getPathname()

Get a path name of file

from File
string
getContent()

Get the content of file

from File
string
getOriginKey()

Original file's identifier

from File
Collection|File[]
getDerives()

Get the derive files of current file

from File
Collection|File[]
getRawDerives()

Get the derive files of current file with the File type

from File
string
url(Closure $callback = null)

Get a file url

from File
Builder
scopeDerives(Builder $query, File $file)

Scope for derives

from File
static Collection|File[]
getByFileable(string $fileableId)

Get the files for fileable

from File
static void
setContentReader(callable $reader)

Set the ContentReader instance

from File
static void
setUrlMaker(UrlMaker $urlMaker)

Set the UrlMaker instance

from File
string
getFileableTable()

Get a fileable table name

from File
static void
bootMimeTypeFilter()

Boot the mime type filter trait for a model.

static MimeTypeScope
getMimeTypeScope()

Returns the mime type filter scope

static Media
make(File $file)

Make media model

from Media
static array
getMimes()

Returns available mime type

from Media
HasOne
meta()

Meta data relationship

from Media
string
getMetaModel()

Returns meta data model for current model

string
render(array $option = array())

Rendered media

string
getType()

Returns media type

array
toArray()

Get the instance as an array.

from Media
string
__toString()

Convert to string

from Media
static Image|null
getThumbnail(Media $media, string $type, string $dimension, bool $defaultSelf = true)

Get a thumbnail image

static Image[]
getThumbnails(Media $media, null|string $type = null)

Get thumbnails

Details

in DynamicModel at line 103
array filter(array $args, array $columns = array())

$args 로 넘어온 데이터와 $columns 를 비교해서 $args 값을 거른다.

처리중인 $columns 와 같은 이름을 데이터만 리턴됨 이 처리는 dynamic 을 통해 proxy 를 처리 할 경우에 대해서 동작됨

Parameters

array $args insert, update data
array $columns table columns

Return Value

array

in DynamicModel at line 124
private array schema()

get table schema

Return Value

array

in DynamicModel at line 135
void fill(array $attributes)

fill

Parameters

array $attributes attributes

Return Value

void

in DynamicModel at line 150
Keygen getKeyGen()

get key generator

Return Value

Keygen

in DynamicModel at line 164
static void setKeyGen(Keygen $keyGenerator)

Set key generator

Parameters

Keygen $keyGenerator key generator

Return Value

void

in DynamicModel at line 175
static Connection resolveConnection(string|null $connection = null)

Resolve a connection instance.

Parameters

string|null $connection connection name

Return Value

Connection

in DynamicModel at line 185
static ConnectionResolverInterface getConnectionResolver()

Get the connection resolver instance.

Return Value

ConnectionResolverInterface

in DynamicModel at line 196
static void setConnectionResolver(ConnectionResolverInterface $resolver)

Set the connection resolver instance.

Parameters

ConnectionResolverInterface $resolver resolver

Return Value

void

in DynamicModel at line 206
static void unsetConnectionResolver()

Unset the connection resolver for models.

Return Value

void

in DynamicModel at line 217
$this setDynamic(bool $use)

dynamic query 사용하도록 설정

Parameters

bool $use use dynamic query

Return Value

$this

in DynamicModel at line 228
$this setProxyOptions(array $options)

proxy option 설정

Parameters

array $options proxy options

Return Value

$this

in DynamicModel at line 239
array getProxyOptions()

get proxy option

Return Value

array

in DynamicModel at line 249
array getDynamicAttributes()

get dynamic attributes

Return Value

array

in DynamicModel at line 261
Builder|DynamicModel newEloquentBuilder(DynamicQuery $query)

Create a new Eloquent query builder for the model.

Xpressengine\Database\Eloquent\Builder 울 사용하도록 변경

Parameters

DynamicQuery $query dynamic query builder

Return Value

Builder|DynamicModel

in DynamicModel at line 272
protected DynamicQuery newBaseQueryBuilder()

Illuminate Model 의 newBaseQueryBuilder 변경 VirtualConnection 을 통해 DynamicQuery 를 사용하도록 처리

Return Value

DynamicQuery

in DynamicModel at line 291
protected bool performInsert(Builder $query, array $options = array())

Parameters

Builder $query Illuminate database eloquent buildere
array $options options

Return Value

bool

in DynamicModel at line 305
bool save(array $options = array())

Save the model to the database.

Parameters

array $options options

Return Value

bool

in DynamicModel at line 321
static void macro(string $name, callable $macro)

Register a custom macro.

Parameters

string $name macro name
callable $macro callable

Return Value

void

in DynamicModel at line 332
static bool hasMacro(string $name)

Checks if macro is registered.

Parameters

string $name macro name

Return Value

bool

in DynamicModel at line 343
mixed callMacro(string $name, array $parameters = array())

call macro

Parameters

string $name macro name
array $parameters parameters

Return Value

mixed

in DynamicModel at line 359
mixed getMacroValue(string $name)

get macro value

Parameters

string $name macro name

Return Value

mixed

in DynamicModel at line 376
mixed __call(string $method, array $parameters)

Handle dynamic method calls into the model.

Parameters

string $method method
array $parameters parameters

Return Value

mixed

in DynamicModel at line 391
mixed __get(string $key)

Dynamically retrieve attributes on the model.

Parameters

string $key key

Return Value

mixed

in File at line 92
string getPathname()

Get a path name of file

Return Value

string

in File at line 102
string getContent()

Get the content of file

Return Value

string

in File at line 112
string getOriginKey()

Original file's identifier

Return Value

string

in File at line 122
Collection|File[] getDerives()

Get the derive files of current file

Return Value

Collection|File[]

in File at line 132
Collection|File[] getRawDerives()

Get the derive files of current file with the File type

Return Value

Collection|File[]

in File at line 146
string url(Closure $callback = null)

Get a file url

Parameters

Closure $callback callback

Return Value

string

in File at line 158
Builder scopeDerives(Builder $query, File $file)

Scope for derives

Parameters

Builder $query query builder instance
File $file file instance

Return Value

Builder

in File at line 171
static Collection|File[] getByFileable(string $fileableId)

Get the files for fileable

Parameters

string $fileableId fileable identifier

Return Value

Collection|File[]

in File at line 188
static void setContentReader(callable $reader)

Set the ContentReader instance

Parameters

callable $reader file content reader

Return Value

void

in File at line 199
static void setUrlMaker(UrlMaker $urlMaker)

Set the UrlMaker instance

Parameters

UrlMaker $urlMaker UrlMaker instance

Return Value

void

in File at line 209
string getFileableTable()

Get a fileable table name

Return Value

string

in MimeTypeFilter at line 37
static void bootMimeTypeFilter()

Boot the mime type filter trait for a model.

Return Value

void

in MimeTypeFilter at line 47
static MimeTypeScope getMimeTypeScope()

Returns the mime type filter scope

Return Value

MimeTypeScope

in Media at line 51
static Media make(File $file)

Make media model

Parameters

File $file file model

Return Value

Media

in Media at line 69
static array getMimes()

Returns available mime type

Return Value

array

in Media at line 79
HasOne meta()

Meta data relationship

Return Value

HasOne

at line 51
string getMetaModel()

Returns meta data model for current model

Return Value

string

at line 105
string render(array $option = array())

Rendered media

Parameters

array $option rendering option

Return Value

string

at line 122
string getType()

Returns media type

Return Value

string

in Media at line 115
array toArray()

Get the instance as an array.

Return Value

array

in Media at line 132
string __toString()

Convert to string

Return Value

string

at line 67
static Image|null getThumbnail(Media $media, string $type, string $dimension, bool $defaultSelf = true)

Get a thumbnail image

Parameters

Media $media media instance
string $type thumbnail make type
string $dimension dimension code
bool $defaultSelf if set true, returns self when thumbnail not exists

Return Value

Image|null

at line 86
static Image[] getThumbnails(Media $media, null|string $type = null)

Get thumbnails

Parameters

Media $media media instance
null|string $type thumbnail make type

Return Value

Image[]