當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBObjectSet::FromLinkSet方法代碼示例

本文整理匯總了PHP中DBObjectSet::FromLinkSet方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBObjectSet::FromLinkSet方法的具體用法?PHP DBObjectSet::FromLinkSet怎麽用?PHP DBObjectSet::FromLinkSet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBObjectSet的用法示例。


在下文中一共展示了DBObjectSet::FromLinkSet方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ComputeImpactedItems

 public function ComputeImpactedItems()
 {
     $oToNotify = $this->Get('contacts_list');
     $oToImpact = $this->Get('functionalcis_list');
     $oImpactedInfras = DBObjectSet::FromLinkSet($this, 'functionalcis_list', 'functionalci_id');
     $aComputed = $oImpactedInfras->GetRelatedObjects('impacts', 10);
     if (isset($aComputed['FunctionalCI']) && is_array($aComputed['FunctionalCI'])) {
         foreach ($aComputed['FunctionalCI'] as $iKey => $oObject) {
             $oNewLink = new lnkFunctionalCIToTicket();
             $oNewLink->Set('functionalci_id', $iKey);
             $oNewLink->Set('impact', 'potentially impacted (automatically computed)');
             $oToImpact->AddObject($oNewLink);
         }
     }
     if (isset($aComputed['Contact']) && is_array($aComputed['Contact'])) {
         foreach ($aComputed['Contact'] as $iKey => $oObject) {
             $oNewLink = new lnkContactToTicket();
             $oNewLink->Set('contact_id', $iKey);
             $oNewLink->Set('role', 'contact automatically computed');
             $oToNotify->AddObject($oNewLink);
         }
     }
     parent::OnInsert();
 }
開發者ID:kira8565,項目名稱:ITOP203-ZHCN,代碼行數:24,代碼來源:model.itop-request-mgmt-itil.php

示例2: OnInsert

 protected function OnInsert()
 {
     $oToNotify = $this->Get('contacts_list');
     $oToImpact = $this->Get('functionalcis_list');
     $oImpactedInfras = DBObjectSet::FromLinkSet($this, 'functionalcis_list', 'functionalci_id');
     $aComputed = $oImpactedInfras->GetRelatedObjects('impacts', 10);
     if (isset($aComputed['FunctionalCI']) && is_array($aComputed['FunctionalCI'])) {
         foreach ($aComputed['FunctionalCI'] as $iKey => $oObject) {
             $oNewLink = new lnkFunctionalCIToTicket();
             $oNewLink->Set('functionalci_id', $iKey);
             $oToImpact->AddObject($oNewLink);
         }
     }
     if (isset($aComputed['Contact']) && is_array($aComputed['Contact'])) {
         foreach ($aComputed['Contact'] as $iKey => $oObject) {
             $oNewLink = new lnkContactToTicket();
             $oNewLink->Set('contact_id', $iKey);
             $oNewLink->Set('role', 'contact automatically computed');
             $oToNotify->AddObject($oNewLink);
         }
     }
     $this->Set('creation_date', time());
     $this->Set('last_update', time());
 }
開發者ID:kira8565,項目名稱:ITOP203-ZHCN,代碼行數:24,代碼來源:model.itop-change-mgmt-itil.php

示例3: LoadValues

 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;
 }
開發者ID:leandroborgeseng,項目名稱:bhtm,代碼行數:28,代碼來源:valuesetdef.class.inc.php


注:本文中的DBObjectSet::FromLinkSet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。