added support for sequence to eloquent models.

This commit is contained in:
Taylor Otwell 2011-09-14 00:15:05 -05:00
parent 8688270f22
commit c576c388b9
1 changed files with 15 additions and 1 deletions

View File

@ -13,6 +13,20 @@ abstract class Model {
*/
public static $connection;
/**
* Indicates if the model has creation and update timestamps.
*
* @var bool
*/
public static $timestamps = false;
/**
* The name of the auto-incrementing sequence associated with the model.
*
* @var string
*/
public static $sequence = null;
/**
* The model query instance.
*
@ -362,7 +376,7 @@ public function save()
}
else
{
$success = is_numeric($this->attributes['id'] = $this->query->insert_get_id($this->attributes));
$success = is_numeric($this->attributes['id'] = $this->query->insert_get_id($this->attributes, static::$sequence));
}
($this->exists = true) and $this->dirty = array();