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


PHP Collection::getId方法代码示例

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


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

示例1: Collection

 function test_find()
 {
     //Arrange
     $name = "Hello Kitty";
     $name2 = "Pokemon";
     $test_collection = new Collection($name);
     $test_collection->save();
     $test_collection2 = new Collection($name2);
     $test_collection2->save();
     //Act
     $result = Collection::find($test_collection2->getId());
     //Assert
     $this->assertEquals($test_collection2, $result);
 }
开发者ID:Camolot,项目名称:inventory-PHP-databases,代码行数:14,代码来源:collectionTest.php

示例2: Collection

 function test_find()
 {
     //Arrange
     $thing = "Run the World";
     $thing2 = "20 20 Experience";
     $test_collection = new Collection($thing);
     $test_collection->save();
     $test_collection2 = new Collection($thing2);
     $test_collection2->save();
     //Act
     $id = $test_collection->getId();
     $result = Collection::find($id);
     //Assert
     $this->assertEquals($test_collection, $result);
 }
开发者ID:jmalo34,项目名称:Inventory_Collection,代码行数:15,代码来源:CollectionTest.php

示例3: setCollection

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

示例4: 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      Collection $value A Collection object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Collection $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
开发者ID:EQ4,项目名称:smint,代码行数:22,代码来源:BaseCollectionPeer.php

示例5: testFind

 function testFind()
 {
     //Arrange
     $collection_name = "Rad stuff";
     $test_collection = new Collection($collection_name);
     $test_collection->save();
     $test_collection_id = $test_collection->getId();
     $name = "Hello Kitty";
     $name2 = "Pokemon";
     $test_item = new Item($name, $test_collection_id);
     $test_item->save();
     $test_item2 = new Item($name2, $test_collection_id);
     $test_item2->save();
     //Act
     $result = Item::find($test_item2->getId());
     //Assert
     $this->assertEquals($test_item2, $result);
 }
开发者ID:ben-pritchard,项目名称:inventory-PHP-databases,代码行数:18,代码来源:itemTest.php


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