-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
new feature requestPlanned Feature or New Feature RequestPlanned Feature or New Feature Request
Description
When you do Model::query() I would like a way to set an alias, this works fine when you're using it like in the docs but if you include something like a ->leftJoin() you'll start to run into issues
Phalcon\Mvc\Model\Exception
The column 'account_id' is ambiguous
and because there doesn't seem to be a way to create an alias you need to do something like this
Model::query()
->columns($columns)
->where(sprintf('%s.account_id = :id:', Model::class), ['id' => $user->account_id])
It would be nice if there was a ->alias() option or an additional param in ::query(alias: 'model') to be able to rename this instead of needing to do the full class name.
Relevant file
https://github.com/phalcon/cphalcon/blob/master/phalcon/Mvc/Model/Criteria.zep
Metadata
Metadata
Assignees
Labels
new feature requestPlanned Feature or New Feature RequestPlanned Feature or New Feature Request