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


PHP Activity::update方法代码示例

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


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

示例1: setActivity

 /**
  * Instance an activity object and updated the time stamp or 
  * if the flag="new" insert a new entry (only for new record)
  */
 function setActivity($flag = "")
 {
     if (!empty($this->idcontact)) {
         $do_activity = new Activity();
         $do_activity->idcontact = $this->idcontact;
         if ($flag == "new") {
             $do_activity->add();
         } else {
             $do_activity->update();
         }
         $q = new sqlQuery($GLOBALS['conx']);
         $q->query("UPDATE " . $this->getSqlViewName() . " SET last_activity=now() WHERE idcontact=" . $this->idcontact);
         $q->free();
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:19,代码来源:.Contact.class.php

示例2: addTagAssociation

 /**
  * While adding a tag association just check if it is 
  * already there. IF not then add that.
  */
 function addTagAssociation($idreference, $tag_name = "", $reference_type = "", $iduser = 0)
 {
     if (empty($iduser)) {
         $iduser = $_SESSION['do_User']->iduser;
     }
     if (empty($reference_type)) {
         $reference_type = $this->default_reference;
     }
     $tag_name = trim($tag_name);
     if (!empty($tag_name)) {
         if (!$this->isTagAssociationExists($tag_name, $idreference, $reference_type, $iduser)) {
             if ($reference_type == "contact") {
                 $activity = new Activity();
                 $activity->idcontact = $idreference;
                 $activity->update();
             }
             $this->addNew();
             $this->iduser = $iduser;
             $this->tag_name = $tag_name;
             $this->reference_type = $reference_type;
             $this->idreference = $idreference;
             $this->date_added = date("Y-m-d");
             $this->add();
             $this->calculateTagSize();
         }
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:Tag.class.php

示例3: delete

 /**
  *
  * @access public
  */
 function delete()
 {
     if ($this->verify()) {
         echo '<br>数据不可修改.<a href="activity">返回</a><br>';
         return;
     }
     $id = get_post_value('id');
     $field = array('status' => '60000');
     $m = new Activity();
     $m->clear();
     $m->setField($field);
     ///设置更新字段及值,(键值数组)
     $m->setTable('vcb_index_activity');
     //设置表名
     $m->setWhere('activity_id', '=', $id);
     //设置Where条件
     $m->update();
     //返回
     echo '<br>操作成功,<a href="activity" >返回</a><br>';
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:24,代码来源:ActivityController.class.php

示例4: testUpdate

 function testUpdate()
 {
     //Arrange
     $activity_name = "Activity One";
     $activity_date = '2016-01-01';
     $activity_location = "Location";
     $activity_description = "Description of Activity One";
     $activity_price = "Price of Activity One";
     $activity_quantity = 10;
     $business_id = 1;
     $activity_category_id = 2;
     $id = 1;
     $test_activity = new Activity($activity_name, $activity_date, $activity_location, $activity_description, $activity_price, $activity_quantity, $business_id, $activity_category_id, $id);
     $test_activity->save();
     $new_activity_name = "Activity Two";
     //Act
     $test_activity->update($new_activity_name);
     //Assert
     $this->assertEquals("Activity Two", $test_activity->getActivityName());
 }
开发者ID:jtorrespdx,项目名称:walk_ins_welcome,代码行数:20,代码来源:ActivityTest.php

示例5: updateActivity

 public function updateActivity($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($args->post['activity-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']);
     $activity->update();
     return $activity;
 }
开发者ID:gpuenteallott,项目名称:rox,代码行数:23,代码来源:activities.model.php


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