mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
e_vars moved to model class for now (prevent autoload issues in thumb and cli mod)
This commit is contained in:
@@ -176,7 +176,7 @@ class e107
|
|||||||
'e_user_extended_structure_tree' => '{e_HANDLER}user_model.php',
|
'e_user_extended_structure_tree' => '{e_HANDLER}user_model.php',
|
||||||
'e_userperms' => '{e_HANDLER}user_handler.php',
|
'e_userperms' => '{e_HANDLER}user_handler.php',
|
||||||
'e_validator' => '{e_HANDLER}validator_class.php',
|
'e_validator' => '{e_HANDLER}validator_class.php',
|
||||||
'e_vars' => '{e_HANDLER}e_parse_class.php',
|
'e_vars' => '{e_HANDLER}model_class.php',
|
||||||
'ecache' => '{e_HANDLER}cache_handler.php',
|
'ecache' => '{e_HANDLER}cache_handler.php',
|
||||||
'news' => '{e_HANDLER}news_class.php',
|
'news' => '{e_HANDLER}news_class.php',
|
||||||
'notify' => '{e_HANDLER}notify_class.php',
|
'notify' => '{e_HANDLER}notify_class.php',
|
||||||
|
@@ -2160,84 +2160,3 @@ class e_parse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Data model for e_parse::simpleParse()
|
|
||||||
* NEW - not inherits core e_object
|
|
||||||
*/
|
|
||||||
class e_vars extends e_object
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Get data array
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getVars()
|
|
||||||
{
|
|
||||||
return $this->getData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set array data
|
|
||||||
*
|
|
||||||
* @param array $array
|
|
||||||
* @return e_vars
|
|
||||||
*/
|
|
||||||
public function setVars(array $array)
|
|
||||||
{
|
|
||||||
$this->setData($array);
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add array data to the object (merge with existing)
|
|
||||||
*
|
|
||||||
* @param array $array
|
|
||||||
* @return e_vars
|
|
||||||
*/
|
|
||||||
public function addVars(array $array)
|
|
||||||
{
|
|
||||||
$this->addData($array);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset object data
|
|
||||||
*
|
|
||||||
* @return e_vars
|
|
||||||
*/
|
|
||||||
public function emptyVars()
|
|
||||||
{
|
|
||||||
$this->removeData();
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if there is data available
|
|
||||||
*
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function isEmpty()
|
|
||||||
{
|
|
||||||
return $this->hasData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if given data key is set
|
|
||||||
* @param string $key
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function isVar($key)
|
|
||||||
{
|
|
||||||
return $this->is($key);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* No need of object conversion, optional cloning
|
|
||||||
* @param boolean $clone return current object clone
|
|
||||||
* @return e_vars
|
|
||||||
*/
|
|
||||||
public function toSc($clone = false)
|
|
||||||
{
|
|
||||||
if($clone) return clone $this;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -409,6 +409,91 @@ class e_object
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data object for e_parse::simpleParse()
|
||||||
|
* NEW - not inherits core e_object
|
||||||
|
* Moved from e_parse_class.php
|
||||||
|
* Could go in separate file in the future, together with e_object class
|
||||||
|
*/
|
||||||
|
class e_vars extends e_object
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get data array
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getVars()
|
||||||
|
{
|
||||||
|
return $this->getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set array data
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @return e_vars
|
||||||
|
*/
|
||||||
|
public function setVars(array $array)
|
||||||
|
{
|
||||||
|
$this->setData($array);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add array data to the object (merge with existing)
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @return e_vars
|
||||||
|
*/
|
||||||
|
public function addVars(array $array)
|
||||||
|
{
|
||||||
|
$this->addData($array);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset object data
|
||||||
|
*
|
||||||
|
* @return e_vars
|
||||||
|
*/
|
||||||
|
public function emptyVars()
|
||||||
|
{
|
||||||
|
$this->removeData();
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if there is data available
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isEmpty()
|
||||||
|
{
|
||||||
|
return $this->hasData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if given data key is set
|
||||||
|
* @param string $key
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isVar($key)
|
||||||
|
{
|
||||||
|
return $this->is($key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* No need of object conversion, optional cloning
|
||||||
|
* @param boolean $clone return current object clone
|
||||||
|
* @return e_vars
|
||||||
|
*/
|
||||||
|
public function toSc($clone = false)
|
||||||
|
{
|
||||||
|
if($clone) return clone $this;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base e107 Model class
|
* Base e107 Model class
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user