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


PHP AIR2_Record::postInsert方法代码示例

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


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

示例1: postInsert

 /**
  * Post-insert hook to log an activity for "manual-entry" submissions.
  * (Can't use regular AIR2Logger, since we need the postInsert xid).
  *
  * @param DoctrineEvent $event
  */
 public function postInsert($event)
 {
     parent::postInsert($event);
     // only manual-entries, and only if requestion
     if ($this->srs_type != self::$TYPE_MANUAL_ENTRY) {
         return;
     }
     if (!self::$LOG_MANUAL_ENTRY) {
         return;
     }
     // figure out what type of entry this is
     $actm_id = false;
     foreach (Inquiry::$MANUAL_TYPES as $code => $config) {
         if ($this->SrcResponse[0]->sr_orig_value == $config['label']) {
             $actm_id = $config['actm'];
             break;
         }
     }
     // find project id
     $prj_id = false;
     if (count($this->Inquiry->ProjectInquiry) > 0) {
         $prj_id = $this->Inquiry->ProjectInquiry[0]->pinq_prj_id;
     }
     // only log if the type matched something
     if ($actm_id && $prj_id) {
         $sact = new SrcActivity();
         $sact->sact_src_id = $this->srs_src_id;
         $sact->sact_actm_id = $actm_id;
         $sact->sact_prj_id = $prj_id;
         $sact->sact_dtim = $this->srs_date;
         $sact->sact_desc = '{USER} entered {XID} for source {SRC}';
         $sact->sact_notes = null;
         $sact->sact_xid = $this->srs_id;
         $sact->sact_ref_type = SrcActivity::$REF_TYPE_RESPONSE;
         $sact->save();
     }
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:43,代码来源:SrcResponseSet.php

示例2: postInsert

 /**
  * Make sure new Organizations get default projects
  *
  * @param Doctrine_Event $event
  */
 public function postInsert($event)
 {
     if (self::$CREATE_DEFAULT_PRJ && $this->org_default_prj_id == 1 && $this->org_type != 'T') {
         $p = new Project();
         $p->prj_name = air2_urlify($this->org_name);
         $p->prj_display_name = 'Project ' . $this->org_display_name;
         $p->prj_desc = 'Default project for organization "' . $this->org_display_name . '"';
         $p->ProjectOrg[0]->porg_org_id = $this->org_id;
         $p->ProjectOrg[0]->porg_contact_user_id = $this->org_cre_user;
         // make sure prj_name is unique
         $count = 0;
         $orig = $p->prj_name;
         $tbl = Doctrine::getTable('Project');
         $name = $tbl->findOneBy('prj_name', $p->prj_name);
         while ($name) {
             $p->prj_name = $orig . '_' . $count;
             $name = $tbl->findOneBy('prj_name', $p->prj_name);
         }
         // save, and make default
         $p->save();
         $this->org_default_prj_id = $p->prj_id;
         $this->save();
     }
     parent::postInsert($event);
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:30,代码来源:Organization.php


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