refactored wrap method for readability.

This commit is contained in:
Taylor Otwell 2011-08-01 20:20:32 -05:00
parent 82a0218011
commit e678b77b5b
1 changed files with 7 additions and 2 deletions

View File

@ -635,12 +635,17 @@ private function wrap($value)
{ {
if (strpos(strtolower($value), ' as ') !== false) if (strpos(strtolower($value), ' as ') !== false)
{ {
return $this->wrap_alias($value, $connection); return $this->wrap_alias($value);
} }
$wrap = $this->connection->wrapper(); $wrap = $this->connection->wrapper();
return implode('.', array_map(function($segment) use ($wrap) { return ($segment != '*') ? $wrap.$segment.$wrap : $segment; }, explode('.', $value))); foreach (explode('.', $value) as $segment)
{
$wrapped[] = ($segment != '*') ? $wrap.$segment.$wrap : $segment;
}
return implode('.', $wrapped);
} }
/** /**