\User\Model\TableUsersTable

Represents "users" database table.

Summary

Methods
Properties
Constants
initialize()
buildRules()
validationDefault()
beforeSave()
updateToken()
countAdministrators()
addSearchOperator()
touch()
unbindFieldable()
No public properties found
No constants found
_applyPasswordPolicies()
_getRawPassword()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

initialize()

initialize(array $config) : void

Initialize a table instance. Called after the constructor.

Parameters

array $config

Configuration options passed to the constructor

buildRules()

buildRules(\Cake\ORM\RulesChecker $rules) : \Cake\ORM\RulesChecker

Application rules.

Parameters

\Cake\ORM\RulesChecker $rules

The rule checker

Returns

\Cake\ORM\RulesChecker

validationDefault()

validationDefault(\Cake\Validation\Validator $validator) : \Cake\Validation\Validator

Default validation rules.

Parameters

\Cake\Validation\Validator $validator

Validator object

Returns

\Cake\Validation\Validator

beforeSave()

beforeSave(\Cake\Event\Event $event, \User\Model\Entity\User $user) : void

If not password is sent means user is not changing it.

Parameters

\Cake\Event\Event $event

The event that was triggered

\User\Model\Entity\User $user

User entity being saved

updateToken()

updateToken(\User\Model\Entity\User $user) : \User\Model\Entity\User

Generates a unique token for the given user entity. The generated token is automatically persisted on DB.

Tokens are unique within the entire DB and follows the pattern below:

<32-random-letters-and-numbers>

Parameters

\User\Model\Entity\User $user

The user for which generate the token

Throws

\Cake\Error\FatalErrorException

When an invalid user entity was given

Returns

\User\Model\Entity\User

The user entity with a the new token property

countAdministrators()

countAdministrators() : integer

Counts the number of administrators ins the system.

Returns

integer

addSearchOperator()

addSearchOperator(string $name, mixed $handler, array $options) : void

Parameters

string $name
mixed $handler
array $options

touch()

touch(\Cake\Datasource\EntityInterface $entity, string $eventName) : boolean

Parameters

\Cake\Datasource\EntityInterface $entity
string $eventName

Returns

boolean

unbindFieldable()

unbindFieldable() : void

_applyPasswordPolicies()

_applyPasswordPolicies(\Cake\Validation\Validator $validator) : \Cake\Validation\Validator

Alters validator object and applies password constraints.

Parameters

\Cake\Validation\Validator $validator

Validator object

Returns

\Cake\Validation\Validator

_getRawPassword()

_getRawPassword(array $context) : string

Tries to get Raw password (unencrypted) from the given context.

Parameters

array $context

Validation rule's context

Returns

string —

Raw password