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


PHP Activity::getId方法代码示例

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


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

示例1: test_1_1_1

 public function test_1_1_1()
 {
     $Activity = new Activity(array('name' => 'Test'));
     $Child = new Kid(array('name' => 'Johanna'));
     $Father = new Father(array('name' => 'Daddy'));
     $Child->father->assign($Father);
     $Activity->kid->assign($Child);
     $Child->save();
     $Activity->save();
     $Test = $Activity->findFirstBy('name', 'Test', array('conditions' => 'id=' . $Activity->getId(), 'include' => array('kid' => array('conditions' => 'id=' . $Child->getId(), 'include' => array('father' => array('conditions' => 'id=' . $Father->getId()))))));
     $this->assertEqual($Test->name, 'Test');
     $this->assertEqual($Test->kid->name, 'Johanna');
     $this->assertEqual($Test->kid->father->name, 'Daddy');
     // die;
     //binds not working properly
     $Test = $Activity->findFirstBy('name', 'Test', array('conditions' => 'id=?', 'bind' => $Test->getId(), 'include' => array('kid' => array('conditions' => 'id=?', 'bind' => $Child->getId(), 'include' => array('father' => array('conditions' => 'id=?', 'bind' => array($Father->getId())))))));
     $this->assertEqual($Test->name, 'Test');
     $this->assertEqual($Test->kid->name, 'Johanna');
     $this->assertEqual($Test->kid->father->name, 'Daddy');
     //die;
 }
开发者ID:bermi,项目名称:akelos,代码行数:21,代码来源:belongs_to_find_include_owner.php

示例2: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Activity $value A Activity object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Activity $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
开发者ID:yasirgit,项目名称:afids,代码行数:22,代码来源:BaseActivityPeer.php

示例3: deleteActivityProfile

 public function deleteActivityProfile($activity, $id)
 {
     if (!$activity instanceof Activity) {
         $activity = new Activity($activity);
     }
     $response = $this->sendRequest('DELETE', 'activities/profile', array('params' => array('activityId' => $activity->getId(), 'profileId' => $id)));
     return $response;
 }
开发者ID:WillSkates,项目名称:TinCanPHP,代码行数:8,代码来源:RemoteLRS.php

示例4: setActivity

 /**
  * Declares an association between this object and a Activity object.
  *
  * @param      Activity $v
  * @return     ActivityHasFeature The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setActivity(Activity $v = null)
 {
     if ($v === null) {
         $this->setActivityId(NULL);
     } else {
         $this->setActivityId($v->getId());
     }
     $this->aActivity = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Activity object, it will not be re-added.
     if ($v !== null) {
         $v->addActivityHasFeature($this);
     }
     return $this;
 }
开发者ID:jfesquet,项目名称:tempos,代码行数:22,代码来源:BaseActivityHasFeature.php

示例5: testGetId

 /**
  * Tests Activity->getId()
  */
 public function testGetId()
 {
     $this->assertEquals(1, $this->Activity->getId());
 }
开发者ID:ahmedadham88,项目名称:enhanced-social-network,代码行数:7,代码来源:ActivityTest.php

示例6: byActivity

 /**
  * Filter by an Activity.
  *
  * @param Activity $activity The Activity to filter by
  *
  * @return self The statements filter
  */
 public function byActivity(Activity $activity)
 {
     $this->filter['activity'] = $activity->getId();
     return $this;
 }
开发者ID:xabbuh,项目名称:xapi-model,代码行数:12,代码来源:StatementsFilter.php

示例7: testFind

 function testFind()
 {
     //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();
     $activity_name2 = "Activity Two";
     $activity_date2 = '2016-02-02';
     $activity_location2 = "Location Two";
     $activity_description2 = "Description of Activity Two";
     $activity_price2 = "Price of Activity Two";
     $activity_quantity2 = 20;
     $business_id2 = 21;
     $activity_category_id2 = 22;
     $id2 = 2;
     $test_activity2 = new Activity($activity_name, $activity_date, $activity_location, $activity_description, $activity_price, $activity_quantity, $business_id, $activity_category_id, $id = null);
     $test_activity2->save();
     //Act
     $result = Activity::find($test_activity->getId());
     //Assert
     $this->assertEquals($test_activity, $result);
 }
开发者ID:jtorrespdx,项目名称:walk_ins_welcome,代码行数:30,代码来源:ActivityTest.php

示例8: testGetId

 function testGetId()
 {
     //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 = 3;
     $test_activity = new Activity($activity_name, $activity_date, $activity_location, $activity_description, $activity_price, $activity_quantity, $business_id, $activity_category_id, $id = null);
     //Act
     $result = $test_activity->getId();
     //Assert
     $this->assertEquals($id, $result);
 }
开发者ID:JordanNavratil,项目名称:walk_ins_welcome,代码行数:18,代码来源:ActivityTest.php


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