@param string   $value values with starting ':' mean a column name, otherwise a regular value.
@param TableMap $table

@return ColumnMap|mixed
340555
protected function getColumnOrValue($value, TableMap $table)
    {
        if (':' === substr($value, 0, 1)) {
            return $table->getColumn(substr($value, 1));
        } else {
            return $value;
        }
    }
404260
public function fromTable(string $tableName) : TableChartMappingDefiner
    {
        if (!isset($this->tables[$tableName])) {
            throw InvalidArgumentException::format(
                    'Invalid table name supplied to %s: expecting one of (%s), \'%s\' given',
                    __METHOD__, Debug::formatValues(array_keys($this->tables)), $tableName
            );
        }

        return new TableChartMappingDefiner($this->name, $this->tables[$tableName]->getDataSource(), $this->callback);
    }
776966
public function wrap($value)
		{
			// Expressions should be injected into the query as raw strings so
			// so we do not want to wrap them in any way. We will just return
			// the string value from the expression to be included.
			if ($value instanceof Expression) return $value->get();

			// If the value being wrapped contains a column alias, we need to
			// wrap it a little differently as each segment must be wrapped
			// and not the entire string.
			if (strpos(strtolower($value), ' as ') !== false) {
				$segments = explode(' ', $value);

				return sprintf(
					'%s AS %s',
					$this->wrap($segments[0]),
					$this->wrap($segments[2])
				);
			}

			// Since columns may be prefixed with their corresponding table
			// name so as to not make them ambiguous, we will need to wrap
			// the table and the column in keyword identifiers.
			foreach (explode('.', $value) as $segment) {
				if ($segment == '*') {
					$wrapped[] = $segment;
				} else {
					$wrapped[] = sprintf($this->wrapper, $segment);
				}
			}

			return implode('.', $wrapped);
		}
1186347
public function setColumn(string $column, $value)
    {
        $this->table->getColumn($column);

        $this->columnData[$column] = $value;
    }
122585
public function getAssocColumn($table, $columnName, $defaultValue = null)
    {
        $values = [];
        foreach ($table as $key => $line) {
            if (array_key_exists($columnName, $line)) {
                $values[$key] = $line[$columnName];
            } else {
                $values[$key] = $defaultValue;
            }
        }

        return $values;
    }
1362571
public function aliasSet( $value )
	{
		$columns = $this->getColumns();
		$this->aliasGet( $oldValue );
		foreach( $columns as &$column )
		{
			$tableAlias = $column[0];
			if( $tableAlias === $oldValue )
			{
				$column[0] = $value;
			}
		}

		$select = $this->getSelect();
		$from = $select->getPart( Zend_Db_Select::FROM );
		$select->reset( Zend_Db_Select::FROM );
		foreach( $from as $tableAlias => $descriptor )
		{
			if( $tableAlias === $oldValue )
			{
				unset($from[$oldValue]);
				$from[$value] = $descriptor;
			}
		}
		$select->from( array( $value => $this->getTable() ), array() );

		return $this
			->setAlias( $value )
			->resetColumns( $columns )
		;
	}
1103325
public static function startsWith($value, $contains, $identical = false)
    {
        $enc = \mb_detect_encoding($value);

        if (false === $identical) {
            return 0 === \mb_stripos($value, $contains, 0, $enc);
        }

        return 0 === \mb_strpos($value, $contains, 0, $enc);
    }
37024
public function getBy(string $table, string $field, $value): array
    {
        $result = $this->getByFilter($table, array($field), array($value));

        if (empty($result)) {
            throw new NotFoundException($value . ' not found.');
        }

        return $result[0];
    }
961684
public function getOption($value)
	{
		foreach ($this->options as $option) {
			if ($option->getValue() === $value) {
				return $option;
			}
		}

		throw new DataGridColumnStatusException("Option [$value] does not exist");
	}
418320
public function getColumnDataForObject($value) : Row
    {
        /** @var EmbeddedParentObjectMapping $embeddedDefinition */
        $embeddedDefinition = $this->getRelation()->getEmbeddedObjectMapper()->getMapping();
        $rowData            = $embeddedDefinition->persistObject(PersistenceContext::dummy(), $value);

        return $rowData;
    }
227345
public function findOrFail($value, $columns = [])
    {
        $entry = $this->find($value, $columns);

        // Make sure we check if the result is an entry or an array before
        // we throw an exception in case the user wants raw results.
        if (! $entry instanceof Model && !is_array($entry)) {
            throw (new ModelNotFoundException())
                ->setQuery($this->getUnescapedQuery(), $this->getDn());
        }

        return $entry;
    }
306054
public function formatTemporalValue($value, ColumnMap $cMap)
    {
        /** @var $dt PropelDateTime */
        if ($dt = PropelDateTime::newInstance($value)) {
            switch ($cMap->getType()) {
                case PropelTypes::TIMESTAMP:
                case PropelTypes::BU_TIMESTAMP:
                    $value = $dt->format($this->getTimestampFormatter());
                    break;
                case PropelTypes::DATE:
                case PropelTypes::BU_DATE:
                    $value = $dt->format($this->getDateFormatter());
                    break;
                case PropelTypes::TIME:
                    $value = $dt->format($this->getTimeFormatter());
                    break;
            }
        }

        return $value;
    }
1265280
protected function parseValue($value)
    {
        if (substr($value, 0, 2) == '=>') {
            // Parse a dictionary reference - used to set foreign keys
            if (strpos($value, '.') !== false) {
                list($class, $identifier) = explode('.', substr($value, 2), 2);
            } else {
                throw new \LogicException("Bad fixture lookup identifier: " . $value);
            }

            if ($this->fixtures && !isset($this->fixtures[$class][$identifier])) {
                throw new InvalidArgumentException(sprintf(
                    'No fixture definitions found for "%s"',
                    $value
                ));
            }

            return $this->fixtures[$class][$identifier];
        } else {
            // Regular field value setting
            return $value;
        }
    }
1181392
public static function tableColumn(Table $table, string $columnName) : ColumnExpr
    {
        if (!$table->hasColumn($columnName)) {
            throw InvalidArgumentException::format(
                'Invalid table column name for table \'%s\': expecting one of (%s), \'%s\' given',
                $table->getName(), Debug::formatValues($table->getColumnNames()), $columnName
            );
        }

        return new ColumnExpr($table->getName(), $table->findColumn($columnName));
    }
236910
public function setLockingColumn(string $column, $value)
    {
        $this->table->getColumn($column);

        $this->lockingColumnData[$column] = $value;
    }
355377
public function mapColumnsWithValues($columns, $values)
    {
        // If $values is null, then use $columns to build it up
        if (is_null($values)) {

            if ($this->isAssoc($columns)) {

                // Incoming is associative array, split it up in two
                $values = array_values($columns);
                $columns = array_keys($columns);

            } else {

                // Create an array of '?' to match number of columns
                $max = count($columns);
                for ($i = 0; $i < $max; $i++) {
                    $values[] = '?';
                }
            }
        }

        return [$columns, $values];
    }
893136
public function findSoft($column, $value)
    {
        return $this->getFirstSoft((is_null($column) ? $this->key : $column) . ' = ?', [$value]);
    }