[FLOW3-general] Beginners question: Objects are not persisted / saved in DB
Susanne Moog
typo3 at susanne-moog.de
Sat Jan 30 13:58:46 CET 2010
Hey everyone,
I'm just starting with FLOW3 today and am currently trying to get a very
small own example to work. I used the blog package as guideline.
My package is called "Accounts" and I have a corresponding Account
model. Now I have first tried to get some data into the db with the
initalSetup like in the blog example:
public function initialSetupAction() {
$this->accountRepository->removeAll();
$account =
$this->objectFactory->create('F3\Accounts\Domain\Model\Account');
$account->setAccountidentifier('http://www.google.de/');
$account->setName('Google');
$account->setUsername('user');
$account->setPassword('pwd');
$this->accountRepository->add($account);
$this->redirect('index', 'Account');
}
If I var_dump($account) it shows up correctly with the wanted
properties, however if I call $this->accountRepository->findAll() after
adding the account to the repository it is always empty.
In a second step I tried using a form for creating new Accounts, that
works like the above example. I can submit data and upon checking the
create action the correct data arrives there but sadly it never enters
the database.
Am I doing something obvious wrong?
Thanks for any help,
Susanne
More information about the FLOW3-general
mailing list