1
0
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:
Cameron
2016-10-24 14:22:53 -07:00
parent 57637fcc9c
commit 2161b397aa

View File

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