當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBObject::mutator方法代碼示例

本文整理匯總了PHP中DBObject::mutator方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBObject::mutator方法的具體用法?PHP DBObject::mutator怎麽用?PHP DBObject::mutator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBObject的用法示例。


在下文中一共展示了DBObject::mutator方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: mutate

 /**
  * Attempts the mutation.
  * 
  * If the mutation completes abnormally, previous mutators are aborted.
  * 
  * Otherwise returns the results of the mutation.
  * 
  */
 final function mutate($class, $name, $arguments)
 {
     $this->mutation_pointer[] = $name;
     $result = DBObject::mutator($class, $name, $arguments)->activate();
     if ($result) {
         $mutation = new stdclass();
         $mutation->result = $result;
         $mutation->class = $class;
         $mutation->name = $name;
         $mutation->arguments = $arguments;
         $this->mutated($mutation);
         return $result;
     } else {
         $this->abort();
     }
 }
開發者ID:htmlgraphic,項目名稱:HTMLgraphic-MVC,代碼行數:24,代碼來源:MutatorModule.class.inc.php

示例2: applyMutator

 public final function applyMutator($name, $parameters = array(), $toString = "__toString")
 {
     $results = array();
     while ($managed_object = $this->nextObject()) {
         $value = DBObject::mutator($this->managed_object(), $name, array_merge(array($managed_object), (array) $parameters))->activate();
         $key = call_user_func(array($managed_object, $toString));
         $results[$key] = $value;
         unset($managed_object);
     }
     return $results;
 }
開發者ID:htmlgraphic,項目名稱:HTMLgraphic-MVC,代碼行數:11,代碼來源:DBObjectIterator.class.inc.php

示例3: send

 function send($html_mode = false)
 {
     if (Config::isLive() || Config::isStaging()) {
         $mail = $this->getEmailer();
         if ($this->send_as_html) {
             //many mail servers break 8bit encoding by adding newlines, QP prevents that for ASCII-only emails (like this)
             $mail->Encoding = "quoted-printable";
             $mail->isHTML(true);
         }
         $mail->Subject = $this->getSubjectWithReplacements();
         $mail->Body = $this->getBodyWithReplacements();
         if (!$mail->Send()) {
             error_log("ERROR: mail not sent: {$mail->ErrorInfo}");
             return false;
         } else {
             if ($this->recordMember) {
                 Loader::load('model', 'com/htmlgraphic/history/Transaction');
                 DBObject::mutator('Transaction', 'RecordContactEmailSentAction', array($this, $this->recordMember))->activate();
             }
         }
         return true;
     } else {
         //this is so you can see if you would have sent an email on a dev box
         if ($this->recordMember) {
             Loader::load('model', 'com/htmlgraphic/history/Transaction');
             DBObject::mutator('Transaction', 'RecordContactEmailSentAction', array($this, $this->recordMember))->activate();
         }
         //error_log(print_r($this->recordMember,true));
         Debugger::log("<span style='color: #fff;'>Subject:</span> " . $this->getSubjectWithReplacements() . "<br><br><span style='color: #fff;'>-----Body-----</span><br>" . $this->getBodyWithReplacements() . "<br><span style='color: #fff;'>-----Body-----</span>");
         return true;
     }
 }
開發者ID:htmlgraphic,項目名稱:HTMLgraphic-MVC,代碼行數:32,代碼來源:Email.class.inc.php


注:本文中的DBObject::mutator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。