\Ceo\ModelsRegistryItem

Base model methods

Summary

Methods
Properties
Constants
getResultsetClass()
hasProperty()
setRelated()
beforeSave()
afterSave()
afterFetch()
getMetadata()
toCompat()
initialize()
getSource()
beforeCreate()
find()
findFirst()
$id
$label
$data
$created_at
$modified_at
No constants found
toArrayRelated()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : integer

internal id

Type

integer

$label

$label : string

label

Type

string

$data

$data : string

data

Type

string

$created_at

$created_at : \Ceo\Models\datetime

Created timestamp

Type

\Ceo\Models\datetime

$modified_at

$modified_at : \Ceo\Models\datetime

Last modified timestamp

Type

\Ceo\Models\datetime

Methods

getResultsetClass()

getResultsetClass() 

hasProperty()

hasProperty(string  $str) : boolean

Determine if the model has a public property.

Useful in determining valid sorting options on the front end.

Parameters

string $str

Property

Returns

boolean

setRelated()

setRelated(string  $relation, mixed  $value = array()) : self

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

Returns

self

beforeSave()

beforeSave() 

afterSave()

afterSave() 

afterFetch()

afterFetch() 

getMetadata()

getMetadata(  $k) 

Parameters

$k

toCompat()

toCompat(  $useKlass = null) : object

Returns a base CEO model as a Gryphon compatible one.

{% set article = fetch('article').order('published_at desc').find() %}
{{ article[0].toCompat().url }}

Parameters

$useKlass

Returns

object

initialize()

initialize() 

getSource()

getSource() 

beforeCreate()

beforeCreate() 

find()

find(mixed  $parameters = null) : \Ceo\Models\ResultSet

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

Parameters

mixed $parameters

Returns

\Ceo\Models\ResultSet

findFirst()

findFirst(mixed  $parameters = null) : \Ceo\Models\ResultSet

Allows to query the first record that match the specified conditions

Parameters

mixed $parameters

Returns

\Ceo\Models\ResultSet

toArrayRelated()

toArrayRelated(  $ops,   $array) 

Parameters

$ops
$array