Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist return value #17

Closed
jmeinlschmidt opened this issue Mar 21, 2017 · 3 comments
Closed

Persist return value #17

jmeinlschmidt opened this issue Mar 21, 2017 · 3 comments

Comments

@jmeinlschmidt
Copy link

After a successfull persisting only TRUE is returned. Wouldn't it be better to return ID or affected row instead?

@uestla
Copy link
Owner

uestla commented Mar 21, 2017

The entity itself is "polluted" during persistence.

$entity = new MyEntity;
$entity->getID(); // NULL
$repository->persist($entity);
$entity->getID(); // 123

I think boolean is OK here. I certainly wouldn't like to have some scalar ID(s) as a return value.

@jmeinlschmidt
Copy link
Author

I'm sorry. Haven't noticed this option from your source code. My fault.

@uestla
Copy link
Owner

uestla commented Mar 30, 2017

Please close this issue if everything's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants