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


PHP AIR2_Record::preValidate方法代码示例

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


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

示例1: preValidate

 /**
  * Converts dotted quad to long integer for tb_ip.
  *
  * @param unknown $event
  * @return parent preValidate
  */
 public function preValidate($event)
 {
     if (!is_numeric($this->tb_ip)) {
         $this->tb_ip = ip2long($this->tb_ip);
     }
     if (!$this->tb_dtim) {
         $this->tb_dtim = air2_date();
     }
     return parent::preValidate($event);
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:16,代码来源:Trackback.php

示例2: preValidate

 /**
  * Custom AIR2 validation before update/save
  *
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     parent::preValidate($event);
     // make sure we got a valid ref type
     if ($this->pa_ref_type && $this->pa_xid) {
         $rt = $this->pa_ref_type;
         if (!in_array($rt, array(self::$REF_TYPE_ORG, self::$REF_TYPE_INQ))) {
             throw new Exception("Invalid pa_ref_type specified!");
         }
     }
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:16,代码来源:ProjectActivity.php

示例3: preValidate

 /**
  * Custom AIR2 validation before update/save
  *
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     parent::preValidate($event);
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:9,代码来源:InquiryActivity.php

示例4: preValidate

 /**
  * Custom AIR2 validation before update/save
  *
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     parent::preValidate($event);
     // make sure we got a valid ref type
     $types = array(self::$REF_TYPE_RESPONSE, self::$REF_TYPE_INQUIRY, self::$REF_TYPE_TANK, self::$REF_TYPE_ORG, self::$REF_TYPE_MAIL, self::$REF_TYPE_EMAIL);
     if ($this->sact_ref_type && $this->sact_xid) {
         if (!in_array($this->sact_ref_type, $types)) {
             throw new Exception("Invalid sact_ref_type specified!");
         }
     }
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:16,代码来源:SrcActivity.php

示例5: preValidate

 /**
  * Lowercase any email address
  *
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     $this->sem_email = strtolower($this->sem_email);
     parent::preValidate($event);
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:10,代码来源:SrcEmail.php

示例6: preValidate

 /**
  * Setup new ProjectSavedSearch.
  *
  * NOTE: this is temporary, until we can explicitly set Projects in the
  * SavedSearch UI.
  *
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     parent::preValidate($event);
     // only create if there are no projects
     if (!$this->exists() && $this->Projects->count() == 0) {
         $u = Doctrine::getTable('User')->find($this->ssearch_cre_user);
         $prj_id = $u ? $u->find_default_prj_id() : null;
         if ($prj_id) {
             $pss = new ProjectSavedSearch();
             $pss->pss_prj_id = $prj_id;
             $this->Projects[] = $pss;
         }
     }
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:22,代码来源:SavedSearch.php

示例7: preValidate

 /**
  * Only one of certain types (e.g. email) allowed.
  *
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     parent::preValidate($event);
     // check if this type is unique and we already have one
     if (!$this->osid_id && in_array($this->osid_type, self::$UNIQUE_TYPES)) {
         $q = AIR2_Query::create()->from('OrgSysId os');
         $q->addWhere('osid_type = ?', $this->osid_type);
         $q->addWhere('osid_org_id = ?', $this->osid_org_id);
         if ($this->exists()) {
             $q->addWhere('osid_id != ?', $this->osid_id);
         }
         if ($q->count() > 0) {
             throw new Exception("May only have one OrgSysId of type " . $this->osid_type);
         }
     }
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:21,代码来源:OrgSysId.php

示例8: preValidate

 /**
  * Make sure we have a file
  *
  * @param unknown $event
  */
 public function preValidate($event)
 {
     parent::preValidate($event);
     if (!$this->img_file_name) {
         throw new Exception('Image cannot be null!');
     }
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:12,代码来源:Image.php

示例9: preValidate

 /**
  * Strip out non-numeric characters
  * 
  * @param Doctrine_Event $event
  */
 public function preValidate($event)
 {
     $this['sph_number'] = preg_replace('/\\D/', '', $this['sph_number']);
     #Carper::carp($this['sph_number']);
     parent::preValidate($event);
 }
开发者ID:kaakshay,项目名称:audience-insight-repository,代码行数:11,代码来源:SrcPhoneNumber.php


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