Skip to content

Condition over table (without ->id) is not working #574

@hrach

Description

@hrach

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();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions