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


PHP Tinebase_Record_Abstract::isValid方法代码示例

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


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

示例1: _importRecord

 /**
  * import single record
  *
  * @param Tinebase_Record_Abstract $_record
  * @param string $_resolveStrategy
  * @param array $_recordData not needed here but in other import classes (i.a. Admin_Import_Csv)
  * @return Tinebase_Record_Abstract the imported record
  * @throws Tinebase_Exception_Record_Validation
  */
 protected function _importRecord($_record, $_resolveStrategy = NULL, $_recordData = array())
 {
     $_record->isValid(TRUE);
     if ($this->_options['dryrun']) {
         Tinebase_TransactionManager::getInstance()->startTransaction(Tinebase_Core::getDb());
     }
     $this->_handleTags($_record, $_resolveStrategy);
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) {
         Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . ' Record to import: ' . print_r($_record->toArray(), true));
     }
     $importedRecord = $this->_importAndResolveConflict($_record, $_resolveStrategy);
     $this->_importResult['results']->addRecord($importedRecord);
     if ($this->_options['dryrun']) {
         Tinebase_TransactionManager::getInstance()->rollBack();
     } else {
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Successfully imported record with id ' . $importedRecord->getId());
         }
     }
     $this->_importResult['totalcount']++;
     return $importedRecord;
 }
开发者ID:hernot,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:31,代码来源:Abstract.php

示例2: isValid

 /**
  * validate and filter the the internal data
  *
  * @param $_throwExceptionOnInvalidData
  * @return bool
  * @throws Tinebase_Exception_Record_Validation
  */
 public function isValid($_throwExceptionOnInvalidData = false)
 {
     $isValid = parent::isValid($_throwExceptionOnInvalidData);
     if (isset($this->_properties['count']) && isset($this->_properties['until'])) {
         $isValid = $this->_isValidated = false;
         if ($_throwExceptionOnInvalidData) {
             $e = new Tinebase_Exception_Record_Validation('count and until can not be set both');
             Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . $e);
             throw $e;
         }
     }
     return $isValid;
 }
开发者ID:ingoratsdorf,项目名称:Tine-2.0-Open-Source-Groupware-and-CRM,代码行数:20,代码来源:Rrule.php

示例3: isValid

 /**
  * additional validation
  *
  * @param $_throwExceptionOnInvalidData
  * @return bool
  * @throws Tinebase_Exception_Record_Validation
  * @see Tinebase_Record_Abstract::isValid()
  */
 function isValid($_throwExceptionOnInvalidData = false)
 {
     if (!$this->__get('org_name') && !$this->__get('n_family')) {
         array_push($this->_validationErrors, array('id' => 'org_name', 'msg' => 'either "org_name" or "n_family" must be given!'));
         array_push($this->_validationErrors, array('id' => 'n_family', 'msg' => 'either "org_name" or "n_family" must be given!'));
         $valid = false;
     } else {
         $valid = true;
     }
     $parentException = false;
     $parentValid = false;
     try {
         $parentValid = parent::isValid($_throwExceptionOnInvalidData);
     } catch (Tinebase_Exception_Record_Validation $e) {
         $parentException = $e;
     }
     if ($_throwExceptionOnInvalidData && (!$valid || !$parentValid)) {
         if (!$valid) {
             $message = 'either "org_name" or "n_family" must be given!';
         }
         if ($parentException) {
             $message .= ', ' . $parentException->getMessage();
         }
         $e = new Tinebase_Exception_Record_Validation($message);
         if (!$valid) {
             Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ":\n" . print_r($this->_validationErrors, true) . $e);
         }
         throw $e;
     }
     return $parentValid && $valid;
 }
开发者ID:rodrigofns,项目名称:ExpressoLivre3,代码行数:39,代码来源:Contact.php


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