Skip to content

Commit 4fdef95

Browse files
committed
Update AuditingTrait.php
1 parent 556b4bf commit 4fdef95

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

src/OwenIt/Auditing/AuditingTrait.php

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ trait AuditingTrait
2424
/**
2525
* @var array
2626
*/
27-
private $dontKeep = [];
27+
protected $dontKeep = [];
2828

2929
/**
3030
* @var array
3131
*/
32-
private $doKeep = [];
32+
protected $doKeep = [];
3333

3434
/**
3535
* @var array
@@ -83,7 +83,7 @@ public static function classLogHistory($limit = 100, $order = 'desc')
8383
*/
8484
public function preSave()
8585
{
86-
if (!isset($this->logEnabled) || $this->logEnabled) {
86+
if (!isset($this->auditEnabled) || $this->auditEnabled) {
8787

8888
// Pega dados originais anteriores
8989
$this->originalData = $this->original;
@@ -133,7 +133,7 @@ public function postSave()
133133
$LogCleanup = false;
134134
}
135135

136-
if (((!isset($this->logEnabled) || $this->logEnabled) && $this->updating) && (!$LimitReached || $LogCleanup))
136+
if (((!isset($this->auditEnabled) || $this->auditEnabled) && $this->updating) && (!$LimitReached || $LogCleanup))
137137
{
138138
$changes_to_record = $this->changedAuditingFields();
139139
if(count($changes_to_record))
@@ -237,25 +237,4 @@ public function identifiableName()
237237
return $this->getKey();
238238
}
239239

240-
/**
241-
* Disabled log field
242-
*
243-
* @param $field
244-
*/
245-
public function disableLogField($field)
246-
{
247-
if (!isset($this->dontKeepRevisionOf)) {
248-
$this->dontKeepRevisionOf = array();
249-
}
250-
if (is_array($field)) {
251-
foreach ($field as $one_field) {
252-
$this->disableRevisionField($one_field);
253-
}
254-
} else {
255-
$donts = $this->dontKeepRevisionOf;
256-
$donts[] = $field;
257-
$this->dontKeepRevisionOf = $donts;
258-
unset($donts);
259-
}
260-
}
261240
}

0 commit comments

Comments
 (0)