Neur0toxine
5f69051859
* New module structure (refactoring) * Simple serializer and deserializer with models, new architecture * Move logic to strategies * Partial api client facade implementation (full implementation is not necessary for now) * Loyalty feature installer * Sms verification order (#167) * Make updater self-sufficient * Fix for order submit & fix for incorrect component rendering in the constructor * Fix for loyalty personal area error handling * Fix for cart component identity * Fix for softlock when customer cannot be registered in loyalty Co-authored-by: Сергей Чазов <45812598+Chazovs@users.noreply.github.com> Co-authored-by: Sergey Chazov <oitv18@gmail.com>
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);
|
|
}
|
|
}
|