Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Chris Berthe
2012-06-25 13:11:54 -04:00
23 changed files with 320 additions and 21 deletions

View File

@@ -194,7 +194,7 @@ class Connection {
return $statement->rowCount();
}
// For insert statements that use the "returning" clause, which is allowed
// by databsae systems such as Postgres, we need to actually return the
// by database systems such as Postgres, we need to actually return the
// real query result so the consumer can get the ID.
elseif (stripos($sql, 'insert') === 0 and stripos($sql, 'returning') !== false)
{

View File

@@ -253,7 +253,27 @@ abstract class Model {
*/
public function _with($includes)
{
$this->includes = (array) $includes;
$includes = (array) $includes;
$all_includes = array();
foreach($includes as $include)
{
$nested = explode('.', $include);
$inc = array();
foreach($nested as $relation)
{
$inc[] = $relation;
$all_includes[] = implode('.', $inc);
}
}
//remove duplicates and reset the array keys.
$this->includes = array_values(array_unique($all_includes));
return $this;
}

View File

@@ -21,7 +21,7 @@ abstract class Grammar extends \Laravel\Database\Grammar {
// command is being executed and the referenced table are wrapped.
$table = $this->wrap($table);
$on = $this->wrap($command->on);
$on = $this->wrap_table($command->on);
// Next we need to columnize both the command table's columns as well as
// the columns referenced by the foreign key. We'll cast the referenced

View File

@@ -418,4 +418,4 @@ class MySQL extends Grammar {
return 'BLOB';
}
}
}

View File

@@ -393,9 +393,7 @@ class Table {
{
$parameters = array_merge(compact('type'), $parameters);
$this->commands[] = new Fluent($parameters);
return end($this->commands);
return $this->commands[] = new Fluent($parameters);
}
/**
@@ -409,9 +407,7 @@ class Table {
{
$parameters = array_merge(compact('type'), $parameters);
$this->columns[] = new Fluent($parameters);
return end($this->columns);
return $this->columns[] = new Fluent($parameters);
}
}