當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。