当前位置: 首页>>代码示例>>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;未经允许,请勿转载。