mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Adjustment in Wire class and bump version to 3.0.68
This commit is contained in:
@@ -45,7 +45,7 @@ class ProcessWire extends Wire {
|
|||||||
* Reversion revision number
|
* Reversion revision number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const versionRevision = 67;
|
const versionRevision = 68;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Version suffix string (when applicable)
|
* Version suffix string (when applicable)
|
||||||
|
@@ -1128,15 +1128,28 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable {
|
|||||||
*
|
*
|
||||||
* #pw-group-changes
|
* #pw-group-changes
|
||||||
*
|
*
|
||||||
* @param bool $getValues Specify true to return an associative array containing an array of previous values, indexed by
|
* @param bool $getValues Specify one of the following, or omit for default setting.
|
||||||
|
* - `false` (bool): return array of changed property names (default setting).
|
||||||
|
* - `true` (bool): return an associative array containing an array of previous values, indexed by
|
||||||
* property name, oldest to newest. Requires Wire::trackChangesValues mode to be enabled.
|
* property name, oldest to newest. Requires Wire::trackChangesValues mode to be enabled.
|
||||||
|
* - `2` (int): Return array where both keys and values are changed property names.
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getChanges($getValues = false) {
|
public function getChanges($getValues = false) {
|
||||||
if($getValues) return $this->changes;
|
if($getValues === 2) {
|
||||||
|
$changes = array();
|
||||||
|
foreach($this->changes as $name => $value) {
|
||||||
|
if($value) {} // value ignored
|
||||||
|
$changes[$name] = $name;
|
||||||
|
}
|
||||||
|
return $changes;
|
||||||
|
} else if($getValues) {
|
||||||
|
return $this->changes;
|
||||||
|
} else {
|
||||||
return array_keys($this->changes);
|
return array_keys($this->changes);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************************************
|
/*******************************************************************************************************
|
||||||
|
Reference in New Issue
Block a user