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


PHP Doctrine_Record::delete方法代码示例

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


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

示例1: limitParentDates

 /**
  * Shift the eff/exp dates of this table so that it fits within its parent(s) (parent_eff <= child_eff < child_exp <= parent_exp)
  * @param $record Doctrine_Record
  * @return null
  */
 protected function limitParentDates(Doctrine_Record $child)
 {
     // loop through temporal relationships and make sure this date range is inside the parent's range
     foreach ($this->_options['parents'] as &$parent) {
         try {
             $parent_obj = $child->{$parent};
             // TODO causes $parent->_oldValues to be erased
             $child->setDatesWithinParent($parent_obj);
         } catch (Doctrine_Record_SavingNonsenseException $e) {
             $child->delete();
         }
     }
 }
开发者ID:JoshuaEstes,项目名称:sfDoctrineExtraPlugin,代码行数:18,代码来源:Temporal.php

示例2: processDelete

 private function processDelete(Doctrine_Record $obj, sfWebRequest $request, $type = null)
 {
     $request->checkCSRFProtection();
     $this->setFlashMessageByType($obj->delete(), $type);
     $this->redirect('@opCalendarPlugin');
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:6,代码来源:actions.class.php

示例3: delete

 public function delete()
 {
     $identifier = $this->identifier();
     $identifier = implode(', ', $identifier);
     // If column aggregation is used on this model we will have $class_type defined. Ensure it's set model is loaded
     if (isset($this['class_type'])) {
         kohana::log('debug', 'Initialized model ' . $this['class_type'] . ' for delete operation.');
         Doctrine::initializeModels($this->class_type);
     }
     if (!self::getBaseTransactionObject()) {
         self::setBaseSaveObject($this);
     }
     try {
         // Before we run the parrent we need to unlink our number
         // this is because the parent will lock the record and if we
         // are proxied then we will not be able to get the necessary fields
         // populated (ya that was a bitch to figure out)
         if (get_parent_class($this) == 'Bluebox_Record') {
             $class_type = get_class($this) . 'Number';
             //transform to class name
         } else {
             $class_type = get_parent_class($this) . 'Number';
             //transform to original parent's class name
         }
         $numbers = Doctrine_Query::create()->from('Number n')->where('class_type = ?', $class_type)->andWhere('foreign_id = ?', $identifier)->execute();
         foreach ($numbers as $number) {
             kohana::log('debug', 'Scheduling detach of number ' . $number['number_id'] . ' from ' . get_class($this) . ' ' . $identifier);
             $number->class_type = NULL;
             $number->foreign_id = 0;
         }
         parent::delete();
         // Ok now if we got this far go ahead an unlink the number, we didnt
         // unlink above because we where not sure if we are in a transaction
         // and if we are not we want to delete to succeed before we unlink :)
         if (!empty($numbers)) {
             foreach ($numbers as $number) {
                 kohana::log('debug', 'Detaching number ' . $number['number_id']);
                 $number->save();
             }
         }
         // Done with any events that may use this
         if (self::getBaseTransactionObject() == $this) {
             self::setBaseSaveObject(NULL);
         }
         $identifier = $this->identifier();
         $identifier = implode(', ', $identifier);
         Kohana::log('debug', 'Deleted record ' . get_class($this) . ' ' . $identifier);
         return TRUE;
     } catch (Doctrine_Validator_Exception $e) {
         Kohana::log('error', 'Doctrine_Validator_Exception: ' . $e->getMessage());
         self::normalizeErrors($e);
         return FALSE;
     } catch (Doctrine_Transaction_Exception $e) {
         Kohana::log('error', 'Doctrine_Transaction_Exception: ' . $e->getMessage());
         self::setBaseSaveObject(NULL);
         throw new Doctrine_Transaction_Exception($e->getMessage());
         return FALSE;
     } catch (Doctrine_Connection_Exception $e) {
         Kohana::log('error', 'Doctrine_Connection_Exception (' . get_class($this) . '): ' . $e->getMessage());
         self::setBaseSaveObject(NULL);
         throw new Doctrine_Connection_Exception($e->getMessage());
         return FALSE;
     } catch (Exception $e) {
         Kohana::log('error', 'Unhandled ' . get_class($e) . ': ' . $e->getMessage());
         self::setBaseSaveObject(NULL);
         throw new Exception($e->getMessage());
         return FALSE;
     }
 }
开发者ID:swk,项目名称:bluebox,代码行数:69,代码来源:Bluebox_Record.php

示例4: delete

 public function delete(Doctrine_Connection $conn = null)
 {
     $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true);
     sfContext::createInstance($configuration)->getLogger()->err('{I18NTester} delete() called!');
     parent::delete($conn);
 }
开发者ID:pierswarmers,项目名称:rtCorePlugin,代码行数:6,代码来源:rtSearchTemplateTest.php


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