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


PHP Activity::insert方法代码示例

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


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

示例1: saveActivity

 /**
  * This is a temp solution, we need something better depending
  * on authority to update activity stored.
  *
  **/
 public function saveActivity($activity_id, $activity_def)
 {
     $exists = \Activity::find($activity_id);
     //if the object activity exists, remove and update with recent
     if ($exists) {
         \Activity::where('_id', $activity_id)->delete();
     }
     //save record
     \Activity::insert(array('_id' => $activity_id, 'definition' => $activity_def));
 }
开发者ID:jesposito,项目名称:learninglocker,代码行数:15,代码来源:EloquentActivityRepository.php

示例2: commit

 public function commit()
 {
     if ($this->valid_origin) {
         $av = new ActivityValidate(array('writer' => $this->writer, 'target' => $this->target, 'title' => $this->title, 'description' => $this->description, 'begin' => $this->begin, 'end' => $this->end, 'origin' => $this->origin));
         $v = new Validate(array('writer' => $this->writer, 'group' => $this->target->group(), 'item' => $av, 'type' => 'activity'));
         $v->insert();
     } else {
         $a = new Activity(array('target' => $this->target, 'origin' => $this->origin, 'title' => $this->title, 'description' => $this->description, 'days' => ''));
         $a->insert();
         $ai = new ActivityInstance(array('activity' => $a, 'writer' => $this->writer, 'comment' => '', 'begin' => $this->begin, 'end' => $this->end));
         $ai->insert();
     }
     return true;
 }
开发者ID:netixx,项目名称:frankiz,代码行数:14,代码来源:activityvalidate.php

示例3: count

 /**
  *
  *
  * @access public
  */
 function add_save()
 {
     $title = get_post_value('title');
     $language = get_post_value('language');
     $start_time = get_post_value('start_time');
     $end_time = get_post_value('end_time');
     $filename = get_post_value('filename');
     $num = count($filename);
     //print_r($filename);
     $m = new Activity();
     if ($filename != '' && count($filename) > 0) {
         $order = 0;
         for ($i = 0; $i < $num; $i++) {
             $field = array('title' => trim($title), 'language' => $language, 'start_time' => $start_time, 'end_time' => $end_time, 'created_name' => '', 'status' => '10000', 'img_path' => '/Upload/' . $filename[$i], 'orders' => $order, 'created' => date('Y-m-d H:i:s', time()));
             $m->clear();
             $m->setTable('vcb_index_activity');
             $m->setField($field);
             $product_id = $m->insert();
             $order++;
         }
     }
     if (!$product_id) {
         echo '<br>保存失败<br>';
     } else {
         echo '<br>保存成功,<a href="add">继续添加</a>,<a href="activity">返回</a><br>';
     }
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:32,代码来源:ActivityController.class.php

示例4: implode

 function handler_new_regular($page)
 {
     $title = Env::t('title', '');
     $description = Env::t('activity_description', '');
     $default_begin = Env::t('begin', '00:00');
     $default_end = Env::t('end', '00:00');
     $days = Env::v('days');
     $target = Env::i('target_group_activity', '');
     $caste = Env::has('target_everybody_activity') ? 'everybody' : 'restricted';
     if (Env::has('send')) {
         S::assert_xsrf_token();
         if ($title == '' || is_null($days) || $default_begin == '00:00' || $default_end == '00:00' || $target == '' || !(preg_match('`^\\d{2}:\\d{2}$`', $default_begin) && strtotime($default_begin) !== false && preg_match('`^\\d{2}:\\d{2}$`', $default_end) && strtotime($default_end) !== false)) {
             $page->assign('msg', 'Il manque des informations pour créer l\'activité.
                 Attention les heures ne peuvent pas rester de la forme 00:00.');
         } else {
             $days = implode(',', $days);
             $target = new Group($target);
             $target->select(GroupSelect::validate());
             if (!S::user()->hasRights($target, Rights::admin())) {
                 throw new Exception("Invalid credentials");
             }
             if ($target->ns() == Group::NS_USER) {
                 $caste = 'restricted';
             }
             $a = new Activity(array('target' => $target->caste(new Rights($caste)), 'origin' => $target, 'title' => $title, 'description' => $description, 'days' => $days, 'default_begin' => $default_begin, 'default_end' => $default_end));
             $a->insert();
             $page->assign('envoye', true);
         }
     }
     $page->assign('title_activity', $title);
     $page->assign('description', $description);
     $page->assign('begin', $default_begin);
     $page->assign('end', $default_end);
     $page->assign('title', 'Créer une activité régulière');
     $page->changeTpl('activity/create_regular_activity.tpl');
 }
开发者ID:netixx,项目名称:frankiz,代码行数:36,代码来源:activity.php

示例5: createActivity

 public function createActivity($args)
 {
     // First add geo location to geonames_cache if it doesn't exist yet
     $locationId = $args->post['activity-location-id'];
     if ($locationId != 0) {
         $geomodel = new GeoModel();
         $geomodel->addGeonameId($locationId, 'member_primary');
     } else {
         $locationId = $this->getLoggedInMember()->IdCity;
     }
     $activity = new Activity();
     $activity->creator = $this->getLoggedInMember()->id;
     $activity->title = $args->post['activity-title'];
     $activity->address = $args->post['activity-address'];
     $activity->locationId = $locationId;
     $startdate = strtotime($args->post['activity-start-date']);
     $activity->dateTimeStart = date('Y-m-d H:i:s', $startdate);
     $enddate = strtotime($args->post['activity-end-date']);
     $activity->dateTimeEnd = date('Y-m-d H:i:s', $enddate);
     $activity->description = $args->post['activity-description'];
     $activity->public = isset($args->post['activity-public']);
     $organizer = array();
     $organizer[$activity->creator] = array("attendeeId" => $activity->creator, "organizer" => "1", "status" => "1");
     $activity->organizers = $organizer;
     $activity->insert();
     return $activity;
 }
开发者ID:gpuenteallott,项目名称:rox,代码行数:27,代码来源:activities.model.php


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