本文整理汇总了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());
}
示例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());
}
示例3: indexAction
function indexAction()
{
if (!VF_Singleton::getInstance()->getConfig()->seo->htmlSitemap) {
return;
}
$this->loadLayoutAndBlock();
}
示例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();
}
示例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());
}
示例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());
}
示例7: getConfig
function getConfig()
{
if (!$this->config instanceof Zend_Config) {
$this->config = VF_Singleton::getInstance()->getConfig();
}
return $this->config;
}
示例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;
}
示例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');
}
示例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;
}
示例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');
}
示例12: getSchema
function getSchema()
{
$schema = VF_Singleton::getInstance()->schema();
if (!is_null($this->getConfig())) {
$schema->setConfig($this->getConfig());
}
return $schema;
}
示例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');
}
示例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');
}
示例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');
}