/    Sign up×
Community /Pin to ProfileBookmark

[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.

[code=php]$rowIterator = $feuille->getRowIterator();

$listePersonnes = new Doctrine_Collection(‘PERSONNES’);

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

if (1 == $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();[/code]

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

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 14.2012 — 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).
Copy linkTweet thisAlerts:
@mortagusauthorAug 14.2012 — i posted my problem here in hopping that somebody has already got that kind of problem
Copy linkTweet thisAlerts:
@NogDogAug 14.2012 — i posted my problem here in hopping that somebody has already got that kind of problem[/QUOTE]

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. ? )
Copy linkTweet thisAlerts:
@Jeff_MottAug 14.2012 — 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.
×

Success!

Help @mortagus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...