Documentation

User extends DAOEntity
in package

User entity.

Provided by the Standalone Users extension.

Table of Contents

Methods

__callStatic()  : AbstractAction
Magic method to return the action object for an api.
autocomplete()  : AutocompleteAction
checkAccess()  : CheckAccessAction
create()  : Create
delete()  : DAODeleteAction
get()  : DAOGetAction
getActions()  : GetActions
getEntityName()  : string
Get entity name from called class
getFields()  : DAOGetFieldsAction
getInfo()  : array{name: string, title: string, description: string, title_plural: string, type: string, paths: array, class: string, primary_key: array, searchable: string, dao: string, label_field: string, icon: string}
Reflection function called by Entity::get()
getLinks()  : GetLinks
login()  : Login
permissions()  : array<string|int, mixed>
Permissions are only used to *authorize* API actions for the current user. This authorization knows nothing of the parameters, values etc. passed into the API call, so it's authorization or not cannot depend on the values. So you do not implement "update own user, but not others" here.
replace()  : BasicReplaceAction
save()  : Save
sendPasswordReset()  : SendPasswordReset
update()  : Update
getDaoName()  : CRM_Core_DAO|string|null
getEntityTitle()  : string
Overridable function to return a localized title for this entity.

Methods

create()

public static create([bool $checkPermissions = TRUE ]) : Create
Parameters
$checkPermissions : bool = TRUE
Return values
Create

getEntityName()

Get entity name from called class

public static getEntityName() : string
Return values
string

getInfo()

Reflection function called by Entity::get()

public static getInfo() : array{name: string, title: string, description: string, title_plural: string, type: string, paths: array, class: string, primary_key: array, searchable: string, dao: string, label_field: string, icon: string}
Tags
see
Get
Return values
array{name: string, title: string, description: string, title_plural: string, type: string, paths: array, class: string, primary_key: array, searchable: string, dao: string, label_field: string, icon: string}
public static getLinks([bool $checkPermissions = TRUE ]) : GetLinks
Parameters
$checkPermissions : bool = TRUE
Return values
GetLinks

login()

public static login([bool $checkPermissions = TRUE ]) : Login
Parameters
$checkPermissions : bool = TRUE
Return values
Login

permissions()

Permissions are only used to *authorize* API actions for the current user. This authorization knows nothing of the parameters, values etc. passed into the API call, so it's authorization or not cannot depend on the values. So you do not implement "update own user, but not others" here.

public static permissions() : array<string|int, mixed>

For this reason, the default permission is just 'access CiviCRM' which is very (too) permissive, but each API method implemented further restricts its use, e.g. write methods typically use _checkAccess()

Note that 'access password resets' permission is defined in this standaloneusers ext. and is intended to be public.

We have to provide a permission for 'save' because it won't use 'default'; it will use the same as 'create' and we want users to be able to use save (on their own record).

Return values
array<string|int, mixed>

save()

public static save([bool $checkPermissions = TRUE ]) : Save
Parameters
$checkPermissions : bool = TRUE
Return values
Save

update()

public static update([bool $checkPermissions = TRUE ]) : Update
Parameters
$checkPermissions : bool = TRUE
Return values
Update

getEntityTitle()

Overridable function to return a localized title for this entity.

protected static getEntityTitle([bool $plural = FALSE ]) : string
Parameters
$plural : bool = FALSE

Whether to return a plural title.

Return values
string

        
On this page

Search results