IsFriendlyName()) { return self::SEARCH_WIDGET_TYPE_RAW; } try { $oRemoteAtt = $this->GetFinalAttDef(); switch (true) { case ($oRemoteAtt instanceof AttributeString): return self::SEARCH_WIDGET_TYPE_EXTERNAL_FIELD; case ($oRemoteAtt instanceof AttributeExternalKey): return self::SEARCH_WIDGET_TYPE_EXTERNAL_KEY; } } catch (CoreException $e) { } return self::SEARCH_WIDGET_TYPE_RAW; } public function IsSearchable() { if ($this->IsFriendlyName()) { return true; } return parent::IsSearchable(); } public static function ListExpectedParams() { return array_merge(parent::ListExpectedParams(), ["extkey_attcode", "target_attcode"]); } public function GetEditClass() { return "ExtField"; } /** * @return AttributeDefinition * @throws CoreException */ public function GetFinalAttDef() { $oExtAttDef = $this->GetExtAttDef(); return $oExtAttDef->GetFinalAttDef(); } protected function GetSQLCol($bFullSpec = false) { // throw new CoreException("external attribute: does it make any sense to request its type ?"); $oExtAttDef = $this->GetExtAttDef(); return $oExtAttDef->GetSQLCol($bFullSpec); } public function GetSQLExpressions($sPrefix = '') { if ($sPrefix == '') { return ['' => $this->GetCode()]; // Warning: Use GetCode() since AttributeExternalField does not have any 'sql' property } else { return $sPrefix; } } /** * @param string $sDefault * * @return string dict entry if defined, otherwise : *