當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Varien_Object::getIdentifier方法代碼示例

本文整理匯總了PHP中Varien_Object::getIdentifier方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Object::getIdentifier方法的具體用法?PHP Varien_Object::getIdentifier怎麽用?PHP Varien_Object::getIdentifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Varien_Object的用法示例。


在下文中一共展示了Varien_Object::getIdentifier方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initControllerRouters

 /**
  *
  */
 public function initControllerRouters($observer)
 {
     $request = $observer->getEvent()->getFront()->getRequest();
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('brand_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $route = trim(Mage::getStoreConfig('ves_brand/general_setting/route'));
     if ($identifier) {
         if (preg_match("#^" . $route . "(\\.html)?\$#", $identifier, $match)) {
             $request->setModuleName('venusbrand')->setControllerName('brand')->setActionName('index');
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         }
         return true;
     }
     return false;
 }
開發者ID:booklein,項目名稱:bookle,代碼行數:29,代碼來源:Observer.php

示例2: match

 /**
  * Validate and Match Cms Page and modify request
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  *
  * @SuppressWarnings(PHPMD.ExitExpression)
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('cms_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return Mage::getControllerInstance('Mage_Core_Controller_Varien_Action_Forward', $request, Mage::app()->getFrontController()->getResponse());
     }
     if (!$condition->getContinue()) {
         return null;
     }
     $page = Mage::getModel('Mage_Cms_Model_Page');
     $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());
     if (!$pageId) {
         return null;
     }
     $request->setModuleName('cms')->setControllerName('page')->setActionName('view')->setParam('page_id', $pageId);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return Mage::getControllerInstance('Mage_Core_Controller_Varien_Action_Forward', $request, Mage::app()->getFrontController()->getResponse());
 }
開發者ID:nemphys,項目名稱:magento2,代碼行數:35,代碼來源:Router.php

示例3: render

 public function render(Varien_Object $row)
 {
     // Get the bank's identifier value
     $bankid = $row->getIdentifier();
     // Match this to M2E Pro's Ebay identifiers (stop searching if one is found)
     $orders = Mage::getModel('M2ePro/ebay_order')->getCollection();
     foreach ($orders as $order) {
         // See if the bank's identifier matches an Ebay identifier
         if ($bankid == $order->getData('ebay_order_id')) {
             // Return the normal Magento order ID
             $order_id = $order->getData('order_id');
             $magento_order_id = Mage::getModel('M2ePro/order')->load($order_id)->getMagentoOrderId();
             return Mage::getModel('sales/order')->load($magento_order_id)->getIncrementId();
         }
     }
     // Match this to M2E Pro's Amazon identifiers (stop searching if one is found)
     $orders = Mage::getModel('M2ePro/amazon_order')->getCollection();
     foreach ($orders as $order) {
         // See if the bank's identifier matches an Amazon identifier
         if ($bankid == $order->getData('amazon_order_id')) {
             // Return the normal Magento order ID
             $order_id = $order->getData('order_id');
             $magento_order_id = Mage::getModel('M2ePro/order')->load($order_id)->getMagentoOrderId();
             return Mage::getModel('sales/order')->load($magento_order_id)->getIncrementId();
         }
     }
     // Could not find a match, return nothing
     return "(not translated)";
 }
開發者ID:tonkberlin,項目名稱:bank-integration,代碼行數:29,代碼來源:Translater.php

示例4: match

 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('magicproduct_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     if (!in_array($identifier, $this->router)) {
         return false;
     }
     $request->setModuleName('magicproduct')->setControllerName('index')->setActionName('product')->setParam('type', $identifier);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return true;
 }
開發者ID:uibar,項目名稱:laviniailies2,代碼行數:25,代碼來源:Router.php

示例5: initControllerRouters

 /**
  *
  */
 public function initControllerRouters($observer)
 {
     Mage::getSingleton('core/session', array('name' => 'adminhtml'));
     if (!is_null(Mage::registry("_singleton/admin/session"))) {
         if (Mage::getSingleton('admin/session')->isLoggedIn()) {
             /*Is admin*/
             //do stuff
             return;
         }
     }
     $request = $observer->getEvent()->getFront()->getRequest();
     if (!Mage::app()->isInstalled()) {
         /*
         Mage::app()->getFrontController()->getResponse()
             ->setRedirect(Mage::getUrl('install'))
             ->sendResponse();
         */
         return;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('blog_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     $identifier = trim($identifier, "/");
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $route = trim(Mage::getStoreConfig('ves_blog/general_setting/route'));
     if ($identifier) {
         if (preg_match("#^" . $route . "(\\.html)?\$#", $identifier, $match)) {
             $request->setModuleName('venusblog')->setControllerName('index')->setActionName('index');
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         } elseif (str_replace('/rss', '', str_replace($route, '', $identifier)) == '') {
             $request->setModuleName('venusblog')->setControllerName('rss')->setActionName('index');
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         } elseif (preg_match("#" . $route . "/tag/(\\w+)\\.?#", $identifier, $match)) {
             if (count($match) <= 1) {
                 return false;
             }
             $request->setModuleName('venusblog')->setControllerName('list')->setActionName('show')->setParam("tag", $match[1]);
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         } elseif (preg_match("#" . $route . "/archive/(\\w+)\\.?#", $identifier, $match)) {
             if (count($match) <= 1) {
                 return false;
             }
             $request->setModuleName('venusblog')->setControllerName('list')->setActionName('show')->setParam("archive", $match[1]);
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         }
     }
     return false;
 }
開發者ID:booklein,項目名稱:bookle,代碼行數:63,代碼來源:Observer.php

示例6: match

 /**
  * Validate and Match Manufacturer Page and modify request
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     if (!Mage::isInstalled()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('install'))->sendResponse();
         exit;
     }
     $router = 'manufacturers';
     $identifier = trim(str_replace('/manufacturers/', '', $request->getPathInfo()), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('manufacturer_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $manufacturer = Mage::getModel('zeon_manufacturer/manufacturer');
     $manufacturerId = $manufacturer->checkIdentifier($identifier, Mage::app()->getStore()->getId());
     if (trim($identifier) && $manufacturerId) {
         $request->setModuleName('manufacturers')->setControllerName('index')->setActionName('view')->setParam('manufacturer_id', $manufacturerId);
         $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $router . '/' . $identifier);
         return true;
     }
     return false;
 }
開發者ID:perseusl,項目名稱:kingdavid,代碼行數:34,代碼來源:Router.php

示例7: render

 public function render(Varien_Object $row)
 {
     Mage::dispatchEvent('adminhtml_cms_page_grid_renderer_action_before_render', array('row' => $row));
     if ($row->getPreviewUrl()) {
         $href = $row->getPreviewUrl();
     } else {
         $urlModel = Mage::getModel('core/url')->setStore($row->getData('_first_store_id'));
         $href = $urlModel->getUrl($row->getIdentifier(), array('_current' => false, '_query' => '___store=' . $row->getStoreCode()));
     }
     return '<a href="' . $href . '" target="_blank">' . $this->__('Preview') . '</a>';
 }
開發者ID:cewolf2002,項目名稱:magento,代碼行數:11,代碼來源:Action.php

示例8: render

 public function render(Varien_Object $row)
 {
     $SelectedEntityIdGrid = Mage::registry('SelectedEntityIdGrid');
     if ($SelectedEntityIdGrid) {
         $is_checked = isset($SelectedEntityIdGrid[$row->getIdentifier()]);
     } else {
         $is_checked = (int) Mage::app()->getRequest()->getParam('theme_id') == (int) Mage::helper('thememanager')->getCmsPageConfigByEntity($row);
     }
     return '<input class="massaction-checkbox" ' . ($is_checked ? 'checked="checked"' : '') . ' type="checkbox" value="' . $row->getIdentifier() . '" name="__CheckedCmsPages[]">
             <input type="hidden" value="' . $row->getIdentifier() . '" name="__CheckCmsPagesList[]">';
 }
開發者ID:kiutisuperking,項目名稱:eatsmartboxdev,代碼行數:11,代碼來源:Meigee_Thememanager_Block_Adminhtml_Options_Tabs_CmsPageTable_EntityIdGrid.php

示例9: clearPageCache

 /**
  * @param Varien_Object $page
  * @return $this
  */
 public function clearPageCache(Varien_Object $page)
 {
     if ($page->getId()) {
         foreach (Mage::app()->getStores() as $store) {
             $identifier = $page->getIdentifier();
             if (empty($identifier)) {
                 $this->clearCacheItem(FPC_HOME_FILENAME, $store);
             } else {
                 $this->clearCacheItem($identifier, $store);
             }
         }
     }
     return $this;
 }
開發者ID:technomagegithub,項目名稱:inmed-magento,代碼行數:18,代碼來源:Data.php

示例10: initControllerRouters

 public function initControllerRouters($observer)
 {
     if (!Mage::app()->getStore()->isAdmin()) {
         Mage::getSingleton('core/session', array('name' => 'adminhtml'));
         if (!is_null(Mage::registry("_singleton/admin/session"))) {
             if (Mage::getSingleton('admin/session')->isLoggedIn()) {
                 /*Is admin*/
                 return;
             }
         }
         $request = $observer->getEvent()->getFront()->getRequest();
         if (!Mage::app()->isInstalled()) {
             return;
         }
         $identifier = trim($request->getPathInfo(), '/');
         $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
         Mage::dispatchEvent('productlist_controller_router_match_before', array('router' => $this, 'condition' => $condition));
         $identifier = $condition->getIdentifier();
         $identifier = trim($identifier, "/");
         if ($condition->getRedirectUrl()) {
             Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
             $request->setDispatched(true);
             return true;
         }
         if (!$condition->getContinue()) {
             return false;
         }
         if ($identifier) {
             $identifier = str_replace('.html', '', $identifier);
             $idarray = explode('/', $identifier);
             $rule = Mage::getModel('productlist/rule')->getCollection()->addFieldToFilter('identifier', $identifier)->addStatusFilter()->addDateFilter()->addStoreFilter()->addCustomerGroupFilter()->getFirstItem();
             $data = $rule->getData();
             $show = Mage::getStoreConfig('productlist/general_setting/show');
             if (empty($data) || !$show) {
                 return false;
             }
             $request->setModuleName('productlist')->setControllerName('rule')->setActionName('view')->setParam('id', $rule->getId());
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier . '.html');
             return true;
         }
         return false;
     }
 }
開發者ID:TusharKDonda,項目名稱:maruti,代碼行數:43,代碼來源:Observer.php

示例11: match

 public function match(Zend_Controller_Request_Http $request)
 {
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $page = Mage::getModel('searchlandingpage/page')->checkIdentifier($identifier);
     if (!$page) {
         return false;
     }
     $request->setModuleName('searchlandingpage')->setControllerName('page')->setActionName('view')->setParam('q', $page->getQueryText())->setParam('id', $page->getId());
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return true;
 }
開發者ID:guohuadeng,項目名稱:aototechweb,代碼行數:21,代碼來源:Router.php

示例12: initControllerRouters

 /**
  *
  */
 public function initControllerRouters($observer)
 {
     $request = $observer->getEvent()->getFront()->getRequest();
     if (!Mage::app()->isInstalled()) {
         return;
     }
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('deals_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     $identifier = trim($identifier, "/");
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $route = trim(Mage::getStoreConfig('ves_deals/deals_setting/route'));
     if ($identifier) {
         if (preg_match("#^" . $route . "(\\.html)?\$#", $identifier, $match)) {
             $request->setModuleName('vesdeals')->setControllerName('index')->setActionName('index');
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         } elseif (str_replace('/rss', '', str_replace($route, '', $identifier)) == '') {
             $request->setModuleName('vesdeals')->setControllerName('rss')->setActionName('index');
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         } elseif (preg_match("#" . $route . "/filter/(\\w+)\\.?#", $identifier, $match)) {
             if (count($match) <= 1) {
                 return false;
             }
             $request->setModuleName('vesdeals')->setControllerName('index')->setActionName('index')->setParam("filter", $match[1]);
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         }
     }
     return false;
 }
開發者ID:quanghuynt93,項目名稱:VesSmartshop,代碼行數:43,代碼來源:Observer.php

示例13: render

 public function render(Varien_Object $row)
 {
     $out = '';
     $skipAllStoresLabel = $this->_getShowAllStoresLabelFlag();
     $skipEmptyStoresLabel = $this->_getShowEmptyStoresLabelFlag();
     $origStores = $row->getData($this->getColumn()->getIndex());
     if (is_null($origStores) && $row->getStoreName()) {
         $scopes = array();
         foreach (explode("\n", $row->getStoreName()) as $k => $label) {
             $scopes[] = str_repeat('&nbsp;', $k * 3) . $label;
         }
         $out .= implode('<br/>', $scopes) . $this->__(' [deleted]');
         return $out;
     }
     if (empty($origStores) && !$skipEmptyStoresLabel) {
         return '';
     }
     if (!is_array($origStores)) {
         $origStores = array($origStores);
     }
     if (empty($origStores)) {
         return '';
     } elseif (in_array(0, $origStores) && count($origStores) == 1 && !$skipAllStoresLabel) {
         return Mage::helper('adminhtml')->__('All Store Views');
     }
     $data = $this->_getStoreModel()->getStoresStructure(false, $origStores);
     foreach ($data as $website) {
         $out .= $website['label'] . '<br/>';
         foreach ($website['children'] as $group) {
             $out .= str_repeat('&nbsp;', 3) . $group['label'] . '<br/>';
             foreach ($group['children'] as $store) {
                 $href = Mage::app()->getStore($store['value'])->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . $row->getIdentifier();
                 $out .= str_repeat('&nbsp;', 6) . '<a target="blank" href="' . $href . '">' . $store['label'] . '</a><br/>';
             }
         }
     }
     return $out;
 }
開發者ID:CE-Webmaster,項目名稱:CE-Hub,代碼行數:38,代碼來源:Store.php

示例14: match

 /**
  * Validate and Match News and modify request
  *
  * @param Zend_Controller_Request_Http $request
  * @return bool
  */
 public function match(Zend_Controller_Request_Http $request)
 {
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('magna_news_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $news = Mage::getModel('magna_news/news');
     $newsId = $news->checkIdentifier($identifier, Mage::app()->getStore()->getId());
     if (!$newsId) {
         return false;
     }
     $request->setModuleName('magna_news')->setControllerName('view')->setActionName('show')->setParam('news_id', $newsId);
     $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
     return true;
 }
開發者ID:zmarius81,項目名稱:Magento-News-Module,代碼行數:29,代碼來源:Router.php

示例15: render

 public function render(Varien_Object $row)
 {
     $urlModel = Mage::getModel('core/url')->setStore($row->getData('_first_store_id'));
     $href = $urlModel->getUrl($row->getIdentifier(), array('_current' => false, '_query' => '___store=' . $row->getStoreCode()));
     return '<a href="' . $href . '" target="_blank">' . $this->__('Preview') . '</a>';
 }
開發者ID:okite11,項目名稱:frames21,代碼行數:6,代碼來源:Action.php


注:本文中的Varien_Object::getIdentifier方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。