[FLOW3-general] Beginners question: Objects are not persisted / saved in DB
Susanne Moog
typo3 at susanne-moog.de
Mon Feb 1 10:33:58 CET 2010
Hey again,
I just figured out what my problem is. First it was the missing @entity
annotation in my model, second it was my try to iterate over my entity
not thinking that there might be more in that object than just my model
properties.
So problem solved :)
Best regards,
Susanne
Susanne Moog wrote:
> 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