58 if ( isset( $this->_aArray[$offset] ) ) {
75 return $this->_aArray[$offset];
91 if ( isset( $offset ) ) {
92 $this->_aArray[$offset] = & $oBase;
95 if ( isset( $oBase->$sLongFieldName->value ) ) {
96 $sOxid = $oBase->$sLongFieldName->value;
97 $this->_aArray[$sOxid] = & $oBase;
99 $this->_aArray[] = & $oBase;
114 if (strcmp($offset, $this->
key()) === 0) {
116 $this->_blRemovedActive =
true;
119 unset( $this->_aArray[$offset] );
129 return array_keys( $this->_aArray );
139 $this->_blRemovedActive =
false;
140 $this->_blValid = (
false !== reset( $this->_aArray ) );
150 return current( $this->_aArray );
160 return key( $this->_aArray );
170 $oVar =
prev($this->_aArray);
171 if ($oVar ===
false) {
173 $oVar = reset($this->_aArray);
175 $this->_blRemovedActive =
false;
186 if ($this->_blRemovedActive ===
true &&
current($this->_aArray)) {
187 $oVar = $this->
prev();
189 $oVar =
next($this->_aArray);
192 $this->_blValid = (
false !== $oVar );
212 return count( $this->_aArray );
227 $this->_aArray = array();
239 $this->_aArray = $aArray;
249 return array_reverse( $this->_aArray );
290 $this->_aSqlLimit[0] = 0;
291 $this->_aSqlLimit[1] = 0;
292 $this->_sShopID =
$myConfig->getShopId();
294 if ( $sObjectName ) {
295 $this->
init( $sObjectName );
308 if ( $sName ==
'aList') {
331 public function init($sObjectName, $sCoreTable = null)
333 $this->_sObjectsInListName = $sObjectName;
335 $this->_sCoreTable = $sCoreTable;
346 if ( !$this->_oBaseObject ) {
347 $this->_oBaseObject =
oxNew( $this->_sObjectsInListName );
348 $this->_oBaseObject->setInList();
349 $this->_oBaseObject->init( $this->_sCoreTable );
367 if ( $this->_aSqlLimit[0] || $this->_aSqlLimit[1]) {
368 $rs = $oDb->selectLimit( $sSql, $this->_aSqlLimit[1], $this->_aSqlLimit[0] );
370 $rs = $oDb->select( $sSql );
373 if ($rs !=
false && $rs->recordCount() > 0) {
379 $oListObject = clone $oSaved;
383 if ($oListObject->getId()) {
384 $this->_aArray[$oListObject->getId()] = $oListObject;
386 $this->_aArray[] = $oListObject;
405 if (
count( $aData ) ) {
409 foreach ($aData as $aItem) {
410 $oListObject = clone $oSaved;
412 if ( $oListObject->getId() ) {
413 $this->_aArray[ $oListObject->getId() ] = $oListObject;
415 $this->_aArray[] = $oListObject;
432 $this->_aSqlLimit[0] = $iStart;
433 $this->_aSqlLimit[1] = $iRecords;
447 foreach ($this->_aArray as $obj) {
448 if ($obj->{$sFieldName}->value == $oVal) {
461 public function getList()
463 $oListObject =$this->getBaseObject();
464 $sFieldList = $oListObject->getSelectFields();
465 $sQ =
"select $sFieldList from " . $oListObject->getViewName();
466 if ( $sActiveSnippet = $oListObject->getSqlActiveSnippet() ) {
467 $sQ .=
" where $sActiveSnippet ";
469 $this->selectString($sQ);
483 protected function _assignElement($oListObject, $aDbFields)
485 $oListObject->assign($aDbFields);
495 protected function _getFieldLongName($sFieldName)
497 if ($this->_sCoreTable) {
498 return $this->_sCoreTable .
'__' . $sFieldName;