uawdijnntqw1x1x1
IP : 216.73.216.177
Hostname : xhost1.intravision.ru
Kernel : Linux xhost1.intravision.ru 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
tiskom
/
data
/
www
/
tiskom.xhost.intravision.ru
/
bitrix
/
modules
/
.
/
seo
/
lib
/
leadads
/
mapper.php
/
/
<? namespace Bitrix\Seo\LeadAds; use Bitrix\Main\ArgumentNullException; /** * Class Mapper. * Form fields Mapper from crm to ads, ads to crm. * * @package Bitrix\Seo\LeadAds */ class Mapper { protected $map = []; public function __construct(array $items = []) { $this->setItems($items); } /** * Get crm name. * * @param string $adsName Ads name. * @return string|null */ public function getCrmName($adsName) { $item = $this->getMapItem(null, $adsName); return empty($item) ? null : $item['CRM_NAME']; } /** * Get ads name. * * @param string $crmName Crm name. * @return string|null */ public function getAdsName($crmName) { $item = $this->getMapItem($crmName, null); return empty($item) ? null : $item['ADS_NAME']; } /** * Set map items. * * @param array $items Map items. * @return $this * @throws ArgumentNullException */ public function setItems(array $items = []) { $this->map = []; foreach ($items as $item) { if (empty($item['CRM_NAME'])) { throw new ArgumentNullException('CRM_NAME'); } if (empty($item['ADS_NAME'])) { throw new ArgumentNullException('ADS_NAME'); } $this->addItem($item['CRM_NAME'], $item['ADS_NAME']); } return $this; } /** * Add map item * * @param string $crmName Crm name. * @param string $adsName Ads name. * @return $this * @throws ArgumentNullException */ public function addItem($crmName, $adsName) { if (empty($crmName)) { throw new ArgumentNullException('$crmName'); } if (empty($adsName)) { throw new ArgumentNullException('$adsName'); } $this->map[] = [ 'CRM_NAME' => $crmName, 'ADS_NAME' => $adsName, ]; return $this; } protected function getMapItem($crmName = null, $adsName = null) { if (empty($crmName) && empty($adsName)) { return null; } foreach ($this->map as $item) { if ($crmName && $item['CRM_NAME'] === $crmName) { return $item; } if ($adsName && $item['ADS_NAME'] === $adsName) { return $item; } } return null; } }
/var/www/tiskom/data/www/tiskom.xhost.intravision.ru/bitrix/modules/./seo/lib/leadads/mapper.php