mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Optimization: do not load the full set of items when it comes to displaying an autocomplete!
SVN:trunk[1275]
This commit is contained in:
@@ -2339,6 +2339,7 @@ class AttributeExternalKey extends AttributeDBFieldVoid
|
||||
|
||||
public function GetAllowedValues($aArgs = array(), $sContains = '')
|
||||
{
|
||||
//throw new Exception("GetAllowedValues on ext key has been deprecated");
|
||||
try
|
||||
{
|
||||
return parent::GetAllowedValues($aArgs, $sContains);
|
||||
@@ -2351,6 +2352,13 @@ class AttributeExternalKey extends AttributeDBFieldVoid
|
||||
}
|
||||
}
|
||||
|
||||
public function GetAllowedValuesAsObjectSet($aArgs = array(), $sContains = '')
|
||||
{
|
||||
$oValSetDef = $this->GetValuesDef();
|
||||
$oSet = $oValSetDef->ToObjectSet($aArgs, $sContains);
|
||||
return $oSet;
|
||||
}
|
||||
|
||||
public function GetDeletionPropagationOption()
|
||||
{
|
||||
return $this->Get("on_target_delete");
|
||||
|
||||
@@ -353,7 +353,10 @@ class DBObjectSet
|
||||
|
||||
public function Rewind()
|
||||
{
|
||||
$this->Seek(0);
|
||||
if ($this->m_bLoaded)
|
||||
{
|
||||
$this->Seek(0);
|
||||
}
|
||||
}
|
||||
|
||||
public function Seek($iRow)
|
||||
|
||||
@@ -1024,6 +1024,11 @@ abstract class MetaModel
|
||||
return $oFltDef->GetAllowedValues($aArgs, $sContains);
|
||||
}
|
||||
|
||||
public static function GetAllowedValuesAsObjectSet($sClass, $sAttCode, $aArgs = array(), $sContains = '')
|
||||
{
|
||||
$oAttDef = self::GetAttributeDef($sClass, $sAttCode);
|
||||
return $oAttDef->GetAllowedValuesAsObjectSet($aArgs, $sContains);
|
||||
}
|
||||
//
|
||||
// Businezz model declaration verbs (should be static)
|
||||
//
|
||||
|
||||
@@ -101,6 +101,22 @@ class ValueSetObjects extends ValueSetDefinition
|
||||
$this->m_bAllowAllData = $bAllowAllData;
|
||||
}
|
||||
|
||||
|
||||
public function ToObjectSet($aArgs = array(), $sContains = '')
|
||||
{
|
||||
if ($this->m_bAllowAllData)
|
||||
{
|
||||
$oFilter = DBObjectSearch::FromOQL_AllData($this->m_sFilterExpr);
|
||||
}
|
||||
else
|
||||
{
|
||||
$oFilter = DBObjectSearch::FromOQL($this->m_sFilterExpr);
|
||||
}
|
||||
|
||||
return new DBObjectSet($oFilter, $this->m_aOrderBy, $aArgs);
|
||||
}
|
||||
|
||||
|
||||
protected function LoadValues($aArgs)
|
||||
{
|
||||
$this->m_aValues = array();
|
||||
|
||||
Reference in New Issue
Block a user