Hello,
As SelectManagers is depreciate, who can help me to adapt to v7x ?
certainly https://docs.espocrm.com/development...a/select-defs/. but no sample :S
Patient entity have many2many Users with a custom column "role".
i use "assignedsUsers" because i need out-of-box assignedUser.
As SelectManagers is depreciate, who can help me to adapt to v7x ?
certainly https://docs.espocrm.com/development...a/select-defs/. but no sample :S
Patient entity have many2many Users with a custom column "role".
i use "assignedsUsers" because i need out-of-box assignedUser.
PHP Code:
<?php
namespace Espo\Custom\SelectManagers;
class Patient extends \Espo\Core\SelectManagers\Base
{
protected function boolFilterOnlyUsers(&$result)
{
$wherePart = null;
if ($this->getSeed()->hasRelation('assignedsUsers')) {
$this->setDistinct(true, $result);
$this->addLeftJoin(['assignedsUsers', 'assignedsUsersOnlyMyFilter'], $result);
$wherePart = [
'assignedsUsersOnlyMyFilter.id' => $this->getUser()->id
];
}
return $wherePart;
}
}
Comment