Scalr\Model\AbstractEntity::qstr PHP Method

qstr() public method

Escapes value for the field
public qstr ( string | Scalr\Model\Loader\Field $field, mixed $value = null ) : string
$field string | Scalr\Model\Loader\Field The name of the field or the Field object
$value mixed optional The value to escape or it will take field's value from the object
return string Returns escaped value for the fiel
    public function qstr($field, $value = null)
    {
        if (!$field instanceof Field) {
            $field = $this->getIterator()->getField((string) $field);
        }
        if (func_num_args() == 1) {
            $value = $this->{$field->name};
        }
        return str_replace('?', $this->db()->qstr($field->type->toDb($value)), $field->type->wh());
    }