本文整理匯總了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());
}
}