mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Issue #1946 - added getMeta() setMeta() and removeMeta() methods.
This commit is contained in:
@@ -3805,6 +3805,46 @@ class eResponse
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @param $content
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setMeta($name, $content)
|
||||||
|
{
|
||||||
|
foreach($this->_meta as $k=>$v)
|
||||||
|
{
|
||||||
|
if($v['name'] === $name)
|
||||||
|
{
|
||||||
|
$this->_meta[$k]['content'] = $content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $name
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function removeMeta($name)
|
||||||
|
{
|
||||||
|
foreach($this->_meta as $k=>$v)
|
||||||
|
{
|
||||||
|
if($v['name'] === $name)
|
||||||
|
{
|
||||||
|
unset($this->_meta[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepend content
|
* Prepend content
|
||||||
* @param str $body
|
* @param str $body
|
||||||
@@ -4060,6 +4100,18 @@ class eResponse
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an array of all meta data
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getMeta()
|
||||||
|
{
|
||||||
|
return $this->_meta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $title
|
* @param string $title
|
||||||
* @return eResponse
|
* @return eResponse
|
||||||
|
Reference in New Issue
Block a user