-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #579 from magento-firedrakes/bugfixes_2.1.4
[Firedrakes] Bugfixes 2.1.4
- Loading branch information
Showing
13 changed files
with
582 additions
and
25 deletions.
There are no files selected for viewing
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
63 changes: 63 additions & 0 deletions
63
app/code/Magento/Catalog/Model/Indexer/Product/Flat/Table/Builder.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Model\Indexer\Product\Flat\Table; | ||
|
||
/** | ||
* Class Builder | ||
*/ | ||
class Builder implements BuilderInterface | ||
{ | ||
/** | ||
* @var \Magento\Framework\DB\Ddl\Table | ||
*/ | ||
private $tableInstance; | ||
|
||
/** | ||
* Builder constructor. | ||
* | ||
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection | ||
* @param string $tableName | ||
*/ | ||
public function __construct(\Magento\Framework\DB\Adapter\AdapterInterface $connection, $tableName) | ||
{ | ||
$this->tableInstance = $connection->newTable($tableName); | ||
} | ||
|
||
/** | ||
* Adds column to table. | ||
* | ||
* $options contains additional options for columns. Supported values are: | ||
* - 'unsigned', for number types only. Default: FALSE. | ||
* - 'precision', for numeric and decimal only. Default: taken from $size, if not set there then 0. | ||
* - 'scale', for numeric and decimal only. Default: taken from $size, if not set there then 10. | ||
* - 'default'. Default: not set. | ||
* - 'nullable'. Default: TRUE. | ||
* - 'primary', add column to primary index. Default: do not add. | ||
* - 'primary_position', only for column in primary index. Default: count of primary columns + 1. | ||
* - 'identity' or 'auto_increment'. Default: FALSE. | ||
* | ||
* @param string $name the column name | ||
* @param string $type the column data type | ||
* @param string|int|array $size the column length | ||
* @param array $options array of additional options | ||
* @param string $comment column description | ||
* @return $this | ||
* @throws \Zend_Db_Exception | ||
*/ | ||
public function addColumn($name, $type, $size = null, $options = [], $comment = null) | ||
{ | ||
$this->tableInstance->addColumn($name, $type, $size, $options, $comment); | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return \Magento\Framework\DB\Ddl\Table | ||
*/ | ||
public function getTable() | ||
{ | ||
return $this->tableInstance; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
app/code/Magento/Catalog/Model/Indexer/Product/Flat/Table/BuilderInterface.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Catalog\Model\Indexer\Product\Flat\Table; | ||
|
||
/** | ||
* Interface BuilderInterface | ||
*/ | ||
interface BuilderInterface | ||
{ | ||
/** | ||
* Adds column to table. | ||
* | ||
* $options contains additional options for columns. Supported values are: | ||
* - 'unsigned', for number types only. Default: FALSE. | ||
* - 'precision', for numeric and decimal only. Default: taken from $size, if not set there then 0. | ||
* - 'scale', for numeric and decimal only. Default: taken from $size, if not set there then 10. | ||
* - 'default'. Default: not set. | ||
* - 'nullable'. Default: TRUE. | ||
* - 'primary', add column to primary index. Default: do not add. | ||
* - 'primary_position', only for column in primary index. Default: count of primary columns + 1. | ||
* - 'identity' or 'auto_increment'. Default: FALSE. | ||
* | ||
* @param string $name the column name | ||
* @param string $type the column data type | ||
* @param string|int|array $size the column length | ||
* @param array $options array of additional options | ||
* @param string $comment column description | ||
* @return $this | ||
* @throws \Zend_Db_Exception | ||
*/ | ||
public function addColumn($name, $type, $size = null, $options = [], $comment = null); | ||
|
||
/** | ||
* @return \Magento\Framework\DB\Ddl\Table | ||
*/ | ||
public function getTable(); | ||
} |
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
Oops, something went wrong.