1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 04:12:00 +02:00

e_vars moved to model class for now (prevent autoload issues in thumb and cli mod)

This commit is contained in:
secretr
2010-12-11 15:55:24 +00:00
parent a0e0ee73dc
commit b540365c69
3 changed files with 86 additions and 82 deletions

View File

@@ -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
*