Permalink
Browse files

Collection index is rebuild after calling removeByDocId()

  • Loading branch information...
kalkin committed Jan 27, 2011
1 parent a3575d9 commit ecb005a8dfe23aea5d8209760376e27de1a67150
Showing with 5 additions and 1 deletion.
  1. +5 −1 JForg/Dodb/Collection.php
@@ -87,8 +87,12 @@ public function removeAll()
public function removeByDocId($id)
{
foreach( $this->_data as $key => $record )
- if ( $record->document->fetchDocumentId() === $id )
+ {
+ if ( $record->document->fetchDocumentId() === $id ){
unset($this->_data[$key]);
+ }
+ }
+ $this->_data = array_values($this->_data);
return $this;
}

0 comments on commit ecb005a

Please sign in to comment.