42 $this->_sSeparator = $sSeparator;
63 public function set( $sTags, $blPrepare = true )
66 $this->
add( $sTags, $blPrepare );
97 public function add( $sTags, $blPrepare =
true )
100 foreach ( $aTags as $sTag ) {
101 $this->
addTag( $sTag, $blPrepare );
113 public function addTag( $mTag, $blPrepare =
true )
115 $oTag = $this->
_formTag( $mTag, $blPrepare );
116 $sTagName = $oTag->get();
117 if ( !$oTag->isValid() ) {
118 if ( $sTagName !==
"" ) {
119 $this->_aInvalidTags[$sTagName] = $oTag;
123 if ( $this->_aTags[$sTagName] === null ) {
124 $this->_aTags[$sTagName] = $oTag;
126 $this->_aTags[$sTagName]->increaseHitCount();
138 $this->_aTags = array();
149 foreach ($this->
get() as $oTag) {
150 $aTags = array_merge($aTags, array_fill(0, $oTag->getHitCount(), $oTag->get() ) );
173 public function slice( $offset, $length )
175 $this->_aTags = array_slice( $this->
get(), $offset, $length,
true );
187 uksort( $this->_aTags, array($oStr,
'strrcmp') );
197 uasort( $this->_aTags, array($this,
'_tagHitsCmp') );
207 return current( $this->_aTags );
217 next( $this->_aTags );
227 return key( $this->_aTags );
237 return isset( $this->_aTags[ $this->
key() ] );
247 reset( $this->_aTags );
258 protected function _formTag( $mTag, $blPrepare =
true )
260 if ( $mTag instanceof
oxTag ) {
263 $oTag =
oxNew(
"oxTag" );
264 $oTag->set( $mTag, $blPrepare );
279 return $oTag2->getHitCount() - $oTag1->getHitCount();