Initial commit: prestashop-entity-selector

Forked from prestashop-target-conditions
Renamed all references from target-conditions to entity-selector
This commit is contained in:
2026-01-26 14:02:54 +00:00
commit a285018e0d
18 changed files with 39802 additions and 0 deletions

13490
src/EntitySelector.php Normal file

File diff suppressed because it is too large Load Diff

View 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

File diff suppressed because it is too large Load Diff