[TYPO3-mvc] Extbase 1.3.0: CLI Importer setPid() not working properly
Cornelius Illi
cornelius.illi at hintertuer.net
Thu Mar 17 04:02:57 CET 2011
Hi guys,
I am currently migrating an extension to Extbase/Fluid.
In order to migrate the existing data to a new data-model I have written a
CLI-Importer, that needs to set the existing PID.
Within a CLI-Script the Persistance-Manager needs to be called manually:
$person->setLastname('X');
$person->setFirstname('Y');
$this->person_repo->add($person);
$this->persistanceManager->persistAll();
$person->setPid(499);
$this->person_repo->update($person);
var_dump($person->getPid());
$this->persistanceManager->persistAll();
var_dump($person->getPid());
$test = $this->person_repo->findOneByLastname('Illi');
var_dump($test->getPid());
Output is:
int(499)
int(499)
int(499)
But Database says:
+-----+-----+----------+-----------+
| uid | pid | lastname | firstname |
+-----+-----+----------+-----------+
| 1 | 0 | X | Y |
+-----+-----+----------+-----------+
1 row in set (0.00 sec)
Any ideas, what is going wrong there. I checked the Backend.php and actually
it should set the PID within the update and the second persistAll()-call.
Being able to set the PID is quite important, as new data is going to be
imported by a scheduler-task and PID needs to be set dynamically, depending
on the values set.
Thanks for your help!
Regards,
Cornelius
More information about the TYPO3-project-typo3v4mvc
mailing list