|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
-
- namespace Lc\ShopBundle\Services;
-
- class Utils
- {
- protected $unitsArray = [
- 'piece' => [
- 'unit' => 'piece',
- 'wording_unit' => 'la pièce',
- 'wording' => 'pièce(s)',
- 'wording_short' => 'p.',
- 'coefficient' => 1,
- 'ref' => 'piece'
- ],
- 'g' => [
- 'unit' => 'g',
- 'wording_unit' => 'le g',
- 'wording' => 'g',
- 'wording_short' => 'g',
- 'coefficient' => 1000,
- 'ref' => 'kg'
- ],
- 'kg' => [
- 'unit' => 'kg',
- 'wording_unit' => 'le kg',
- 'wording' => 'kg',
- 'wording_short' => 'kg',
- 'coefficient' => 1,
- 'ref' => 'kg'
- ],
- 'mL' => [
- 'unit' => 'mL',
- 'wording_unit' => 'le mL',
- 'wording' => 'mL',
- 'wording_short' => 'mL',
- 'coefficient' => 1000,
- 'ref' => 'L'
- ],
- 'cL' => [
- 'unit' => 'cL',
- 'wording_unit' => 'le cL',
- 'wording' => 'cL',
- 'wording_short' => 'cL',
- 'coefficient' => 100,
- 'ref' => 'L'
- ],
- 'L' => [
- 'unit' => 'L',
- 'wording_unit' => 'le litre',
- 'wording' => 'L',
- 'wording_short' => 'L',
- 'coefficient' => 1,
- 'ref' => 'L'
- ],
- ];
-
- public static function getDayByNumber($number)
- {
- $daysArray = [
- 1 => 'Lundu',
- 2 => 'Mardi',
- 3 => 'Mercredi',
- 4 => 'Jeudi',
- 5 => 'Vendredi',
- 6 => 'Samedi',
- 7 => 'Dimanche'
- ] ;
-
- if(isset($daysArray[$number])) {
- return $daysArray[$number] ;
- }
-
- return '' ;
- }
-
- public function getUnitsListFormatedForType(){
- foreach ($this->unitsArray as $unit=>$unitInfo){
- $choices[$unitInfo['wording_unit']] = $unit;
- };
- return $choices;
- }
- public function getUnitsList(){
- return $this->unitsArray;
- }
-
-
-
-
- }
|