Created
July 9, 2013 05:08
-
-
Save nclundsten/5954863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
/* | |
* | |
* Option tests below here. | |
* | |
* | |
*/ | |
public function top_level_product_no_options($params) | |
{ | |
extract($params); | |
if ( | |
$this->topLevel($product) | |
&& $option_count === 0 | |
) { | |
$model->setProductTypeId($this->TYPE_PRODUCT); | |
return __METHOD__; | |
} | |
return false; | |
} | |
public function single_option_distributor_id_1($params) | |
{ | |
extract($params); | |
if ( | |
$option_count === 1 | |
&& 1 === (int) $product['distributor_id'] | |
) { | |
$model->setProductTypeId($this->TYPE_SHELL); | |
$option = $this->createOption($product['options'][0]); | |
$model->addOption($option); | |
return __METHOD__; | |
} | |
return false; | |
} | |
public function single_option_no_sub_options($params) | |
{ | |
extract($params); | |
if ( | |
$option_count === 1 | |
&& !$this->hasSubOptions($product['options'][0]) | |
) { | |
$model->setProductTypeId($this->TYPE_SHELL); | |
$option = $this->createOption($product['options'][0]); | |
$model->addOption($option); | |
return __METHOD__; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment