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


PHP Events::getErrors方法代码示例

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


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

示例1: actionIndex

 public function actionIndex()
 {
     $event = new Events();
     $event->attributes = $_GET;
     if (!isset($_GET['content_id'])) {
         $content = Content::model()->findByAttributes(array('slug' => Cii::get($_GET, 'uri', NULL)));
         if ($content !== NULL) {
             $event->content_id = $content->id;
         }
     }
     if ($event->save()) {
         Yii::app()->end();
     }
     return $this->returnError(400, NULL, $event->getErrors());
 }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:15,代码来源:EventController.php

示例2: execute

 public function execute(&$params)
 {
     $options =& $this->config['options'];
     $event = new Events();
     $notif = new Notification();
     $user = $this->parseOption('user', $params);
     $type = $this->parseOption('type', $params);
     if ($type === 'auto') {
         if (!isset($params['model'])) {
             return array(false, '');
         }
         $notif->modelType = get_class($params['model']);
         $notif->modelId = $params['model']->id;
         $notif->type = $this->getNotifType();
         $event->associationType = get_class($params['model']);
         $event->associationId = $params['model']->id;
         $event->type = $this->getEventType();
         if ($params['model']->hasAttribute('visibility')) {
             $event->visibility = $params['model']->visibility;
         }
         // $event->user = $this->parseOption('user',$params);
     } else {
         $text = $this->parseOption('text', $params);
         $notif->type = 'custom';
         $notif->text = $text;
         $event->type = 'feed';
         $event->subtype = $type;
         $event->text = $text;
         if ($user == 'auto' && isset($params['model']) && $params['model']->hasAttribute('assignedTo') && !empty($params['model']->assignedTo)) {
             $event->user = $params['model']->assignedTo;
         } elseif (!empty($user)) {
             $event->user = $user;
         } else {
             $event->user = 'admin';
         }
     }
     if (!$this->parseOption('createNotif', $params)) {
         if (!$notif->save()) {
             return array(false, array_shift($notif->getErrors()));
         }
     }
     if ($event->save()) {
         return array(true, "");
     } else {
         return array(false, array_shift($event->getErrors()));
     }
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:47,代码来源:X2FlowCreateEvent.php

示例3: execute

 public function execute(&$params)
 {
     $options =& $this->config['options'];
     $event = new Events();
     $notif = new Notification();
     $user = $this->parseOption('feed', $params);
     $author = $this->parseOption('user', $params);
     $type = $this->parseOption('type', $params);
     $visibility = $this->parseOption('visibility', $params);
     // Unfinsihed automatic event type detection feature
     //        if($type === 'auto'){
     //            if(!isset($params['model']))
     //                return array (false, '');
     //            $notif->modelType = get_class($params['model']);
     //            $notif->modelId = $params['model']->id;
     //            $notif->type = $this->getNotifType();
     //
     //            $event->associationType = get_class($params['model']);
     //            $event->associationId = $params['model']->id;
     //            $event->type = $this->getEventType();
     //            if($params['model']->hasAttribute('visibility'))
     //                $event->visibility = $params['model']->visibility;
     //            // $event->user = $this->parseOption('user',$params);
     //        } else{
     $text = $this->parseOption('text', $params);
     $notif->type = 'custom';
     $notif->text = $text;
     $event->type = 'feed';
     $event->subtype = $type;
     $event->text = $text;
     $event->visibility = $visibility;
     if ($author == 'auto' && isset($params['model']) && $params['model']->hasAttribute('assignedTo') && !empty($params['model']->assignedTo)) {
         $event->user = $params['model']->assignedTo;
     } else {
         $event->user = $author;
     }
     if (!empty($user)) {
         if ($user == 'auto' && isset($params['model']) && $params['model']->hasAttribute('assignedTo') && !empty($params['model']->assignedTo)) {
             $associatedUser = $params['model']->assignedTo;
         } else {
             $associatedUser = $user;
         }
         $associatedUser = User::model()->findByAttributes(array('username' => $associatedUser));
         if ($associatedUser) {
             $event->associationType = 'User';
             $event->associationId = $associatedUser->id;
             $notif->modelType = 'Profile';
             $notif->modelId = $event->associationId;
             $notif->type = 'social_post';
             $notif->createdBy = $event->user;
             $notif->user = $associatedUser->username;
         }
     }
     if (!$this->parseOption('createNotif', $params)) {
         if (!$notif->save()) {
             $errors = $notif->getErrors();
             return array(false, array_shift($errors));
         }
     }
     if ($event->save()) {
         return array(true, "");
     } else {
         $errors = $event->getErrors();
         return array(false, array_shift($errors));
     }
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:66,代码来源:X2FlowCreateEvent.php


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