Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -12,8 +12,41 @@
namespace Thelia\Module;
use Thelia\Model\Area;
use Thelia\Model\AreaDeliveryModuleQuery;
use Thelia\Model\Country;
abstract class AbstractDeliveryModule extends BaseModule implements DeliveryModuleInterface
{
// This class is the base class for delivery modules
// It may contains common methods in the future.
/**
* @return bool
*/
public function handleVirtualProductDelivery()
{
return false;
}
/**
* Return the first area that matches the given country for the given module
* @param Country $country
* @param BaseModule $module
* @return Area|null
*/
public function getAreaForCountry(Country $country)
{
$area = null;
if (null !== $areaDeliveryModule = AreaDeliveryModuleQuery::create()->findByCountryAndModule(
$country,
$this->getModuleModel()
)) {
$area = $areaDeliveryModule->getArea();
}
return $area;
}
}