@param        $app
@param string $field
@param mixed  $value

@return mixed
491582
protected function checkIssetCollection($app, $field, $value = null)
    {
        return isset($app->$field) ? new Collection($app->$field) : $value;
    }
47403
public function set(string $field, $value)
    {
        if ($value === null)
            $value = "";

        switch ($field)
        {
            case "scheme":
                $this->scheme = strtolower($value);
                return $this;
            case "port":
                $value = empty($value) ? null : (int)$value;
            case "username":
            case "password":
            case "fragment":
                $this->$field = $value;
                return $this;
            case "query":
                $this->query = $this->parseQuery($value);
                return $this;
            case "path":
                $this->setPath($value);
                return $this;
            case "host":
                return $this->setHost($value);
        }
        throw new \OutOfRangeException($field);
    }
1190340
public function orWhere($field, $value)
    {
        if (strtolower($field) === "meta_query") {
            return $this->metaWhere($field, $value, 'OR');
        } elseif (strtolower($field) === "tax_query") {
            return $this->taxWhere($field, $value, 'OR');
        }

        $this->filters[$field] = $value;
        return $this;
    }
107179
public function oneByIntOrFail(string $field, int $value): Model
    {
        return $this->oneByOrFail($field, $value);
    }
1212102
public function getBy($field, $value, $table = null)
	{
		if(null === $table)
		{
			$table = $this->tableName();
		}
		return $this->where(array((false === $table ? '' : ($table . '.')) . $field=>$value))->getOne();
	}
548526
public function loadBy($field, $value)
    {
        // store
        $field = $this->getField($field);
        $system = $field->system;
        $default = $field->default;

        // add condition and load record
        $this->addCondition($field, $value);

        try {
            $this->loadAny();
        } catch (\Exception $e) {
            // restore
            array_pop($this->conditions);
            $field->system = $system;
            $field->default = $default;

            throw $e;
        }

        // restore
        array_pop($this->conditions);
        $field->system = $system;
        $field->default = $default;

        return $this;
    }
1240998
public function run( $field, $value, $message = null ) {
        $this->field   = $field;
        $this->message = $message;
        $value = preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $value);

        return !empty($value);
    }
1197625
public function set($field, $value = null)
    {
        if (func_num_args() == 1) {
            if (is_array($field)) {
                foreach ($field as $key => $value) {
                    if ($key === '0' || $key === 0) {
                        $this->set($value);
                    } else {
                        $this->set($key, $value);
                    }
                }

                return $this;
            } elseif ($field instanceof self) {
                $this->data = $field->data;
                //$this->id = $field->id;

                return $this;
            } else {
                $value = $field;
                $field = $this->title_field;
            }
        }

        $field = $this->normalizeFieldName($field);

        $f = $this->hasField($field);

        try {
            if ($f && $this->hook('normalize', [$f, $value]) !== false) {
                $value = $f->normalize($value);
            }
        } catch (Exception $e) {
            $e->addMoreInfo('field', $field);
            $e->addMoreInfo('value', $value);
            $e->addMoreInfo('f', $f);

            throw $e;
        }

        $default_value = $f ? $f->default : null;

        $original_value = array_key_exists($field, $this->dirty) ? $this->dirty[$field] :
            ((isset($f) && isset($f->default)) ? $f->default : null);

        $current_value = array_key_exists($field, $this->data) ? $this->data[$field] : $original_value;

        if (gettype($value) == gettype($current_value) && $value == $current_value) {
            // do nothing, value unchanged
            return $this;
        }

        if ($f) {
            // perform bunch of standard validation here. This can be re-factored in the future.
            if ($f->read_only) {
                throw new Exception([
                    'Attempting to change read-only field',
                    'field' => $field,
                    'model' => $this,
                ]);
            }

            // enum property support
            if (isset($f->enum) && $f->enum && $f->type != 'boolean') {
                if ($value === '') {
                    $value = null;
                }
                if ($value !== null && !in_array($value, $f->enum, true)) {
                    throw new Exception([
                        'This is not one of the allowed values for the field',
                        'field' => $field,
                        'model' => $this,
                        'value' => $value,
                        'enum'  => $f->enum,
                    ]);
                }
            }

            // values property support
            if ($f->values) {
                if ($value === '') {
                    $value = null;
                } elseif ($value === null) {
                    // all is good
                } elseif (!is_string($value) && !is_int($value)) {
                    throw new Exception([
                        'Field can be only one of pre-defined value, so only "string" and "int" keys are supported',
                        'field' => $field,
                        'model' => $this,
                        'value' => $value,
                        'values'=> $f->values,
                    ]);
                } elseif (!array_key_exists($value, $f->values)) {
                    throw new Exception([
                        'This is not one of the allowed values for the field',
                        'field'   => $field,
                        'model'   => $this,
                        'value'   => $value,
                        'values'  => $f->values,
                    ]);
                }
            }
        }

        if (array_key_exists($field, $this->dirty) && (
            gettype($this->dirty[$field]) == gettype($value) && $this->dirty[$field] == $value
        )) {
            unset($this->dirty[$field]);
        } elseif (!array_key_exists($field, $this->dirty)) {
            $this->dirty[$field] =
                array_key_exists($field, $this->data) ?
                $this->data[$field] : $default_value;
        }
        $this->data[$field] = $value;

        return $this;
    }
746145
protected function checkIssetImage($app, $field, $value = null)
    {
        return isset($app->$field) ? $this->getImageForGame($app->appid, $app->$field) : $value;
    }
591910
public function findByField($field, $value = null, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();
        $model = $this->model->where($field, '=', $value)->get($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
919508
public function gte($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) >= $value;
        };
    }
35292
public function oneByOrFail(string $field, $value): Model
    {
        $model = $this->oneBy($field, $value);
        if (empty($model)) {
            throw new ResourceNotFoundException();
        }

        return $model;
    }
693331
public function getValue($value = '', $field = 'id', $fieldOutput = '')
    {
        if (!is_array($fieldOutput)) {
            $fieldOutput = [$fieldOutput];
        }
        $db = $this->db->select($fieldOutput)->from($this->table);
        if (is_array($value) && count($value) > 0) {
            foreach ($value as $column => $column_value) {
                if (is_array($column_value)) {
                    $db->whereIn($column, $column_value);
                } else {
                    $db->where($column, self::OPERATOR_EQUAL_TO, $column_value);
                }
            }
        } else {
            $db->where($field, self::OPERATOR_EQUAL_TO, $value);
        }
        $result = $db->execute()->fetch();

        $this->debug->debug(__FUNCTION__, 'GET Result => ' . json_encode($result));
        if (isset($result->$fieldOutput)) {
            return $result->$fieldOutput;
        } else {
            return NULL;
        }
    }
426571
protected function parseValue($value, $field = '')
    {
        unset($field);
        if (is_string($value)) {
            $value = strpos($value, ':') === 0 && $this->query->isBind(substr($value, 1)) ? $value : $this->connection->quote($value);
        } elseif (is_array($value)) {
            $value = array_map([$this, 'parseValue'], $value);
        } elseif (is_bool($value)) {
            $value = $value ? '1' : '0';
        } elseif (is_null($value)) {
            $value = 'null';
        }
        return $value;
    }
294543
public function lookAt($value, $field)
    {
        $this->value = $value;
        $this->field = $field;
        return $this;

    }
1037765
public function appendFieldValue($value, Buffer $buffer)
    {
        if (is_string($value)) {
            $buffer->appendUint8(Constants::FIELD_LONG_STRING);
            $buffer->appendUint32(strlen($value));
            $buffer->append($value);

        } elseif (is_int($value)) {
            $buffer->appendUint8(Constants::FIELD_LONG_INT);
            $buffer->appendInt32($value);

        } elseif (is_bool($value)) {
            $buffer->appendUint8(Constants::FIELD_BOOLEAN);
            $buffer->appendUint8(intval($value));

        } elseif (is_float($value)) {
            $buffer->appendUint8(Constants::FIELD_DOUBLE);
            $buffer->appendDouble($value);

        } elseif (is_array($value)) {
            if (array_keys($value) === range(0, count($value) - 1)) { // sequential array
                $buffer->appendUint8(Constants::FIELD_ARRAY);
                $this->appendArray($value, $buffer);
            } else {
                $buffer->appendUint8(Constants::FIELD_TABLE);
                $this->appendTable($value, $buffer);
            }

        } elseif (is_null($value)) {
            $buffer->appendUint8(Constants::FIELD_NULL);

        } elseif ($value instanceof \DateTime) {
            $buffer->appendUint8(Constants::FIELD_TIMESTAMP);
            $this->appendTimestamp($value, $buffer);

        } else {
            throw new ProtocolException(
                "Unhandled value type '" . gettype($value) . "' " .
                (is_object($value) ? "(class " . get_class($value) . ")" : "") .
                "."
            );
        }
    }
696102
public function data($field, $value = null)
    {
        if (is_array($field)) {
            $this->options['data'] = isset($this->options['data']) ? array_merge($this->options['data'], $field) : $field;
        } else {
            $this->options['data'][$field] = $value;
        }

        return $this;
    }