Content
class Content extends BaseModel
Content model
Traits
Properties
integer | $id | ID | |
string | $uuid | UUID | |
string | $title | Title/Headline | |
string | $title_url | Default url dirived from title | |
string | $slug | Content slug | |
string | $type | User-definable type | |
integer | $version | Version number (not ID) | |
string | $abstract | Abstract | |
string | $abstract_raw | Abstract Raw contains the raw Draft object | |
string | $content | Content | |
string | $content_raw | Content raw contains the raw Draft object | |
string | $created_at | Created timestamp | |
string | $modified_at | Modified timestamp | |
string | $published_at | Published timestamp | |
integer | $state | Workflow state | |
integer | $user_id | Editing user ID | |
integer | $assignment_id | Parent assignment ID | |
integer | $workflow_id | Workflow ID | |
integer | $weight | Content weight. | |
integer | $dominant_attachment_id | Dominant attachment reference | |
integer | $container_id | Container id, mostly just for blogs | |
string | $layout_template | Layout template for frontend system | |
string | $click_through | Click through URL for media |
Methods
Phalcon has this bug where if you enumerate a relation then try to set it via the magic setter, it won't save.
Return model's SRN. Model should implement a 'srn_name' protected value.
Set default pushable options for model, uses an array with the keys
- category - string socket category user is subscribed to
- related - array of related properties to include when serializing
Example:
class Content extends BaseModel { use Pushable; .
Push the model to the web socket server via the queue service Options are set as keyword arguments in the form of
- category - (string) supplemental category
- options - (array) override options, see setPushableOptions for more info
Initializer
No description
No description
Returns table name mapped in the model.
Allows to query a set of records that match the specified conditions
Allows to query the first record that match the specified conditions
Array override
Returns only the metaProperties that belong to this version of the content item
Return audit logs for this content item
No description
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.
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...
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
in Srnable at line line 37
object
findFirstBySrn(string $srn)
Find model by SRN
in Pushable at line line 44
setPushableOptions(array $opts = array())
Set default pushable options for model, uses an array with the keys
- category - string socket category user is subscribed to
- related - array of related properties to include when serializing
Example:
class Content extends BaseModel { use Pushable; ... $this->setPushableOptions([ 'category' => 'contentupdate', 'related' => [ 'export', 'authors', 'tags', 'assignment', 'attachment', 'audit', 'export', 'dominantAttachment' ] ] }
in Pushable at line line 58
pushToSocket(array $kwargs = array())
Push the model to the web socket server via the queue service Options are set as keyword arguments in the form of
- category - (string) supplemental category
- options - (array) override options, see setPushableOptions for more info
in Connectable at line line 44
pushToConnector(array $kwargs = array())
Push items to connected front end
at line line 200
initialize()
Initializer
at line line 367
beforeValidation()
at line line 413
validation()
at line line 433
string
getSource()
Returns table name mapped in the model.
at line line 444
static Content[]
find(mixed $parameters = null)
Allows to query a set of records that match the specified conditions
at line line 455
static Content
findFirst(mixed $parameters = null)
Allows to query the first record that match the specified conditions
at line line 465
array
toArray(array $ops = false)
Array override
at line line 545
array
getVersionMetaProperties()
Returns only the metaProperties that belong to this version of the content item
at line line 568
array
getAuditTrail()
Return audit logs for this content item