当前位置: 首页>>代码示例>>PHP>>正文


PHP VF_Singleton::getInstance方法代码示例

本文整理汇总了PHP中VF_Singleton::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP VF_Singleton::getInstance方法的具体用法?PHP VF_Singleton::getInstance怎么用?PHP VF_Singleton::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VF_Singleton的用法示例。


在下文中一共展示了VF_Singleton::getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: doSetUp

 function doSetUp()
 {
     $this->switchSchema('make,model,year');
     $this->expectedDefinition = $this->createMMY();
     $this->setRequestParams($this->expectedDefinition->toValueArray());
     $this->sitemap = new Elite_Vafsitemap_Model_Sitemap_Product_Sub(VF_Singleton::getInstance()->getConfig());
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:HtmlTest.php

示例2: testCount1

 function testCount1()
 {
     $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(VF_Singleton::getInstance()->getConfig());
     $vehicle = $this->createMMTC();
     $this->insertMappingMMTC($vehicle);
     $this->assertEquals(1, $sitemap->vehicleCount());
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:CountMMTCTest.php

示例3: indexAction

 function indexAction()
 {
     if (!VF_Singleton::getInstance()->getConfig()->seo->htmlSitemap) {
         return;
     }
     $this->loadLayoutAndBlock();
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:ProductController.php

示例4: listAction

 function listAction()
 {
     $helper = VF_Singleton::getInstance();
     $helper->setRequest($this->getRequest());
     $helper->storeFitInSession();
     if (!$helper->vehicleSelection() || !$helper->getProductIds()) {
         return $this->redirectToHomePage();
     }
     $this->myLoadLayout();
     switch (VF_Singleton::getInstance()->getConfig()->homepagesearch->mode) {
         case 'grid':
             // set in layout.xml
             break;
         default:
         case 'group':
             // unset the grid block added from layout.xml
             $this->getLayout()->getBlock('content')->unsetChild('vaf_products');
             $block = $this->createBlock('vaf/product_result_group', 'vaf_products');
             $this->appendBlock($block);
             break;
         case 'category':
             // unset the grid block added from layout.xml
             $this->getLayout()->getBlock('content')->unsetChild('vaf_products');
             $block = $this->createBlock('vaf/product_result_group2', 'vaf_products');
             $this->appendBlock($block);
             break;
         case 'group3':
             // unset the grid block added from layout.xml
             $this->getLayout()->getBlock('content')->unsetChild('vaf_products');
             $block = $this->createBlock('vaf/product_result_group3', 'vaf_products');
             $this->appendBlock($block);
             break;
     }
     $this->renderLayout();
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:35,代码来源:ProductController.php

示例5: testGetProductIDsWithSpace

 function testGetProductIDsWithSpace()
 {
     $vehicle2 = $this->createMMY('Ford', 'F 150', '2000');
     $this->insertMappingMMY($vehicle2, 2);
     $this->setRequestParams($vehicle2->toTitleArray());
     $this->assertEquals(array(2), VF_Singleton::getInstance()->getProductIds());
 }
开发者ID:vehiclefits,项目名称:library,代码行数:7,代码来源:FitAlphaTest.php

示例6: testDefinitionsMMY

 function testDefinitionsMMY()
 {
     $sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(VF_Singleton::getInstance()->getConfig());
     $vehicles = $sitemap->getDefinitions(10);
     $this->assertTrue($vehicles[0] instanceof VF_Vehicle);
     $this->assertNotEquals(0, (int) $vehicles[0]->getLevel('year')->getId());
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:DefinitionMMYTest.php

示例7: getConfig

 function getConfig()
 {
     if (!$this->config instanceof Zend_Config) {
         $this->config = VF_Singleton::getInstance()->getConfig();
     }
     return $this->config;
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:Category.php

示例8: block

 protected function block($config = array(), $request)
 {
     $block = new Elite_Vaf_Block_Search_SubmitTestSub();
     $block->setConfig($this->config($config));
     VF_Singleton::getInstance()->setRequest($request);
     return $block;
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:SubmitActionPerCategoryTest.php

示例9: testShouldCreateSchemaOverCommandLine

 function testShouldCreateSchemaOverCommandLine()
 {
     $command = __DIR__ . '/vf schema --force --levels="year,make,model"';
     exec($command);
     $schema = VF_Singleton::getInstance()->schema();
     $this->assertEquals(array('year', 'make', 'model'), $schema->getLevels(), 'should create default schema of MMY');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:7,代码来源:schemaTest.php

示例10: getSelections

 function getSelections()
 {
     $startTime = time();
     $vehicle = VF_Singleton::getInstance()->vehicleSelection();
     if (Mage::app()->getStore()->isAdmin()) {
         return $this->getData('selections');
     }
     if (!$this->superProductFits($vehicle)) {
         return $this->getData('selections');
     }
     $selections = $this->getData('selections');
     if (!$selections) {
         return;
     }
     if ($vehicle && $vehicle->getLeafValue()) {
         $productIds = VF_Singleton::getInstance()->getProductIds();
         $return = array();
         foreach ($selections as $product) {
             if (in_array($product->getId(), $productIds)) {
                 array_push($return, $product);
             }
         }
         return $return;
     }
     $endTime = time();
     var_dump($endTime - $startTime);
     exit;
     return $selections;
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:29,代码来源:Option.php

示例11: testShouldClearFromSession

 function testShouldClearFromSession()
 {
     $flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_stud_spread' => '114.3'));
     VF_Singleton::getInstance()->storeFitInSession();
     $flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_stud_spread' => '0'));
     VF_Singleton::getInstance()->storeFitInSession();
     $this->assertNull($this->flexibleWheeladapterSearch()->wheelSideStudSpread(), 'should clear wheel side stud spread from session');
 }
开发者ID:ngagestudios,项目名称:Vehicle-Fits-Magento,代码行数:8,代码来源:WheelSideSpreadTest.php

示例12: getSchema

 function getSchema()
 {
     $schema = VF_Singleton::getInstance()->schema();
     if (!is_null($this->getConfig())) {
         $schema->setConfig($this->getConfig());
     }
     return $schema;
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:8,代码来源:Slug.php

示例13: testShouldClearFromSession

 function testShouldClearFromSession()
 {
     $flexibleSearch = $this->flexibleWheelSearch(array('stud_spread' => '5'));
     VF_Singleton::getInstance()->storeFitInSession();
     $flexibleSearch = $this->flexibleWheelSearch(array('stud_spread' => '0'));
     VF_Singleton::getInstance()->storeFitInSession();
     $this->assertEquals(0, $this->flexibleWheelSearch()->studSpread(), 'should clear stud spread from session');
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:8,代码来源:StudSpreadTest.php

示例14: testShouldClearFromSession

 function testShouldClearFromSession()
 {
     $flexibleSearch = $this->flexibleTireSearch(array('section_width' => '205', 'aspect_ratio' => '55', 'diameter' => '16'));
     VF_Singleton::getInstance()->storeFitInSession();
     $flexibleSearch = $this->flexibleTireSearch(array('section_width' => '0', 'aspect_ratio' => '0', 'diameter' => '0'));
     VF_Singleton::getInstance()->storeFitInSession();
     $this->assertNull($this->flexibleTireSearch()->diameter(), 'should clear diameter from session');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:8,代码来源:DiameterTest.php

示例15: testShouldClearFromSession

 function testShouldClearFromSession()
 {
     $flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_lug_count' => '5'));
     VF_Singleton::getInstance()->storeFitInSession();
     $flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_lug_count' => '0'));
     VF_Singleton::getInstance()->storeFitInSession();
     $this->assertNull($this->flexibleWheeladapterSearch()->wheelSideLugCount(), 'should clear wheel side lug count from session');
 }
开发者ID:ngagestudios,项目名称:Vehicle-Fits-Magento,代码行数:8,代码来源:WheelSideLugCountTest.php


注:本文中的VF_Singleton::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。