本文整理匯總了PHP中unknown::getCategory方法的典型用法代碼示例。如果您正苦於以下問題:PHP unknown::getCategory方法的具體用法?PHP unknown::getCategory怎麽用?PHP unknown::getCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類unknown
的用法示例。
在下文中一共展示了unknown::getCategory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructs a new placeholder class and use the object to fill
* the placeholder with.
*
* @param unknown $object
*/
public function __construct($object, $begin = "<<", $end = ">>")
{
$replace = array();
if ($object instanceof Part) {
$replace = array('id' => $object->getId(), 'barcodeId' => $object->getId() * 10 + 1, 'name' => $object->getName(), 'internalNumber' => $object->getInternalPartNumber(), 'description' => $object->getDescription(), 'categoryFull' => $object->getCategory()->getCategoryPath(), 'categoryLast' => $object->getCategory()->getName(), 'footprintName' => $object->getFootprint() === null ? '' : $object->getFootprint()->getName(), 'storageLocationName' => $object->getStorageLocation() === null ? '' : $object->getStorageLocation()->getName());
} else {
if ($object instanceof StorageLocation) {
$replace = array('id' => $object->getId(), 'barcodeId' => $object->getId() * 10 + 2, 'name' => $object->getName());
}
}
$this->beginToken = $begin;
$this->endToken = $end;
$this->replacements = $replace;
}
示例2: categorySaveBefore
/**
* Catch category data before category save
* @param unknown $observer
*/
public function categorySaveBefore($observer)
{
if ($this->autoIndex) {
$categoryId = $observer->getCategory()->getId();
$this->data['save_category_id'] = $categoryId;
}
}