本文整理汇总了PHP中unknown::getEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown::getEvent方法的具体用法?PHP unknown::getEvent怎么用?PHP unknown::getEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown
的用法示例。
在下文中一共展示了unknown::getEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: productDeleteAfter
/**
* When a magento product deleted
* @param unknown $observer
*/
public function productDeleteAfter($observer)
{
if ($this->autoIndex) {
$product = $observer->getEvent()->getProduct();
$this->updateSolrIndex($product->getId());
}
}
示例2: productDeleteAfter
/**
* When a magento product deleted
* @param unknown $observer
*/
public function productDeleteAfter($observer)
{
$availableCores = array_keys($this->ultility->getAvailableCores());
$solr_server_url = Mage::getStoreConfig('webmods_solrsearch/settings/solr_server_url', 0);
$product = $observer->getEvent()->getProduct();
foreach ($availableCores as $solrcore) {
$Url = trim($solr_server_url, '/') . '/' . $solrcore . '/update?stream.body=<delete><query>products_id:' . $product->getId() . '</query></delete>&commit=true';
Mage::getResourceModel('solrsearch/solr')->doRequest($Url);
//Remove product id from log table
$this->ultility->removeLogProductId($product->getId());
}
}