|
@@ -25,6 +25,12 @@ class Model
|
|
|
*/
|
|
|
protected $aCalc = [];
|
|
|
|
|
|
+ /**
|
|
|
+ * Зависимости свойств
|
|
|
+ * @var array
|
|
|
+ */
|
|
|
+ protected $dependProp = [];
|
|
|
+
|
|
|
/**
|
|
|
* Конструктор
|
|
|
*
|
|
@@ -58,6 +64,10 @@ class Model
|
|
|
{
|
|
|
unset($this->a[$name]); //????
|
|
|
unset($this->aCalc[$name]); //????
|
|
|
+
|
|
|
+ if (isset($this->dependProp[$name])) {
|
|
|
+ $this->aCalc = \array_diff_key($this->aCalc, \array_flip($this->dependProp[$name]));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -70,6 +80,10 @@ class Model
|
|
|
{
|
|
|
unset($this->aCalc[$name]);
|
|
|
|
|
|
+ if (isset($this->dependProp[$name])) {
|
|
|
+ $this->aCalc = \array_diff_key($this->aCalc, \array_flip($this->dependProp[$name]));
|
|
|
+ }
|
|
|
+
|
|
|
if (\method_exists($this, $method = 'set' . $name)) {
|
|
|
$this->$method($val);
|
|
|
} else {
|