Skip to content

Commit 5ab30b5

Browse files
committed
Add clear() method
1 parent c06a700 commit 5ab30b5

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

classes/ETL/VariableStore.php

+13-2
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,22 @@ public function __construct($store = null, Log $logger = null)
6868
}
6969
} // __construct()
7070

71+
/**
72+
* Clear the variables in the store
73+
*/
74+
75+
public function clear()
76+
{
77+
$this->variables = array();
78+
}
79+
7180
/**
7281
* Set a variable in the store. If a variable should be overwritten use overwrite() instead.
7382
* Setting a variable to a NULL value will unset the variable. If the variable is already set,
74-
* do not overwrite and issue a warning. We issue a warning because it may be the case that the
75-
* developer is expecting a value to be updated and want to alter them that it is not.
83+
* do not overwrite and issue a warning. This is done so that variables set early in a process
84+
* (such as ETL) are not blindly changed causing unexpected results. We issue a warning because
85+
* it may be the case that the developer is expecting a value to be updated and want to alert
86+
* them that it is not.
7687
*
7788
* @param string $var The name of the variable to set
7889
* @param scalar $value The value of the variable

0 commit comments

Comments
 (0)