-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
ProductActionInterface.php
63 lines (55 loc) · 1.46 KB
/
ProductActionInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
/*
* Isotope eCommerce for Contao Open Source CMS
*
* Copyright (C) 2009 - 2019 terminal42 gmbh & Isotope eCommerce Workgroup
*
* @link https://isotopeecommerce.org
* @license https://opensource.org/licenses/lgpl-3.0.html
*/
namespace Isotope\Frontend\ProductAction;
use Isotope\Interfaces\IsotopeProduct;
interface ProductActionInterface
{
/**
* Gets the internal name of the action.
*
* @return string
*/
public function getName();
/**
* Gets the label for the action.
*
* @param IsotopeProduct|null $product
*
* @return string
*/
public function getLabel(IsotopeProduct $product = null);
/**
* Returns whether the action is available for the given product.
*
* @param IsotopeProduct $product
* @param array $config
*
* @return bool
*/
public function isAvailable(IsotopeProduct $product, array $config = []);
/**
* Generates HTML content for this action.
*
* @param IsotopeProduct $product
* @param array $config
*
* @return string
*/
public function generate(IsotopeProduct $product, array $config = []);
/**
* Handles submit of the product. Must self-check if this action applies.
*
* @param IsotopeProduct $product
* @param array $config
*
* @return bool
*/
public function handleSubmit(IsotopeProduct $product, array $config = []);
}