| @@ 34-68 (lines=35) @@ | ||
| 31 | * @link https://github.com/techdivision/import-product-bundle |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class ProductBundleOptionCreateProcessor extends AbstractCreateProcessor |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Return's the array with the SQL statements that has to be prepared. |
|
| 39 | * |
|
| 40 | * @return array The SQL statements to be prepared |
|
| 41 | * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements() |
|
| 42 | */ |
|
| 43 | protected function getStatements() |
|
| 44 | { |
|
| 45 | ||
| 46 | // load the utility class name |
|
| 47 | $utilityClassName = $this->getUtilityClassName(); |
|
| 48 | ||
| 49 | // return the array with the SQL statements that has to be prepared |
|
| 50 | return array( |
|
| 51 | $utilityClassName::CREATE_PRODUCT_BUNDLE_OPTION => $utilityClassName::CREATE_PRODUCT_BUNDLE_OPTION |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Persist's the passed row. |
|
| 57 | * |
|
| 58 | * @param array $row The row to persist |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function execute($row, $name = null) |
|
| 64 | { |
|
| 65 | $this->getPreparedStatement($name)->execute($row); |
|
| 66 | return $this->getConnection()->lastInsertId(); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| @@ 34-68 (lines=35) @@ | ||
| 31 | * @link https://github.com/techdivision/import-product-bundle |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class ProductBundleSelectionCreateProcessor extends AbstractCreateProcessor |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Return's the array with the SQL statements that has to be prepared. |
|
| 39 | * |
|
| 40 | * @return array The SQL statements to be prepared |
|
| 41 | * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements() |
|
| 42 | */ |
|
| 43 | protected function getStatements() |
|
| 44 | { |
|
| 45 | ||
| 46 | // load the utility class name |
|
| 47 | $utilityClassName = $this->getUtilityClassName(); |
|
| 48 | ||
| 49 | // return the array with the SQL statements that has to be prepared |
|
| 50 | return array( |
|
| 51 | $utilityClassName::CREATE_PRODUCT_BUNDLE_SELECTION => $utilityClassName::CREATE_PRODUCT_BUNDLE_SELECTION |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Persist's the passed row. |
|
| 57 | * |
|
| 58 | * @param array $row The row to persist |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function execute($row, $name = null) |
|
| 64 | { |
|
| 65 | $this->getPreparedStatement($name)->execute($row); |
|
| 66 | return $this->getConnection()->lastInsertId(); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||
| @@ 34-68 (lines=35) @@ | ||
| 31 | * @link https://github.com/techdivision/import-product-bundle |
|
| 32 | * @link http://www.techdivision.com |
|
| 33 | */ |
|
| 34 | class ProductBundleSelectionPriceCreateProcessor extends AbstractCreateProcessor |
|
| 35 | { |
|
| 36 | ||
| 37 | /** |
|
| 38 | * Return's the array with the SQL statements that has to be prepared. |
|
| 39 | * |
|
| 40 | * @return array The SQL statements to be prepared |
|
| 41 | * @see \TechDivision\Import\Actions\Processors\AbstractBaseProcessor::getStatements() |
|
| 42 | */ |
|
| 43 | protected function getStatements() |
|
| 44 | { |
|
| 45 | ||
| 46 | // load the utility class name |
|
| 47 | $utilityClassName = $this->getUtilityClassName(); |
|
| 48 | ||
| 49 | // return the array with the SQL statements that has to be prepared |
|
| 50 | return array( |
|
| 51 | $utilityClassName::CREATE_PRODUCT_BUNDLE_SELECTION_PRICE => $utilityClassName::CREATE_PRODUCT_BUNDLE_SELECTION_PRICE |
|
| 52 | ); |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Persist's the passed row. |
|
| 57 | * |
|
| 58 | * @param array $row The row to persist |
|
| 59 | * @param string|null $name The name of the prepared statement that has to be executed |
|
| 60 | * |
|
| 61 | * @return string The last inserted ID |
|
| 62 | */ |
|
| 63 | public function execute($row, $name = null) |
|
| 64 | { |
|
| 65 | $this->getPreparedStatement($name)->execute($row); |
|
| 66 | return $this->getConnection()->lastInsertId(); |
|
| 67 | } |
|
| 68 | } |
|
| 69 | ||