Hi,
As next release will have : Multiple assigned users enabled with parameter in entity manager #3158
There are something i don't understand and it's just for understand.
What happend if we use assignedUser and assignedUsers
If i look this file (maybe wrong file) .. i see the "return" in the if statement "$this->fieldHelper->hasAssignedUsersField()", so never go in the if statement of assignedUser
Maybe is preferable to remove the "return" ?
What do you think ? i am wrong or ?
Best Regards
application/Espo/Core/Select/Bool/Filters/OnlyMy.php
As next release will have : Multiple assigned users enabled with parameter in entity manager #3158
There are something i don't understand and it's just for understand.
What happend if we use assignedUser and assignedUsers
If i look this file (maybe wrong file) .. i see the "return" in the if statement "$this->fieldHelper->hasAssignedUsersField()", so never go in the if statement of assignedUser
Maybe is preferable to remove the "return" ?
What do you think ? i am wrong or ?
Best Regards
application/Espo/Core/Select/Bool/Filters/OnlyMy.php
PHP Code:
if ($this->fieldHelper->hasAssignedUsersField()) {
$relationDefs = $this->defs
->getEntity($this->entityType)
->getRelation('assignedUsers');
$middleEntityType = ucfirst($relationDefs->getRelationshipName());
$key1 = $relationDefs->getMidKey();
$key2 = $relationDefs->getForeignMidKey();
$subQuery = QueryBuilder::create()
->select('id')
->from($this->entityType)
->leftJoin($middleEntityType, 'assignedUsersMiddle', [
"assignedUsersMiddle.$key1:" => 'id',
'assignedUsersMiddle.deleted' => false,
])
->where(["assignedUsersMiddle.$key2" => $this->user->getId()])
->build();
$orGroupBuilder->add(
Cond::in(
Cond::column('id'),
$subQuery
)
);
return; // <-- maybe remove "return" ?
}
if ($this->fieldHelper->hasAssignedUserField()) {
$orGroupBuilder->add(
Cond::equal(
Cond::column('assignedUserId'),
$this->user->getId()
)
);
return;
}
Comment