class Attachment extends BaseModel

Traits

The SRNable trait provides an easy interface to generate and find by SRNs

Properties

integer $id
string $uuid
string $base_name
string $salt
string $extension
integer $parent_id
integer $content_id
integer $height
integer $width
string $size_name
string $type adapter type
string $preview_extension preview extension
integer $container_id Parent container, if any
string $metadata Random metadata for the adapter.

Methods

getResultsetClass()

No description

from BaseModel
boolean
hasProperty(string $str)

Determine if the model has a public property.

from BaseModel
setRelated(string $relation, mixed $value = array())

Phalcon has this bug where if you enumerate a relation then try to set it via the magic setter, it won't save.

from BaseModel
string
getSrn()

Return model's SRN. Model should implement a 'srn_name' protected value.

from Srnable
object
findFirstBySrn(string $srn)

Find model by SRN

from Srnable
initialize()

Initializer

string
getSource()

Returns table name mapped in the model.

static Attachments[]
find(mixed $parameters = null)

Allows to query a set of records that match the specified conditions

static Attachments
findFirst(mixed $parameters = null)

Allows to query the first record that match the specified conditions

array
toArray(array $ops = false)

Array override

afterFetch()

Post fetch callback Populates the adapter reference

beforeSave()

before save callback

afterSave()

undo the before save callback

string
previewUrl()

Returns sized preview image. Will defer to Adapter's previewUrl method if provided.

string
originalUrl()

Returns path to original file. Will defer to Adapter's originalUrl method if provided.

string
imgixUrl()

Returns path to imgix file. Will defer to Adapter's imgixUrl method if provided.

Details

in BaseModel at line line 13
getResultsetClass()

in BaseModel at line line 25
boolean hasProperty(string $str)

Determine if the model has a public property.

Useful in determining valid sorting options on the front end.

Parameters

string $str Property

Return Value

boolean

in BaseModel at line line 40
BaseModel setRelated(string $relation, mixed $value = array())

Phalcon has this bug where if you enumerate a relation then try to set it via the magic setter, it won't save.

I think it has something to do with implicit transactions, but I'm not entirely sure...

Parameters

string $relation
mixed $value

Return Value

BaseModel

in Srnable at line line 18
string getSrn()

Return model's SRN. Model should implement a 'srn_name' protected value.

Otherwise, this will pull from the 'getSource' method

Return Value

string SRN

in Srnable at line line 37
object findFirstBySrn(string $srn)

Find model by SRN

Parameters

string $srn complete SRN

Return Value

object Model object

at line line 119
initialize()

Initializer

at line line 148
string getSource()

Returns table name mapped in the model.

Return Value

string

at line line 159
static Attachments[] find(mixed $parameters = null)

Allows to query a set of records that match the specified conditions

Parameters

mixed $parameters

Return Value

Attachments[]

at line line 170
static Attachments findFirst(mixed $parameters = null)

Allows to query the first record that match the specified conditions

Parameters

mixed $parameters

Return Value

Attachments

at line line 180
array toArray(array $ops = false)

Array override

Parameters

array $ops Options for generation

Return Value

array

at line line 198
afterFetch()

Post fetch callback Populates the adapter reference

at line line 213
beforeSave()

before save callback

at line line 223
afterSave()

undo the before save callback

at line line 235
string previewUrl()

Returns sized preview image. Will defer to Adapter's previewUrl method if provided.

Return Value

string

at line line 256
string originalUrl()

Returns path to original file. Will defer to Adapter's originalUrl method if provided.

Return Value

string

at line line 277
string imgixUrl()

Returns path to imgix file. Will defer to Adapter's imgixUrl method if provided.

Return Value

string