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

Condition over table (without its column/PK) is not working #574

Open
hrach opened this issue Apr 20, 2022 · 0 comments
Open

Condition over table (without its column/PK) is not working #574

hrach opened this issue Apr 20, 2022 · 0 comments
Labels

Comments

@hrach
Copy link
Member

hrach commented Apr 20, 2022

To Reproduce

/**
 * @property-read string         $id        {primary}
 * @property AlarmDeparture|null $departure {1:1 AlarmDeparture::$alarm}
 */
final class Alarm extends Entity
{

}

/**
 * @property-read string $id    {primary}
 * @property-read Alarm  $alarm {1:1 Alarm::$departure, isMain=true}
 */
final class AlarmDeparture extends Entity
{

}

$alarmRepository->findBy([
	'departure!=' => null,
])->fetchAll();

Produces

Nextras\Dbal\Drivers\Exception\QueryException: ERROR:  column alarms . departure does not exist
LINE 1: ...'alarms' .* FROM 'app' . 'alarms' as 'alarms' WHERE('alarms' . "...

Expected behavior
It works.

Workaround

$alarmRepository->findBy([
	'departure->id!=' => null,
])->fetchAll();
@hrach hrach added the bug label Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant