本文整理汇总了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;
}
}