Commit 91a6cb88 authored by Taylor Otwell's avatar Taylor Otwell

Added wrap_value function to grammar.

parent 033455cc
...@@ -91,19 +91,23 @@ abstract class Grammar { ...@@ -91,19 +91,23 @@ abstract class Grammar {
// the table and the column in keyword identifiers. // the table and the column in keyword identifiers.
foreach (explode('.', $value) as $segment) foreach (explode('.', $value) as $segment)
{ {
if ($segment == '*') $wrapped[] = $this->wrap_value($segment);
{
$wrapped[] = $segment;
}
else
{
$wrapped[] = sprintf($this->wrapper, $segment);
}
} }
return implode('.', $wrapped); return implode('.', $wrapped);
} }
/**
* Wrap a single string value in keyword identifiers.
*
* @param string $value
* @return string
*/
protected function wrap_value($value)
{
return ($value !== '*') ? sprintf($this->wrapper, $value) : $value;
}
/** /**
* Create query parameters from an array of values. * Create query parameters from an array of values.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment