Class Mage_Catalog_Model_Url

Description

Catalog url model

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


	
			
Class Constant Summary
Variable Summary
Method Summary
string generatePath ([string $type = 'target'], [Varien_Object $product = null], [Varien_Object $category = null], [string $parentPath = null])
string getCategoryUrlSuffix (int $storeId)
string getProductRequestPath (Varien_Object $product, Varien_Object $category)
string getProductUrlSuffix (int $storeId)
bool getShouldSaveRewritesHistory ([int $storeId = null])
Varien_Object getStoreRootCategory ( $storeId)
Mage_Core_Model_Store|array getStores ([int $storeId = null])
string getUnusedPath (int $storeId, string $requestPath, string $idPath)
Mage_Catalog_Model_Url refreshCategoryRewrite (int $categoryId, [int|null $storeId = null], [bool $refreshProducts = true])
Mage_Catalog_Model_Url refreshProductRewrite (int $productId, [int|null $storeId = null])
Mage_Catalog_Model_Url refreshRewrites ([int $storeId = null])
void _addCategoryUrlPath (Varien_Object $category)
Mage_Catalog_Model_Url _refreshCategoryRewrites ( $category, [string $parentPath = null], [ $refreshProducts = true])
Mage_Catalog_Model_Url _saveRewriteHistory (array $rewriteData, Varien_Object $rewrite)
Variables
static Mage_Catalog_Model_Category $_categoryForUrlPath (line 112)

Singleton of category model for building URL path

  • access: protected
array $_categories = array() (line 63)

Categories cache for products

  • access: protected
array $_categoryUrlSuffix = array() (line 98)

Cache for category rewrite suffix

  • access: protected
array $_productUrlSuffix = array() (line 91)

Cache for product rewrite suffix

  • access: protected
Mage_Catalog_Model_Resource_Eav_Mysql4_Url $_resourceModel (line 56)

Resource model

  • access: protected
Varien_Object $_rewrite (line 84)

Current url rewrite rule

  • access: protected
array $_rewrites = array() (line 77)

Rewrite cache

  • access: protected
array $_rootCategories = array() (line 70)

Store root categories cache

  • access: protected
bool $_saveRewritesHistory = null (line 105)

Flag to overwrite config settings for Catalog URL rewrites history maintainance

  • access: protected
Methods
clearStoreInvalidRewrites (line 580)

Deletes old rewrites for store, left from the times when store had some other root category

  • access: public
Mage_Catalog_Model_Url clearStoreInvalidRewrites ([int $storeId = null])
  • int $storeId
generatePath (line 768)

Generate either id path, request path or target path for product and/or category

For generating id or system path, either product or category is required For generating request path - category is required $parentPath used only for generating category path

  • throws: Mage_Core_Exception
  • access: public
string generatePath ([string $type = 'target'], [Varien_Object $product = null], [Varien_Object $category = null], [string $parentPath = null])
  • string $type
  • Varien_Object $product
  • Varien_Object $category
  • string $parentPath
generateUniqueIdPath (line 851)

Return unique string based on the time in microseconds.

  • access: public
string generateUniqueIdPath ()
getCategoryModel (line 175)

Retrieve Category model singleton

  • access: public
Mage_Catalog_Model_Category getCategoryModel ()
getCategoryUrlSuffix (line 669)

Retrieve category rewrite sufix for store

  • access: public
string getCategoryUrlSuffix (int $storeId)
  • int $storeId
getProductModel (line 185)

Retrieve product model singleton

  • access: public
Mage_Catalog_Model_Product getProductModel ()
getProductRequestPath (line 681)

Get unique product request path

  • access: public
string getProductRequestPath (Varien_Object $product, Varien_Object $category)
  • Varien_Object $product
  • Varien_Object $category
getProductUrlSuffix (line 658)

Retrieve product rewrite sufix for store

  • access: public
string getProductUrlSuffix (int $storeId)
  • int $storeId
getResource (line 162)

Retrieve resource model

  • access: public
getShouldSaveRewritesHistory (line 226)

Indicate whether to save URL Rewrite History or not (create redirects to old URLs)

  • access: public
bool getShouldSaveRewritesHistory ([int $storeId = null])
  • int $storeId: Store View
getStoreRootCategory (line 195)

Returns store root category, uses caching for it

  • access: public
Varien_Object getStoreRootCategory ( $storeId)
  • $storeId
getStores (line 152)

Retrieve stores array or store model

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

Get requestPath that was not used yet.

Will try to get unique path by adding -1 -2 etc. between url_key and optional url_suffix

  • access: public
string getUnusedPath (int $storeId, string $requestPath, string $idPath)
  • int $storeId
  • string $requestPath
  • string $idPath
refreshCategoryRewrite (line 431)

Refresh category and childs rewrites Called when reindexing all rewrites and as a reaction on category change that affects rewrites

  • access: public
Mage_Catalog_Model_Url refreshCategoryRewrite (int $categoryId, [int|null $storeId = null], [bool $refreshProducts = true])
  • int $categoryId
  • int|null $storeId
  • bool $refreshProducts
refreshProductRewrite (line 468)

Refresh product rewrite urls for one store or all stores Called as a reaction on product change that affects rewrites

  • access: public
Mage_Catalog_Model_Url refreshProductRewrite (int $productId, [int|null $storeId = null])
  • int $productId
  • int|null $storeId
refreshProductRewrites (line 520)

Refresh all product rewrites for designated store

  • access: public
Mage_Catalog_Model_Url refreshProductRewrites (int $storeId)
  • int $storeId
refreshRewrites (line 241)

Refresh all rewrite urls for some store or for all stores Used to make full reindexing of url rewrites

  • access: public
Mage_Catalog_Model_Url refreshRewrites ([int $storeId = null])
  • int $storeId
setShouldSaveRewritesHistory (line 214)

Setter for $_saveRewritesHistory Force Rewrites History save bypass config settings

  • access: public
Mage_Catalog_Model_Url setShouldSaveRewritesHistory ( $flag)
  • $flag
_addCategoryUrlPath (line 123)

Adds url_path property for non-root category - to ensure that url path is not empty.

Sometimes attribute 'url_path' can be empty, because url_path hasn't been generated yet, in this case category is loaded with empty url_path and we should generate it manually.

  • access: protected
void _addCategoryUrlPath (Varien_Object $category)
  • Varien_Object $category
_refreshCategoryProductRewrites (line 386)

Refresh products for catwgory

  • access: protected
Mage_Catalog_Model_Url _refreshCategoryProductRewrites ( $category)
  • Varien_Object $category
_refreshCategoryRewrites (line 265)

Refresh category rewrite

  • access: protected
Mage_Catalog_Model_Url _refreshCategoryRewrites ( $category, [string $parentPath = null], [ $refreshProducts = true])
  • Varien_Object $category
  • string $parentPath
  • $refreshProducts
_refreshProductRewrite (line 329)

Refresh product rewrite

  • access: protected
Mage_Catalog_Model_Url _refreshProductRewrite ( $product,  $category)
  • Varien_Object $product
  • Varien_Object $category
_saveRewriteHistory (line 864)

Create Custom URL Rewrite for old product/category URL after url_key changed It will perform permanent redirect from old URL to new URL

  • access: protected
Mage_Catalog_Model_Url _saveRewriteHistory (array $rewriteData, Varien_Object $rewrite)
  • array $rewriteData: New rewrite data
  • Varien_Object $rewrite: Rewrite model
Class Constants
ALLOWED_REQUEST_PATH_OVERFLOW = 10 (line 49)

Number of characters allowed to be in URL path after MAX_REQUEST_PATH_LENGTH number of characters

MAX_REQUEST_PATH_LENGTH = 240 (line 41)

Number of characters allowed to be in URL path

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