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


PHP Category::getId方法代码示例

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


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

示例1: clickCategoryFilterLink

 /**
  * @param Category $category
  */
 public function clickCategoryFilterLink($category)
 {
     $elt = $this->getElement('Categories tree')->find('css', sprintf('#node_%s a', $category->getId()));
     if (!$elt) {
         throw new \Exception(sprintf('Could not find category filter "%s".', $category->getId()));
     }
     $elt->click();
 }
开发者ID:javiersantos,项目名称:pim-community-dev,代码行数:11,代码来源:Index.php

示例2: getBudgetArticleByCategory

 public function getBudgetArticleByCategory(Category $category)
 {
     if (isset($this->_budgetArticles[$category->getId()])) {
         return $this->_budgetArticles[$category->getId()];
     }
     $budgetArticle = new BudgetCategory();
     $this->_budgetArticles[$category->getId()] = $budgetArticle;
     $budgetArticle->setCategory($category);
     $budgetArticle->setType($category->getType() == Category::TYPE_PROFIT ? BudgetCategory::TYPE_PROFIT : BudgetCategory::TYPE_EXPENSE);
     $budgetArticle->setUser($this->_user);
     $budgetArticle->setDateStart($this->_startDate->format('Y-m-d'));
     return $budgetArticle;
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:13,代码来源:Budget.class.php

示例3: update

 public function update(Category $category)
 {
     if ($this->find($category->getId())) {
         $catId = $category->getId();
         $userId = $category->getUser()->getId();
         $superCat = $category->getParentCategory()->getId();
         $subCat = $category->getSubCategory();
         $sql = "UPDATE " . $this->TABLE_NAME . " SET\n                    userId='{$userId}',superCategory='{$superCat}',subCategory='{$subCat}'\n                    WHERE id='{$catId}'";
         if (mysql_query($sql, $this->connection)) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:junilm,项目名称:MyMap_AdminPanel,代码行数:17,代码来源:CategoryController.php

示例4: Category

 function test_getId()
 {
     $name = "Work stuff";
     $id = 1;
     $test_Category = new Category($name, $id);
     $result = $test_Category->getId();
     $this->assertEquals(true, is_numeric($result));
 }
开发者ID:CaseyH33,项目名称:ToD,代码行数:8,代码来源:CategoryTest.php

示例5: ensureConsistency

 /**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aCategory !== null && $this->thelia_category_id !== $this->aCategory->getId()) {
         $this->aCategory = null;
     }
     if ($this->aLang !== null && $this->lang_id !== $this->aLang->getId()) {
         $this->aLang = null;
     }
 }
开发者ID:Mertiozys,项目名称:GoogleShopping,代码行数:22,代码来源:GoogleshoppingTaxonomy.php

示例6: ensureConsistency

 /**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
         $this->aCategory = null;
     }
     if ($this->aTaxRule !== null && $this->tax_rule_id !== $this->aTaxRule->getId()) {
         $this->aTaxRule = null;
     }
 }
开发者ID:thelia-modules,项目名称:CriteriaSearch,代码行数:22,代码来源:CriteriaSearchCategoryTaxRule.php

示例7: ensureConsistency

 /**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
         $this->aCategory = null;
     }
     if ($this->aAttribute !== null && $this->attribute_id !== $this->aAttribute->getId()) {
         $this->aAttribute = null;
     }
 }
开发者ID:thelia-modules,项目名称:CriteriaSearch,代码行数:22,代码来源:CriteriaSearchCategoryAttribute.php

示例8: ensureConsistency

 /**
  * Checks and repairs the internal consistency of the object.
  *
  * This method is executed after an already-instantiated object is re-hydrated
  * from the database.  It exists to check any foreign keys to make sure that
  * the objects related to the current object are correct based on foreign key.
  *
  * You can override this method in the stub class, but you should always invoke
  * the base method from the overridden method (i.e. parent::ensureConsistency()),
  * in case your model changes.
  *
  * @throws PropelException
  */
 public function ensureConsistency()
 {
     if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
         $this->aCategory = null;
     }
     if ($this->aFeature !== null && $this->feature_id !== $this->aFeature->getId()) {
         $this->aFeature = null;
     }
 }
开发者ID:thelia-modules,项目名称:CriteriaSearch,代码行数:22,代码来源:CriteriaSearchCategoryFeature.php

示例9: getAllCategoriesFromDatabase

 public static function getAllCategoriesFromDatabase($dbConn)
 {
     $categoryIds = readFromDatabase::readEntireColumnFromTable($dbConn, array(self::ID_COLUMN_NAME), self::TABLE_NAME);
     $categories = array();
     foreach ($categoryIds as $categoryId) {
         $category = new Category($dbConn, $categoryId[self::ID_COLUMN_NAME]);
         $categories[$category->getId()] = $category->getName();
     }
     return $categories;
 }
开发者ID:radioCKUT,项目名称:digital-logsheets,代码行数:10,代码来源:manageCategoryEntries.php

示例10: Category

 function test_getId()
 {
     //Arrange
     $name = "Work stuff";
     $id = 1;
     $test_category = new Category($name, $id);
     //Act
     $result = $test_category->getId();
     //Assert
     $this->assertEquals(true, is_numeric($result));
 }
开发者ID:jschold,项目名称:ToDoSQL,代码行数:11,代码来源:CategoryTest.php

示例11: insert

 public function insert(Category $category, Subcategory $subcategory, Brand $brand, Item $item)
 {
     //        $sql = "INSERT INTO item values (null, 'aalluu', 'asdfasd',true,true, '2015-10-10','asdfasf', 'asdfasd', 1, 1 ,1, 1)";
     $sql = "INSERT INTO item values (null, '" . $item->getTitle() . "','" . $item->getDetail() . "',true,false, '" . $item->getDate() . "', '" . $item->getLocation() . "','asfasf'," . $category->getId() . "," . $subcategory->getId() . ", 1 ," . $brand->getId() . ")";
     echo $sql;
     if ($this->conn->query($sql) === TRUE) {
         echo "Insert operation successful";
     } else {
         echo "Error inserting: ";
     }
 }
开发者ID:ppandey224,项目名称:manaslu,代码行数:11,代码来源:ReportService.php

示例12: Category

 function test_find()
 {
     $name = "Wash the dog";
     $name2 = "Home stuff";
     $test_Category = new Category($name);
     $test_Category->save();
     $test_Category2 = new Category($name2);
     $test_Category2->save();
     $result = Category::find($test_Category->getId());
     $this->assertEquals($test_Category, $result);
 }
开发者ID:bdspen,项目名称:todo_database,代码行数:11,代码来源:CategoryTest.php

示例13: edit

 public function edit(User $currentUser, Category $category)
 {
     $id = intval($category->getId());
     $name = $this->database->quote($category->getName());
     $description = $this->database->quote($category->getDescription());
     $query = "UPDATE category SET name = '" . $name . "', description = '" . $description . "' WHERE id = " . $id;
     $result = $this->database->exec($query);
     if ($result) {
         return true;
     } else {
         throw new Exception("Catastrophe base de données.");
     }
 }
开发者ID:CreepingPanda,项目名称:FennecPlusUltra,代码行数:13,代码来源:CategoryManager.class.php

示例14: serialize

	/**
	 * (non-PHPdoc)
	 * @see de\RaumZeitLabor\PartKeepr\Util.Serializable::serialize()
	 */
	public function serialize () {
		$aManufacturers = array();
		
		foreach ($this->getManufacturers() as $manufacturer) {
			$aManufacturers[] = $manufacturer->serialize();
		}
		
		$aDistributors = array();
		
		foreach ($this->getDistributors() as $distributor) {
			$aDistributors[] = $distributor->serialize();
		}
		
		$aParameters = array();
		foreach ($this->getParameters() as $parameter) {
			$aParameters[] = $parameter->serialize();
		}
		
		$aImages = array();
		foreach ($this->getImages() as $image) {
			$aImages[] = $image->serialize();
		}
		
		$aAttachments = array();
		foreach ($this->getAttachments() as $attachment) {
			$aAttachments[] = $attachment->serialize();
		}
		
		return array(
					"id" => $this->getId(),
					"name" => $this->getName(),
					"comment" => $this->getComment(),
					"stockLevel" => $this->getStockLevel(),
					"footprint_id" => is_object($this->footprint) ? $this->footprint->getId() : null,
					"minStockLevel" => $this->minStockLevel,
					"storageLocation_id" => is_object($this->storageLocation) ? $this->storageLocation->getId() : null,
					"storageLocationName" => is_object($this->storageLocation) ? $this->storageLocation->getName() : null,
					"category_id" => is_object($this->category) ?  $this->category->getId() : null,
					"partUnit_id" => is_object($this->partUnit) ? $this->getPartUnit()->getId() : null,
					"partUnit_name" => is_object($this->partUnit) ? $this->getPartUnit()->getId() : PartKeepr::i18n("Pieces"),
					"partUnit_shortName" => is_object($this->partUnit) ? $this->getPartUnit()->getId() : "",
					"manufacturers" => $aManufacturers,
					"distributors" => $aDistributors,
					"images" => $aImages,
					"attachments" => $aAttachments,
					"parameters" => $aParameters
		
		);
	}
开发者ID:nessi,项目名称:PartKeepr,代码行数:53,代码来源:Part.php

示例15: Category

 function test_save()
 {
     //Arrange
     $name = "Home stuff";
     $id = null;
     $test_category = new Category($name, $id);
     $test_category->save();
     $due_date = "2015-10-12";
     $description = "Wash the dog";
     $category_id = $test_category->getId();
     $test_task = new Task($description, $due_date, $id, $category_id);
     //Act
     $test_task->save();
     //Assert
     $result = Task::getAll();
     var_dump($result);
     $this->assertEquals($test_task, $result[0]);
 }
开发者ID:r-hills,项目名称:To_Do_List,代码行数:18,代码来源:TaskTest.php


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