-
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 #504 from magento-troll/sprint21
MAGETWO-51655 [Improvement] Convert customer group identifier field from SMALLINT to INT
- Loading branch information
Showing
44 changed files
with
654 additions
and
81 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
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
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
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
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
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
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
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
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
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
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,21 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Customer\Block\Account; | ||
|
||
/** | ||
* Class for delimiter. | ||
*/ | ||
class Delimiter extends \Magento\Framework\View\Element\Template implements SortLinkInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getSortOrder() | ||
{ | ||
return $this->getData(self::SORT_ORDER); | ||
} | ||
} |
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
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,47 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Customer\Block\Account; | ||
|
||
use \Magento\Framework\View\Element\Html\Links; | ||
use \Magento\Customer\Block\Account\SortLinkInterface; | ||
|
||
/** | ||
* Class for sorting links in navigation panels. | ||
*/ | ||
class Navigation extends Links | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getLinks() | ||
{ | ||
$links = $this->_layout->getChildBlocks($this->getNameInLayout()); | ||
$sortableLink = []; | ||
foreach ($links as $key => $link) { | ||
if ($link instanceof SortLinkInterface) { | ||
$sortableLink[] = $link; | ||
unset($links[$key]); | ||
} | ||
} | ||
|
||
usort($sortableLink, [$this, "compare"]); | ||
return array_merge($sortableLink, $links); | ||
} | ||
|
||
/** | ||
* Compare sortOrder in links. | ||
* | ||
* @param SortLinkInterface $firstLink | ||
* @param SortLinkInterface $secondLink | ||
* @return int | ||
* @SuppressWarnings(PHPMD.UnusedPrivateMethod) | ||
*/ | ||
private function compare(SortLinkInterface $firstLink, SortLinkInterface $secondLink) | ||
{ | ||
return ($firstLink->getSortOrder() < $secondLink->getSortOrder()); | ||
} | ||
} |
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,21 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Customer\Block\Account; | ||
|
||
/** | ||
* Class for sortable links. | ||
*/ | ||
class SortLink extends \Magento\Framework\View\Element\Html\Link\Current implements SortLinkInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getSortOrder() | ||
{ | ||
return $this->getData(self::SORT_ORDER); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
app/code/Magento/Customer/Block/Account/SortLinkInterface.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,27 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Customer\Block\Account; | ||
|
||
/** | ||
* Interface for sortable links. | ||
* @api | ||
*/ | ||
interface SortLinkInterface | ||
{ | ||
/**#@+ | ||
* Constant for confirmation status | ||
*/ | ||
const SORT_ORDER = 'sortOrder'; | ||
/**#@-*/ | ||
|
||
/** | ||
* Get sort order for block. | ||
* | ||
* @return int | ||
*/ | ||
public function getSortOrder(); | ||
} |
Oops, something went wrong.