Display a relation as text

@param value $value
@return string
325706
public function showRelation($value)
    {
        // Display nicer
        $display = $this->calculateFieldInfo($value, array());
        if ($value == $display) {
            $display = $this->_('-');
        }

        return $display;
    }
1029065
public function quote($value)
    {
        $PdoConnection = $this->getPdoConnection();
        
        // If a PDO database connection is set, use it to quote the value using
        // the underlying database. Otherwise, quote it manually.
        if ($PdoConnection) {
            return $PdoConnection->quote($value);
        } elseif (is_null($value)) {
            return "NULL";
        } else {
            return "'" . addslashes($value) . "'";
        }
    }
292059
public function displayValue( $value )
    {
        $values = explode( ' ', $value, 2 );
        
        if ( 1 < count( $values ) )
        {
            $value = $this->view->currencyFormat( $values[0], $values[1] );
        }
        
        return $value;
    }
876924
protected function getRelationCondition($relation, $value)
    {
        /** @var \yii\db\ActiveRecord $relationClass */
        $relationClass = $relation->modelClass;
        if ($relation->via !== null) {
            /* @var $viaRelation \yii\db\ActiveQuery */
            $viaRelation = is_array($relation->via) ? $relation->via[1] : $relation->via;
            /** @var \yii\db\ActiveRecord $viaClass */
            $viaClass = $viaRelation->modelClass;
            $subquery = (new Query)
                ->select(array_map(function ($key) {
                    return 'j.' . $key;
                }, array_keys($viaRelation->link)))
                ->from(['t' => $relationClass::tableName()])
                ->innerJoin(['j' => $viaClass::tableName()], implode(' AND ', array_map(function ($leftKey, $rightKey) {
                    return 't.' . $leftKey .' = j.' . $rightKey;
                }, array_keys($relation->link), array_values($relation->link))))
                ->where(['IN', array_map(function ($key) {
                    return 't.' . $key;
                }, $relationClass::primaryKey()), $value]);
            $linkKeys = array_values($viaRelation->link);
        } else {
            $subquery = (new Query)
                ->select(array_keys($relation->link))
                ->from(['t' => $relationClass::tableName()])
                ->where(['IN', array_map(function ($key) {
                    return 't.' . $key;
                }, $relationClass::primaryKey()), $value]);
            $linkKeys = array_values($relation->link);
        }
        return ['IN', array_map(function ($key) {
            return 't.' . $key;
        }, $linkKeys), $subquery];
    }
1283582
public function displayValue( $value )
    {
        if ( ! is_bool( $value ) )
        {
            $value = (string) $value;
        }
        
        return ( in_array( $value, $this->validTrues, true ) )
                ? self::TRUE : self::FALSE;
    }
1161490
public static function IS_TEXT($value = null)
    {
        $value = self::flattenSingleValue($value);

        return (is_string($value) && !self::IS_ERROR($value));
    }
57056
protected function formatRelationshipInput($value, Field $field)
    {
        $value = trim($value);

        if ($field->getOption('multiple_values')) {
            $value = $value ? explode(',', $value) : array();
        }

        return $value;
    }
427975
public static function parse($value){
		if(preg_match(Name::PATTERN, $value)) return new Name($value);
		if(preg_match(Text::PATTERN, $value)) return new Text($value);
		if(preg_match(Color::PATTERN, $value)) return new Color($value);
		if(preg_match(Measurement::PATTERN, $value)) return new Measurement($value);
		
		throw new \Exception("Invalid Value '$value'");
	}
1332115
private function valueToString($value): string
    {
        // null
        if ($value === null) {
            return 'NULL';
        }

        // bool
        if (\is_bool($value)) {
            return $value ? 'TRUE' : 'FALSE';
        }

        // array
        if (\is_array($value)) {
            return 'Array';
        }

        // scalar types (integer, float, string)
        if (\is_scalar($value)) {
            return (string) $value;
        }

        // resource
        if (\is_resource($value)) {
            return \get_resource_type($value) . ' resource #' . (int) $value;
        }

        // object
        return \get_class($value) . ' Object';
    }
571173
public static function getLabel($value)
    {
        $list = static::$list;

        if (isset($list[$value])) {
            return Yii::t(static::$messageCategory, $list[$value]);
        }

        return null;
    }
1013787
protected function addValue($value)
    {
        $name                = 'where' . $this->whereContainer->getBindingCount();
        $this->values[$name] = $value;

        return ':' . $name;
    }
523151
public function setValue($value)
    {
        $this->value = $value;
        if (is_string($value) && !empty($value)) {
            $value = Convert::json2array($value);
        } elseif (!is_array($value)) {
            $value = array($value);
        }

        $pattern = "/^{$this->getName()}\[(.*)\]$/";
        foreach ($this->children as $c) {
            $title = $c->getName();
            preg_match($pattern, $title, $matches);
            if (!empty($matches[1]) && isset($value[$matches[1]])) {
                $c->setValue($value[$matches[1]]);
            }
        }

        return $this;
    }
515147
public function setRelation($relation, $value)
    {
        $this->checkInitRelations();
        $this->relations[$relation] = $value;

        return $this;
    }
3971
public function setRelations($value)
    {
        if (is_array($value)) {
            $bag = new Bag();
            foreach ($value as $itemParameters) {
                $bag->add(new Relation($itemParameters));
            }
            $value = $bag;
        }
        return $this->setParameter('relations', $value);
    }
510814
private function translate( $value ) {
		$textdomain = $this->get_textdomain();
		if ( ! empty( $textdomain ) ) {
			$translated = __( $value, $textdomain );
			if ( $value !== $translated ) {
				return $translated;
			}
		}

		return __( $value, TECHNOTE_PLUGIN );
	}
454037
public function translate( $value ) {
		$text_domain = $this->get_text_domain();
		if ( ! empty( $text_domain ) ) {
			$translated = __( $value, $text_domain );
			if ( $value !== $translated ) {
				return $translated;
			}
		}

		return __( $value, $this->define->lib_textdomain );
	}
1365254
public function getAndSet(string $value): string
    {
        return $this->handle->getSet($this->name, $value);
    }