• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SplSubject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: update

 /**
  * @param \SplSubject $subject
  *
  * @throws \InvalidArgumentException
  */
 public function update(\SplSubject $subject)
 {
     if (!$subject instanceof EventInterface) {
         throw new \InvalidArgumentException('Command can only be attached to an event!');
     }
     call_user_func_array($this, $subject->getInvokeArgs());
 }
开发者ID:jiangyu7408,项目名称:Statemachine,代码行数:12,代码来源:Command.php


示例2: 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


示例3: update

 public function update(\SplSubject $obj)
 {
     if ($this->dev == true) {
         $content = $obj->getFormatedException();
         require 'view.php';
     }
 }
开发者ID:damdamd,项目名称:ddfram,代码行数:7,代码来源:ScreenPrinter.php


示例4: Update

 public function Update(SplSubject $Subject)
 {
     $Status = $Subject->getStatus();
     //retrieve status array
     $Results = $Status['Results'];
     $Sender = $Status['Sender'];
     if (isset($Results[$this->Name])) {
         if (isset($Results[$this->Name]['matches'])) {
             $Sanitized = $this->ValidateInputs();
             //get offset
             $Matches = $this->GetSQLData($Sanitized['ResultFormat'], $Results[$this->Name]['matches']);
             // $Matches = $this->HighLightResults($Matches, $Results[$this->Name]['query'], $this->Settings['Admin']->BuildExcerptsTitleEnable, $this->Settings['Admin']->BuildExcerptsBodyEnable);
             $Matches = $this->HighLightResults($Matches, $Results[$this->Name]['query'], true, true);
             // Highlighting is ALWAYS enabled
             $Results[$this->Name]['matches'] = $Matches;
         }
         $Sender->SetData($this->Name, $Results[$this->Name]);
         //still set the data even if no total found
         if (!isset($Results[$this->Name]['total_found'])) {
             $Total = 0;
         } else {
             $Total = $Results[$this->Name]['total_found'];
         }
         if ($Total > $this->Settings['Admin']->MaxMatches) {
             $Total = $this->Settings['Admin']->MaxMatches;
         }
         //total_found is applied BEFORE setLimits and maxmatches take affect. We want to limit
         //pagination results to the max matches that sphinx will return...or else some pages will have a blank result set
         $this->BuildPager($Sender, $Total);
     }
 }
开发者ID:Nordic-T,项目名称:vanilla-plugins,代码行数:31,代码来源:class.widget.main.php


示例5: update

 public function update(\SplSubject $subject)
 {
     /** @var FormConfigParser $subject */
     $modelConfig = $subject->getModelConfigVerify();
     $config = [];
     // process groups
     foreach ($modelConfig->groups as $_grp => $_fls) {
         $parsedFSConfig = $this->setParsedFormConfig()->getParsedFormConfigVerify();
         if (is_numeric($_grp)) {
             $_grp = $_fls;
             $_baseFieldSet = $_grp == 'fields';
             $_label = $modelConfig->model;
         } else {
             $_baseFieldSet = isset($_fls['base']) && $_fls['base'] == true;
             if (!isset($_fls['label'])) {
                 $_label = $modelConfig->model;
             } else {
                 $_label = $_fls['label'];
             }
         }
         $parsedFSConfig->name = $modelConfig->model . 'Fieldset';
         $parsedFSConfig->group = $_grp;
         $parsedFSConfig->type = 'fieldset';
         $parsedFSConfig->options = ['label' => $_label];
         $parsedFSConfig->attributes = ['name' => $_grp, 'class' => 'table'];
         $config['fieldsets'][$_grp] = ['type' => $modelConfig->model . 'Fieldset', 'options' => ['label' => $_label]];
         if ($_baseFieldSet == true) {
             $config['fieldsets'][$_grp]['options']['use_as_base_fieldset'] = true;
         }
         $config['fieldsets_configs'][$_grp] = $parsedFSConfig;
     }
     $subject->addParsedConfig($config);
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:33,代码来源:GroupsObserver.php


示例6: update

 public function update(\SplSubject $obj)
 {
     if ($this->dev == true) {
         $content = $obj->getFormatedError();
         require __DIR__ . '/../../../../app/templates/errors.php';
     }
 }
开发者ID:DamdamD,项目名称:Website,代码行数:7,代码来源:ScreenPrinter.php


示例7: update

 public function update(\SplSubject $obj)
 {
     $q = $this->db->prepare('INSERT INTO exceptions SET message = :message, date = NOW()');
     $q->bindValue(':message', $obj->getFormatedException());
     $q->execute();
     $q->closeCursor();
 }
开发者ID:damdamd,项目名称:ddfram,代码行数:7,代码来源:BDDWriter.php


示例8: update

 public function update(\SplSubject $subject)
 {
     $queue = Queue::declareQueue($this->queueName);
     $producer = new \MicroQueue\Producer($queue);
     $message = $subject->getData();
     $producer->publish($message);
 }
开发者ID:marcusesa,项目名称:microqueue,代码行数:7,代码来源:RequeueListener.php


示例9: update

 public function update(SplSubject $subject)
 {
     // looks for an observer method with the state name
     if (method_exists($this, $subject->getState())) {
         call_user_func_array(array($this, $subject->getState()), array($subject));
     }
 }
开发者ID:arielZusman,项目名称:www.chat.io,代码行数:7,代码来源:Observer.php


示例10: update

 /**
  * Receive update from subject
  *
  * @param SplSubject $subject Subject observed that contains event to write
  *
  * @return void
  */
 public function update(SplSubject $subject)
 {
     $this->subject = $subject;
     $event = $subject->getEvent();
     // delegate to right event implementation
     call_user_func(array($this, $event->getName()), $event);
 }
开发者ID:remicollet,项目名称:php-compat-info,代码行数:14,代码来源:Console.php


示例11: update

 public function update(\SplSubject $obj)
 {
     if ($this->dev == true) {
         $content = $obj->getFormatedError();
         require '/home/rousseauzx/www/app/templates/errors.php';
     }
 }
开发者ID:damdamd,项目名称:ddfram,代码行数:7,代码来源:ScreenPrinter.php


示例12: fillJoins

 /**
  * @param \SplSubject|Logic $subject
  */
 protected function fillJoins($subject)
 {
     $models = $subject->getEventObject();
     $modelConfig = $subject->getModelService()->getParsedModelConfig($subject->getModelName());
     if (!(is_array($models) || $models instanceof ResultSetInterface)) {
         $models = [$models];
     }
     $aModels = [];
     foreach ($models as $_k => $aclModel) {
         if ($aclModel instanceof AclDataModel) {
             $mymodel = $aclModel->getDataModel();
         } else {
             $mymodel = $aclModel;
         }
         foreach ($modelConfig->joins as $_k => $join) {
             if ($join['type'] == 'lookup') {
                 $this->fillLookup($join, $subject, $mymodel);
             } elseif ($join['type'] == 'static_lookup') {
                 $this->fillStaticLookup($join, $subject, $mymodel);
             }
         }
         $aModels[] = $mymodel->getArrayCopy();
     }
     if ($models instanceof ResultSetInterface) {
         $models->initialize($aModels);
     }
     //        else
     //        {
     //            $models = $aModels;
     //        }
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:34,代码来源:FillJoinsObserver.php


示例13: update

 public function update(\SplSubject $subject)
 {
     /** @var FormConfigParser $subject */
     $modelConfig = $subject->getModelConfigVerify();
     $formConfig = ['name' => $modelConfig->model . 'Form', 'group' => 'form', 'type' => 'form', 'options' => ['label' => $modelConfig->model . ' information'], 'attributes' => ['class' => 'validate apiform', 'method' => 'post', 'name' => $modelConfig->model . 'form', 'data-scope' => strtolower($modelConfig->model), 'data-id' => $subject->getDataModel()->id()], 'fieldsets' => [], 'elements' => [], 'filters' => [], 'validationGroup' => []];
     $subject->addParsedConfig($formConfig);
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:7,代码来源:InitObserver.php


示例14: getStateMachineContext

 /**
  * @param \SplSubject|StatemachineInterface|Statemachine $stateMachine
  * @return \ArrayAccess|null
  */
 private function getStateMachineContext($stateMachine)
 {
     $context = null;
     if ($stateMachine instanceof Statemachine) {
         $context = $stateMachine->getCurrentContext();
     }
     return $context;
 }
开发者ID:metabor,项目名称:statemachine,代码行数:12,代码来源:OnEnterObserver.php


示例15: update

 /**
  * @see SplObserver::update()
  */
 public function update(\SplSubject $stateMachine)
 {
     if ($stateMachine instanceof StatemachineInterface) {
         if ($stateMachine->getCurrentState()->hasEvent($this->eventName)) {
             $stateMachine->triggerEvent($this->eventName);
         }
     }
 }
开发者ID:jiangyu7408,项目名称:Statemachine,代码行数:11,代码来源:OnEnterObserver.php


示例16: update

 public function update(SplSubject $subject)
 {
     $event = $subject->getLastEvent();
     // force a timeout when writing request body
     if ('sentHeaders' == $event['name']) {
         $this->headers = $event['data'];
     }
 }
开发者ID:SuhitNarayan,项目名称:SuhitNarayan-SEMANTICTECH,代码行数:8,代码来源:CommonNetworkTest.php


示例17: update

 public function update(SplSubject $subject)
 {
     /* @var $subject HTTP_Request2 */
     $event = $subject->getLastEvent();
     if ($event['name'] !== end($this->sequence) && (empty($this->_watched) || in_array($event['name'], $this->_watched, true))) {
         $this->sequence[] = $event['name'];
     }
 }
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:8,代码来源:CommonNetworkTest.php


示例18: update

 public function update(\SplSubject $subject)
 {
     /** @var ModelConfigParser $subject */
     $modelConfig = $subject->getModelConfig();
     // init
     $config = ['fields' => [], 'joins' => [], 'adapter' => $modelConfig->adapter, 'model' => $modelConfig->model, 'label' => $modelConfig->label, 'table' => $modelConfig->table, 'fieldsets' => [], 'unique' => $modelConfig->unique];
     $subject->addParsedConfig($config);
 }
开发者ID:modelframework,项目名称:modelframework,代码行数:8,代码来源:InitObserver.php


示例19: update

 /**
  * Receive update from subject
  *
  * @param SplSubject $subject Subject observed that contains event to write
  *
  * @return void
  */
 public function update(SplSubject $subject)
 {
     $this->subject = $subject;
     $event = $subject->getEvent();
     // delegate to right event implementation
     $data = call_user_func(array($this, $event->getName()), $event);
     error_log(sprintf('%s [%s] %s %s', strftime($this->timeFormat, $data['timestamp']), $data['level'], $data['message'], PHP_EOL), 3, $this->destFile);
 }
开发者ID:remicollet,项目名称:php-compat-info,代码行数:15,代码来源:File.php


示例20: update

 public function update(SplSubject $subject)
 {
     /* @var $subject HTTP_Request2 */
     $event = $subject->getLastEvent();
     if ('sentBody' == $event['name']) {
         $this->size = $event['data'];
     }
 }
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:8,代码来源:CurlTest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SplitWord类代码示例发布时间:2022-05-23
下一篇:
PHP SplStack类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap