|
|
|
@ -12,7 +12,6 @@ use Riesjart\Relaquent\Model\Concerns\HasRelaquentRelationships; |
|
|
|
|
* @property int $id |
|
|
|
|
* @property \Carbon\Carbon $created_at |
|
|
|
|
* @property \Carbon\Carbon $updated_at |
|
|
|
|
* @property int $refs |
|
|
|
|
* @property int $ancestor_id |
|
|
|
|
* @property string $note |
|
|
|
|
* @property object $columns |
|
|
|
@ -26,18 +25,6 @@ class Revision extends Model |
|
|
|
|
use HasRelaquentRelationships; |
|
|
|
|
protected $guarded = []; |
|
|
|
|
|
|
|
|
|
protected static function boot() |
|
|
|
|
{ |
|
|
|
|
parent::boot(); |
|
|
|
|
|
|
|
|
|
static::deleting(function(Revision $self) { |
|
|
|
|
// update refcounts |
|
|
|
|
$self->rows()->decrement('refs'); |
|
|
|
|
|
|
|
|
|
$self->rows()->where('refs', '<=', 0)->delete(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** Included rows */ |
|
|
|
|
public function rows() |
|
|
|
|
{ |
|
|
|
|