Initial commit: prestashop-entity-selector
Forked from prestashop-target-conditions Renamed all references from target-conditions to entity-selector
This commit is contained in:
13490
src/EntitySelector.php
Normal file
13490
src/EntitySelector.php
Normal file
File diff suppressed because it is too large
Load Diff
47
src/HolidayProviderInterface.php
Executable file
47
src/HolidayProviderInterface.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* HolidayProviderInterface
|
||||
*
|
||||
* Interface for holiday functionality in ScheduleConditions.
|
||||
* Implement this interface in your module to enable public holiday exclusions.
|
||||
*
|
||||
* @author mypresta.rocks <info@mypresta.rocks>
|
||||
* @copyright Copyright (c) mypresta.rocks
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
namespace MyPrestaRocks\EntitySelector;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
interface HolidayProviderInterface
|
||||
{
|
||||
/**
|
||||
* Check if a specific date is a public holiday for any of the given countries
|
||||
*
|
||||
* @param string $date Date in Y-m-d format
|
||||
* @param array $countryIds Array of country IDs to check
|
||||
* @return bool True if date is a holiday for any of the countries
|
||||
*/
|
||||
public static function isHoliday($date, array $countryIds);
|
||||
|
||||
/**
|
||||
* Get list of country IDs that have holidays configured
|
||||
*
|
||||
* @return array Array of country IDs
|
||||
*/
|
||||
public static function getCountriesWithHolidays();
|
||||
|
||||
/**
|
||||
* Get holidays within a date range for specific countries
|
||||
*
|
||||
* @param array $countryIds Array of country IDs
|
||||
* @param string $startDate Start date in Y-m-d format
|
||||
* @param string $endDate End date in Y-m-d format
|
||||
* @return array Array of holiday data with keys: holiday_date, display_name, country_iso
|
||||
*/
|
||||
public static function getHolidaysInRange(array $countryIds, $startDate, $endDate);
|
||||
}
|
||||
1193
src/ScheduleConditions.php
Executable file
1193
src/ScheduleConditions.php
Executable file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user