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


PHP xPDOObject::getOne方法代码示例

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


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

示例1:

 /**
  * Returns related modElement instances based on the element_class column.
  *
  * {@inheritdoc}
  */
 public function &getOne($alias, $criteria = null, $cacheFlag = true)
 {
     if ($alias == 'Element') {
         $criteria = $this->xpdo->newQuery($this->get('element_class'), $criteria);
     }
     $object = parent::getOne($alias, $criteria, $cacheFlag);
     return $object;
 }
开发者ID:JoeBlow,项目名称:revolution,代码行数:13,代码来源:modelementpropertyset.class.php

示例2: prepareRow

 function prepareRow(xPDOObject $object)
 {
     /** @var byAd $ad */
     $ad = $object->getOne('Ad');
     $row = array_merge($ad->toArray(), $object->toArray());
     $row['image'] = $ad->getImageUrl();
     return $row;
 }
开发者ID:suasti,项目名称:BannerY,代码行数:8,代码来源:getlist.class.php

示例3: sendNotice

 /** @inheritdoc} */
 public function sendNotice(xPDOObject $instance, $status = 0)
 {
     $this->modx->log(1, print_r('sendNotice sendNotice', 1));
     if (!$status) {
         $status = $instance->getOne('Status');
     } else {
         $status = $this->modx->getObject('MlmSystemStatus', $status);
     }
     if (!$status or !$this->MlmSystem->getOption('mail_notice', null, false)) {
         return false;
     }
     /* get context */
     if (!($context = $instance->get('context'))) {
         $context = !$this->modx->context->key || $this->modx->context->key == 'mgr' ? 'web' : $this->modx->context->key;
     }
     /* get users */
     $user = array();
     switch (true) {
         case $instance instanceof MlmSystemClient:
             $user[] = $instance->get('id');
             break;
         default:
             break;
     }
     $pls = array('listUser' => '', 'listEmail' => '', 'subjectEmail' => '', 'bodyEmail' => '', 'queueEmail' => false, 'getUser' => false, 'formatField' => true, 'fastMode' => true, 'context' => $context, 'addPls' => array());
     if ($status->get('email_user')) {
         if ($chunk = $this->modx->getObject('modChunk', $status->get('tpl_user'))) {
             $plsWork = $pls;
             $plsWork['listUser'] = implode(',', $user);
             if ($properties = $chunk->getProperties()) {
                 foreach ($properties as $k => $v) {
                     if (!isset($plsWork[$k])) {
                         $plsWork[$k] = $v;
                     } elseif (is_string($plsWork[$k]) and !empty($plsWork[$k])) {
                         $plsWork[$k] .= ',' . $v;
                     } elseif (is_string($plsWork[$k]) and empty($plsWork[$k])) {
                         $plsWork[$k] = $v;
                     } elseif (is_array($plsWork[$k])) {
                         $plsWork[$k] = array_merge($this->modx->fromJSON($v), $plsWork[$k]);
                     } elseif (is_bool($plsWork[$k])) {
                         $plsWork[$k] = $v;
                     }
                 }
             }
             $plsWork['addPls'] = array_merge($plsWork['addPls'], $this->processObject($instance, (int) $plsWork['formatField']));
             $this->runProcessor('mgr/email/send', $plsWork);
         }
     }
     if ($status->get('email_manager')) {
         if ($chunk = $this->modx->getObject('modChunk', $status->get('tpl_manager'))) {
             $plsWork = $pls;
             $plsWork['listEmail'] = $this->MlmSystem->getOption('email_manager', null, $this->modx->getOption('emailsender'));
             if ($properties = $chunk->getProperties()) {
                 foreach ($properties as $k => $v) {
                     if (!isset($plsWork[$k])) {
                         $plsWork[$k] = $v;
                     } elseif (is_string($plsWork[$k]) and !empty($plsWork[$k])) {
                         $plsWork[$k] .= ',' . $v;
                     } elseif (is_string($plsWork[$k]) and empty($plsWork[$k])) {
                         $plsWork[$k] = $v;
                     } elseif (is_array($plsWork[$k])) {
                         $plsWork[$k] = array_merge($this->modx->fromJSON($v), $plsWork[$k]);
                     } elseif (is_bool($plsWork[$k])) {
                         $plsWork[$k] = $v;
                     }
                 }
             }
             $plsWork['addPls'] = array_merge($plsWork['addPls'], $this->processObject($instance, (int) $plsWork['formatField']));
             $this->runProcessor('mgr/email/send', $plsWork);
         }
     }
     return true;
 }
开发者ID:vgrish,项目名称:mlmsystem,代码行数:74,代码来源:systemtools.class.php


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