1f35d4f03d0c86637b838ee8266bc71942ee0aa6
[yaffs-website] / web / modules / contrib / crop / src / CropTypeInterface.php
1 <?php
2
3 namespace Drupal\crop;
4
5 use Drupal\Core\Config\Entity\ConfigEntityInterface;
6
7 /**
8  * Provides an interface defining a crop type entity.
9  */
10 interface CropTypeInterface extends ConfigEntityInterface {
11
12   /**
13    * Aspect ratio validation regexp.
14    *
15    * @var array
16    */
17   const VALIDATION_REGEXP = '#^[0-9]+:[0-9]+$#';
18
19   /**
20    * Get aspect ratio of this crop type.
21    *
22    * @return string|null
23    *   The aspect ratio of this crop type.
24    */
25   public function getAspectRatio();
26
27   /**
28    * Returns a list of available crop type names.
29    *
30    * This list can include types that are queued for addition or deletion.
31    *
32    * @return string[]
33    *   An array of crop type labels, keyed by the crop type name.
34    */
35   public static function getCropTypeNames();
36
37   /**
38    * Validates the currently set values.
39    *
40    * @return \Symfony\Component\Validator\ConstraintViolationListInterface
41    *   A list of constraint violations. If the list is empty, validation
42    *   succeeded.
43    */
44   public function validate();
45
46   /**
47    * Returns width and height soft limit values.
48    *
49    * @return array
50    *   Width and height values.
51    */
52   public function getSoftLimit();
53
54   /**
55    * Returns width and height hard limit values.
56    *
57    * @return array
58    *   Width and height values.
59    */
60   public function getHardLimit();
61
62 }