entityManager = $entityManager; $this->user = $user; $this->acl = $acl; $this->aclManager = $aclManager; $this->metadata = $metadata; $this->config = $config; } public function create($entityType) { $normalizedName = Util::normilizeClassName($entityType); $className = '\\Espo\\Custom\\SelectManagers\\' . $normalizedName; if (!class_exists($className)) { $moduleName = $this->metadata->getScopeModuleName($entityType); if ($moduleName) { $className = '\\Espo\\Modules\\' . $moduleName . '\\SelectManagers\\' . $normalizedName; } else { $className = '\\Espo\\SelectManagers\\' . $normalizedName; } if (!class_exists($className)) { $className = '\\Espo\\Core\\SelectManagers\\Base'; } } $selectManager = new $className($this->entityManager, $this->user, $this->acl, $this->aclManager, $this->metadata, $this->config); $selectManager->setEntityType($entityType); return $selectManager; } }