-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23cbe14
commit 60674b2
Showing
7 changed files
with
97 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Copyright © OpenGento, All rights reserved. | ||
* See LICENSE bundled with this library for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Opengento\DocumentWidget\Model\Document\Collection; | ||
|
||
use Magento\Framework\Data\Collection\AbstractDb; | ||
use Magento\Framework\Data\CollectionModifierInterface; | ||
|
||
/** | ||
* @api | ||
*/ | ||
final class CollectionModifier implements CollectionModifierInterface | ||
{ | ||
/** | ||
* @var CollectionModifierInterface[] | ||
*/ | ||
private $modifiers; | ||
|
||
public function __construct( | ||
array $modifiers = [] | ||
) { | ||
$this->modifiers = $modifiers; | ||
} | ||
|
||
public function apply(AbstractDb $collection): void | ||
{ | ||
foreach ($this->modifiers as $modifier) { | ||
$modifier->apply($collection); | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,29 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Copyright © OpenGento, All rights reserved. | ||
* See LICENSE bundled with this library for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<type name="Opengento\DocumentWidget\Model\Document\Collection\CollectionModifier"> | ||
<arguments> | ||
<argument name="modifiers" xsi:type="array"> | ||
<item name="select" xsi:type="object">Opengento\Document\Model\Document\Collection\SelectModifier</item> | ||
<item name="sorter" xsi:type="object">Opengento\DocumentWidget\Model\Document\Collection\SorterModifier</item> | ||
</argument> | ||
</arguments> | ||
</type> | ||
<type name="Opengento\DocumentWidget\Block\Widget\Document\ListByType"> | ||
<arguments> | ||
<argument name="collectionModifier" xsi:type="object">Opengento\DocumentWidget\Model\Document\Collection\CollectionModifier</argument> | ||
</arguments> | ||
</type> | ||
<type name="Opengento\DocumentWidget\Model\Document\Collection\SorterModifier"> | ||
<arguments> | ||
<argument name="mapper" xsi:type="array"> | ||
<item name="entity_id" xsi:type="string">main_table.entity_id</item> | ||
</argument> | ||
</arguments> | ||
</type> | ||
</config> |
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