52 lines
1.0 KiB
PHP
52 lines
1.0 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* PHP version 7.1
|
||
|
*
|
||
|
* @category Integration
|
||
|
* @package Intaro\RetailCrm\Model\Bitrix
|
||
|
* @author RetailCRM <integration@retailcrm.ru>
|
||
|
* @license MIT
|
||
|
* @link http://retailcrm.ru
|
||
|
* @see http://retailcrm.ru/docs
|
||
|
*/
|
||
|
namespace Intaro\RetailCrm\Model\Bitrix\Xml;
|
||
|
|
||
|
/**
|
||
|
* единица измерения для товара, элемент не является обязательным в icml
|
||
|
*
|
||
|
* Class Unit
|
||
|
* @package Intaro\RetailCrm\Model\Bitrix\Xml
|
||
|
*/
|
||
|
class Unit
|
||
|
{
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
public $name;
|
||
|
|
||
|
/**
|
||
|
* @var string
|
||
|
*/
|
||
|
public $code;
|
||
|
|
||
|
/**
|
||
|
* единица измерения товара
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
public $sym;
|
||
|
|
||
|
/**
|
||
|
* @param \Intaro\RetailCrm\Model\Bitrix\Xml\Unit|null $unitCode
|
||
|
* @return \Intaro\RetailCrm\Model\Bitrix\Xml\Unit
|
||
|
*/
|
||
|
public function merge(?Unit $unitCode): Unit
|
||
|
{
|
||
|
if ($this->code === null && $unitCode !== null) {
|
||
|
return $unitCode;
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
}
|