本文整理汇总了PHP中Mage_Index_Model_Indexer_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Index_Model_Indexer_Abstract类的具体用法?PHP Mage_Index_Model_Indexer_Abstract怎么用?PHP Mage_Index_Model_Indexer_Abstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Index_Model_Indexer_Abstract类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: matchEvent
/**
* Match Event
* @param Mage_Index_Model_Event $event
* @see Mage_Index_Model_Indexer_Abstract::matchEvent()
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
$resultKey = 'rewards_customer_points_match_result';
if (isset($data[$resultKey])) {
return $data[$resultKey];
}
$result = null;
$entity = $event->getEntity();
if ($entity == self::REWARDS_TRANSFER_ENTITY || $entity == self::REWARDS_CUSTOMER_ENTITY) {
if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) {
$result = true;
} else {
if ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) {
/* @var $transfer TBT_Rewards_Model_Transfer */
$result = true;
} else {
$result = false;
}
}
} else {
$result = parent::matchEvent($event);
}
$event->addNewData($resultKey, $result);
return $result;
}
开发者ID:rajarshc,项目名称:Rooja,代码行数:32,代码来源:Points.php
示例2: matchEvent
/**
* Check if event can be matched by process.
* Overwrote for specific config save, store and store groups save matching
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$entity = $event->getEntity();
if ($entity == Mage_Core_Model_Store::ENTITY) {
$store = $event->getDataObject();
if ($store && ($store->isObjectNew() || $store->dataHasChangedFor('group_id'))) {
$result = true;
} else {
$result = false;
}
} elseif ($entity == Mage_Core_Model_Store_Group::ENTITY) {
$storeGroup = $event->getDataObject();
$hasDataChanges = $storeGroup && ($storeGroup->dataHasChangedFor('root_category_id') || $storeGroup->dataHasChangedFor('website_id'));
if ($storeGroup && !$storeGroup->isObjectNew() && $hasDataChanges) {
$result = true;
} else {
$result = false;
}
} else {
$result = parent::matchEvent($event);
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:technomagegithub,项目名称:magento,代码行数:35,代码来源:Post.php
示例3: __construct
public function __construct()
{
parent::__construct();
$this->engine = new Algolia_Algoliasearch_Model_Resource_Engine();
$this->config = Mage::helper('algoliasearch/config');
$this->logger = Mage::helper('algoliasearch/logger');
}
开发者ID:aude,项目名称:algoliasearch-magento,代码行数:7,代码来源:Algolia.php
示例4: __construct
public function __construct()
{
/**
* Add the customer groups as a matched entity in addition to category or product entity.
*/
$this->_matchedEntities[Mage_Customer_Model_Group::ENTITY] = array(Mage_Index_Model_Event::TYPE_SAVE);
parent::__construct();
}
开发者ID:gewaechshaus,项目名称:groupscatalog2,代码行数:8,代码来源:Abstract.php
示例5: _construct
protected function _construct()
{
//$this->_init('solrsearch/indexer_solr');
$this->batchDirectory = Mage::getBaseDir('var') . '/solrbridge_processes/';
if (!is_dir($this->batchDirectory)) {
mkdir($this->batchDirectory, 0777);
}
return parent::_construct();
}
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:9,代码来源:Solr.php
示例6: matchEvent
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$result = parent::matchEvent($event);
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:xiaoguizhidao,项目名称:magento,代码行数:10,代码来源:VendorProductAssoc.php
示例7: matchEvent
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$entity = $event->getEntity();
if ($entity == Mage_Core_Model_Store::ENTITY) {
$store = $event->getDataObject();
if ($store && $store->isObjectNew()) {
$result = true;
} else {
$result = false;
}
} else {
$result = parent::matchEvent($event);
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:santhosh400,项目名称:ecart,代码行数:20,代码来源:Url.php
示例8: matchEvent
/**
* Check if event can be matched by process.
* Rewrited for checking configuration settings save (like price scope).
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
if ($event->getEntity() == Mage_Core_Model_Config_Data::ENTITY) {
$data = $event->getDataObject();
if ($data && in_array($data->getPath(), $this->_relatedConfigSettings)) {
$result = $data->isValueChanged();
} else {
$result = false;
}
} elseif ($event->getEntity() == Mage_Customer_Model_Group::ENTITY) {
$result = $event->getDataObject() && $event->getDataObject()->isObjectNew();
} else {
$result = parent::matchEvent($event);
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:28,代码来源:Price.php
示例9: matchEvent
/**
* Check if event can be matched by process
* Overwrote for check is flat catalog category is enabled and specific save
* category, store, store_group
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
/** @var $categoryFlatHelper Mage_Catalog_Helper_Category_Flat */
$categoryFlatHelper = Mage::helper('catalog/category_flat');
if (!$categoryFlatHelper->isAccessible() || !$categoryFlatHelper->isBuilt()) {
return false;
}
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$entity = $event->getEntity();
if ($entity == Mage_Core_Model_Store::ENTITY) {
if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) {
$result = true;
} elseif ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) {
/** @var $store Mage_Core_Model_Store */
$store = $event->getDataObject();
if ($store && ($store->isObjectNew() || $store->dataHasChangedFor('group_id') || $store->dataHasChangedFor('root_category_id'))) {
$result = true;
} else {
$result = false;
}
} else {
$result = false;
}
} elseif ($entity == Mage_Core_Model_Store_Group::ENTITY) {
/** @var $storeGroup Mage_Core_Model_Store_Group */
$storeGroup = $event->getDataObject();
if ($storeGroup && ($storeGroup->dataHasChangedFor('website_id') || $storeGroup->dataHasChangedFor('root_category_id'))) {
$result = true;
} else {
$result = false;
}
} else {
$result = parent::matchEvent($event);
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:48,代码来源:Flat.php
示例10: matchEvent
/**
* Check if event can be matched by process.
* Rewrited for checking configuration settings save (like price scope).
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
$resultKey = 'catalog_product_price_match_result';
if (isset($data[$resultKey])) {
return $data[$resultKey];
}
$result = null;
if ($event->getEntity() == Mage_Core_Model_Config_Data::ENTITY) {
$data = $event->getDataObject();
if (in_array($data->getPath(), $this->_relatedConfigSettings)) {
$result = $data->isValueChanged();
} else {
$result = false;
}
} elseif ($event->getEntity() == Mage_Customer_Model_Group::ENTITY) {
$result = $event->getDataObject()->isObjectNew();
} else {
$result = parent::matchEvent($event);
}
$event->addNewData($resultKey, $result);
return $result;
}
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:30,代码来源:Price.php
示例11: matchEvent
/**
* Check if event can be matched by process
* Overwrote for check is flat catalog product is enabled and specific save
* attribute, store, store_group
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
/** @var $productFlatHelper Mage_Catalog_Helper_Product_Flat */
$productFlatHelper = Mage::helper('catalog/product_flat');
if (!$productFlatHelper->isAvailable() || !$productFlatHelper->isBuilt()) {
return false;
}
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$entity = $event->getEntity();
if ($entity == Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY) {
/* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
$attribute = $event->getDataObject();
$addFilterable = $productFlatHelper->isAddFilterableAttributes();
$enableBefore = $attribute && ($attribute->getOrigData('backend_type') == 'static' || $addFilterable && $attribute->getOrigData('is_filterable') > 0 || $attribute->getOrigData('used_in_product_listing') == 1 || $attribute->getOrigData('is_used_for_promo_rules') == 1 || $attribute->getOrigData('used_for_sort_by') == 1);
$enableAfter = $attribute && ($attribute->getData('backend_type') == 'static' || $addFilterable && $attribute->getData('is_filterable') > 0 || $attribute->getData('used_in_product_listing') == 1 || $attribute->getData('is_used_for_promo_rules') == 1 || $attribute->getData('used_for_sort_by') == 1);
if ($attribute && $event->getType() == Mage_Index_Model_Event::TYPE_DELETE) {
$result = $enableBefore;
} elseif ($attribute && $event->getType() == Mage_Index_Model_Event::TYPE_SAVE) {
if ($enableAfter || $enableBefore) {
$result = true;
} else {
$result = false;
}
} else {
$result = false;
}
} else {
if ($entity == Mage_Core_Model_Store::ENTITY) {
if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) {
$result = true;
} else {
/* @var $store Mage_Core_Model_Store */
$store = $event->getDataObject();
if ($store && $store->isObjectNew()) {
$result = true;
} else {
$result = false;
}
}
} else {
if ($entity == Mage_Core_Model_Store_Group::ENTITY) {
/* @var $storeGroup Mage_Core_Model_Store_Group */
$storeGroup = $event->getDataObject();
if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) {
$result = true;
} else {
$result = false;
}
} else {
$result = parent::matchEvent($event);
}
}
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:beejhuff,项目名称:magento-1.13.0.2,代码行数:67,代码来源:Flat.php
示例12: __construct
public function __construct()
{
parent::__construct();
$this->config = Mage::helper('algoliasearch/config');
$this->queue = Mage::getSingleton('algoliasearch/queue');
}
开发者ID:YouweGit,项目名称:algoliasearch-magento,代码行数:6,代码来源:Algoliaqueuerunner.php
示例13: matchEvent
/**
* Check if event can be matched by process
* Overwrote for check is flat catalog product is enabled and specific save
* attribute, store, store_group
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$entity = $event->getEntity();
if ($entity == Mage_Catalog_Model_Resource_Eav_Attribute::ENTITY) {
/* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
$attribute = $event->getDataObject();
if (!$attribute) {
$result = FALSE;
} elseif ($event->getType() == Mage_Index_Model_Event::TYPE_SAVE) {
$result = $attribute->dataHasChangedFor('is_searchable');
} elseif ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) {
$result = $attribute->getIsSearchable();
} else {
$result = FALSE;
}
} else {
if ($entity == Mage_Core_Model_Store::ENTITY) {
if ($event->getType() == Mage_Index_Model_Event::TYPE_DELETE) {
$result = TRUE;
} else {
/* @var $store Mage_Core_Model_Store */
$store = $event->getDataObject();
if ($store && $store->isObjectNew()) {
$result = TRUE;
} else {
$result = FALSE;
}
}
} else {
if ($entity == Mage_Core_Model_Store_Group::ENTITY) {
/* @var $storeGroup Mage_Core_Model_Store_Group */
$storeGroup = $event->getDataObject();
if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) {
$result = TRUE;
} else {
$result = FALSE;
}
} else {
if ($entity == Mage_Core_Model_Config_Data::ENTITY) {
$data = $event->getDataObject();
if ($data && (in_array($data->getPath(), $this->_relatedConfigSettingsReindex) || in_array($data->getPath(), $this->_relatedConfigSettingsUpdate))) {
$result = $data->isValueChanged();
} else {
$result = FALSE;
}
} else {
$result = parent::matchEvent($event);
}
}
}
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:par-orillonsoft,项目名称:algoliasearch-magento,代码行数:66,代码来源:Algolia.php
示例14: __construct
public function __construct()
{
parent::__construct();
$this->engine = new Algolia_Algoliasearch_Model_Resource_Engine();
}
开发者ID:algolia,项目名称:algoliasearch-magento,代码行数:5,代码来源:Abstract.php
示例15: matchEvent
/**
* Check if event can be matched by process.
* Overwrote for specific config save, store and store groups save matching
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
$resultKey = 'catalog_category_product_match_result';
if (isset($data[$resultKey])) {
return $data[$resultKey];
}
$result = null;
$entity = $event->getEntity();
if ($entity == Mage_Core_Model_Store::ENTITY) {
$store = $event->getDataObject();
if ($store->isObjectNew() || $store->dataHasChangedFor('group_id')) {
$result = true;
} else {
$result = false;
}
} elseif ($entity == Mage_Core_Model_Store_Group::ENTITY) {
$storeGroup = $event->getDataObject();
$hasDataChanges = $storeGroup->dataHasChangedFor('root_category_id') || $storeGroup->dataHasChangedFor('website_id');
if (!$storeGroup->isObjectNew() && $hasDataChanges) {
$result = true;
} else {
$result = false;
}
} else {
$result = parent::matchEvent($event);
}
$event->addNewData($resultKey, $result);
return $result;
}
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:37,代码来源:Product.php
示例16: _getResource
/**
* Retrieve resource instance
*
* @return Enterprise_TargetRule_Model_Mysql4_Index
*/
protected function _getResource()
{
return parent::_getResource();
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:9,代码来源:Index.php
示例17: __construct
public function __construct()
{
parent::__construct();
$this->_config = Mage::helper('nanowebg_elasticsearch/elasticsearch')->getEngineConfig();
$this->_stores = explode(",", $this->_config['stores']);
}
开发者ID:javik223,项目名称:Evron-Magento,代码行数:6,代码来源:Indexer.php
示例18: __construct
public function __construct()
{
$this->mapping = Mage::helper('merlinsearch/mapping');
parent::__construct();
}
开发者ID:blackbirdtech,项目名称:merlin-magento,代码行数:5,代码来源:Merlinindexer.php
示例19: _construct
protected function _construct()
{
$this->_init('solrsearch/indexer_thumb');
return parent::_construct();
}
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:5,代码来源:Thumb.php
示例20: matchEvent
/**
* Check if event can be matched by process.
* Overwrote for specific config save, store and store groups save matching
*
* @param Mage_Index_Model_Event $event
* @return bool
*/
public function matchEvent(Mage_Index_Model_Event $event)
{
$data = $event->getNewData();
if (isset($data[self::EVENT_MATCH_RESULT_KEY])) {
return $data[self::EVENT_MATCH_RESULT_KEY];
}
$entity = $event->getEntity();
if ($entity == Mage_Core_Model_Store::ENTITY) {
/* @var $store Mage_Core_Model_Store */
$store = $event->getDataObject();
if ($store && $store->isObjectNew()) {
$result = true;
} else {
$result = false;
}
} else {
if ($entity == Mage_Core_Model_Store_Group::ENTITY) {
/* @var $storeGroup Mage_Core_Model_Store_Group */
$storeGroup = $event->getDataObject();
if ($storeGroup && $storeGroup->dataHasChangedFor('website_id')) {
$result = true;
} else {
$result = false;
}
} else {
if ($entity == Mage_Core_Model_Config_Data::ENTITY) {
$configData = $event->getDataObject();
if ($configData && in_array($configData->getPath(), $this->_relatedConfigSettings)) {
$result = $configData->isValueChanged();
} else {
$result = false;
}
} else {
$result = parent::matchEvent($event);
}
}
}
$event->addNewData(self::EVENT_MATCH_RESULT_KEY, $result);
return $result;
}
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:47,代码来源:Stock.php
注:本文中的Mage_Index_Model_Indexer_Abstract类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论