Skip to content

Commit

Permalink
Merge pull request #134 from aranw/master
Browse files Browse the repository at this point in the history
Update the performUpdate and performInsert
  • Loading branch information
franzose committed Oct 10, 2014
2 parents f544306 + c9b3c3f commit 7af4b2c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Franzose/ClosureTable/Models/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1251,28 +1251,32 @@ protected function getNewRealDepth($ancestor)
* Perform a model insert operation.
*
* @param EloquentBuilder $query
* @param array $options
*
* @return bool
*/
protected function performInsert(EloquentBuilder $query)
protected function performInsert(EloquentBuilder $query, array $options)
{
if ($this->isMoved === false)
{
$this->position = $this->position !== null ? $this->position : $this->getNextAfterLastPosition();
$this->real_depth = $this->getNewRealDepth($this->parent_id);
}

return parent::performInsert($query);
return parent::performInsert($query, $options);
}

/**
* Perform a model update operation.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param array $options
*
* @return bool
*/
protected function performUpdate(EloquentBuilder $query)
protected function performUpdate(EloquentBuilder $query, array $options)
{
if (parent::performUpdate($query))
if (parent::performUpdate($query, $options))
{
if ($this->real_depth != $this->old_real_depth && $this->isMoved === true)
{
Expand Down

0 comments on commit 7af4b2c

Please sign in to comment.