User extends Element
in package
Uses IdentifiableElementTrait, IntegrableElementTrait, DateAddedTrait, CustomTagValuesTrait, EnumResolverTrait, SalesAgentTrait, ElementTrait

This is the user main class.

The user information will be stored in that class and will remain immutable (only get methods are available)

Tags
see
User::getEmail()
see
User::getNick()
see
User::getGender()
see
User::getUserGroups()
see
User::getUniqueId()
see
User::getBirthday()
see
User::getLastUsed()
see
User::getLanguageCode()
see
User::getCurrencyCode()
see
User::getUseShippingAddress()
see
User::getVerified()
see
User::getBlogVerified()
see
User::getActive()
see
User::getImage()
see
User::getSupplier()
see
User::getBlogger()
see
User::getParentId()
see
User::getBillingAddresses()
see
User::getDefaultBillingAddress()
see
User::getShippingAddresses()
see
User::getDefaultShippingAddress()
see
User::getAddress()
see
User::getSelectedBillingAddressId()
see
User::getSelectedShippingAddressId()
see
Element
see
ElementTrait
see
IdentifiableElementTrait
see
IntegrableElementTrait
see
DateAddedTrait
see
CustomTagValuesTrait
see
EnumResolverTrait
see
SalesAgentTrait

Table of Contents

$customTagValues  : array<string|int, mixed>
$error  : Error|null
$id Autonumeric element id.  : int
$pId Public and readable element id.  : string
__construct() {@inheritdoc}  : mixed
__toString() Uses "json_encode" function to return the JSON format of the element.  : string
getActive() Sets if the user is active or not.  : bool
getAddress() Returns the user address filtered by the given id.  : Address|null
getBillingAddresses() Returns the user billing addresses.  : array<string|int, BillingAddress>
getBirthday() Returns the user's birthday.  : Date|null
getBlogger() Sets if the user is blogger or not.  : bool
getBlogVerified() Sets if the user is verified on the blog or not.  : bool
getCurrencyCode() Returns the user's default currency code  : string
getCustomTagValues() Returns the element custom tag values.  : array<string|int, CustomTagValue>
getDateAdded() Returns the date when the element was added.  : Date|null
getDefaultBillingAddress() Returns the user default billing address.  : BillingAddress|null
getDefaultShippingAddress() Returns the user default shipping address.  : ShippingAddress|null
getEmail() Returns the user email.  : string
getError() Returns the current element error (if there is error).  : Error|null
getGender() Returns the user gender.  : string
getId() Returns the element id.  : int
getImage() Returns the user image.  : string
getLanguageCode() Returns the user's default language initials  : string
getLastUsed() Returns the date when the user was used for the last time.  : Date|null
getNick() Returns the user nick.  : string
getParentId() Returns the user parent internal identifier.  : int
getPId() Returns the element public id (pId).  : string
getSalesAgent() Returns the element salesAgent data.  : bool
getSalesAgentId() Returns the element salesAgentId data.  : int
getSelectedBillingAddressId() Returns the user selected billing address internal identifier.  : int
getSelectedShippingAddressId() Returns the user selected shipping address internal identifier.  : int
getShippingAddresses() Returns the user shipping addresses.  : array<string|int, ShippingAddress>
getSupplier() Sets if the user is a supplier or not.  : bool
getUniqueId() Returns the user unique Id  : string
getUserAdditionalInformation() Returns the user additional information.  : UserAdditionalInformation|null
getUserGroups() Returns the user groups where this user belongs  : array<string|int, UserGroup>
getUseShippingAddress() Sets if the user wants to use the shipping address or not.  : bool
getVerified() Sets if the user is verified or not.  : bool
jsonSerialize() Allow elements to be serialized.  : array<string|int, mixed>
toArray() Used to allow elements to be serialized.  : array<string|int, mixed>
getFieldItem()  : object|null
getFormattedData()  : mixed
setArrayField() Convert an API array of objects to a PHP array of objects.  : array<string|int, mixed>
setCustomTagValues()  : void
setError()  : void

Properties

$id

Autonumeric element id.

protected int $id = 0

All the given elements by the LogiCommerce API will send it.

$pId

Public and readable element id.

protected string $pId = ''

Setted by the user on LogiCommerce. All the integrable elements by the LogiCommerce API will send it. Useful for integrations and other 3rd party softwares that need to connect to LogiCommerce software.

Methods

__construct()

{@inheritdoc}

public __construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
$data : array<string|int, mixed> = []
Tags
see
ElementTrait::__construct()
Return values
mixed

__toString()

Uses "json_encode" function to return the JSON format of the element.

public __toString() : string

Auto-invoked using echo or concatenations.

Return values
string

getActive()

Sets if the user is active or not.

public getActive() : bool
Return values
bool

getAddress()

Returns the user address filtered by the given id.

public getAddress(int $id) : Address|null
Parameters
$id : int

Identifier of the address you want to get.

Tags
see
Address
Return values
Address|null

getBillingAddresses()

Returns the user billing addresses.

public getBillingAddresses() : array<string|int, BillingAddress>
Return values
array<string|int, BillingAddress>

getBirthday()

Returns the user's birthday.

public getBirthday() : Date|null
Return values
Date|null

getBlogger()

Sets if the user is blogger or not.

public getBlogger() : bool
Return values
bool

getBlogVerified()

Sets if the user is verified on the blog or not.

public getBlogVerified() : bool
Return values
bool

getCurrencyCode()

Returns the user's default currency code

public getCurrencyCode() : string
Return values
string

getDateAdded()

Returns the date when the element was added.

public getDateAdded() : Date|null
Return values
Date|null

getEmail()

Returns the user email.

public getEmail() : string
Return values
string

getError()

Returns the current element error (if there is error).

public getError() : Error|null
Return values
Error|null

getGender()

Returns the user gender.

public getGender() : string
Return values
string

getImage()

Returns the user image.

public getImage() : string
Return values
string

getLanguageCode()

Returns the user's default language initials

public getLanguageCode() : string
Return values
string

getLastUsed()

Returns the date when the user was used for the last time.

public getLastUsed() : Date|null
Return values
Date|null

getNick()

Returns the user nick.

public getNick() : string
Return values
string

getParentId()

Returns the user parent internal identifier.

public getParentId() : int
Return values
int

getSalesAgent()

Returns the element salesAgent data.

public getSalesAgent() : bool
Return values
bool

getSalesAgentId()

Returns the element salesAgentId data.

public getSalesAgentId() : int
Return values
int

getSelectedBillingAddressId()

Returns the user selected billing address internal identifier.

public getSelectedBillingAddressId() : int
Return values
int

getSelectedShippingAddressId()

Returns the user selected shipping address internal identifier.

public getSelectedShippingAddressId() : int
Return values
int

getShippingAddresses()

Returns the user shipping addresses.

public getShippingAddresses() : array<string|int, ShippingAddress>
Return values
array<string|int, ShippingAddress>

getSupplier()

Sets if the user is a supplier or not.

public getSupplier() : bool
Return values
bool

getUniqueId()

Returns the user unique Id

public getUniqueId() : string
Return values
string

getUserGroups()

Returns the user groups where this user belongs

public getUserGroups() : array<string|int, UserGroup>
Return values
array<string|int, UserGroup>

getUseShippingAddress()

Sets if the user wants to use the shipping address or not.

public getUseShippingAddress() : bool
Return values
bool

getVerified()

Sets if the user is verified or not.

public getVerified() : bool
Return values
bool

jsonSerialize()

Allow elements to be serialized.

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

Auto-invoked using "json_encode" function.

Return values
array<string|int, mixed>

toArray()

Used to allow elements to be serialized.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFieldItem()

protected getFieldItem(array<string|int, mixed> $item, string $class) : object|null
Parameters
$item : array<string|int, mixed>
$class : string
Return values
object|null

getFormattedData()

protected getFormattedData(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

setArrayField()

Convert an API array of objects to a PHP array of objects.

protected setArrayField(array<string|int, mixed> $data, string $class) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Array that contains all the values to the objects to initialize

$class : string

The PHP class we want the objects to be

Return values
array<string|int, mixed>

setCustomTagValues()

protected setCustomTagValues(array<string|int, mixed> $customTagValues) : void
Parameters
$customTagValues : array<string|int, mixed>
Return values
void

setError()

protected setError(mixed $error) : void
Parameters
$error : mixed
Return values
void

Search results