当前位置: 首页>>代码示例>>PHP>>正文


PHP Opportunity::load_relationship方法代码示例

本文整理汇总了PHP中Opportunity::load_relationship方法的典型用法代码示例。如果您正苦于以下问题:PHP Opportunity::load_relationship方法的具体用法?PHP Opportunity::load_relationship怎么用?PHP Opportunity::load_relationship使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Opportunity的用法示例。


在下文中一共展示了Opportunity::load_relationship方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processListViews

 /**
  * Add and Remove fields from all the list views
  *
  * @param array $fieldMap How are we going to change the fields
  * @return array The Modules which had their subpanels affected
  */
 public function processListViews(array $fieldMap)
 {
     // get the views for the module
     $mm = MetadataManager::getManager();
     $views = $mm->getModuleViews('Opportunities');
     // fix the selected-list view
     $this->processSelectedListView($fieldMap);
     // fix the dupecheck-list view
     $this->processDupeCheckListView($fieldMap);
     // get the generic list view
     $this->processListView($fieldMap);
     // get the mobile list view now
     $this->processMobileListView($fieldMap);
     $subpanel_modules = array('Opportunities');
     $links = $this->bean->get_linked_fields();
     foreach ($links as $link => $def) {
         if ($this->bean->load_relationship($link) && $this->bean->{$link} instanceof Link2) {
             $linkname = $this->bean->{$link}->getRelatedModuleLinkName();
             if (!empty($linkname)) {
                 $this->processListView($fieldMap, $this->bean->{$link}->getRelatedModuleName(), $linkname);
                 $subpanel_modules[] = $this->bean->{$link}->getRelatedModuleName();
             }
         }
     }
     return $subpanel_modules;
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:32,代码来源:OpportunityViews.php

示例2: setUp

 public function setUp()
 {
     SugarTestHelper::setUp('beanFiles');
     SugarTestHelper::setUp('beanList');
     SugarTestHelper::setUp('current_user');
     $this->account = SugarTestAccountUtilities::createAccount();
     $this->contact = SugarTestContactUtilities::createContact();
     $this->email = SugarTestEmailUtilities::createEmail();
     $this->opportunity = SugarTestOpportunityUtilities::createOpportunity('', $this->account);
     $this->contact->account_id = $this->account->id;
     $this->contact->save();
     $this->opportunity->load_relationship('contacts');
     $this->opportunity->contacts->add($this->contact);
     $this->email->parent_id = $this->contact->id;
     $this->email->parent_type = $this->contact->module_name;
     $this->email->save();
     if (isset($GLOBALS['app'])) {
         $this->application = $GLOBALS['app'];
     }
     $GLOBALS['app'] = new SugarApplication();
     $GLOBALS['app']->controller = new SugarController();
 }
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:22,代码来源:Bug58863Test.php

示例3: linkQuoteContactsToOpportunity

 /**
  * Take any Billing and Shipping Contacts and link the to the Opportunity
  *
  * @param Quote $quote
  * @param Opportunity $opp
  */
 protected function linkQuoteContactsToOpportunity(Quote $quote, Opportunity $opp)
 {
     // @codeCoverageIgnoreStart
     global $app_list_strings;
     // @codeCoverageIgnoreEnd
     //opportunity_relationship_type_dom
     $quote->load_relationship('shipping_contacts');
     $quote->load_relationship('billing_contacts');
     $ids = array_merge($quote->shipping_contacts->get(), $quote->billing_contacts->get());
     $ids = array_unique($ids);
     $default_role = isset($app_list_strings['opportunity_relationship_type_dom']['Other']) ? 'Other' : '';
     if (!empty($ids)) {
         $opp->load_relationship('contacts');
         foreach ($ids as $id) {
             $opp->contacts->add($id, array('contact_role' => $default_role));
         }
     }
 }
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:24,代码来源:QuoteConvertApi.php

示例4: Opportunity

    if (empty($contact->last_name)) {
        $contact->last_name = $contact_last_name;
    }
    if (empty($contact->mobile)) {
        $contact->mobile = $contact_mobile;
    }
    if (empty($contact->assigned_user_id)) {
        $contact->assigned_user_id = 1;
    }
    $contact->save();
} else {
    $contact->first_name = $contact_first_name;
    $contact->last_name = $contact_last_name;
    $contact->email1 = $contact_email;
    $contact->mobile = $contact_mobile;
    $contact->assigned_user_id = 1;
    $contact->save();
    $contact->load_relationship('accounts');
    $contact->accounts->add($account->id);
}
// Create the Opportunity
$opportunity = new Opportunity();
$opportunity->name = $opportunity_name;
$opportunity->amount = $opportunity_amount;
$opportunity->date_closed = $timeDate->getNow(true)->asDbDate();
$opportunity->sales_stage = "Closed Won";
$opportunity->account_id = $account->id;
$opportunity->assigned_user_id = 1;
$opportunity->save();
$opportunity->load_relationship('contacts');
$opportunity->contacts->add($contact->id);
开发者ID:julieth756,项目名称:SugarCRMEntryPoints,代码行数:31,代码来源:WebToOpportunity.php


注:本文中的Opportunity::load_relationship方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。