41 public function getValueEntity($elementEntity =
null)
43 if ($this->valueEntity ===
null)
45 if ($elementEntity ===
null)
47 $elementEntity = IblockTable::compileEntity(
49 'select' => [
'ID',
'API_CODE']
55 $entityClassName =
'IblockProperty'.$this->getId().
'Table';
56 $entityClass =
'\\'.IblockTable::DATA_CLASS_NAMESPACE.
'\\'.$entityClassName;
58 if (class_exists($entityClass,
false))
61 return $this->valueEntity = $entityClass::getEntity();
64 $valueTableName = $this->getMultiple()
65 ? $elementEntity->getMultiValueTableName()
66 : $elementEntity->getSingleValueTableName();
68 if ($this->getVersion() == 1 || ($this->getVersion() == 2 && $this->getMultiple()))
70 switch ($this->getPropertyType())
76 $realValueColumnName =
'VALUE_NUM';
80 $realValueColumnName =
'VALUE_ENUM';
85 $realValueColumnName =
'VALUE';
88 $realDescriptionColumnName =
'DESCRIPTION';
94 ->configureAutocomplete(),
100 elseif ($this->getVersion() == 2 && !$this->getMultiple())
103 $realValueColumnName =
'PROPERTY_'.$this->getId();
104 $realDescriptionColumnName =
'DESCRIPTION_'.$this->getId();
118 $this->valueEntity = Entity::compileEntity(
123 'table_name' => $valueTableName,
124 'parent' => ValueStorageTable::class,
132 $this->valueEntity->getField(
'VALUE')->configureColumnName($realValueColumnName);
135 if ($realValueColumnName !==
'VALUE'
138 || $this->getMultiple()
142 $this->valueEntity->addField(
148 if ($this->getWithDescription())
150 $this->valueEntity->addField(
152 ->configureColumnName($realDescriptionColumnName)
157 return $this->valueEntity;
static getByPrimary($primary, array $parameters=array())