Tools
in package
Table of Contents
Constants
- currencyMapping = ['USD' => 6, 'EUR' => 5, 'CNY' => 7]
- DAYS_OF_WEEK = [0 => "Sunday", 1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday"]
- MAPPING_DROPSHIP_MANUFACTURE = [711 => "AsirGroupMode", 706 => "AsirGroup", 697 => "vidaxl", 698 => "palimi", 712 => "Cmp", 696 => 'bigbuy', 727 => 'Notio']
- MAPPING_LOG_COLUM_PRICE_SHEET = ['sell_price03' => "Prix 0/3", 'sell_price36' => "Prix 3/6", 'sell_price69' => "Prix 6/9", 'sell_price912' => "Prix 9/12", 'sell_price12plus' => "Prix 12+", 'max_price' => "Prix max", 'max_price_from' => "Début prix max", 'max_price_to' => "Fin prix max", 'promo_price' => "Prix promo (cacher)", 'promo_price_from' => "Début prix promo (cacher)", 'promo_price_to' => "Fin Prix promo (cacher)", 'is_max_price_applied' => "Prix max appliqué", 'special_price' => "Prix promo (valide)", 'special_price_from' => "Prix promo (valide)", 'special_price_to' => "Prix promo (valide)", 'last_manual_update' => 'Dernière Màj manuelle', 'current_sell_price_tag' => 'Tag du prix', 'is_end_product_max_price' => 'Fin de prix max']
- secret_iv = 'TORecw:sJkqR5Kdl)w)}pI#!G~Wq[IW7'
- secret_key = 'XJ%l#h[ERX}[6hir;w*CR/kdjCqgDja#'
- TRUSK_CLOSED_DAYS = ['1' => [6, 7], '2' => [6, 7], '3' => [6, 7], '4' => [6, 7]]
- Trusk Closed Days
Properties
- $productApi : mixed
- $router : RouterInterface
Methods
- __construct() : mixed
- addTextInsteadOfNameToCategories() : mixed
- arrayDiff() : array<string|int, mixed>
- axFormatDispoDate() : mixed
- Get formatted dispo date
- base64Encode() : string
- base64ToJpegImage() : mixed
- cDean14() : false|string
- checkIsValidFormatDateTime() : mixed
- checkRangeDate() : void
- clean() : string|array<string|int, string>|null
- Clean string from special chars
- cleanHtmlString() : string
- cleanSpaces() : string
- cleanStringFromAccent() : string|array<string|int, string>
- Clean a string from french accent
- cmp() : int|lt
- compressImage() : mixed
- Compress image to specific quality
- convertFlatArrayToTree() : mixed
- csvLineToAnsi() : mixed
- Convert csv line to ansi
- csvStringToArray() : array<string|int, mixed>
- Converting csv string to php array
- decodeData() : bool|string
- Decoding data
- delete() : bool|string
- encodeData() : bool|string
- Encode Data So we can send it securely to magento
- encodeQrCode() : mixed
- formatDimension() : int|string
- Formats a dimension value according to the specified rules.
- formatPhoneNumber() : bool
- Format phone number
- formatPostalCode() : string
- formatterDate() : mixed
- generateEanProduct() : string
- generateImageWithQrCodeAndText() : void
- generateRandomColor() : string
- generateRandomString() : bool|string
- Generating random string
- get() : bool|string
- Send post request
- getAsirGroupIndexLimitShippingDay() : array<string|int, mixed>|false|mixed|string|array<string|int, string>
- getCalculedAsirRatio() : mixed
- getCarrierNameFromFileName() : mixed
- Get Carrier from imported file
- getCleanNumber() : float
- Cleaning a number from string
- getCleanTagPrice() : void
- getCsvData() : array<string|int, mixed>
- Retrieve CSV file data as array
- getHolidays() : array<string|int, mixed>
- get holidays
- getIdfRealShipmentLabel() : array<string|int, mixed>
- getLangFromStore() : mixed|string
- getMenzzoProductShippingRate() : mixed
- getNamefromArray() : mixed|string
- getOffset() : float|int
- getPaymentMethodeLabel() : mixed
- getRdvAvailableUntil() : array<string|int, mixed>
- get rdvAvailableUntil
- getReferSource() : string|null
- getResizedImage() : string
- getSourceOfSale() : mixed
- getStoreIdMapping() : array<string|int, mixed>
- getTamdisRealShipmentLabel() : array<string|int, mixed>
- getTextBetweenRoundBrackets() : array<string|int, mixed>|null
- getVariationBetweenTwoNumbers() : mixed
- guidv4() : mixed
- imagettftextvertical() : mixed
- initImageLogidav() : array<string|int, mixed>
- isJson() : bool
- moveFileRemotely() : bool
- post() : bool|string
- Send post request
- priceFromCents() : float
- priceToCents() : int
- purifierHtmlString() : mixed
- put() : bool|string
- Send put request
- recursive_array_diff() : array<string|int, mixed>
- remove_accents() : string
- replaceArrayKey() : array<string|int, mixed>|mixed
- roundUpLikeExcel() : float|int
- roundUpTo9Or5() : mixed
- slugify() : string
- stripQueryParamFromUrl() : string
- Removing specific param from url
- strposArray() : bool
- xmlStringToArray() : mixed
- Convert xml string into array
- execute() : bool|string|ResponseInterface
- Execute request
- getMonthNameInLocale() : false|string
- getRateDay() : mixed
Constants
currencyMapping
public
array<string|int, int>
currencyMapping
= ['USD' => 6, 'EUR' => 5, 'CNY' => 7]
DAYS_OF_WEEK
public
mixed
DAYS_OF_WEEK
= [0 => "Sunday", 1 => "Monday", 2 => "Tuesday", 3 => "Wednesday", 4 => "Thursday", 5 => "Friday", 6 => "Saturday"]
MAPPING_DROPSHIP_MANUFACTURE
public
mixed
MAPPING_DROPSHIP_MANUFACTURE
= [711 => "AsirGroupMode", 706 => "AsirGroup", 697 => "vidaxl", 698 => "palimi", 712 => "Cmp", 696 => 'bigbuy', 727 => 'Notio']
MAPPING_LOG_COLUM_PRICE_SHEET
public
mixed
MAPPING_LOG_COLUM_PRICE_SHEET
= ['sell_price03' => "Prix 0/3", 'sell_price36' => "Prix 3/6", 'sell_price69' => "Prix 6/9", 'sell_price912' => "Prix 9/12", 'sell_price12plus' => "Prix 12+", 'max_price' => "Prix max", 'max_price_from' => "Début prix max", 'max_price_to' => "Fin prix max", 'promo_price' => "Prix promo (cacher)", 'promo_price_from' => "Début prix promo (cacher)", 'promo_price_to' => "Fin Prix promo (cacher)", 'is_max_price_applied' => "Prix max appliqué", 'special_price' => "Prix promo (valide)", 'special_price_from' => "Prix promo (valide)", 'special_price_to' => "Prix promo (valide)", 'last_manual_update' => 'Dernière Màj manuelle', 'current_sell_price_tag' => 'Tag du prix', 'is_end_product_max_price' => 'Fin de prix max']
secret_iv
public
mixed
secret_iv
= 'TORecw:sJkqR5Kdl)w)}pI#!G~Wq[IW7'
secret_key
public
mixed
secret_key
= 'XJ%l#h[ERX}[6hir;w*CR/kdjCqgDja#'
TRUSK_CLOSED_DAYS
Trusk Closed Days
public
mixed
TRUSK_CLOSED_DAYS
= ['1' => [6, 7], '2' => [6, 7], '3' => [6, 7], '4' => [6, 7]]
Properties
$productApi
protected
static mixed
$productApi
= false
$router
private
RouterInterface
$router
Methods
__construct()
public
__construct(RouterInterface $router) : mixed
Parameters
- $router : RouterInterface
addTextInsteadOfNameToCategories()
public
static addTextInsteadOfNameToCategories(mixed &$cats) : mixed
Parameters
- $cats : mixed
arrayDiff()
public
static arrayDiff(mixed $properties1, mixed $properties2) : array<string|int, mixed>
Parameters
- $properties1 : mixed
- $properties2 : mixed
Return values
array<string|int, mixed>axFormatDispoDate()
Get formatted dispo date
public
static axFormatDispoDate(mixed $date) : mixed
Parameters
- $date : mixed
base64Encode()
public
static base64Encode(mixed $string) : string
Parameters
- $string : mixed
Return values
stringbase64ToJpegImage()
public
static base64ToJpegImage(mixed $base64_string, mixed $output_file) : mixed
Parameters
- $base64_string : mixed
- $output_file : mixed
cDean14()
public
static cDean14(mixed $str, mixed $nbrColi) : false|string
Parameters
- $str : mixed
- $nbrColi : mixed
Return values
false|stringcheckIsValidFormatDateTime()
public
static checkIsValidFormatDateTime(mixed $rdvDateTime) : mixed
Parameters
- $rdvDateTime : mixed
checkRangeDate()
public
static checkRangeDate(mixed $startDate, mixed $endDate) : void
Parameters
- $startDate : mixed
- $endDate : mixed
clean()
Clean string from special chars
public
static clean(mixed $string) : string|array<string|int, string>|null
Parameters
- $string : mixed
Return values
string|array<string|int, string>|nullcleanHtmlString()
public
static cleanHtmlString(mixed $string) : string
Parameters
- $string : mixed
Return values
stringcleanSpaces()
public
static cleanSpaces(mixed $string[, string $replacement = '' ]) : string
Parameters
- $string : mixed
- $replacement : string = ''
Return values
stringcleanStringFromAccent()
Clean a string from french accent
public
static cleanStringFromAccent(mixed $text) : string|array<string|int, string>
Parameters
- $text : mixed
Tags
Return values
string|array<string|int, string>cmp()
public
static cmp(mixed $a, mixed $b[, bool $arrayKey = false ]) : int|lt
Parameters
- $a : mixed
- $b : mixed
- $arrayKey : bool = false
Return values
int|ltcompressImage()
Compress image to specific quality
public
static compressImage(mixed $source, mixed $destination, mixed $quality) : mixed
Parameters
- $source : mixed
- $destination : mixed
- $quality : mixed
convertFlatArrayToTree()
public
static convertFlatArrayToTree(array<string|int, mixed> $flat, mixed $pidKey[, null $idKey = null ]) : mixed
Parameters
- $flat : array<string|int, mixed>
- $pidKey : mixed
- $idKey : null = null
csvLineToAnsi()
Convert csv line to ansi
public
static csvLineToAnsi(mixed &$value) : mixed
Parameters
- $value : mixed
csvStringToArray()
Converting csv string to php array
public
static csvStringToArray(mixed $content, mixed $delimiter[, string $linesSeparator = PHP_EOL ]) : array<string|int, mixed>
Parameters
- $content : mixed
- $delimiter : mixed
- $linesSeparator : string = PHP_EOL
Return values
array<string|int, mixed>decodeData()
Decoding data
public
static decodeData(mixed $string) : bool|string
Parameters
- $string : mixed
Return values
bool|stringdelete()
public
static delete(mixed $url, mixed $body[, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $ClientConfig = [] ]) : bool|string
Parameters
- $url : mixed
- $body : mixed
- $headers : array<string|int, mixed> = []
- $ClientConfig : array<string|int, mixed> = []
Tags
Return values
bool|stringencodeData()
Encode Data So we can send it securely to magento
public
static encodeData(mixed $string) : bool|string
Parameters
- $string : mixed
Return values
bool|stringencodeQrCode()
public
static encodeQrCode([mixed $string = '' ]) : mixed
Parameters
- $string : mixed = ''
formatDimension()
Formats a dimension value according to the specified rules.
public
static formatDimension(float|null $dimension[, int $decimalPrecision = 2 ][, string $decimalSeparator = ',' ][, string $thousandsSeparator = '' ]) : int|string
Parameters
- $dimension : float|null
-
The dimension value to format
- $decimalPrecision : int = 2
-
The number of decimal places to preserve if non-zero digits are found after the decimal point
- $decimalSeparator : string = ','
-
The decimal separator character to use
- $thousandsSeparator : string = ''
-
The thousands separator character to use
Return values
int|string —Formatted dimension value
formatPhoneNumber()
Format phone number
public
static formatPhoneNumber(mixed $number) : bool
Parameters
- $number : mixed
Return values
boolformatPostalCode()
public
static formatPostalCode(string $postalCode) : string
Parameters
- $postalCode : string
Return values
stringformatterDate()
public
static formatterDate(mixed $date) : mixed
Parameters
- $date : mixed
generateEanProduct()
public
static generateEanProduct(mixed $code) : string
Parameters
- $code : mixed
Return values
stringgenerateImageWithQrCodeAndText()
public
static generateImageWithQrCodeAndText(mixed $text, mixed $qrText, mixed $outputPath, mixed $fontFile[, mixed $fontSize = 19 ][, mixed $imageWidth = 300 ][, mixed $imageHeight = 200 ]) : void
Parameters
- $text : mixed
- $qrText : mixed
- $outputPath : mixed
- $fontFile : mixed
- $fontSize : mixed = 19
- $imageWidth : mixed = 300
- $imageHeight : mixed = 200
Tags
generateRandomColor()
public
static generateRandomColor() : string
Return values
stringgenerateRandomString()
Generating random string
public
static generateRandomString([int $length = 10 ][, bool $integerOnly = false ]) : bool|string
Parameters
- $length : int = 10
- $integerOnly : bool = false
Return values
bool|stringget()
Send post request
public
static get(mixed $url[, array<string|int, mixed> $body = [] ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $ClientConfig = [] ]) : bool|string
Parameters
- $url : mixed
- $body : array<string|int, mixed> = []
- $headers : array<string|int, mixed> = []
- $ClientConfig : array<string|int, mixed> = []
Tags
Return values
bool|stringgetAsirGroupIndexLimitShippingDay()
public
static getAsirGroupIndexLimitShippingDay(ContainerInterface $container, DateTime|string $date[, mixed $store = 3 ][, mixed $storeLocal = 'fr_FR' ][, mixed $asirDeliveryInfo = '' ][, mixed $dateConfAsir = '' ][, mixed $source = 'Menzzo' ]) : array<string|int, mixed>|false|mixed|string|array<string|int, string>
Parameters
- $container : ContainerInterface
- $date : DateTime|string
- $store : mixed = 3
- $storeLocal : mixed = 'fr_FR'
- $asirDeliveryInfo : mixed = ''
- $dateConfAsir : mixed = ''
- $source : mixed = 'Menzzo'
Tags
Return values
array<string|int, mixed>|false|mixed|string|array<string|int, string>getCalculedAsirRatio()
public
static getCalculedAsirRatio(mixed $wholeSalePrice, mixed $invoicedPrice) : mixed
Parameters
- $wholeSalePrice : mixed
- $invoicedPrice : mixed
getCarrierNameFromFileName()
Get Carrier from imported file
public
static getCarrierNameFromFileName(mixed $fileName) : mixed
Parameters
- $fileName : mixed
getCleanNumber()
Cleaning a number from string
public
static getCleanNumber(mixed $number) : float
Parameters
- $number : mixed
Return values
floatgetCleanTagPrice()
public
static getCleanTagPrice(mixed $val) : void
Parameters
- $val : mixed
getCsvData()
Retrieve CSV file data as array
public
getCsvData(string $file[, string $delimiter = ',' ][, string $lineLength = 1000 ][, string $enclosure = '"' ]) : array<string|int, mixed>
Parameters
- $file : string
- $delimiter : string = ','
- $lineLength : string = 1000
- $enclosure : string = '"'
Return values
array<string|int, mixed>getHolidays()
get holidays
public
static getHolidays(mixed $rdvHoliday[, mixed $year = null ]) : array<string|int, mixed>
Parameters
- $rdvHoliday : mixed
- $year : mixed = null
Return values
array<string|int, mixed>getIdfRealShipmentLabel()
public
static getIdfRealShipmentLabel(mixed $array) : array<string|int, mixed>
Parameters
- $array : mixed
Return values
array<string|int, mixed>getLangFromStore()
public
static getLangFromStore(mixed $storeCode) : mixed|string
Parameters
- $storeCode : mixed
Return values
mixed|stringgetMenzzoProductShippingRate()
public
static getMenzzoProductShippingRate(ContainerInterface $container, mixed $id[, int $qty = 1 ][, int $storeId = 3 ]) : mixed
Parameters
- $container : ContainerInterface
- $id : mixed
- $qty : int = 1
- $storeId : int = 3
Tags
getNamefromArray()
public
static getNamefromArray(mixed $file, mixed $filesArray) : mixed|string
Parameters
- $file : mixed
- $filesArray : mixed
Return values
mixed|stringgetOffset()
public
getOffset([int $length = 0 ][, int $start = 0 ]) : float|int
Parameters
- $length : int = 0
- $start : int = 0
Return values
float|intgetPaymentMethodeLabel()
public
static getPaymentMethodeLabel(mixed $sale) : mixed
Parameters
- $sale : mixed
getRdvAvailableUntil()
get rdvAvailableUntil
public
static getRdvAvailableUntil(mixed $rdvAvailableUntil[, mixed $year = null ]) : array<string|int, mixed>
Parameters
- $rdvAvailableUntil : mixed
- $year : mixed = null
Return values
array<string|int, mixed> —This function is used in res.menzzo.fr if y
getReferSource()
public
static getReferSource(Request $request[, mixed $fromCurrentRoute = false ]) : string|null
Parameters
- $request : Request
- $fromCurrentRoute : mixed = false
Return values
string|nullgetResizedImage()
public
static getResizedImage(mixed $urlImage[, int|null $width = null ][, int|null $height = null ]) : string
Parameters
- $urlImage : mixed
- $width : int|null = null
- $height : int|null = null
Return values
stringgetSourceOfSale()
public
static getSourceOfSale(mixed $input) : mixed
Parameters
- $input : mixed
getStoreIdMapping()
public
static getStoreIdMapping() : array<string|int, mixed>
Return values
array<string|int, mixed>getTamdisRealShipmentLabel()
public
static getTamdisRealShipmentLabel(mixed $array) : array<string|int, mixed>
Parameters
- $array : mixed
Return values
array<string|int, mixed>getTextBetweenRoundBrackets()
public
static getTextBetweenRoundBrackets(mixed $text) : array<string|int, mixed>|null
Parameters
- $text : mixed
Return values
array<string|int, mixed>|nullgetVariationBetweenTwoNumbers()
public
static getVariationBetweenTwoNumbers(mixed $from, mixed $to) : mixed
Parameters
- $from : mixed
- $to : mixed
guidv4()
public
static guidv4([mixed $data = null ]) : mixed
Parameters
- $data : mixed = null
imagettftextvertical()
public
static imagettftextvertical(mixed $image, mixed $fontSize, mixed $textX, mixed $textY, mixed $color, mixed $fontFile, mixed $text) : mixed
Parameters
- $image : mixed
- $fontSize : mixed
- $textX : mixed
- $textY : mixed
- $color : mixed
- $fontFile : mixed
- $text : mixed
initImageLogidav()
public
static initImageLogidav(mixed $id, mixed $name, mixed $alt, mixed $path, mixed $role, mixed $position, mixed $disabled) : array<string|int, mixed>
Parameters
- $id : mixed
- $name : mixed
- $alt : mixed
- $path : mixed
- $role : mixed
- $position : mixed
- $disabled : mixed
Return values
array<string|int, mixed>isJson()
public
static isJson(mixed $string) : bool
Parameters
- $string : mixed
Return values
boolmoveFileRemotely()
public
static moveFileRemotely(SFTP $sftp, mixed $sourcePath, mixed $targetPath) : bool
Parameters
- $sftp : SFTP
- $sourcePath : mixed
- $targetPath : mixed
Return values
boolpost()
Send post request
public
static post(mixed $url, mixed $body[, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $ClientConfig = [] ]) : bool|string
Parameters
- $url : mixed
- $body : mixed
- $headers : array<string|int, mixed> = []
- $ClientConfig : array<string|int, mixed> = []
Tags
Return values
bool|stringpriceFromCents()
public
static priceFromCents(int $amount) : float
Parameters
- $amount : int
Return values
floatpriceToCents()
public
static priceToCents(float $price) : int
Parameters
- $price : float
Return values
intpurifierHtmlString()
public
static purifierHtmlString(mixed $string) : mixed
Parameters
- $string : mixed
put()
Send put request
public
static put(mixed $url, mixed $body[, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $ClientConfig = [] ]) : bool|string
Parameters
- $url : mixed
- $body : mixed
- $headers : array<string|int, mixed> = []
- $ClientConfig : array<string|int, mixed> = []
Tags
Return values
bool|stringrecursive_array_diff()
public
static recursive_array_diff(mixed $a1, mixed $a2) : array<string|int, mixed>
Parameters
- $a1 : mixed
- $a2 : mixed
Return values
array<string|int, mixed>remove_accents()
public
static remove_accents(mixed $string) : string
Parameters
- $string : mixed
Return values
stringreplaceArrayKey()
public
static replaceArrayKey(mixed $subject, mixed $newKey, mixed $oldKey) : array<string|int, mixed>|mixed
Parameters
- $subject : mixed
- $newKey : mixed
- $oldKey : mixed
Return values
array<string|int, mixed>|mixedroundUpLikeExcel()
public
static roundUpLikeExcel(mixed $value, mixed $precision) : float|int
Parameters
- $value : mixed
- $precision : mixed
Return values
float|introundUpTo9Or5()
public
static roundUpTo9Or5(mixed $n) : mixed
Parameters
- $n : mixed
slugify()
public
static slugify(mixed $string) : string
Parameters
- $string : mixed
Return values
stringstripQueryParamFromUrl()
Removing specific param from url
public
static stripQueryParamFromUrl(mixed $url) : string
Parameters
- $url : mixed
Return values
stringstrposArray()
public
static strposArray(string $haystack, array<string|int, mixed> $needles[, int $offset = 0 ]) : bool
Parameters
- $haystack : string
- $needles : array<string|int, mixed>
- $offset : int = 0
Return values
boolxmlStringToArray()
Convert xml string into array
public
static xmlStringToArray(mixed $xmlString) : mixed
Parameters
- $xmlString : mixed
execute()
Execute request
private
static execute(mixed $url[, string $requestType = 'GET' ][, null $body = null ][, array<string|int, mixed> $headers = [] ][, array<string|int, mixed> $clientConfig = [] ]) : bool|string|ResponseInterface
Parameters
- $url : mixed
- $requestType : string = 'GET'
- $body : null = null
- $headers : array<string|int, mixed> = []
- $clientConfig : array<string|int, mixed> = []
Return values
bool|string|ResponseInterfacegetMonthNameInLocale()
private
static getMonthNameInLocale(mixed $date[, string $locale = 'fr_FR' ]) : false|string
Parameters
- $date : mixed
- $locale : string = 'fr_FR'
Tags
Return values
false|stringgetRateDay()
private
getRateDay(mixed $day) : mixed
Parameters
- $day : mixed