2020 * @category Mage
2121 * @package Mage_Catalog
2222 */
23- class Mage_Catalog_Model_Product_Url extends Varien_Object
23+ class Mage_Catalog_Model_Product_Url extends Mage_Catalog_Model_Url
2424{
2525 public const CACHE_TAG = 'url_rewrite ' ;
2626
27- /**
28- * URL instance
29- *
30- * @var Mage_Core_Model_Url
31- */
32- protected $ _url ;
33-
34- /**
35- * URL Rewrite Instance
36- *
37- * @var Mage_Core_Model_Url_Rewrite
38- */
39- protected $ _urlRewrite ;
40-
41- /**
42- * Factory instance
43- *
44- * @var Mage_Catalog_Model_Factory
45- */
46- protected $ _factory ;
47-
4827 /**
4928 * @var Mage_Core_Model_Store
5029 */
@@ -59,32 +38,6 @@ public function __construct(array $args = [])
5938 $ this ->_store = !empty ($ args ['store ' ]) ? $ args ['store ' ] : Mage::app ()->getStore ();
6039 }
6140
62- /**
63- * Retrieve URL Instance
64- *
65- * @return Mage_Core_Model_Url
66- */
67- public function getUrlInstance ()
68- {
69- if ($ this ->_url === null ) {
70- $ this ->_url = Mage::getModel ('core/url ' );
71- }
72- return $ this ->_url ;
73- }
74-
75- /**
76- * Retrieve URL Rewrite Instance
77- *
78- * @return Mage_Core_Model_Url_Rewrite
79- */
80- public function getUrlRewrite ()
81- {
82- if ($ this ->_urlRewrite === null ) {
83- $ this ->_urlRewrite = $ this ->_factory ->getUrlRewriteInstance ();
84- }
85- return $ this ->_urlRewrite ;
86- }
87-
8841 /**
8942 * 'no_selection' shouldn't be a valid image attribute value
9043 *
@@ -132,21 +85,6 @@ public function getProductUrl($product, $useSid = null)
13285 return $ this ->getUrl ($ product , $ params );
13386 }
13487
135- /**
136- * Format Key for URL
137- *
138- * @param string $str
139- * @return string
140- */
141- public function formatUrlKey ($ str )
142- {
143- $ urlKey = preg_replace ('#[^0-9a-z]+#i ' , '- ' , Mage::helper ('catalog/product_url ' )->format ($ str ));
144- $ urlKey = strtolower ($ urlKey );
145- $ urlKey = trim ($ urlKey , '- ' );
146-
147- return $ urlKey ;
148- }
149-
15088 /**
15189 * Retrieve Product Url path (with category if exists)
15290 *
@@ -281,7 +219,6 @@ protected function _getRequestPath($product, $categoryId)
281219 if ($ rewrite ->getId ()) {
282220 return $ rewrite ->getRequestPath ();
283221 }
284-
285222 return false ;
286223 }
287224}
0 commit comments