Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
condition.php
1<?php
3
7
9{
10 protected $object = 'Document';
11 protected $field;
12
13 public function __construct(array $params = null)
14 {
15 parent::__construct($params);
16
17 if ($params && isset($params['field']))
18 {
19 $this->setField($params['field']);
20 }
21 if ($params && isset($params['object']))
22 {
23 $this->setObject($params['object']);
24 }
25 }
26
31 public function setField(string $field)
32 {
33 $this->field = (string)$field;
34 return $this;
35 }
36
40 public function getField()
41 {
42 return $this->field;
43 }
44
49 public function setObject(string $objectName)
50 {
51 $this->object = $objectName;
52 return $this;
53 }
54
58 public function getObject()
59 {
60 return $this->object;
61 }
62
70 public function check($needle, $fieldType, BaseTarget $target, FieldType $fieldTypeObject)
71 {
72 $documentId = $target->getDocumentType();
73 $documentId[2] = $target->getDocumentId();
74
75 return $this->checkValue($needle, $fieldTypeObject, $documentId);
76 }
77
81 public function toArray()
82 {
83 $array = parent::toArray();
84 $array['field'] = $this->getField();
85 $array['object'] = $this->getObject();
86
87 return $array;
88 }
89}
checkValue($valueToCheck, FieldType $fieldType, array $documentId)
Definition condition.php:83
check($needle, $fieldType, BaseTarget $target, FieldType $fieldTypeObject)
Definition condition.php:70