Added wrap_value function to grammar.

This commit is contained in:
Taylor Otwell 2012-03-21 12:06:31 -05:00
parent 033455cc51
commit 91a6cb882e
1 changed files with 12 additions and 8 deletions

View File

@ -91,19 +91,23 @@ public function wrap($value)
// 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.
* *