From c66728e47852cbf34cdb1a7ee6b845289edeff37 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 27 Apr 2017 14:02:02 +0000 Subject: [PATCH] Cleanup: unused code SVN:trunk[4710] --- core/valuesetdef.class.inc.php | 74 ---------------------------------- 1 file changed, 74 deletions(-) diff --git a/core/valuesetdef.class.inc.php b/core/valuesetdef.class.inc.php index 294a2832b..97ce58cac 100644 --- a/core/valuesetdef.class.inc.php +++ b/core/valuesetdef.class.inc.php @@ -228,80 +228,6 @@ class ValueSetObjects extends ValueSetDefinition } -/** - * Set of existing values for a link set attribute, given a relation code - * - * @package iTopORM - */ -class ValueSetRelatedObjectsFromLinkSet extends ValueSetDefinition -{ - protected $m_sLinkSetAttCode; - protected $m_sExtKeyToRemote; - protected $m_sRelationCode; - protected $m_iMaxDepth; - protected $m_sTargetClass; - protected $m_sTargetExtKey; -// protected $m_aOrderBy; - - public function __construct($sLinkSetAttCode, $sExtKeyToRemote, $sRelationCode, $iMaxDepth, $sTargetClass, $sTargetLinkClass, $sTargetExtKey) - { - $this->m_sLinkSetAttCode = $sLinkSetAttCode; - $this->m_sExtKeyToRemote = $sExtKeyToRemote; - $this->m_sRelationCode = $sRelationCode; - $this->m_iMaxDepth = $iMaxDepth; - $this->m_sTargetClass = $sTargetClass; - $this->m_sTargetLinkClass = $sTargetLinkClass; - $this->m_sTargetExtKey = $sTargetExtKey; -// $this->m_aOrderBy = $aOrderBy; - } - - protected function LoadValues($aArgs) - { - $this->m_aValues = array(); - - if (!array_key_exists('this', $aArgs)) - { - throw new CoreException("Missing 'this' in arguments", array('args' => $aArgs)); - } - - $oTarget = $aArgs['this->object()']; - - // Nodes from which we will start the search for neighbourhood - $oNodes = DBObjectSet::FromLinkSet($oTarget, $this->m_sLinkSetAttCode, $this->m_sExtKeyToRemote); - - // Neighbours, whatever their class - $aRelated = $oNodes->GetRelatedObjects($this->m_sRelationCode, $this->m_iMaxDepth); - - $sRootClass = MetaModel::GetRootClass($this->m_sTargetClass); - if (array_key_exists($sRootClass, $aRelated)) - { - $aLinksToCreate = array(); - foreach($aRelated[$sRootClass] as $iKey => $oObject) - { - if (MetaModel::IsParentClass($this->m_sTargetClass, get_class($oObject))) - { - $oNewLink = MetaModel::NewObject($this->m_sTargetLinkClass); - $oNewLink->Set($this->m_sTargetExtKey, $iKey); - //$oNewLink->Set('role', 'concerned by an impacted CI'); - - $aLinksToCreate[] = $oNewLink; - } - } - // #@# or AddObjectArray($aObjects) ? - $oSetToCreate = DBObjectSet::FromArray($this->m_sTargetLinkClass, $aLinksToCreate); - $this->m_aValues[$oObject->GetKey()] = $oObject->GetName(); - } - - return true; - } - - public function GetValuesDescription() - { - return 'Filter: '.$this->m_sFilterExpr; - } -} - - /** * Fixed set values (could be hardcoded in the business model) *