1
0
mirror of synced 2024-12-05 03:16:04 +03:00

Delete RetailcrmHelpers.php

This commit is contained in:
Vitaly Artemev 2016-12-06 14:43:29 +04:00 committed by GitHub
parent 6bd6395a7a
commit 361ee88089

View File

@ -1,41 +0,0 @@
<?php
abstract class RetailcrmHelpers {
/**
* @param $mapArr array
* @return array
*/
public function getRelationMap($mapArr) {
if(empty($mapArr)) return array();
$map = array();
foreach ($mapArr as $mapItem) {
$mapItem = explode(' <-> ', $mapItem);
$map[$mapItem[0]] = $mapItem[1];
}
return $map;
}
/**
* @param $map array
* @param $item string
* @param $reversed bool
* @return string|null
*/
public function getRelationByMap($map, $item, $reversed = false) {
if(!$reversed) {
if(isset($map[$item]) && !empty($map[$item]))
return $map[$item];
else
return null;
} else {
foreach ($map as $umiStatusOrder => $crmStatusOrder) {
if($crmStatusOrder == $item)
return $umiStatusOrder;
}
return null;
}
}
}