当前位置: 首页>>代码示例>>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;未经允许,请勿转载。