Browse Source

[UPDATE] introduce __set_state methods

experimental
Georgi Hristov 2 years ago
parent
commit
b2d637c55e
1 changed files with 33 additions and 0 deletions
  1. +33
    -0
      modules/Utils/RecordBrowser/Crits.php

+ 33
- 0
modules/Utils/RecordBrowser/Crits.php View File

@@ -146,6 +146,17 @@ class Utils_RecordBrowser_CritsSingle extends Utils_RecordBrowser_CritsInterface
$this->negation = $negation;
$this->raw_sql_value = $raw_sql_value;
}
public static function __set_state($array)
{
$crits = new static();
foreach ($array as $key => $value) {
$crits->{$key} = $value;
}
return $crits;
}

public static function parse_subfield($field)
{
@@ -299,6 +310,17 @@ class Utils_RecordBrowser_CritsRawSQL extends Utils_RecordBrowser_CritsInterface
}
$this->vals = $values;
}
public static function __set_state($array)
{
$crits = new static();
foreach ($array as $key => $value) {
$crits->{$key} = $value;
}
return $crits;
}

/**
* @return mixed
@@ -397,6 +419,17 @@ class Utils_RecordBrowser_Crits extends Utils_RecordBrowser_CritsInterface
}
}
}
public static function __set_state($array)
{
$crits = new static();
foreach ($array as $key => $value) {
$crits->{$key} = $value;
}
return $crits;
}

public function normalize()
{


Loading…
Cancel
Save