TruskApi
extends TransactionalService
in package
Class TruskApi
Table of Contents
Constants
- FLOORS = ['-3' => '3ème sous-sol', '-2' => '2ème sous-sol', '-1' => '1er sous-sol', '0' => 'RDC ', '1' => '1er ', '2' => '2ème', '3' => '3ème', '4' => '4ème', '5' => '5ème', '6' => '6ème', '7' => '7ème', '8' => '8ème', '9' => '9ème', '10' => '10ème', '11' => '11ème', '12' => '12ème', '13' => '13ème', '14' => '14ème', '15' => '15ème', '16' => '16ème', '17' => '17ème', '18' => '18ème', '19' => '19ème', '20' => '20ème']
Properties
- $clientId : string
- $clientSecret : string
- $container : ContainerInterface
- $em : EntityManager
- $menzzoClient : mixed
- $token : string
- $url : string
- $finalSaleProducts : mixed
- $finalSkus : mixed
Methods
- __construct() : mixed
- TruskApi constructor.
- addCustomerContact() : mixed
- addMenzzoContact() : mixed
- addRepository() : void
- Add a repository to this service
- addService() : void
- Add a service to this service
- cancel() : mixed
- canUpdate() : bool
- checkCustomerContact() : bool
- getEntityManager() : EntityManager
- Getter of the Entity Manager
- getHeaders() : mixed
- getSale() : mixed
- getSaleData() : array<string|int, mixed>
- getSaleTasks() : mixed
- oauth() : bool
- send() : bool
- setEntityManager() : mixed
- Setter of the Entity Manager
- update() : bool|mixed
Constants
FLOORS
public
mixed
FLOORS
= ['-3' => '3ème sous-sol', '-2' => '2ème sous-sol', '-1' => '1er sous-sol', '0' => 'RDC ', '1' => '1er ', '2' => '2ème', '3' => '3ème', '4' => '4ème', '5' => '5ème', '6' => '6ème', '7' => '7ème', '8' => '8ème', '9' => '9ème', '10' => '10ème', '11' => '11ème', '12' => '12ème', '13' => '13ème', '14' => '14ème', '15' => '15ème', '16' => '16ème', '17' => '17ème', '18' => '18ème', '19' => '19ème', '20' => '20ème']
Properties
$clientId
protected
string
$clientId
$clientSecret
protected
string
$clientSecret
$container
protected
ContainerInterface
$container
$em
protected
EntityManager
$em
The Entity Manager
$menzzoClient
protected
mixed
$menzzoClient
= 'I9xYmnSADn'
$token
protected
string
$token
$url
protected
string
$url
$finalSaleProducts
private
mixed
$finalSaleProducts
= []
$finalSkus
private
mixed
$finalSkus
= []
Methods
__construct()
TruskApi constructor.
public
__construct(string $url, string $clientId, string $clientSecret) : mixed
Parameters
- $url : string
- $clientId : string
- $clientSecret : string
addCustomerContact()
public
addCustomerContact(Sale $sale) : mixed
Parameters
- $sale : Sale
addMenzzoContact()
public
addMenzzoContact(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
addRepository()
Add a repository to this service
public
addRepository(int $key, string $class) : void
Parameters
- $key : int
-
Key
- $class : string
-
Class
addService()
Add a service to this service
public
addService(int $key, mixed $service) : void
Parameters
- $key : int
-
Key
- $service : mixed
cancel()
public
cancel(Sale $sale, string $truskRef) : mixed
Parameters
- $sale : Sale
- $truskRef : string
canUpdate()
public
canUpdate(mixed $id) : bool
Parameters
- $id : mixed
Return values
boolcheckCustomerContact()
public
checkCustomerContact(mixed $email, mixed $phone) : bool
Parameters
- $email : mixed
- $phone : mixed
Return values
boolgetEntityManager()
Getter of the Entity Manager
public
getEntityManager() : EntityManager
Return values
EntityManagergetHeaders()
public
getHeaders() : mixed
getSale()
public
getSale(mixed $id) : mixed
Parameters
- $id : mixed
getSaleData()
public
getSaleData(Sale $sale, array<string|int, mixed> $saleProducts) : array<string|int, mixed>
Parameters
- $sale : Sale
- $saleProducts : array<string|int, mixed>
Return values
array<string|int, mixed>getSaleTasks()
public
getSaleTasks(mixed $id) : mixed
Parameters
- $id : mixed
oauth()
public
oauth() : bool
Return values
boolsend()
public
send(Sale $sale, array<string|int, mixed> $saleProducts) : bool
Parameters
- $sale : Sale
- $saleProducts : array<string|int, mixed>
Return values
boolsetEntityManager()
Setter of the Entity Manager
public
setEntityManager(EntityManager $em) : mixed
Parameters
- $em : EntityManager
-
the Entity Manager
update()
public
update(Sale $sale, array<string|int, mixed> $saleProducts, string $truskRef) : bool|mixed
Parameters
- $sale : Sale
- $saleProducts : array<string|int, mixed>
- $truskRef : string