File tree Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 13
13
use Magento \Framework \Model \AbstractExtensibleModel ;
14
14
use Opengento \Document \Api \Data \DocumentExtensionInterface ;
15
15
use Opengento \Document \Api \Data \DocumentInterface ;
16
+ use function array_merge ;
16
17
17
18
class Document extends AbstractExtensibleModel implements DocumentInterface, IdentityInterface
18
19
{
19
- public const CACHE_TAG = 'opengento_document ' ;
20
+ public const CACHE_TAG = 'ope_d ' ;
20
21
21
22
protected function _construct (): void
22
23
{
@@ -28,12 +29,18 @@ protected function _construct(): void
28
29
public function getIdentities (): array
29
30
{
30
31
return [
32
+ self ::CACHE_TAG ,
31
33
self ::CACHE_TAG . '_ ' . $ this ->getId (),
32
34
self ::CACHE_TAG . '_ ' . $ this ->getCode (),
33
35
DocumentType::CACHE_TAG . '_ ' . $ this ->getTypeId (),
34
36
];
35
37
}
36
38
39
+ public function getCacheTags (): array
40
+ {
41
+ return $ this ->getIdentities () ?: parent ::getCacheTags ();
42
+ }
43
+
37
44
public function getId (): ?int
38
45
{
39
46
return parent ::getId () ? (int ) parent ::getId () : null ;
Original file line number Diff line number Diff line change 13
13
use Magento \Framework \Model \AbstractExtensibleModel ;
14
14
use Opengento \Document \Api \Data \DocumentTypeExtensionInterface ;
15
15
use Opengento \Document \Api \Data \DocumentTypeInterface ;
16
+ use function array_merge ;
16
17
use function explode ;
17
18
18
19
class DocumentType extends AbstractExtensibleModel implements DocumentTypeInterface, IdentityInterface
19
20
{
20
- public const CACHE_TAG = 'opengento_document_type ' ;
21
+ public const CACHE_TAG = 'ope_dt ' ;
21
22
22
23
protected function _construct (): void
23
24
{
@@ -28,7 +29,12 @@ protected function _construct(): void
28
29
29
30
public function getIdentities (): array
30
31
{
31
- return [self ::CACHE_TAG . '_ ' . $ this ->getId (), self ::CACHE_TAG . '_ ' . $ this ->getCode ()];
32
+ return [self ::CACHE_TAG , self ::CACHE_TAG . '_ ' . $ this ->getId (), self ::CACHE_TAG . '_ ' . $ this ->getCode ()];
33
+ }
34
+
35
+ public function getCacheTags (): array
36
+ {
37
+ return $ this ->getIdentities () ?: parent ::getCacheTags ();
32
38
}
33
39
34
40
public function getId (): ?int
Original file line number Diff line number Diff line change 146
146
<argument name =" fetchStrategy" xsi : type =" object" >Opengento\Document\Model\ResourceModel\Document\Collection\FetchStrategy</argument >
147
147
</arguments >
148
148
</type >
149
- <virtualType name =" Opengento\Document\Model\Cache\Document" type =" Opengento\Document\Model\Cache\Cache" >
150
- <arguments >
151
- <argument name =" cacheList" xsi : type =" array" >
152
- <item name =" block_html" xsi : type =" const" >Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER</item >
153
- <item name =" collections" xsi : type =" const" >Magento\Framework\App\Cache\Type\Collection::TYPE_IDENTIFIER</item >
154
- </argument >
155
- <argument name =" tags" xsi : type =" array" >
156
- <item name =" document" xsi : type =" const" >Opengento\Document\Model\Document::CACHE_TAG</item >
157
- </argument >
158
- </arguments >
159
- </virtualType >
160
149
<!-- Global Settings -->
161
150
<preference for =" Opengento\Document\Model\Document\Operation\CreateFromFileInterface" type =" Opengento\Document\Model\Document\Operation\CreateFromFile" />
162
151
<type name =" Opengento\Document\Model\Document\ProcessorFactory" >
You can’t perform that action at this time.
0 commit comments