@param string $field
@param mixed $value

@return callable
494775
public function eq($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) === $value;
        };
    }
1077992
public function typecastLoadField(Field $f, $value)
    {
        try {
            // use $f->typecast = [typecast_save_callback, typecast_load_callback]
            if (is_array($f->typecast) && isset($f->typecast[1]) && is_callable($t = $f->typecast[1])) {
                return $t($value, $f, $this);
            }

            // only string type fields can use empty string as legit value, for all
            // other field types empty value is the same as no-value, nothing or null
            if ($f->type && $f->type != 'string' && $value === '') {
                return;
            }

            // we respect null values
            if ($value === null) {
                return;
            }

            // run persistence-specific typecasting of field value
            return $this->_typecastLoadField($f, $value);
        } catch (\Exception $e) {
            throw new Exception(['Unable to typecast field value on load', 'field' => $f->name], null, $e);
        }
    }
118072
public function whereEq($field, $value)
    {
        foreach ($this->queries as $query) {
            $query->whereEq($field, $value);
        }

        return $this;
    }
1203420
public function setField(string $field, $value)
    {
        if (isset($this->_record[$field]) && $this->_record[$field] === $value)
            return;

        $db = $this->getDB();
        $dao = $db->getDAO(static::class);
        $columns = $dao->getColumns();
        if (!isset($columns[$field]))
            throw new InvalidValueException("Field $field does not exist!");

        $pkey = $dao->getPrimaryKey();
        $coldef = $columns[$field];
        if (static::validate($coldef, $value))
        {
            $this->_record[$field] = $value;
            $this->_changed[$field] = true;

            if (isset($pkey[$field]))
                $this->_id[$field] = $value;

            // Synchronize value of local properties
            if (property_exists($this, $field))
                $this->$field = $value;
        }

        return $this;
    }
943227
public function compileStartsWith($field, $value)
    {
        return $this->wrap($field.Operator::$equals.$value.Operator::$has);
    }
919508
public function gte($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) >= $value;
        };
    }
626884
public function set($field, $value) {
        $parser = $this->getParser($field);
        $this->_properties[$field] = $parser->parse($value);
        return $this;
    }
702301
public function compileEndsWith($field, $value)
    {
        return $this->wrap($field.Operator::$equals.Operator::$has.$value);
    }
146820
public function contains($field, $value)
    {
        return function ($object) use ($field, $value) {
            return false !== strpos(ClosureExpressionBuilder::getObjectFieldValue($object, $field), $value);
        };
    }
883177
public function select($field, $value = null)
    {
        $element = $this->resolver->resolveForSelection($field);

        $options = $element->findElements(WebDriverBy::cssSelector('option:not([disabled])'));

        if (is_null($value)) {
            $options[array_rand($options)]->click();
        } else {
            foreach ($options as $option) {
                if ((string) $option->getAttribute('value') === (string) $value) {
                    $option->click();

                    break;
                }
            }
        }

        return $this;
    }
347186
public function fillFieldWithValue($field, $value = '')
    {
        $fieldNode = $this->spin(
            function () use ($field) {
                $fieldNode = $this->getSession()->getPage()->findField($field);
                if ($fieldNode == null) {
                    throw new \Exception('Field not found');
                }

                return $fieldNode;
            }
        );

        $this->spin(
            function () use ($fieldNode, $field, $value) {
                // make sure any autofocus elements don't mis-behave when setting value
                $fieldNode->blur();
                usleep(10 * 1000);
                $fieldNode->focus();
                usleep(10 * 1000);

                // setting value on pre-filled inputs can cause issues, clearing before
                $fieldNode->setValue('');
                $fieldNode->setValue($value);

                // verication that the field was really filled in correctly
                $this->sleep();
                $check = $this->getSession()->getPage()->findField($field)->getValue();
                if ($check != $value) {
                    throw new \Exception('Failed to set the field value: ' . $check);
                }

                return true;
            }
        );
    }
872483
public function lte($field, $value)
    {
        return function ($object) use ($field, $value) {
            return ClosureExpressionBuilder::getObjectFieldValue($object, $field) <= $value;
        };
    }
1100411
public function setResult($field, $value)
    {
        if (!isset($this->results[$field])) {
            $this->results[$field] = $value;
        }

        return $this;
    }
947605
public function oneByStringOrFail(string $field, string $value): Model
    {
        return $this->oneByOrFail($field, $value);
    }
515396
public function append($field, $value)
    {
        $this->resolver->resolveForTyping($field)->sendKeys($value);

        return $this;
    }
568046
public function orWhere($field, $value = null)
    {
        if ($field instanceof Closure) {
            return $this->formatWhere('$or', $field);
        }

        return $this->formatWhere('$or', $field, $value);
    }
261205
public function set($field, $value = null)
    {
        if (! is_array($field)) {
            $field = [$field => $value];
        }

        foreach ($field as $f => $v) {
            $this->update('$set', $f, $v);
        }

        return $this;
    }