added support for sequence to eloquent models.
This commit is contained in:
parent
8688270f22
commit
c576c388b9
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue