Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factory.php
1<?php
2
3namespace Bitrix\Seo\Checkout;
4
6
12{
20 public static function create($object, $type, $parameters = null)
21 {
22 $spaceList = explode('\\', $object);
23 $objectClassName = array_pop($spaceList);
24 array_push($spaceList, 'Services', $objectClassName);
25 $className = implode('\\', $spaceList).mb_strtoupper(mb_substr($type, 0, 1)).mb_strtolower(mb_substr($type, 1));
26
27 if (!class_exists($object))
28 {
29 throw new ArgumentOutOfRangeException('Object');
30 }
31
32 if (!class_exists($className))
33 {
34 throw new ArgumentOutOfRangeException('Type');
35 }
36
37 $instance = new $className($parameters);
38
39 return $instance;
40 }
41}
static create($object, $type, $parameters=null)
Definition factory.php:20