123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- /**
- *
- * Cube Framework $Id$ QALpM3u7lqOMsgICJPtyCKg4/tcBXUah4q0viZK6e3Y=
- *
- * @link http://codecu.be/framework
- * @copyright Copyright (c) 2014 CodeCube SRL
- * @license http://codecu.be/framework/license Commercial License
- *
- * @version 1.3
- */
- /**
- * abstract feed class
- */
- namespace Cube\Feed;
- class Entry
- {
- /**
- *
- * elements array
- *
- * @var array
- */
- protected $_elements = array();
- /**
- *
- * set elements
- *
- * @param array $elements
- *
- * @return $this
- */
- public function setElements($elements)
- {
- foreach ((array)$elements as $key => $value) {
- $this->addElement($key, $value);
- }
- return $this;
- }
- /**
- *
- * add single element to elements array
- *
- * @param string $key
- * @param string $value
- *
- * @return $this
- */
- public function addElement($key, $value)
- {
- $this->_elements[$key] = $this->_formatString($value);
- return $this;
- }
- /**
- *
- * get elements array
- *
- * @return array
- */
- public function getElements()
- {
- return $this->_elements;
- }
- /**
- *
- * clear elements array
- *
- * @return $this
- */
- public function clearElements()
- {
- $this->_elements = array();
- return $this;
- }
- /**
- *
- * format string
- *
- * @param string $string
- *
- * @return string
- */
- protected function _formatString($string)
- {
- return strip_tags(
- str_ireplace(
- array('&'), array('&'), $string));
- }
- }
|