class User extends BaseModel

Base user model

Traits

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

Properties

int $id ID
string $uuid UUID
string $name User name (full name)
string $slug Slug
string $email User email
string $phone User phone
string $password User's (hashed) password
string $sessid Session id, unused in API
string $session_salt Session cryptographic salt
string $settings Settings, stored as json encoded string
string $public_key Public API key
string $private_key Private api key
boolean $is_snworks Is SNworks flag
boolean $status User status
boolean $is_service Is a Service User
boolean $can_receive_email Can user receive email

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
findFirstBySrn(string $srn)

Find first instance by SRN

initialize()

Initialize method for model.

beforeValidation()

No description

validation()

No description

beforeDelete()

No description

afterUpdate()

No description

beforeSave()

No description

string
getSource()

Returns table name mapped in the model.

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

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

static User
findFirst(mixed $parameters = null)

Allows to query the first record that match the specified conditions

hasRole($role)

No description

array
toArray($opts = array())

toArray override to hide things like, you know, hashed passwords. Notice there are no related options for users.

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

at line line 332
User findFirstBySrn(string $srn)

Find first instance by SRN

Parameters

string $srn

Return Value

User

at line line 134
initialize()

Initialize method for model.

at line line 185
beforeValidation()

at line line 208
validation()

at line line 241
beforeDelete()

at line line 252
afterUpdate()

at line line 267
beforeSave()

at line line 299
string getSource()

Returns table name mapped in the model.

Return Value

string

at line line 310
static User[] find(mixed $parameters = null)

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

Parameters

mixed $parameters

Return Value

User[]

at line line 321
static User findFirst(mixed $parameters = null)

Allows to query the first record that match the specified conditions

Parameters

mixed $parameters

Return Value

User

at line line 339
hasRole($role)

Parameters

$role

at line line 355
array toArray($opts = array())

toArray override to hide things like, you know, hashed passwords. Notice there are no related options for users.

Parameters

$opts

Return Value

array