Skip to content

Commit 31bab30

Browse files
committed
init
0 parents  commit 31bab30

File tree

131 files changed

+7643
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+7643
-0
lines changed

Api/Data/DocumentInterface.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Opengento\Document\Api\Data;
9+
10+
use DateTime;
11+
use Magento\Framework\Api\ExtensibleDataInterface;
12+
13+
/**
14+
* @api
15+
*/
16+
interface DocumentInterface extends ExtensibleDataInterface
17+
{
18+
public function getId(): ?int;
19+
20+
public function getTypeId(): int;
21+
22+
public function getCode(): string;
23+
24+
public function getName(): string;
25+
26+
public function getDescription(): string;
27+
28+
public function getLocale(): ?string;
29+
30+
public function getFileName(): string;
31+
32+
public function getFilePath(): string;
33+
34+
public function getImageFileName(): string;
35+
36+
public function getCreatedAt(): DateTime;
37+
38+
public function getUpdatedAt(): DateTime;
39+
40+
/**
41+
* @return \Opengento\Document\Api\Data\DocumentExtensionInterface
42+
*/
43+
public function getExtensionAttributes(): DocumentExtensionInterface;
44+
45+
/**
46+
* @param \Opengento\Document\Api\Data\DocumentExtensionInterface $extensionAttributes
47+
* @return \Opengento\Document\Api\Data\DocumentInterface
48+
*/
49+
public function setExtensionAttributes(DocumentExtensionInterface $extensionAttributes): DocumentInterface;
50+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Opengento\Document\Api\Data;
9+
10+
use Magento\Framework\Api\SearchResultsInterface;
11+
12+
/**
13+
* @api
14+
*/
15+
interface DocumentSearchResultsInterface extends SearchResultsInterface
16+
{
17+
/**
18+
* @inheritdoc
19+
* @return \Opengento\Document\Api\Data\DocumentInterface[]
20+
*/
21+
public function getItems(): array;
22+
23+
/**
24+
* @inheritdoc
25+
* @param \Opengento\Document\Api\Data\DocumentInterface[] $items
26+
* @return $this
27+
*/
28+
public function setItems(array $items): self;
29+
}

Api/Data/DocumentTypeInterface.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Opengento\Document\Api\Data;
9+
10+
use DateTime;
11+
use Magento\Framework\Api\ExtensibleDataInterface;
12+
13+
/**
14+
* @api
15+
*/
16+
interface DocumentTypeInterface extends ExtensibleDataInterface
17+
{
18+
public function getId(): ?int;
19+
20+
public function getCode(): string;
21+
22+
public function getScheduledImport(): bool;
23+
24+
public function getName(): string;
25+
26+
public function getFileSourcePath(): string;
27+
28+
public function getFileDestPath(): string;
29+
30+
public function getSubPathLength(): int;
31+
32+
public function getFilePattern(): string;
33+
34+
public function getFileAllowedExtensions(): array;
35+
36+
public function getDefaultImageFileName(): string;
37+
38+
public function getCreatedAt(): DateTime;
39+
40+
public function getUpdatedAt(): DateTime;
41+
42+
/**
43+
* @return \Opengento\Document\Api\Data\DocumentTypeExtensionInterface
44+
*/
45+
public function getExtensionAttributes(): DocumentTypeExtensionInterface;
46+
47+
/**
48+
* @param \Opengento\Document\Api\Data\DocumentTypeExtensionInterface $extensionAttributes
49+
* @return \Opengento\Document\Api\Data\DocumentTypeInterface
50+
*/
51+
public function setExtensionAttributes(DocumentTypeExtensionInterface $extensionAttributes): DocumentTypeInterface;
52+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Opengento\Document\Api\Data;
9+
10+
use Magento\Framework\Api\SearchResultsInterface;
11+
12+
/**
13+
* @api
14+
*/
15+
interface DocumentTypeSearchResultsInterface extends SearchResultsInterface
16+
{
17+
/**
18+
* @inheritdoc
19+
* @return \Opengento\Document\Api\Data\DocumentTypeInterface[]
20+
*/
21+
public function getItems(): array;
22+
23+
/**
24+
* @inheritdoc
25+
* @param \Opengento\Document\Api\Data\DocumentTypeInterface[] $items
26+
* @return $this
27+
*/
28+
public function setItems(array $items): self;
29+
}

Api/DocumentRepositoryInterface.php

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Opengento\Document\Api;
9+
10+
use Magento\Framework\Api\SearchCriteriaInterface;
11+
use Magento\Framework\Api\SearchResultsInterface;
12+
use Magento\Framework\Exception\CouldNotDeleteException;
13+
use Magento\Framework\Exception\CouldNotSaveException;
14+
use Magento\Framework\Exception\LocalizedException;
15+
use Magento\Framework\Exception\NoSuchEntityException;
16+
use Opengento\Document\Api\Data\DocumentInterface;
17+
use Opengento\Document\Api\Data\DocumentSearchResultsInterface;
18+
19+
/**
20+
* @api
21+
*/
22+
interface DocumentRepositoryInterface
23+
{
24+
/**
25+
* @param int $documentId
26+
* @return DocumentInterface
27+
* @throws NoSuchEntityException
28+
*/
29+
public function getById(int $documentId): DocumentInterface;
30+
31+
/**
32+
* @param string $documentCode
33+
* @return DocumentInterface
34+
* @throws NoSuchEntityException
35+
*/
36+
public function getByCode(string $documentCode): DocumentInterface;
37+
38+
/**
39+
* @param SearchCriteriaInterface $searchCriteria
40+
* @return DocumentSearchResultsInterface
41+
* @throws LocalizedException
42+
*/
43+
public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface;
44+
45+
/**
46+
* @param DocumentInterface $document
47+
* @return DocumentInterface
48+
* @throws CouldNotSaveException
49+
*/
50+
public function save(DocumentInterface $document): DocumentInterface;
51+
52+
/**
53+
* @param DocumentInterface $document
54+
* @throws CouldNotDeleteException
55+
*/
56+
public function delete(DocumentInterface $document): void;
57+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright © OpenGento, All rights reserved.
4+
* See LICENSE bundled with this library for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Opengento\Document\Api;
9+
10+
use Magento\Framework\Api\SearchCriteriaInterface;
11+
use Magento\Framework\Api\SearchResultsInterface;
12+
use Magento\Framework\Exception\CouldNotDeleteException;
13+
use Magento\Framework\Exception\CouldNotSaveException;
14+
use Magento\Framework\Exception\LocalizedException;
15+
use Magento\Framework\Exception\NoSuchEntityException;
16+
use Opengento\Document\Api\Data\DocumentTypeInterface;
17+
use Opengento\Document\Api\Data\DocumentTypeSearchResultsInterface;
18+
19+
/**
20+
* @api
21+
*/
22+
interface DocumentTypeRepositoryInterface
23+
{
24+
/**
25+
* @param int $documentTypeId
26+
* @return DocumentTypeInterface
27+
* @throws NoSuchEntityException
28+
*/
29+
public function getById(int $documentTypeId): DocumentTypeInterface;
30+
31+
/**
32+
* @param string $documentTypeCode
33+
* @return DocumentTypeInterface
34+
* @throws NoSuchEntityException
35+
*/
36+
public function getByCode(string $documentTypeCode): DocumentTypeInterface;
37+
38+
/**
39+
* @param SearchCriteriaInterface $searchCriteria
40+
* @return DocumentTypeSearchResultsInterface
41+
* @throws LocalizedException
42+
*/
43+
public function getList(SearchCriteriaInterface $searchCriteria): SearchResultsInterface;
44+
45+
/**
46+
* @param DocumentTypeInterface $documentType
47+
* @return DocumentTypeInterface
48+
* @throws CouldNotSaveException
49+
*/
50+
public function save(DocumentTypeInterface $documentType): DocumentTypeInterface;
51+
52+
/**
53+
* @param DocumentTypeInterface $documentType
54+
* @throws CouldNotDeleteException
55+
*/
56+
public function delete(DocumentTypeInterface $documentType): void;
57+
}

0 commit comments

Comments
 (0)