Example #1
0
 /**
  * Конструктор.
  * @param ISelector $selector селектор, к которому относится выражение
  * @param IField $field поле типа данных
  * @param string $collectionAlias алиас для коллекции
  * @param string $placeholder уникальный плейсхолдер для поля
  * @param string $localeId идентификатор локали (для локализованных полей)
  * @return self
  */
 public function __construct(ISelector $selector, IField $field, $collectionAlias, $placeholder, $localeId)
 {
     $columnName = $field->getIsLocalized() ? $field->getColumnName($localeId) : $field->getColumnName();
     $this->selector = $selector;
     $this->field = $field;
     $this->fieldColumn = $collectionAlias . ISelector::FIELD_SEPARATOR . $columnName;
     $this->placeholder = $placeholder;
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function getDbValue()
 {
     if (!$this->getIsLoaded()) {
         $localization = $this->object->getLoadLocalization();
         if ($this->field->getIsLocalized()) {
             $currentLocaleId = $localization === ILocalesService::LOCALE_CURRENT ? $this->getCurrentDataLocale() : $localization;
             if ($this->localeId !== $currentLocaleId && $this->localeId !== $this->getDefaultDataLocale()) {
                 $localization = ILocalesService::LOCALE_ALL;
             }
         }
         $this->object->fullyLoad($localization);
     }
     return $this->dbValue;
 }