本文整理汇总了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);
}
示例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!");
}
}
}
示例3: preValidate
/**
* Custom AIR2 validation before update/save
*
* @param Doctrine_Event $event
*/
public function preValidate($event)
{
parent::preValidate($event);
}
示例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!");
}
}
}
示例5: preValidate
/**
* Lowercase any email address
*
* @param Doctrine_Event $event
*/
public function preValidate($event)
{
$this->sem_email = strtolower($this->sem_email);
parent::preValidate($event);
}
示例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;
}
}
}
示例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);
}
}
}
示例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!');
}
}
示例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);
}