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


PHP SplSubject::getGatewayServiceVerify方法代码示例

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


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

示例1: update

 public function update(\SplSubject $subject)
 {
     $this->allow_models[] = 'Account';
     $this->allow_models[] = 'Order';
     $this->allow_models[] = 'OrderDetail';
     $this->allow_models[] = 'Lead';
     $this->allow_models[] = 'Patient';
     $this->allow_models[] = 'User';
     $Recipient_id = $subject->getParam('recipient', 0);
     if ($Recipient_id) {
         $dataModel = $subject->getGatewayServiceVerify()->get('Email')->findOne(['model_id' => $Recipient_id]);
         if ($dataModel) {
             $this->allow_models[] = ucfirst($dataModel->data);
         }
     }
     if (!is_array($this->allow_models)) {
         return;
     }
     foreach ($this->allow_models as $model) {
         $visibleFields['pattern_items'][$model] = $subject->getAclServiceVerify()->getVisibleFields($model);
     }
     /* Copy current recipient data to array 'Contacts' */
     if (isset($dataModel)) {
         $visibleFields['pattern_items']['Contacts'] = $visibleFields['pattern_items'][ucfirst($dataModel->data)];
     }
     $subject->setData($visibleFields);
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:27,代码来源:ConstructPatternMenuObserver.php

示例2: update

 /**
  * @param \SplSubject|View $subject
  */
 public function update(\SplSubject $subject)
 {
     $viewConfig = $subject->getViewConfigVerify();
     $query = $subject->getQueryServiceVerify()->get($viewConfig->query)->setParams($subject->getParams())->process();
     $subject->setData($query->getData());
     $model = $subject->getGatewayServiceVerify()->get($viewConfig->model)->find($query->getWhere());
     if (!$model->count()) {
         return;
     }
     foreach ($model as $row) {
         $result['selectlinks'][] = ['route' => 'common', 'label' => $row->title, 'routeparams' => ['view' => $viewConfig->params['view'], 'data' => $subject->getParams()->fromRoute('data')], 'queryparams' => ['id' => $subject->getParams()->fromRoute('id'), 'template' => $row->_id]];
     }
     $subject->setData($result);
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:17,代码来源:ListLiteObserver.php

示例3: update

 /**
  * @param \SplSubject|Logic $subject
  *
  * @throws \Exception
  */
 public function update(\SplSubject $subject)
 {
     $models = $subject->getEventObject();
     if (!(is_array($models) || $models instanceof ResultSetInterface)) {
         $models = [$models];
     }
     foreach ($models as $_k => $model) {
         if ($model instanceof AclDataModel) {
             $dataModel = $model->getDataModel();
         } else {
             $dataModel = $model;
         }
         $subject->getGatewayServiceVerify()->get($dataModel->getModelName())->delete(['_id' => $dataModel->id()]);
     }
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:20,代码来源:CleanObserver.php

示例4: update

 /**
  * @param \SplSubject|View $subject
  */
 public function update(\SplSubject $subject)
 {
     $viewConfig = $subject->getViewConfigVerify();
     $query = $subject->getQueryServiceVerify()->get($viewConfig->query)->setParams($subject->getParams())->process();
     $subject->setData($query->getData());
     $model = $subject->getGatewayServiceVerify()->get($viewConfig->model)->find($query->getWhere());
     if (!$model->count()) {
         return;
     }
     foreach ($model as $key => $row) {
         $result['selectlinks'][] = ['route' => 'common', 'label' => $row->title, 'folder_title' => $row->folder_title, 'routeparams' => ['view' => 'send', 'data' => 'mail'], 'queryparams' => ['recipient' => $subject->getParams()->fromRoute('id'), 'template' => $row->_id]];
     }
     usort($result['selectlinks'], function ($a, $b) {
         return strnatcmp($a['folder_title'], $b['folder_title']);
     });
     $subject->setData($result);
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:20,代码来源:MailTplObserver.php

示例5: update

 /**
  * @param \SplSubject|Logic $subject
  */
 public function update(\SplSubject $subject)
 {
     $model = $subject->getEventObject();
     $settings = $this->getRootConfig();
     if ($model->{$settings}['isdefault_field'] == 'true') {
         $gw = $subject->getGatewayServiceVerify()->get($model->getModelName());
         $searchQuery = [];
         foreach ($settings['unique_fields'] as $field) {
             $searchQuery[$field] = $model->{$field};
         }
         $searchQuery['-_id'] = $model->_id;
         $otherModels = $gw->find($searchQuery);
         foreach ($otherModels as $othrModel) {
             $othrModel->{$settings}['isdefault_field'] = 'false';
             $gw->save($othrModel);
         }
     }
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:21,代码来源:SetAsDefaultObserver.php


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