Class Mage_Catalog_Model_Resource_Eav_Mysql4_Url

Description

Catalog url rewrite resource model

Located in /Catalog/Model/Resource/Eav/Mysql4/Url.php (line 34)

Mage_Core_Model_Resource_Abstract
   |
   --Mage_Core_Model_Mysql4_Abstract
      |
      --Mage_Catalog_Model_Resource_Eav_Mysql4_Url
Variable Summary
Method Summary
false checkRequestPaths (array $paths, int $storeId)
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearProductRewrites (int $productId, int $storeId, [array $excludeCategoryIds = array()])
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearStoreProductsInvalidRewrites (int $storeId, [int|array|null $productId = null])
Mage_Catalog_Model_Resource_Eav_Mysql4_Url deleteCategoryProductStoreRewrites (int $categoryId, [array|int|null $productIds = null], [null|int $storeId = null])
void deleteRewrite (string $requestPath, int $storeId)
string findFinalTargetPath (string $requestPath, int $storeId, [ &$_checkedPaths = array()], array $_checkedPaths)
array getCategories (int|array $categoryIds, int $storeId)
Varien_Object getCategory (int $categoryId, int $storeId)
string getCategoryParentPath ( $category)
Varien_Object getProduct (int $productId, int $storeId)
array getProductIdsByCategory (Varien_Object|int $category)
array getProductsByCategory ( $category,  &$lastEntityId, int $lastEntityId)
array getProductsByStore (int $storeId,  &$lastEntityId, int $lastEntityId)
Varien_Object getRewriteByIdPath (string $idPath,  $storeId)
array getRewriteByProductStore ( $products)
Varien_Object getRewriteByRequestPath (string $requestPath,  $storeId)
Varien_Object getRootChildrenIds ( $categoryId,  $categoryPath, [ $includeStart = true], Varien_Object $category)
Mage_Core_Model_Store|array getStores ([int $storeId = null])
Varien_Object loadCategoryChilds ( $category)
array prepareRewrites (int $storeId, [int|array $categoryIds = null], [int|array $productIds = null])
Mage_Catalog_Model_Resource_Eav_Mysql4_Url saveRewrite (array $rewriteData,  $rewrite, Varien_Object $rewriteObject)
void saveRewriteHistory ( $rewriteData)
void _construct ()
array _getCategories (int|array $categoryIds, [int $storeId = null], [string $path = null])
array _getCategoryAttribute (string $attributeCode, int|array $categoryIds, int $storeId)
array _getProductAttribute (string $attributeCode, int|array $productIds, string $storeId)
array _getProducts ([int|array $productIds = null], int $storeId, [int $entityId = 0],  &$lastEntityId, int $lastEntityId)
array _prepareStoreRootCategories (array $stores)
Variables
array $_categoryAttributes = array() (line 48)

Category attribute properties cache

  • access: protected
array $_productAttributes = array() (line 55)

Product attribute properties cache

  • access: protected
int $_productLimit = 250 (line 62)

Limit products for select

  • access: protected
array $_rootChildrenIds = array() (line 69)

Cache of root category children ids

  • access: protected
array $_stores (line 41)

Stores configuration array

  • access: protected

Inherited Variables

Inherited from Mage_Core_Model_Mysql4_Abstract

Mage_Core_Model_Mysql4_Abstract::$_connections
Mage_Core_Model_Mysql4_Abstract::$_fieldsForUpdate
Mage_Core_Model_Mysql4_Abstract::$_idFieldName
Mage_Core_Model_Mysql4_Abstract::$_isPkAutoIncrement
Mage_Core_Model_Mysql4_Abstract::$_mainTable
Mage_Core_Model_Mysql4_Abstract::$_mainTableFields
Mage_Core_Model_Mysql4_Abstract::$_resourceModel
Mage_Core_Model_Mysql4_Abstract::$_resourcePrefix
Mage_Core_Model_Mysql4_Abstract::$_resources
Mage_Core_Model_Mysql4_Abstract::$_serializableFields
Mage_Core_Model_Mysql4_Abstract::$_tables
Mage_Core_Model_Mysql4_Abstract::$_uniqueFields
Mage_Core_Model_Mysql4_Abstract::$_useIsObjectNew

Inherited from Mage_Core_Model_Resource_Abstract

Mage_Core_Model_Resource_Abstract::$_commitCallbacks
Methods
checkRequestPaths (line 168)

Validate array of request paths. Return first not used path in case if validations passed

  • return: | string
  • access: public
false checkRequestPaths (array $paths, int $storeId)
  • array $paths
  • int $storeId
clearCategoryProduct (line 976)

Find and remove unused products rewrites - a case when products were moved away from the category (either to other category or deleted), so rewrite "category_id-product_id" is invalid

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearCategoryProduct (int $storeId)
  • int $storeId
clearProductRewrites (line 1013)

Remove unused rewrites for product - called after we created all needed rewrites for product and know the categories where the product is contained ($excludeCategoryIds), so we can remove all invalid product rewrites that have other category ids

Notice: this routine is not identical to clearCategoryProduct(), because after checking all categories this one removes rewrites for product still contained within categories.

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearProductRewrites (int $productId, int $storeId, [array $excludeCategoryIds = array()])
  • int $productId: Product entity Id
  • int $storeId: Store Id for rewrites
  • array $excludeCategoryIds: Array of category Ids that should be skipped
clearStoreCategoriesInvalidRewrites (line 1037)

Finds and deletes all old category and category/product rewrites for store left from the times when categories/products belonged to store

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearStoreCategoriesInvalidRewrites (int $storeId)
  • int $storeId
clearStoreInvalidRewrites (line 1110)

Finds and deletes old rewrites for store a) category rewrites left from the times when store had some other root category b) product rewrites left from products that once belonged to this site, but then deleted or just removed from website

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearStoreInvalidRewrites (int $storeId)
  • int $storeId
clearStoreProductsInvalidRewrites (line 1069)

Finds and deletes product rewrites (that are not assigned to any category) for store left from the times when product was assigned to this store's website and now is not assigned

Notice: this routine is different from clearProductRewrites() and clearCategoryProduct() because it handles direct rewrites to product without defined category (category_id IS NULL) whilst that routines handle only product rewrites within categories

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url clearStoreProductsInvalidRewrites (int $storeId, [int|array|null $productId = null])
  • int $storeId
  • int|array|null $productId
deleteCategoryProductRewrites (line 1124)

Delete rewrites for associated to category products

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url deleteCategoryProductRewrites (int $categoryId, array $productIds)
  • int $categoryId
  • array $productIds
deleteCategoryProductStoreRewrites (line 1138)

Delete URL rewrites for category products of specific store

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url deleteCategoryProductStoreRewrites (int $categoryId, [array|int|null $productIds = null], [null|int $storeId = null])
  • int $categoryId
  • array|int|null $productIds
  • null|int $storeId
deleteRewrite (line 1254)

Delete rewrite path record from the database.

  • access: public
void deleteRewrite (string $requestPath, int $storeId)
  • string $requestPath
  • int $storeId
findFinalTargetPath (line 1223)

Find and return final id path by request path Needed for permanent redirect old URLs.

  • return: | bool
  • access: public
string findFinalTargetPath (string $requestPath, int $storeId, [ &$_checkedPaths = array()], array $_checkedPaths)
  • string $requestPath
  • int $storeId
  • array $_checkedPaths: internal varible to prevent infinite loops.
  • &$_checkedPaths
getCategories (line 730)

Retrieve categories data objects by their ids. Return only categories that belong to specified store.

  • access: public
array getCategories (int|array $categoryIds, int $storeId)
  • int|array $categoryIds
  • int $storeId
getCategory (line 710)

Retrieve category data object

  • access: public
Varien_Object getCategory (int $categoryId, int $storeId)
  • int $categoryId
  • int $storeId
getCategoryModel (line 102)

Retrieve Category model singleton

  • access: public
Mage_Catalog_Model_Category getCategoryModel ()
getCategoryParentPath (line 812)

Retrieve category parent path

  • access: public
string getCategoryParentPath ( $category)
  • Varien_Object $category
getProduct (line 931)

Retrieve Product data object

  • access: public
Varien_Object getProduct (int $productId, int $storeId)
  • int $productId
  • int $storeId
getProductIdsByCategory (line 833)

Retrieve product ids by category

  • access: public
array getProductIdsByCategory (Varien_Object|int $category)
  • Varien_Object|int $category
getProductModel (line 112)

Retrieve product model singleton

  • access: public
Mage_Catalog_Model_Product getProductModel ()
getProductsByCategory (line 960)

Retrieve Product data objects in category

  • access: public
array getProductsByCategory ( $category,  &$lastEntityId, int $lastEntityId)
  • Varien_Object $category
  • int $lastEntityId
  • &$lastEntityId
getProductsByStore (line 948)

Retrieve Product data obects for store

  • access: public
array getProductsByStore (int $storeId,  &$lastEntityId, int $lastEntityId)
  • int $storeId
  • int $lastEntityId
  • &$lastEntityId
getRewriteByIdPath (line 123)

Retrieve rewrite by idPath

  • access: public
Varien_Object getRewriteByIdPath (string $idPath,  $storeId)
  • string $idPath
  • $storeId
getRewriteByProductStore (line 1174)

Retrieve rewrites and visibility by store

Input array format: product_id as key and store_id as value

Output array format (product_id as key) store_id int; store id visibility int; visibility for store url_rewrite string; rewrite URL for store

  • access: public
array getRewriteByProductStore ( $products)
  • array $products
getRewriteByRequestPath (line 145)

Retrieve rewrite by requestPath

  • access: public
Varien_Object getRewriteByRequestPath (string $requestPath,  $storeId)
  • string $requestPath
  • $storeId
getRootChildrenIds (line 782)

Retrieves all children ids of root category tree Actually this routine can be used to get children ids of any category, not only root.

But as far as result is cached in memory, it's not recommended to do so.

  • access: public
Varien_Object getRootChildrenIds ( $categoryId,  $categoryPath, [ $includeStart = true], Varien_Object $category)
  • Varien_Object $category
  • $categoryId
  • $categoryPath
  • $includeStart
getStores (line 86)

Retrieve stores array or store model

  • access: public
Mage_Core_Model_Store|array getStores ([int $storeId = null])
  • int $storeId
loadCategoryChilds (line 745)

Retrieve category childs data objects

  • access: public
Varien_Object loadCategoryChilds ( $category)
  • Varien_Object $category
prepareRewrites (line 192)

Prepare rewrites for condition

  • access: public
array prepareRewrites (int $storeId, [int|array $categoryIds = null], [int|array $productIds = null])
  • int $storeId
  • int|array $categoryIds
  • int|array $productIds
saveCategoryAttribute (line 304)

Save category attribute

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url saveCategoryAttribute ( $category, string $attributeCode)
  • Varien_Object $category
  • string $attributeCode
saveProductAttribute (line 445)

Save product attribute

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url saveProductAttribute ( $product, string $attributeCode)
  • Varien_Object $product
  • string $attributeCode
saveRewrite (line 248)

Save rewrite URL

  • access: public
Mage_Catalog_Model_Resource_Eav_Mysql4_Url saveRewrite (array $rewriteData,  $rewrite, Varien_Object $rewriteObject)
  • array $rewriteData
  • Varien_Object $rewriteObject
  • $rewrite
saveRewriteHistory (line 284)
  • access: public
void saveRewriteHistory ( $rewriteData)
  • $rewriteData
_construct (line 75)

Load core Url rewrite model

  • access: protected
void _construct ()

Redefinition of:
Mage_Core_Model_Resource_Abstract::_construct()
Resource initialization
_getCategories (line 628)

Retrieve categories objects Either $categoryIds or $path (with ending slash) must be specified

  • access: protected
array _getCategories (int|array $categoryIds, [int $storeId = null], [string $path = null])
  • int|array $categoryIds
  • int $storeId
  • string $path
_getCategoryAttribute (line 375)

Retrieve category attributes

  • access: protected
array _getCategoryAttribute (string $attributeCode, int|array $categoryIds, int $storeId)
  • string $attributeCode
  • int|array $categoryIds
  • int $storeId
_getProductAttribute (line 516)

Retrieve product attribute

  • access: public
array _getProductAttribute (string $attributeCode, int|array $productIds, string $storeId)
  • string $attributeCode
  • int|array $productIds
  • string $storeId
_getProducts (line 863)

Retrieve Product data objects

  • access: protected
array _getProducts ([int|array $productIds = null], int $storeId, [int $entityId = 0],  &$lastEntityId, int $lastEntityId)
  • int|array $productIds
  • int $storeId
  • int $entityId
  • int $lastEntityId
  • &$lastEntityId
_prepareCategoryParentId (line 578)

Prepare category parentId

  • access: protected
Mage_Catalog_Model_Resource_Eav_Mysql4_Url _prepareCategoryParentId ( $category)
  • Varien_Object $category
_prepareStoreRootCategories (line 596)

Prepare stores root categories

  • access: protected
array _prepareStoreRootCategories (array $stores)
  • array $stores

Inherited Methods

Inherited From Mage_Core_Model_Mysql4_Abstract

Mage_Core_Model_Mysql4_Abstract::addUniqueField()
Mage_Core_Model_Mysql4_Abstract::afterLoad()
Mage_Core_Model_Mysql4_Abstract::delete()
Mage_Core_Model_Mysql4_Abstract::forsedSave()
Mage_Core_Model_Mysql4_Abstract::getChecksum()
Mage_Core_Model_Mysql4_Abstract::getIdFieldName()
Mage_Core_Model_Mysql4_Abstract::getMainTable()
Mage_Core_Model_Mysql4_Abstract::getReadConnection()
Mage_Core_Model_Mysql4_Abstract::getTable()
Mage_Core_Model_Mysql4_Abstract::getUniqueFields()
Mage_Core_Model_Mysql4_Abstract::getValueTable()
Mage_Core_Model_Mysql4_Abstract::hasDataChanged()
Mage_Core_Model_Mysql4_Abstract::load()
Mage_Core_Model_Mysql4_Abstract::resetUniqueField()
Mage_Core_Model_Mysql4_Abstract::save()
Mage_Core_Model_Mysql4_Abstract::unserializeFields()
Mage_Core_Model_Mysql4_Abstract::_afterDelete()
Mage_Core_Model_Mysql4_Abstract::_afterLoad()
Mage_Core_Model_Mysql4_Abstract::_afterSave()
Mage_Core_Model_Mysql4_Abstract::_beforeDelete()
Mage_Core_Model_Mysql4_Abstract::_beforeSave()
Mage_Core_Model_Mysql4_Abstract::_checkUnique()
Mage_Core_Model_Mysql4_Abstract::_getConnection()
Mage_Core_Model_Mysql4_Abstract::_getLoadSelect()
Mage_Core_Model_Mysql4_Abstract::_getReadAdapter()
Mage_Core_Model_Mysql4_Abstract::_getWriteAdapter()
Mage_Core_Model_Mysql4_Abstract::_init()
Mage_Core_Model_Mysql4_Abstract::_initUniqueFields()
Mage_Core_Model_Mysql4_Abstract::_prepareDataForSave()
Mage_Core_Model_Mysql4_Abstract::_prepareDataForTable()
Mage_Core_Model_Mysql4_Abstract::_prepareValueForSave()
Mage_Core_Model_Mysql4_Abstract::_serializeFields()
Mage_Core_Model_Mysql4_Abstract::_setMainTable()
Mage_Core_Model_Mysql4_Abstract::_setResource()

Inherited From Mage_Core_Model_Resource_Abstract

Mage_Core_Model_Resource_Abstract::__construct()
Mage_Core_Model_Resource_Abstract::addCommitCallback()
Mage_Core_Model_Resource_Abstract::beginTransaction()
Mage_Core_Model_Resource_Abstract::commit()
Mage_Core_Model_Resource_Abstract::formatDate()
Mage_Core_Model_Resource_Abstract::mktime()
Mage_Core_Model_Resource_Abstract::rollBack()
Mage_Core_Model_Resource_Abstract::_construct()
Mage_Core_Model_Resource_Abstract::_getReadAdapter()
Mage_Core_Model_Resource_Abstract::_getWriteAdapter()
Mage_Core_Model_Resource_Abstract::_serializeField()
Mage_Core_Model_Resource_Abstract::_unserializeField()
Class Constants

Documentation generated on Fri, 11 Feb 2011 17:15:29 +0200 by phpDocumentor 1.4.3