-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added option to attach a custom license to an email. Code cleanup to …
…better fit newer Magento and PHP 8 Standards
- Loading branch information
1 parent
52b4a96
commit c453ccb
Showing
33 changed files
with
1,868 additions
and
1,840 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DevStone\UsageCalculator\Api\Data; | ||
|
||
interface UsageCustomerInterface | ||
{ | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* @param int $entity_id | ||
* @return UsageCustomerInterface | ||
*/ | ||
public function setId(int $entity_id); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getUsageId(): int; | ||
|
||
/** | ||
* @param int $usageId | ||
* @return UsageCustomerInterface | ||
*/ | ||
public function setUsageId(int $usageId): UsageCustomerInterface; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getCustomerId(): int; | ||
|
||
/** | ||
* @param int $customerId | ||
* @return UsageCustomerInterface | ||
*/ | ||
public function setCustomerId(int $customerId): UsageCustomerInterface; | ||
/** | ||
* @return string | ||
*/ | ||
public function getPendingCustomerEmail(): string; | ||
|
||
/** | ||
* @param string $pendingCustomerEmail | ||
* @return UsageCustomerInterface | ||
*/ | ||
public function setPendingCustomerEmail(string $pendingCustomerEmail): UsageCustomerInterface; | ||
} |
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 © All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace DevStone\UsageCalculator\Api\Data; | ||
|
||
use Magento\Framework\Api\SearchResultsInterface; | ||
|
||
interface UsageCustomerSearchResultsInterface extends SearchResultsInterface | ||
{ | ||
|
||
/** | ||
* Get UsageCustomer list. | ||
* @return UsageCustomerInterface[] | ||
*/ | ||
public function getItems(); | ||
|
||
/** | ||
* Set entity_id list. | ||
* @param UsageCustomerInterface[] $items | ||
* @return $this | ||
*/ | ||
public function setItems(array $items); | ||
} |
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,95 @@ | ||
<?php | ||
/** | ||
* Copyright © All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace DevStone\UsageCalculator\Api; | ||
|
||
use DevStone\UsageCalculator\Api\Data\UsageCustomerInterface; | ||
use DevStone\UsageCalculator\Api\Data\UsageCustomerSearchResultsInterface; | ||
use Magento\Framework\Api\SearchCriteriaInterface; | ||
use Magento\Framework\Api\SearchResultsInterface; | ||
use Magento\Framework\Exception\LocalizedException; | ||
use Magento\Framework\Exception\NoSuchEntityException; | ||
|
||
interface UsageCustomerRepositoryInterface | ||
{ | ||
|
||
/** | ||
* Save UsageCustomer | ||
* @param UsageCustomerInterface $usageCustomer | ||
* @return UsageCustomerInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function save( | ||
UsageCustomerInterface $usageCustomer | ||
): UsageCustomerInterface; | ||
|
||
/** | ||
* Retrieve UsageCustomer | ||
* @param int $usageCustomerId | ||
* @return UsageCustomerInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function get(int $usageCustomerId): UsageCustomerInterface; | ||
|
||
/** | ||
* Retrieve UsageCustomer | ||
* @param int $usageId | ||
* @param int $customerId | ||
* @return UsageCustomerInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function getByUsageAndCustomer(int $usageId, int $customerId): ?UsageCustomerInterface; | ||
|
||
/** | ||
* Retrieve UsageCustomer | ||
* @param int $usageId | ||
* @param string $email | ||
* @return UsageCustomerInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function getByUsageAndEmail(int $usageId, string $email): ?UsageCustomerInterface; | ||
|
||
/** | ||
* Retrieve UsageCustomer matching the specified criteria. | ||
* @param SearchCriteriaInterface $searchCriteria | ||
* @return SearchResultsInterface | ||
* @throws LocalizedException | ||
*/ | ||
public function getList( | ||
SearchCriteriaInterface $searchCriteria | ||
): SearchResultsInterface; | ||
|
||
/** | ||
* Delete UsageCustomer | ||
* @param UsageCustomerInterface $usageCustomer | ||
* @return bool true on success | ||
* @throws LocalizedException | ||
*/ | ||
public function delete( | ||
UsageCustomerInterface $usageCustomer | ||
): bool; | ||
|
||
/** | ||
* Delete UsageCustomers | ||
* @param SearchCriteriaInterface $searchCriteria | ||
* @return bool true on success | ||
* @throws LocalizedException | ||
*/ | ||
public function deleteList( | ||
SearchCriteriaInterface $searchCriteria | ||
): bool; | ||
|
||
/** | ||
* Delete UsageCustomer by ID | ||
* @param int $usageCustomerId | ||
* @return bool true on success | ||
* @throws NoSuchEntityException | ||
* @throws LocalizedException | ||
*/ | ||
public function deleteById(int $usageCustomerId): bool; | ||
} | ||
|
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.