Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/modules/aspro.allcorp3/lib/crm/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/modules/aspro.allcorp3/lib/crm/lead.php |
<? namespace Aspro\Allcorp3\CRM; use Aspro\Allcorp3\CRM; class Lead { public static function getClass(string $type) :string { return CRM\Type::getClass($type, 'Lead'); } public static function newInstance(CRM\Base\Connection $connection) { $type = $connection->type; $className = static::getClass($type); if (strlen($className)) { if (class_exists($className)) { return new $className($connection); } throw new \Exception('Unknown class '.$className); } throw new \Exception('Invalid type '.$type); } }