fix merge conflicts.

This commit is contained in:
Taylor Otwell
2012-03-30 08:44:23 -05:00
6 changed files with 30 additions and 6 deletions

View File

@@ -385,6 +385,19 @@ abstract class Model {
return $result;
}
/**
* Delete the model from the database.
*
* @return int
*/
public function delete()
{
if ($this->exists)
{
return $this->query()->where(static::$key, '=', $this->get_key())->delete();
}
}
/**
* Set the update and creation timestamps on the model.
*

View File

@@ -170,9 +170,7 @@ class Has_Many_And_Belongs_To extends Relationship {
*/
public function delete()
{
$id = $this->base->get_key();
return $this->joining_table()->where($this->foreign_key(), '=', $id)->delete();
return $this->pivot()->delete();
}
/**