www.webdeveloper.com
Results 1 to 5 of 5

Thread: [Doctrine_Collection] infinite loop with function save

Hybrid View

  1. #1
    Join Date
    Aug 2012
    Posts
    2

    [Doctrine_Collection] infinite loop with function save

    Hello everyone,

    I'm developing a small extractor from a excel file to file up a mysql db.

    I'm using phpexcel to read the excel file and using doctrine in stand alone to manipulate de db.

    My problem is that when i want to save the data in the db, the call of the save function never ends.

    PHP Code:
    $rowIterator $feuille->getRowIterator();

            
    $listePersonnes = new Doctrine_Collection('PERSONNES');

            foreach (
    $rowIterator as $row) {
                
    $rowIndex $row->getRowIndex();

                if (
    == $rowIndex) { continue; }
                
    $cellIterator $row->getCellIterator();
                
    $cellIterator->setIterateOnlyExistingCells(false);

                
    $listePersonnes[$rowIndex] = new PERSONNES();

                foreach (
    $cellIterator as $cell) {
                    
    $value trim($cell->getValue());
                    
    $column $cell->getColumn();
                    switch (
    $column) {
                            
    //specific process for each column
                    
    }
                }
                echo 
    "<hr/>";
            }
            
            
    //this is the line which never ends
            
    $listePersonnes->save(); 
    I tried a of different ways in order to fixed it but the only thing which goes wrong is the last line, and i don't know why.
    Does somebody can help me ?
    If you need my model, just tell me

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,392
    Without knowing what the Doctrine_Collection::save() method does, it will be difficult for us to debug it (unless someone here happens to also have experience with that class).
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    i posted my problem here in hopping that somebody has already got that kind of problem

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,392
    Quote Originally Posted by mortagus View Post
    i posted my problem here in hopping that somebody has already got that kind of problem
    You never know: you may get lucky.

    (I suspect you'll get luckier, though, if you can find a forum or support page specific to that product -- but it never hurts to ask here. )
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    The best I can say is that the code snippet you posted seems to look just like the documentation example, so the real error may be elsewhere in your code.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles