-
Notifications
You must be signed in to change notification settings - Fork 284
Migrate to query builder mappers #1036
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
Conversation
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
|
…ry-builder-mapper
lib/Db/CollectedAddressMapper.php
Outdated
->from($this->getTableName()) | ||
->where( | ||
$qb->expr()->eq('user_id', $qb->createNamedParameter($userId)), | ||
$qb->expr()->orX( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below you do andWhere
on the sexond expression. Might make sense to do it consitently one way. (I prefer the andWhere since it makes it explicit it is an AND
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear I mean
->where(
<1>,
<2>);
vs
->where(<1>)
->andWhere(<2>);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes. Fixed.
lib/Db/CollectedAddressMapper.php
Outdated
->select('*') | ||
->from($this->getTableName()) | ||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))) | ||
->andWhere($qb->expr()->eq('email', $qb->createNamedParameter($email))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original expersssion does an ILIKE.. this is pure equal. intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not intentional, but rather a copy-paste error :P
lib/Db/LocalAttachmentMapper.php
Outdated
$query = $qb | ||
->select('*') | ||
->from($this->getTableName()) | ||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The oroginal statement has id = ?
this one not. Intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, my fault.
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and questions. |
Fixes #960.
Required for #959.
This migration is mandatory as the old mappers are deprecated now.