Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factory.php
1<?php
2
3
5
6
8
9class Factory
10{
11 static public function create($type, array $values = null)
12 {
13 if($type == EntityType::ACTIVITY)
14 {
15 return new Activity($values);
16 }
17 elseif($type == EntityType::DEAL)
18 {
19 return new Deal($values);
20 }
21 elseif($type == EntityType::COMPANY)
22 {
23 return new Company($values);
24 }
25 elseif($type == EntityType::CONTACT)
26 {
27 return new Contact($values);
28 }
29 else
30 {
31 throw new \Bitrix\Main\NotSupportedException("BuilderEntity type: '".$type."' is not supported in current context");
32 }
33 }
34}