Commit ca77cd5a authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #438 from sparksp/patch-7

Fix named keys on Schema columns
parents 32e194ad d1de7b9f
......@@ -120,9 +120,16 @@ class Schema {
{
foreach (array('primary', 'unique', 'fulltext', 'index') as $key)
{
if (isset($column->attributes[$key]))
if (isset($column->$key))
{
$table->$key($column->name);
if ($column->$key === true)
{
$table->$key($column->name);
}
else
{
$table->$key($column->name, $column->$key);
}
}
}
}
......
......@@ -77,4 +77,20 @@ class Fluent {
$this->attributes[$key] = $value;
}
/**
* Dynamically check if an attribute is set.
*/
public function __isset($key)
{
return isset($this->attributes[$key]);
}
/**
* Dynamically unset an attribute.
*/
public function __unset($key)
{
return unset($this->attributes[$key]);
}
}
\ No newline at end of file
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