diff --git a/apiConfig.readonly.json b/apiConfig.readonly.json
index df4e43c..8784673 100644
--- a/apiConfig.readonly.json
+++ b/apiConfig.readonly.json
@@ -1,5 +1,5 @@
{
- "version": "2.1.7",
+ "version": "2.1.8",
"tokenTimeout": 60,
"apiRequestRatePerMinute": 256,
"servicesDBCache": 10
diff --git a/composer.json b/composer.json
index c80b940..888c3f0 100644
--- a/composer.json
+++ b/composer.json
@@ -3,7 +3,7 @@
"type": "library",
"description": "LDC CRM Client V2",
"license": "MIT",
- "version": "2.1.7",
+ "version": "2.1.8",
"authors": [
{
"name": "Jérémy Munsch",
diff --git a/documentation/classes/LDC-LDCCRM-CrmApiV2.html b/documentation/classes/LDC-LDCCRM-CrmApiV2.html
index 389f499..0219433 100644
--- a/documentation/classes/LDC-LDCCRM-CrmApiV2.html
+++ b/documentation/classes/LDC-LDCCRM-CrmApiV2.html
@@ -70,7 +70,9 @@
models
transport
utilities
+ Wordpress
+
diff --git a/documentation/classes/LDC-LDCCRM-Models-ArcadiaMailDefault.html b/documentation/classes/LDC-LDCCRM-Models-ArcadiaMailDefault.html
index 83b2726..a68e3fb 100644
--- a/documentation/classes/LDC-LDCCRM-Models-ArcadiaMailDefault.html
+++ b/documentation/classes/LDC-LDCCRM-Models-ArcadiaMailDefault.html
@@ -70,7 +70,9 @@
models
transport
utilities
+ Wordpress
+
+
+
+
+ jsonSerialize()
+
+
+
+
+ Serialize this object to an array
+
+
+ public
+ jsonSerialize ( ) : array<string|int, mixed>
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+ —
+
+
ArcadiaMailGame.php
:
- 149
+ 153
@@ -952,6 +994,32 @@ Required
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
Return values
bool
diff --git a/documentation/classes/LDC-LDCCRM-Models-Customer.html b/documentation/classes/LDC-LDCCRM-Models-Customer.html
index e830269..dd55789 100644
--- a/documentation/classes/LDC-LDCCRM-Models-Customer.html
+++ b/documentation/classes/LDC-LDCCRM-Models-Customer.html
@@ -70,7 +70,9 @@
models
transport
utilities
+ Wordpress
+
@@ -2122,12 +2215,147 @@ This is an alias of Customer::find()
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
Return values
self|null
—
+
+
+
+ jsonSerialize()
+
+
+
+
+ Serialize this object to an array
+
+
+ public
+ jsonSerialize ( ) : array<string|int, mixed>
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+ —
+
+
+
+
+
+ login()
+
+
+
+
+ Test customer credentials
+
+
+ public
+ static login ( string $email , string $password ) : bool
+
+
+ Parameters
+
+
+ $email
+ : string
+
+
+
+
+
+ $password
+ : string
+
+
+
+
+
+
+
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
+
+ Return values
+ bool
+ —
+
+
Customer.php
:
- 438
+ 433
@@ -2155,6 +2383,32 @@ This is an alias of Customer::find()
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
Return values
bool
@@ -2177,7 +2431,7 @@ This is an alias of Customer::find()
@@ -2190,6 +2444,32 @@ This is an alias of Customer::find()
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
Return values
bool
@@ -2212,7 +2492,7 @@ This is an alias of Customer::find()
@@ -2258,7 +2538,7 @@ This is an alias of Customer::find()
@@ -2291,7 +2571,7 @@ This is an alias of Customer::find()
diff --git a/documentation/classes/LDC-LDCCRM-Models-Question.html b/documentation/classes/LDC-LDCCRM-Models-Question.html
index 4fc4ca8..5d9fd4e 100644
--- a/documentation/classes/LDC-LDCCRM-Models-Question.html
+++ b/documentation/classes/LDC-LDCCRM-Models-Question.html
@@ -70,7 +70,9 @@
models
transport
utilities
+ Wordpress
+
+
+
+ jsonSerialize()
+
+
+
+
+ Serialize this object to an array
+
+
+ public
+ jsonSerialize ( ) : array<string|int, mixed>
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+ —
+
+
Question.php
:
- 262
+ 273
@@ -1036,6 +1130,32 @@ using validation rules
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
Return values
array<string|int, Question >
diff --git a/documentation/classes/LDC-LDCCRM-Models-SingleOptin.html b/documentation/classes/LDC-LDCCRM-Models-SingleOptin.html
index 940f886..0d4ac86 100644
--- a/documentation/classes/LDC-LDCCRM-Models-SingleOptin.html
+++ b/documentation/classes/LDC-LDCCRM-Models-SingleOptin.html
@@ -70,7 +70,9 @@
models
transport
utilities
+ Wordpress
+
+
+
+ $translations
+
+
+
+
+
+
+ Loaded translations
+
+
+ private
+ static array<string|int, mixed>
+ $translations
+ = []
+
+
+
+
+
@@ -311,7 +369,7 @@
@@ -375,7 +433,7 @@
@@ -408,7 +466,7 @@
@@ -455,6 +513,62 @@
—
+
+
+
+ log()
+
+
+
+
+ Write log using syslog
+It also write log using \Illuminate\Support\Facades\Log
+if it is present
+
+
+ public
+ static log ( string $message , LogLevel $level ) : void
+
+
+ Parameters
+
+
+ $message
+ : string
+
+
+ The message is prefixed with "LDC CRM:"
+
+
+
+
+ $level
+ : LogLevel
+
+
+
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
Utils.php
:
- 49
+ 56
@@ -477,7 +591,7 @@
public
- static makeValidator ( array<string|int, mixed> $data , array<string|int, mixed> $rules [ , array<string|int, mixed> $messages = [] ] [ , array<string|int, mixed> $customAttributes = [] ] ) : Validator
+ static makeValidator ( array<string|int, mixed> $data , array<string|int, mixed> $rules ) : Validator
Parameters
@@ -496,17 +610,53 @@
+
+
+
+
+ Return values
+ Validator
+ —
+
+
+
+
+
+ translate()
+
+
+
+
+ Translation a string using php file lang
+
+
+ public
+ static translate ( string $key [ , string $lang = 'fr' ] ) : string
+
+
+ Parameters
+
- $messages
- : array<string|int, mixed>
- = []
+ $key
+ : string
+
- $customAttributes
- : array<string|int, mixed>
- = []
+ $lang
+ : string
+ = 'fr'
@@ -515,7 +665,7 @@
Return values
- Validator
+ string
—
diff --git a/documentation/classes/LDC-LDCCRM-WordPress-WPCrm.html b/documentation/classes/LDC-LDCCRM-WordPress-WPCrm.html
new file mode 100644
index 0000000..87ee0e2
--- /dev/null
+++ b/documentation/classes/LDC-LDCCRM-WordPress-WPCrm.html
@@ -0,0 +1,1941 @@
+
+
+
+
+ CRM V2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WPCrm
+
+
+
+
+
+
+
+
+
+ Class de gestion des users en session avec Wordpress (ce truc immonde)
+
+
+
+
+
+
+ category
+
+
+
+
+
+
+
+ subpackage
+
+
+
+
+
+
+
+ author
+
+
+
+
+
+
+
+ license
+
+
+
+ MIT https://opensource.org/licenses/MIT
+
+
+
+
+ link
+
+
+ /
+
+
+
+
+
+
+
+
+
+
+ Table of Contents
+
+
+
+
+
+ $api
+
+ : CrmApiV2
+
+The user object
+
+
+ $user
+
+ : WPCrmUser
+
+The user object
+
+
+ $sessionDestroyed
+
+ : mixed
+
+
+
+
+ $sessionKey
+
+ : mixed
+
+
+
+
+ activateUser()
+
+ : bool
+
+Toggle the current user optin value
+on the current user and the crm
+
+
+ check()
+
+ : bool
+
+Check if the user is Authenticated
+
+
+ deleteUser()
+
+ : bool
+
+Delete current customer from
+the local database and the crm
+
+
+ forceLogin()
+
+ : WPCrmUser |null
+
+Login user by setting user session
+
+
+ getNewUser()
+
+ : WPCrmUser
+
+Generate a new user
+
+
+ getUser()
+
+ : WPCrmUser |null
+
+Get the current user
+return null if the user is not logged in
+
+
+ getUserFromApi()
+
+ : WPCrmUser |false
+
+Get the current user
+return api response code if an error occurs
+
+
+ getUserFromTable()
+
+ : array<string|int, mixed>|null
+
+Get a customer from table
+
+
+ getUserFromTableByEmail()
+
+ : array<string|int, mixed>|null
+
+Get a customer from table by an email
+
+
+ getUserFromTableByUuid()
+
+ : array<string|int, mixed>|null
+
+Get a customer from table by an email
+
+
+ login()
+
+ : WPCrmUser |false
+
+Try to login with CRM API
+return api response code if an error occurs
+
+
+ logout()
+
+ : void
+
+Destroy the customer from session
+and therefore logout
+
+
+ saveUser()
+
+ : bool
+
+Save current customer to
+the local database and on crm
+
+
+ sendArcadiaMailDefault()
+
+ : bool
+
+send An arcadia mail with type default
+This methods requires to have a user in session (to be logged in)
+
+
+ sendArcadiaMailGame()
+
+ : bool
+
+send An arcadia mail with type game
+This methods requires to have a user in session (to be logged in)
+
+
+ setSingleOptin()
+
+ : bool
+
+Set the single optin status for an email
+on the crm
+
+
+ toggleUserOptin()
+
+ : bool
+
+Toggle the current user optin value
+on the current user and the crm
+
+
+ unsetActiveUser()
+
+ : void
+
+Remove active user
+to prevent WPCrm::check to return true
+
+
+ getRawProperty()
+
+ : mixed
+
+Get a property
+
+
+ bootSessionIfNeeded()
+
+ : void
+
+Boot the php session if needed
+
+
+ deleteUserFromTable()
+
+ : void
+
+Save or update the user to the table
+
+
+ getCustomer()
+
+ : Customer |null
+
+Get all customer infos
+
+
+ getWpDb()
+
+ : object
+
+Get WP 'pdo instance'
+
+
+ initLdcApi()
+
+ : ApiV1
+
+Get the initialized API object
+
+
+ loginUserWithApi()
+
+ : WPCrmUser |false
+
+Get the current user
+return null if the user is not logged in
+
+
+ makeApiV2Call()
+
+ : mixed|false
+
+Make a call using apiV2
+
+
+ query()
+
+ : object
+
+Query in DB
+
+
+ saveOrUpdateUserToTable()
+
+ : void
+
+Save or update the user to the table
+
+
+ setUser()
+
+ : void
+
+Create a user
+stores it to the session
+and finally saves it to the database if it does not exists
+
+
+
+
+
+
+
+
+
+
+
+
+ $api
+
+
+
+
+
+
+ The user object
+
+
+ protected
+ static CrmApiV2
+ $api
+ = null
+
+
+
+
+
+
+
+
+ $user
+
+
+
+
+
+
+ The user object
+
+
+ protected
+ static WPCrmUser
+ $user
+ = null
+
+
+
+
+
+
+
+
+ $sessionDestroyed
+
+
+
+
+
+
+
+
+ private
+ static mixed
+ $sessionDestroyed
+ = false
+
+
+
+
+
+
+
+
+
+
+ $sessionKey
+
+
+
+
+
+
+
+
+ private
+ static mixed
+ $sessionKey
+ = 'LDC_CRM_USER'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ activateUser()
+
+
+
+
+ Toggle the current user optin value
+on the current user and the crm
+
+
+ public
+ static activateUser ( ) : bool
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded
+
+
+
+
+
+
+ check()
+
+
+
+
+ Check if the user is Authenticated
+
+
+ public
+ static check ( ) : bool
+
+
+
+
+
+ Return values
+ bool
+ —
+
+
+
+
+
+ deleteUser()
+
+
+
+
+ Delete current customer from
+the local database and the crm
+
+
+ public
+ static deleteUser ( ) : bool
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded
+
+
+
+
+
+
+ forceLogin()
+
+
+
+
+ Login user by setting user session
+
+
+ public
+ static forceLogin ( ) : WPCrmUser |null
+
+
+
+
+
+ Return values
+ WPCrmUser |null
+ —
+
+
+
+
+
+ getNewUser()
+
+
+
+
+ Generate a new user
+
+
+ public
+ static getNewUser ( ) : WPCrmUser
+
+
+
+
+
+ Return values
+ WPCrmUser
+ —
+
+
+
+
+
+ getUser()
+
+
+
+
+ Get the current user
+return null if the user is not logged in
+
+
+ public
+ static getUser ( ) : WPCrmUser |null
+
+
+
+
+
+ Return values
+ WPCrmUser |null
+ —
+
+
+
+
+
+ getUserFromApi()
+
+
+
+
+ Get the current user
+return api response code if an error occurs
+
+
+ public
+ static getUserFromApi ( string $identification ) : WPCrmUser |false
+
+
+ Parameters
+
+
+ $identification
+ : string
+
+
+ The customer hashcode or email
+
+
+
+
+
+
+
+ Return values
+ WPCrmUser |false
+ —
+
+
+
+
+
+ getUserFromTable()
+
+
+
+
+ Get a customer from table
+
+
+ public
+ static getUserFromTable ( string $hashcode ) : array<string|int, mixed>|null
+
+
+ Parameters
+
+
+ $hashcode
+ : string
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>|null
+ —
+
+
+
+
+
+ getUserFromTableByEmail()
+
+
+
+
+ Get a customer from table by an email
+
+
+ public
+ static getUserFromTableByEmail ( string $email ) : array<string|int, mixed>|null
+
+
+ Parameters
+
+
+ $email
+ : string
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>|null
+ —
+
+
+
+
+
+ getUserFromTableByUuid()
+
+
+
+
+ Get a customer from table by an email
+
+
+ public
+ static getUserFromTableByUuid ( string $uuid ) : array<string|int, mixed>|null
+
+
+ Parameters
+
+
+ $uuid
+ : string
+
+
+ The customer transaction uuid
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>|null
+ —
+
+
+
+
+
+ login()
+
+
+
+
+ Try to login with CRM API
+return api response code if an error occurs
+
+
+ public
+ static login ( string $email , string $password ) : WPCrmUser |false
+
+
+ Parameters
+
+
+ $email
+ : string
+
+
+
+
+
+
+ $password
+ : string
+
+
+
+
+
+
+
+
+
+ Return values
+ WPCrmUser |false
+ —
+
+
+
+
+
+ logout()
+
+
+
+
+ Destroy the customer from session
+and therefore logout
+
+
+ public
+ static logout ( ) : void
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ saveUser()
+
+
+
+
+ Save current customer to
+the local database and on crm
+
+
+ public
+ static saveUser ( ) : bool
+
+
+
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ with \LDC\LDCCRM\Enums\ApiError::customerExists()
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded false otherwise
+
+
+
+
+
+
+ sendArcadiaMailDefault()
+
+
+
+
+ send An arcadia mail with type default
+This methods requires to have a user in session (to be logged in)
+
+
+ public
+ static sendArcadiaMailDefault ( ArcadiaMailDefault $mail ) : bool
+
+
+ Parameters
+
+
+ $mail
+ : ArcadiaMailDefault
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+
+
+
+
+
+
+ sendArcadiaMailGame()
+
+
+
+
+ send An arcadia mail with type game
+This methods requires to have a user in session (to be logged in)
+
+
+ public
+ static sendArcadiaMailGame ( ArcadiaMailGame $mail ) : bool
+
+
+ Parameters
+
+
+ $mail
+ : ArcadiaMailGame
+
+
+
+
+
+
+
+
+ Return values
+ bool
+ —
+
+
+
+
+
+
+ setSingleOptin()
+
+
+
+
+ Set the single optin status for an email
+on the crm
+
+
+ public
+ static setSingleOptin ( string $email , bool $opt_in ) : bool
+
+
+ Parameters
+
+
+ $email
+ : string
+
+
+
+
+
+ $opt_in
+ : bool
+
+
+
+
+
+
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ with \LDC\LDCCRM\Enums\ApiError::singleOptinCustomerExists()
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded false otherwise
+
+
+
+
+
+
+ toggleUserOptin()
+
+
+
+
+ Toggle the current user optin value
+on the current user and the crm
+
+
+ public
+ static toggleUserOptin ( ) : bool
+
+
+
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ with \LDC\LDCCRM\Enums\ApiError::singleOptinCustomerExists()
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded
+
+
+
+
+
+
+ unsetActiveUser()
+
+
+
+
+ Remove active user
+to prevent WPCrm::check to return true
+
+
+ public
+ static unsetActiveUser ( ) : void
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ getRawProperty()
+
+
+
+
+ Get a property
+
+
+ protected
+ static getRawProperty ( object $object , string $field ) : mixed
+
+
+ Parameters
+
+
+ $object
+ : object
+
+
+
+
+
+
+ $field
+ : string
+
+
+
+
+
+
+
+
+ Return values
+ mixed
+ —
+
+
+
+
+
+ bootSessionIfNeeded()
+
+
+
+
+ Boot the php session if needed
+
+
+ private
+ static bootSessionIfNeeded ( ) : void
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ deleteUserFromTable()
+
+
+
+
+ Save or update the user to the table
+
+
+ private
+ static deleteUserFromTable ( ) : void
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ getCustomer()
+
+
+
+
+ Get all customer infos
+
+
+ private
+ static getCustomer ( ) : Customer |null
+
+
+
+
+
+ Return values
+ Customer |null
+ —
+
+
+
+
+
+ getWpDb()
+
+
+
+
+ Get WP 'pdo instance'
+
+
+ private
+ static getWpDb ( ) : object
+
+
+
+
+
+ Return values
+ object
+ —
+
+
+
+
+
+
+ initLdcApi()
+
+
+
+
+ Get the initialized API object
+
+
+ private
+ static initLdcApi ( ) : ApiV1
+
+
+
+
+
+ Return values
+ ApiV1
+ —
+
+
+
+
+
+ loginUserWithApi()
+
+
+
+
+ Get the current user
+return null if the user is not logged in
+
+
+ private
+ static loginUserWithApi ( string $email , string $password ) : WPCrmUser |false
+
+
+ Parameters
+
+
+ $email
+ : string
+
+
+
+
+
+
+ $password
+ : string
+
+
+
+
+
+
+
+
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
+
+ Return values
+ WPCrmUser |false
+ —
+
+
+
+
+
+ makeApiV2Call()
+
+
+
+
+ Make a call using apiV2
+
+
+ private
+ static makeApiV2Call ( mixed $obj , string $method [ , array<string|int, mixed> $arguments = [] ] ) : mixed|false
+
+
+ Parameters
+
+
+ $obj
+ : mixed
+
+
+
+
+
+
+ $method
+ : string
+
+
+
+
+
+ $arguments
+ : array<string|int, mixed>
+ = []
+
+
+
+
+
+
+
+ Return values
+ mixed|false
+ —
+
+
+
+
+
+ query()
+
+
+
+
+ Query in DB
+
+
+ private
+ static query ( string $query [ , array<string|int, mixed> $params = [] ] ) : object
+
+
+ Parameters
+
+
+ $query
+ : string
+
+
+ La request avec les variables en points d'interrogation
+
+
+
+
+ $params
+ : array<string|int, mixed>
+ = []
+
+ Les paramètres des la requète
+
+
+
+
+
+
+
+ Return values
+ object
+ —
+ Containing the row columns
+
+
+
+
+
+
+ saveOrUpdateUserToTable()
+
+
+
+
+ Save or update the user to the table
+
+
+ private
+ static saveOrUpdateUserToTable ( ) : void
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ setUser()
+
+
+
+
+ Create a user
+stores it to the session
+and finally saves it to the database if it does not exists
+
+
+ private
+ static setUser ( Customer $customer ) : void
+
+
+ Parameters
+
+
+ $customer
+ : Customer
+
+
+
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/classes/LDC-LDCCRM-WordPress-WPCrmAnswer.html b/documentation/classes/LDC-LDCCRM-WordPress-WPCrmAnswer.html
new file mode 100644
index 0000000..13fcef2
--- /dev/null
+++ b/documentation/classes/LDC-LDCCRM-WordPress-WPCrmAnswer.html
@@ -0,0 +1,444 @@
+
+
+
+
+ CRM V2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WPCrmAnswer
+
+
+
+
+
+
+
+
+
+ Class de gestion de la segmentation question avec Wordpress (ce truc immonde)
+
+
+
+
+
+
+ category
+
+
+
+
+
+
+
+ subpackage
+
+
+
+
+
+
+
+ author
+
+
+
+
+
+
+
+ license
+
+
+
+ MIT https://opensource.org/licenses/MIT
+
+
+
+
+ link
+
+
+ /
+
+
+
+
+
+
+
+
+
+
+ Table of Contents
+
+
+
+
+
+ setQuestionAnswers()
+
+ : bool
+
+Set unanswered question for a specific customer
+
+
+ getRawProperty()
+
+ : mixed
+
+Get a property
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setQuestionAnswers()
+
+
+
+
+ Set unanswered question for a specific customer
+
+
+ public
+ setQuestionAnswers ( WPCrmUser $user , int $questionId , array<string|int, mixed> $answersId ) : bool
+
+
+ Parameters
+
+
+ $user
+ : WPCrmUser
+
+
+
+
+
+
+ $questionId
+ : int
+
+
+
+
+
+
+ $answersId
+ : array<string|int, mixed>
+
+
+ An array with answers id
+
+
+
+
+
+
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
+
+ Return values
+ bool
+ —
+
+
+
+
+
+
+ getRawProperty()
+
+
+
+
+ Get a property
+
+
+ protected
+ static getRawProperty ( object $object , string $field ) : mixed
+
+
+ Parameters
+
+
+ $object
+ : object
+
+
+
+
+
+
+ $field
+ : string
+
+
+
+
+
+
+
+
+ Return values
+ mixed
+ —
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/classes/LDC-LDCCRM-WordPress-WPCrmQuestion.html b/documentation/classes/LDC-LDCCRM-WordPress-WPCrmQuestion.html
new file mode 100644
index 0000000..8229379
--- /dev/null
+++ b/documentation/classes/LDC-LDCCRM-WordPress-WPCrmQuestion.html
@@ -0,0 +1,576 @@
+
+
+
+
+ CRM V2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WPCrmQuestion
+
+
+
+
+
+
+
+
+
+ Class de gestion de la segmentation question avec Wordpress (ce truc immonde)
+
+
+
+
+
+
+ category
+
+
+
+
+
+
+
+ subpackage
+
+
+
+
+
+
+
+ author
+
+
+
+
+
+
+
+ license
+
+
+
+ MIT https://opensource.org/licenses/MIT
+
+
+
+
+ link
+
+
+ /
+
+
+
+
+
+
+
+
+
+
+ Table of Contents
+
+
+
+
+
+ allWithCustomerAnswers()
+
+ : array<string|int, mixed>
+
+Get all the questions with user answers
+
+
+ getAll()
+
+ : array<string|int, mixed>
+
+Get all questions only
+
+
+ unansweredBy()
+
+ : array<string|int, Question >
+
+Get unanswered question for a specific customer
+
+
+ getRawProperty()
+
+ : mixed
+
+Get a property
+
+
+
+
+
+
+
+
+
+
+
+
+
+ allWithCustomerAnswers()
+
+
+
+
+ Get all the questions with user answers
+
+
+ public
+ static allWithCustomerAnswers ( WPCrmUser $user ) : array<string|int, mixed>
+
+
+ Parameters
+
+
+ $user
+ : WPCrmUser
+
+
+
+
+
+
+
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+ —
+ [
+0 => [
+'question' => \LDC\LDCCRM\Models\Question,
+'customerAnswers' => \LDC\LDCCRM\Models\Answer[]
+]
+]
+with \LDC\LDCCRM\Models\Question[]
+and the customer \LDC\LDCCRM\Models\Answer[]
+
+
+
+
+
+
+ getAll()
+
+
+
+
+ Get all questions only
+
+
+ public
+ static getAll ( ) : array<string|int, mixed>
+
+
+
+
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+ —
+ with \LDC\LDCCRM\Models\Question[]
+
+
+
+
+
+
+ unansweredBy()
+
+
+
+
+ Get unanswered question for a specific customer
+
+
+ public
+ static unansweredBy ( WPCrmUser $user ) : array<string|int, Question >
+
+
+ Parameters
+
+
+ $user
+ : WPCrmUser
+
+
+
+
+
+
+
+
+
+
+ throws
+
+
+ CrmException
+
+ if an error occurs on server side or on getting response
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ If any error or \LDC\LDCCRM\Enums\ApiError occurs
+
+
+
+
+
+ Return values
+ array<string|int, Question >
+ —
+
+
+
+
+
+ getRawProperty()
+
+
+
+
+ Get a property
+
+
+ protected
+ static getRawProperty ( object $object , string $field ) : mixed
+
+
+ Parameters
+
+
+ $object
+ : object
+
+
+
+
+
+
+ $field
+ : string
+
+
+
+
+
+
+
+
+ Return values
+ mixed
+ —
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/classes/LDC-LDCCRM-WordPress-WPCrmUser.html b/documentation/classes/LDC-LDCCRM-WordPress-WPCrmUser.html
new file mode 100644
index 0000000..be04cdb
--- /dev/null
+++ b/documentation/classes/LDC-LDCCRM-WordPress-WPCrmUser.html
@@ -0,0 +1,1633 @@
+
+
+
+
+ CRM V2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WPCrmUser
+
+
+
+
+
+ implements
+ JsonSerializable
+
+
+
+
+
+ Class de gestion des users en session avec Wordpress (ce truc immonde)
+
+ @property string $uuidToken — A local transaction token for this user
+
+
+
+
+
+
+ category
+
+
+
+
+
+
+
+ subpackage
+
+
+
+
+
+
+
+ author
+
+
+
+
+
+
+
+ license
+
+
+
+ MIT https://opensource.org/licenses/MIT
+
+
+
+
+ link
+
+
+ /
+
+
+
+
+
+
+
+
+ Interfaces, Classes and Traits
+
+
+
+
+ JsonSerializable
+
+
+
+
+
+
+
+ Table of Contents
+
+
+
+
+
+ $address
+
+ : string
+
+
+
+
+ $address2
+
+ : string
+
+
+
+
+ $birth_date
+
+ : string
+
+
+
+
+ $city
+
+ : string
+
+
+
+
+ $country
+
+ : Country
+
+
+
+
+ $email
+
+ : string
+
+
+
+
+ $firstname
+
+ : string
+
+
+
+
+ $hashcode
+
+ : string
+
+
+
+
+ $last_connection
+
+ : string
+
+
+
+
+ $lastname
+
+ : string
+
+
+
+
+ $opt_in
+
+ : bool
+
+
+
+
+ $password
+
+ : string
+
+
+
+
+ $phone
+
+ : string
+
+
+
+
+ $postcode
+
+ : string
+
+
+
+
+ $status
+
+ : bool
+
+
+
+
+ $info
+
+ : Customer
+
+The CRM customer info (the api response)
+
+
+ $pemail
+
+ : string
+
+The CRM customer email
+
+
+ $phashcode
+
+ : string
+
+The CRM hashcode (UUID)
+
+
+ $uuidToken
+
+ : string
+
+The CRM customer temp uuidToken to validate transactions
+
+
+ __construct()
+
+ : mixed
+
+WPCrmUser construct
+
+
+ __get()
+
+ : bool|string|Country
+
+Magic getter
+
+
+ __set()
+
+ : bool|string|Country
+
+Magic setter
+
+
+ activate()
+
+ : bool
+
+Activate the account in the crm
+
+
+ delete()
+
+ : bool
+
+Delete current customer to
+the local database and on crm
+
+
+ jsonSerialize()
+
+ : array<string|int, mixed>
+
+Serialize this object to an array
+
+
+ parseFromJson()
+
+ : WPCrmUser
+
+Generate a user from session data
+
+
+ save()
+
+ : bool
+
+Save current customer to
+the local database and on crm
+
+
+ setInfo()
+
+ : void
+
+Set the customer info
+with api response
+
+
+ toggleOptin()
+
+ : bool
+
+Toggle the current user optin value
+on the current user and the crm
+
+
+
+
+
+
+
+
+
+
+
+
+ $address
+
+
+
+
+
+
+
+
+ public
+ string
+ $address
+
+
+ The account address (street number, name, build, flat number)
+
+
+
+
+
+
+
+
+
+ $address2
+
+
+
+
+
+
+
+
+ public
+ string
+ $address2
+
+
+ — The account phone (address complement)
+
+
+
+
+
+
+
+
+
+ $birth_date
+
+
+
+
+
+
+
+
+ public
+ string
+ $birth_date
+
+
+ — The account birth date 'yyyy-mm-dd'
+
+
+
+
+
+
+
+
+
+ $city
+
+
+
+
+
+
+
+
+ public
+ string
+ $city
+
+
+ — The account city name
+
+
+
+
+
+
+
+
+
+ $country
+
+
+
+
+
+
+
+
+ public
+ Country
+ $country
+
+
+ — The account country residence
+
+
+
+
+
+
+
+
+
+ $email
+
+
+
+
+
+
+
+
+ public
+ string
+ $email
+
+
+ — Must be a rfc valid email on a valid domain name
+
+
+
+
+
+
+
+
+
+ $firstname
+
+
+
+
+
+
+
+
+ public
+ string
+ $firstname
+
+
+ — The account first name
+
+
+
+
+
+
+
+
+
+ $hashcode
+
+
+
+
+
+
+
+
+ public
+ string
+ $hashcode
+
+
+ — The crm hashcode this is a readonly field
+
+
+
+
+
+
+
+
+
+ $last_connection
+
+
+
+
+
+
+
+
+ public
+ string
+ $last_connection
+
+
+ the last time user was connected 'yyyy-mm-dd HH:ii:ss'
+
+
+
+
+
+
+
+
+
+ $lastname
+
+
+
+
+
+
+
+
+ public
+ string
+ $lastname
+
+
+ — The account last name
+
+
+
+
+
+
+
+
+
+ $opt_in
+
+
+
+
+
+
+
+
+ public
+ bool
+ $opt_in
+
+
+ — true if the account is opt in
+
+
+
+
+
+
+
+
+
+ $password
+
+
+
+
+
+
+
+
+ public
+ string
+ $password
+
+
+ Required only on create,
+must have upper and lowers chars,
+at least 1 number,
+at leat 1 upper char,
+at least 1 lower char and
+at leat 1 special char
+
+
+
+
+
+
+
+
+
+ $phone
+
+
+
+
+
+
+
+
+ public
+ string
+ $phone
+
+
+
+
+
+
+
+
+
+
+
+ $postcode
+
+
+
+
+
+
+
+
+ public
+ string
+ $postcode
+
+
+ — The account city postcode
+
+
+
+
+
+
+
+
+
+ $status
+
+
+
+
+
+
+
+
+ public
+ bool
+ $status
+
+
+ — true if the account is activated
+
+
+
+
+
+
+
+
+
+ $info
+
+
+
+
+
+
+ The CRM customer info (the api response)
+
+
+ protected
+ Customer
+ $info
+ = null
+
+
+
+
+
+
+
+
+ $pemail
+
+
+
+
+
+
+ The CRM customer email
+
+
+ protected
+ string
+ $pemail
+ = null
+
+
+
+
+
+
+
+
+ $phashcode
+
+
+
+
+
+
+ The CRM hashcode (UUID)
+
+
+ protected
+ string
+ $phashcode
+ = null
+
+
+
+
+
+
+
+
+ $uuidToken
+
+
+
+
+
+
+ The CRM customer temp uuidToken to validate transactions
+
+
+ protected
+ string
+ $uuidToken
+ = null
+
+
+
+
+
+
+
+
+
+
+
+
+
+ __construct()
+
+
+
+
+ WPCrmUser construct
+
+
+ public
+ __construct ( [ string $hashcode = null ] [ , string $email = null ] ) : mixed
+
+
+ Parameters
+
+
+ $hashcode
+ : string
+ = null
+
+ The customer hashcode (UUID)
+
+
+
+
+ $email
+ : string
+ = null
+
+
+
+
+
+
+
+
+ Return values
+ mixed
+ —
+
+
+
+
+
+ __get()
+
+
+
+
+ Magic getter
+
+
+ public
+ __get ( string $prop ) : bool|string|Country
+
+
+ Parameters
+
+
+ $prop
+ : string
+
+
+
+
+
+
+
+
+
+ Return values
+ bool|string|Country
+ —
+
+
+
+
+
+ __set()
+
+
+
+
+ Magic setter
+
+
+ public
+ __set ( string $prop , mixed $value ) : bool|string|Country
+
+
+ Parameters
+
+
+ $prop
+ : string
+
+
+
+
+
+
+ $value
+ : mixed
+
+
+
+
+
+
+
+
+
+ Return values
+ bool|string|Country
+ —
+
+
+
+
+
+ activate()
+
+
+
+
+ Activate the account in the crm
+
+
+ public
+ activate ( ) : bool
+
+
+
+
+
+ Return values
+ bool
+ —
+
+
+
+
+
+
+ delete()
+
+
+
+
+ Delete current customer to
+the local database and on crm
+
+
+ public
+ delete ( ) : bool
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded false otherwise
+
+
+
+
+
+
+ jsonSerialize()
+
+
+
+
+ Serialize this object to an array
+
+
+ public
+ jsonSerialize ( ) : array<string|int, mixed>
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+ —
+
+
+
+
+
+ parseFromJson()
+
+
+
+
+ Generate a user from session data
+
+
+ public
+ static parseFromJson ( string $string ) : WPCrmUser
+
+
+ Parameters
+
+
+ $string
+ : string
+
+
+ The json data stored in session
+
+
+
+
+
+
+
+ Return values
+ WPCrmUser
+ —
+
+
+
+
+
+ save()
+
+
+
+
+ Save current customer to
+the local database and on crm
+
+
+ public
+ save ( ) : bool
+
+
+
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ with \LDC\LDCCRM\Enums\ApiError::customerExists()
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded false otherwise
+
+
+
+
+
+
+ setInfo()
+
+
+
+
+ Set the customer info
+with api response
+
+
+ public
+ setInfo ( Customer $customer ) : void
+
+
+ Parameters
+
+
+ $customer
+ : Customer
+
+
+ The Api object reponse (user)
+
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ toggleOptin()
+
+
+
+
+ Toggle the current user optin value
+on the current user and the crm
+
+
+ public
+ toggleOptin ( ) : bool
+
+
+
+
+
+
+
+ throws
+
+
+ ApiErrorException
+
+ with \LDC\LDCCRM\Enums\ApiError::singleOptinCustomerExists()
+
+
+
+
+
+ Return values
+ bool
+ —
+ true if the operation succeeded
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/documentation/files/examples-customerexample.html b/documentation/files/examples-customerexample.html
index 2f66a7c..7bb0da2 100644
--- a/documentation/files/examples-customerexample.html
+++ b/documentation/files/examples-customerexample.html
@@ -70,7 +70,9 @@
models
transport
utilities
+ Wordpress
+