public function sanitizeValue()
    {
        $strColNameId    = $this->objAttribute->get('tag_id') ?: 'id';
        $strColNameAlias = $this->objAttribute->get('tag_alias');
        $arrValues       = \is_array($this->value) ? $this->value : \explode(',', $this->value);

        if (!$this->isMetaModel()) {
            if ($strColNameAlias) {
                $builder = $this->connection->createQueryBuilder()
                    ->select($strColNameId)
                    ->from($this->objAttribute->get('tag_table'));
                foreach ($arrValues as $index => $value) {
                    $builder
                        ->orWhere($strColNameAlias . ' LIKE :value_' . $index)
                        ->setParameter('value_' . $index, $value);
                }
                $arrValues = $builder->execute()->fetchAll(\PDO::FETCH_COLUMN);
            } else {
                $arrValues = \array_map('intval', $arrValues);
            }
        } else {
            if ($strColNameAlias == 'id') {
                $values = $arrValues;
            } else {
                $values = [];
                foreach ($arrValues as $value) {
                    $values[] = \array_values(
                        $this->getTagMetaModel()->getAttribute($strColNameAlias)->searchFor($value)
                    );
                }
            }

            $arrValues = $this->flatten($values);
        }

        return $arrValues;
    }
public function sanitizeValue()
    {
        $strColNameId    = $this->objAttribute->get('tag_id') ?: 'id';
        $strColNameAlias = $this->objAttribute->get('tag_alias');
        $arrValues       = \is_array($this->value) ? $this->value : \explode(',', $this->value);

        if (!$this->isMetaModel()) {
            if ($strColNameAlias) {
                $builder = $this->connection->createQueryBuilder()
                    ->select($strColNameId)
                    ->from($this->objAttribute->get('tag_table'));
                foreach ($arrValues as $index => $value) {
                    $builder
                        ->orWhere($strColNameAlias . ' LIKE :value_' . $index)
                        ->setParameter('value_' . $index, $value);
                }
                $arrValues = $builder->execute()->fetchAll(\PDO::FETCH_COLUMN);
            } else {
                $arrValues = \array_map('intval', $arrValues);
            }
        } else {
            if ($strColNameAlias == 'id') {
                $values = $arrValues;
            } else {
                $values = [];
                foreach ($arrValues as $value) {
                    $values[] = \array_values(
                        $this->getTagMetaModel()->getAttribute($strColNameAlias)->searchFor($value)
                    );
                }
            }

            $arrValues = $this->flatten($values);
        }

        return $arrValues;
    }
public function sanitizeValue ( ) { $ strColNameId = $ this -> objAttribute -> get ( 'tag_id' ) ? : 'id' ; $ strColNameAlias = $ this -> objAttribute -> get ( 'tag_alias' ) ; $ arrValues = \ is_array ( $ this -> value ) ? $ this -> value : \ explode ( ',' , $ this -> value ) ; if ( ! $ this -> isMetaModel ( ) ) { if ( $ strColNameAlias ) { $ builder = $ this -> connection -> createQueryBuilder ( ) -> select ( $ strColNameId ) -> from ( $ this -> objAttribute -> get ( 'tag_table' ) ) ; foreach ( $ arrValues as $ index => $ value ) { $ builder -> orWhere ( $ strColNameAlias . ' LIKE :value_' . $ index ) -> setParameter ( 'value_' . $ index , $ value ) ; } $ arrValues = $ builder -> execute ( ) -> fetchAll ( \ PDO :: FETCH_COLUMN ) ; } else { $ arrValues = \ array_map ( 'intval' , $ arrValues ) ; } } else { if ( $ strColNameAlias == 'id' ) { $ values = $ arrValues ; } else { $ values = [ ] ; foreach ( $ arrValues as $ value ) { $ values [ ] = \ array_values ( $ this -> getTagMetaModel ( ) -> getAttribute ( $ strColNameAlias ) -> searchFor ( $ value ) ) ; } } $ arrValues = $ this -> flatten ( $ values ) ; } return $ arrValues ; }
Ensure the value is either a proper id or array od ids - converts aliases to ids.

@return array
Ensure the value is either a proper id or array od ids - converts aliases to ids .