34e8105583
* Loyalty program * fix dot bug for shops-exoprt option * delete credantials request from services * add CurlException for credentials catch * add catching CurlException * edit error msgs * add supportind double bonuses * add any step for bonus-input field in sale.order.ajax template * recalculate bonuses * fix bonus rounded * strtoupper for params in icml * change delivery service code
166 lines
2.8 KiB
PHP
166 lines
2.8 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;
|
|
|
|
use Intaro\RetailCrm\Component\Json\Mapping;
|
|
use Intaro\RetailCrm\Repository\BuyerProfileRepository;
|
|
|
|
/**
|
|
* Class BuyerProfile
|
|
*
|
|
* @package Intaro\RetailCrm\Model\Bitrix
|
|
*/
|
|
class BuyerProfile extends AbstractSerializableModel
|
|
{
|
|
/**
|
|
* @var int
|
|
*
|
|
* @Mapping\Type("int")
|
|
* @Mapping\SerializedName("ID")
|
|
*/
|
|
protected $id;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @Mapping\Type("string")
|
|
* @Mapping\SerializedName("NAME")
|
|
*/
|
|
protected $name;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @Mapping\Type("string")
|
|
* @Mapping\SerializedName("USER_ID")
|
|
*/
|
|
protected $userId;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @Mapping\Type("string")
|
|
* @Mapping\SerializedName("PERSON_TYPE_ID")
|
|
*/
|
|
protected $personTypeId;
|
|
|
|
/**
|
|
* @return int|null
|
|
*/
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* @param int $id
|
|
*
|
|
* @return BuyerProfile
|
|
*/
|
|
public function setId($id): BuyerProfile
|
|
{
|
|
$this->id = $id;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* @param string $name
|
|
*
|
|
* @return BuyerProfile
|
|
*/
|
|
public function setName($name): BuyerProfile
|
|
{
|
|
$this->name = $name;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getUserId(): ?string
|
|
{
|
|
return $this->userId;
|
|
}
|
|
|
|
/**
|
|
* @param string $userId
|
|
*
|
|
* @return BuyerProfile
|
|
*/
|
|
public function setUserId($userId): BuyerProfile
|
|
{
|
|
$this->userId = $userId;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getPersonTypeId(): ?string
|
|
{
|
|
return $this->personTypeId;
|
|
}
|
|
|
|
/**
|
|
* @param string $personTypeId
|
|
*
|
|
* @return BuyerProfile
|
|
*/
|
|
public function setPersonTypeId($personTypeId): BuyerProfile
|
|
{
|
|
$this->personTypeId = $personTypeId;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function getBaseClass(): string
|
|
{
|
|
return \CSaleOrderUserProps::class;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function isSaveStatic(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function isDeleteStatic(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public static function getEntityByPrimary($primary)
|
|
{
|
|
return BuyerProfileRepository::getById((int) $primary);
|
|
}
|
|
}
|