Merged
Conversation
Revert "rename Model::join to addJoin" This reverts commit b403c55.
0727329 to
1fbf369
Compare
1fbf369 to
a483230
Compare
This reverts commit c789e7e.
8244971 to
6136102
Compare
mvorisek
commented
Nov 10, 2021
| // handle foreign table containing a dot - that will be reverse join | ||
| if (strpos($this->foreign_table, '.') !== false) { | ||
| // split by LAST dot in foreign_table name | ||
| [$this->foreign_table, $this->foreign_field] = preg_split('~\.+(?=[^.]+$)~', $this->foreign_table); |
Member
Author
There was a problem hiding this comment.
FYI foreign_table table is used as an index when added to a Model, must be set prior init
DarkSide666
approved these changes
Nov 10, 2021
| if (strpos($this->foreign_table, '.') !== false) { | ||
| // split by LAST dot in foreign_table name | ||
| [$this->foreign_table, $this->foreign_field] = preg_split('~\.+(?=[^.]+$)~', $this->foreign_table); | ||
| $this->reverse = true; |
Member
There was a problem hiding this comment.
Can we still overwrite $reverse property while initializing join?
| return $this->add(Join::fromSeed($this->_default_seed_join, $defaults)); | ||
| $join = Join::fromSeed($this->_default_seed_join, $defaults); | ||
|
|
||
| if ($this->hasElement($name = $join->getDesiredName())) { |
Member
There was a problem hiding this comment.
Can we join same table multiple times?
Member
Author
There was a problem hiding this comment.
only one Join can be added which can be retrived by getJoin, same as for fields and references (even if the setup methods are named hasOne/hasMany)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.