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


PHP Car::getId方法代码示例

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


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

示例1: shouldBeAbleToPopulateByJSON

 /**
  * @test
  */
 public function shouldBeAbleToPopulateByJSON()
 {
     // given
     $car = new Car(1);
     $this->assertEquals(1, $car->getId());
     $json = $car;
     $array = json_decode($json, true);
     // when
     $array['brand'] = 'BMW';
     $car->setValues($array);
     $car->commit();
     $newCar = new Car(1);
     // then
     $this->assertEquals('BMW', $newCar->getBrand());
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:18,代码来源:JSONTest.php

示例2:

     }
 } else {
     $presscontact->setName($_POST["presscontactname"]);
     $presscontact->setHTMLContent(utf8_encode($_POST["presscontacthtml"]));
     $presscontact->setCarBrandId($_POST["carbrand"]);
     $presscontactinsert = $blPressContact->insertPressContact($presscontact);
     if (is_numeric($presscontactinsert)) {
         $car->setPressContactId($presscontactinsert);
         $errorpresscontact["success"] = "Press contact saved!";
     } else {
         $car->setPressContactId(0);
         $errorpresscontact = $presscontactinsert;
     }
 }
 //check if car is set
 if ($car->getId() != 0) {
     $carprev = $blCar->getCar($_POST["carid"]);
     $car->setFolderName($carprev->getFolderName());
     $car->setDateAdded($carprev->getDateAdded());
     $car->setDateApproved($carprev->getDateApproved());
     $car->setUserIdAdded($carprev->getUserIdAdded());
     $car->setUserIdApproved($carprev->getUserIdApproved());
     $car->setLRClicks($carprev->getLRClicks());
     $car->setHRClicks($carprev->getHRClicks());
     $car->setViews($carprev->getViews());
     $car->setState($carprev->getState());
     $car->setDefaultPictureId($carprev->getDefaultPictureId());
     $error = $blCar->updateCar($car);
 } else {
     $car->setState('Design');
     $car->setFolderName(uniqid());
开发者ID:janb87,项目名称:media-cars,代码行数:31,代码来源:addcar.php

示例3: shouldBeAbleToMerge

 /**
  * @test
  */
 public function shouldBeAbleToMerge()
 {
     // given
     $car = new Car();
     $car->deleteTableData()->yesImSure();
     $car->setBrand("Volkswagen");
     $car->setModel("Polo 1.6 TDI");
     $car->commit();
     $this->addCarProperty($car->getId(), "Hk", "75");
     $this->addCarProperty($car->getId(), "Mileage", "42000");
     $this->addCarProperty($car->getId(), "Year", "2010");
     $cars = new CarsWithProperties();
     // when
     $values = $cars->getValues();
     $firstCar = $values[0];
     // then
     $this->assertNotNull($firstCar['properties']);
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:21,代码来源:CollectionTest.php

示例4: addCarToStatistics

 public function addCarToStatistics(Car $car)
 {
     if (array_key_exists($car->getId(), $this->statisticsCars)) {
         $this->statisticsCars[$car->getId()]->increment();
     } else {
         $this->statisticsCars[$car->getId()] = new StatCountTuple($car);
     }
 }
开发者ID:jspetrak,项目名称:raillog,代码行数:8,代码来源:_model.php

示例5: testShouldBeAbleToGetRecordById

 /**
  * @test
  */
 public function testShouldBeAbleToGetRecordById()
 {
     $car = new Car();
     $car->drop()->yesImSure();
     $car->createTable();
     // when
     $car = new Car(1);
     // then
     $this->assertEquals('Opel', $car->getBrand());
     $this->assertEquals('1', $car->getId());
 }
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:14,代码来源:LudoDBModelTests.php


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