Open hrach opened 2 years ago
Current status:
It is not working on the non-main side. The main side works due to the implementation detail that the property is mapped to the actual column (alarm_id) and then the comparison works.
Since we do not do any optimization when alarm->id
would be optimized to alarm_id
comparison without a join, I am not super sure that what the future is here - if we want to support the shortcut as it is; expand its behavior to auto-optimize and/or support it on the non-main side.
Also, the Orm IntelliJ plugin auto-adds ->
after picking "departure".
I am marking it as a feature request.
testcase:
public function testFilterAutomaticallyById(): void
{
$ean = new Ean();
$ean->code = '1234';
$ean->book = $this->orm->books->getByIdChecked(1);
$this->orm->eans->persistAndFlush($ean);
$eanId = $ean->id;
$this->orm->clear();
$ean = $this->orm->books->findBy(['ean' => $eanId])->fetch();
Assert::notNull($ean);
$book = $this->orm->eans->findBy(['book' => 1])->fetch(); // failure
Assert::notNull($book);
}
To Reproduce
Produces
Expected behavior It works.
Workaround