Build the condition by casting the value if needed

@param  string $field
@param  array  $fieldConf Various values about the field

@return string
437050
public function getCondition(string $field, array $fieldConf): string
    {
        $type = strtolower($fieldConf['type']);
        $unsigned = $fieldConf['unsigned'];

        $integerCast = $this->getIntegerCast($unsigned);

        $condition = "(CASE $field WHEN NULL THEN NULL ELSE :$field END)";

        $typeToCast = [
            'date' => 'DATE',
            'datetime' => 'DATE',
            'time' => 'TIME',
            'smallint' => $integerCast,
            'integer' => $integerCast,
            'bigint' => $integerCast,
            'float' => 'DECIMAL',
            'decimal' => 'DECIMAL',
        ];

        // No cast required
        if (!array_key_exists($type, $typeToCast)) {
            return $condition;
        }

        return "CAST($condition AS {$typeToCast[$type]})";
    }
241387
function create_field( $field )
	{
		// vars
		$o = array( 'id', 'class', 'name', 'value' );
		$e = '';
		
		
		$e .= '<div class="acf-color_picker">';
		$e .= '<input type="text"';
		
		foreach( $o as $k )
		{
			$e .= ' ' . $k . '="' . esc_attr( $field[ $k ] ) . '"';	
		}
		
		$e .= ' />';
		$e .= '</div>';
		
		
		// return
		echo $e;
	}
192667
public function castValue($field, $value)
    {
        if (null === $value) {
            return $value;
        }

        $cast = $this->getCast($field);

        switch ($cast) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'string':
                return (string) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'object':
                return json_decode($value);
            case 'array':
            case 'json':
                return json_decode($value, true);
            case 'date':
            case 'datetime':
                return $this->toDateTime($value);
            case 'timestamp':
                return $this->toDateTime($value)->getTimestamp();
            case class_exists($cast):
                return new $cast($value);
            case is_callable($cast):
                return $cast($value);
            default:
                return $value;
        }
    }
346017
public function fieldValue($field, $value)
    {
        if (!in_array($field, $this->supports)) {
            $this->supports[ ] = $field;
        }
        $this->values[ $field ] = $value;

        return $this;
    }
193503
public static function forField(IField $field) : ColumnComponentType
    {
        return new self(
                $field->getProcessedType(),
                StandardConditions::forField($field, $field->getProcessedType()->getConditionOperators())
        );
    }
82180
public function whereInset($field, $value)
    {
        $key = strtr($field, '.', '_');
        $this->_conditions[] = 'FIND_IN_SET(:' . $key . ', ' . '[' . str_replace('.', '].[', $field) . '])>0';
        $this->_bind[$key] = $value;

        return $this;
    }
1138407
private String buildCsvValue(final Field field,
                                 final String fieldValue) {


        return (areTextValuesWrapped && field.getType().equals(String.class)
                || isValueWrappable.test(fieldValue))
                ? wrapWithQuotes(fieldValue)
                : fieldValue;
    }
532171
public function getOptionValue($field)
    {
        $postType = getPostType($this->getTable());
        if(!$postType) {
            throw new \Exception("Post type ".$this->getTable()."' does not exists!");
        }
        return $postType->getMultioptionFieldValue($field, $this->$field);
    }
249006
private function buildField($field, $type, $variable, $value = true)
    {
        $column = strtolower($field['name']);
        $title = ucfirst($field['name']);

        if ($value === true) {
            $value = '$' . $variable . '->' . $column;
        } else {
            $value = 'old("'.$column.'")';
        }

        $syntax = [];

        switch($type) {
            case 'string':
            default:
                $input = 'text';
                break;
            case 'text':
                $input = 'textarea';
                break;
        }

        $syntax[] = '<div class="form-group @if($errors->has('."'". $column . "'".')) has-error @endif">';
        $syntax[] = '   <label for="' . $column . '-field">' . $title . '</label>';

        if($this->illuminate) {
            $syntax[] = '   {!! Form::' . $input . '("' . $column . '", ' . $value . ', array("class" => "form-control", "id" => "' . $column . '-field")) !!}';
        } else {
            $syntax[] = $this->htmlField($column, $variable, $field, $type);
        }

        $syntax[] = '   @if($errors->has("' . $column . '"))';
        $syntax[] = '    <span class="help-block">{{ $errors->first("' . $column . '") }}</span>';
        $syntax[] = '   @endif';
        $syntax[] = '</div>';

        return join("\n".str_repeat(' ', 20), $syntax);
    }
130025
private function getSelectConditionStatementColumnSQL($field, $assoc = null)
    {
        if (isset($this->class->columnNames[$field])) {
            $className = (isset($this->class->fieldMappings[$field]['inherited']))
                ? $this->class->fieldMappings[$field]['inherited']
                : $this->class->name;

            return array($this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform));
        }

        if (isset($this->class->associationMappings[$field])) {
            $association = $this->class->associationMappings[$field];
            // Many-To-Many requires join table check for joinColumn
            $columns = array();
            $class   = $this->class;

            if ($association['type'] === ClassMetadata::MANY_TO_MANY) {
                if ( ! $association['isOwningSide']) {
                    $association = $assoc;
                }

                $joinTableName = $this->quoteStrategy->getJoinTableName($association, $class, $this->platform);
                $joinColumns   = $assoc['isOwningSide']
                    ? $association['joinTable']['joinColumns']
                    : $association['joinTable']['inverseJoinColumns'];


                foreach ($joinColumns as $joinColumn) {
                    $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
                }

            } else {

                if ( ! $association['isOwningSide']) {
                    throw ORMException::invalidFindByInverseAssociation($this->class->name, $field);
                }

                $className  = (isset($association['inherited']))
                    ? $association['inherited']
                    : $this->class->name;

                foreach ($association['joinColumns'] as $joinColumn) {
                    $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
                }
            }
            return $columns;
        }

        if ($assoc !== null && strpos($field, " ") === false && strpos($field, "(") === false) {
            // very careless developers could potentially open up this normally hidden api for userland attacks,
            // therefore checking for spaces and function calls which are not allowed.

            // found a join column condition, not really a "field"
            return array($field);
        }

        throw ORMException::unrecognizedField($field);
    }
1095308
public static function forField(IField $field, array $operators = null) : array
    {
        if ($operators === null) {
            $operators = $field->getProcessedType()->getConditionOperators();
        }

        $conditions = [];

        $arrayField = Field::name($field->getName())
                ->label($field->getLabel())
                ->arrayOfField($field)
                ->build();

        $stringField = Field::name($field->getName())
                ->label($field->getLabel())
                ->string()
                ->build();

        foreach ($operators as $operator) {
            if ($operator === ConditionOperator::IN || $operator === ConditionOperator::NOT_IN) {
                $conditions[] = new ColumnComponentOperator($operator, $arrayField);
            } elseif ($operator === ConditionOperator::STRING_CONTAINS || $operator === ConditionOperator::STRING_CONTAINS_CASE_INSENSITIVE) {
                $conditions[] = new ColumnComponentOperator($operator, $stringField);
            } else {
                $conditions[] = new ColumnComponentOperator($operator, $field);
            }
        }

        return $conditions;
    }
784256
public void configFields(Configuration conf, String[] fields) 
            throws IllegalArgumentException, IOException {
        for (int i = 0; i < fields.length; i++) {
            fields[i] = fields[i].trim();
            if ("".equals(fields[i])) {
                LOG.warn("Column " + (i+1) + " has no header and will be skipped");
            }
        }
    }
1222488
public function uses(FieldConfig $field)
    {
        return in_array($field, $this->fields->toArray()) || $field instanceof IdFieldConfig;
    }
633088
public function withPredefinedColumnValues(FieldBuilderBase $field, array $columnValues) : TableRowFieldDefiner
    {
        $this->fieldBuilder->attr(TableType::ATTR_PREDEFINED_COLUMNS, array_values($columnValues));
        return $this->withColumnKeyAs($field);
    }
129103
public function validateFieldValue($sFieldValue)
    {
        $blValid = true;
        if (is_array($sFieldValue)) {
            $blValid = $this->_validateFieldValueArray($sFieldValue);
        } else {
            if (!trim($sFieldValue)) {
                $blValid = false;
            }
        }

        return $blValid;
    }
299902
protected function getNestedConfig($field, $config)
	{
		$field = preg_split('(__([0-9]+)__)', substr($field, 11), -1, PREG_SPLIT_DELIM_CAPTURE);

		if (!isset($config[$field[0]])) {
			return null;
		}

		$fieldConfig =& $config[$field[0]];

		for ($i = 0; isset($field[$i]); $i += 2) {

			if (isset($field[$i + 1])) {
				if (!isset($fieldConfig['fields'])) {
					return null;
				}
				if (!isset($fieldConfig['fields'][$field[$i + 2]])) {
					return null;
				}
				$fieldConfig =& $fieldConfig['fields'][$field[$i + 2]];
			}
			else {
				return $fieldConfig;
			}

		}
	}
144131
public function condition($field, $value = NULL, $expressionOperator = NULL)
    {

        if (!isset($expressionOperator)) {
            if (is_array($value)) {
                $expressionOperator = 'IN';
            }
            else {
                $expressionOperator = '=';
            }
        }
        $this->conditions[] = array(
            'field' => $field,
            'value' => $value,
            'operator' => $expressionOperator,
        );
        return $this;
    }