1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-21 13:11:52 +02:00

Issue #1946 - added getMeta() setMeta() and removeMeta() methods.

This commit is contained in:
Cameron 2016-10-24 14:22:53 -07:00
parent 57637fcc9c
commit 2161b397aa

View File

@ -3804,6 +3804,46 @@ class eResponse
$this->_body[$ns] = $body;
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
@ -4060,6 +4100,18 @@ class eResponse
return '';
}
/**
* Return an array of all meta data
* @return array
*/
function getMeta()
{
return $this->_meta;
}
/**
* @param string $title
* @return eResponse