Blame view

backend/components/croppers/CropFactory.php 1.07 KB
01ebf78c   Administrator   Initial commit
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
  <?php
  
  namespace backend\components\croppers;
  
  use Yii;
  
  class CropFactory
  {
      private static $instance;
      private $crops = [];
  
      private function __construct() {
          $this->init();
      }
  
      private function init() {
          $this->crops[] = new EconomixCrop();
          $this->crops[] = new GoldenGardenFlowersCrop();
          $this->crops[] = new GoldenGardenVegiesCrop();
          $this->crops[] = new GoldenGardenGiantCrop();
          $this->crops[] = new UkrSeedsNovikGiantCrop();
          $this->crops[] = new UkrSeedsNovikMiniCrop();
          $this->crops[] = new UkrSeedsNovikVegiesCrop();
          $this->crops[] = new UkrSeedsNovikFlowersCrop();
          $this->crops[] = new UkrSeedsTekVegiesCrop();
          $this->crops[] = new UkrSeedsFloraMiniCrop();
          $this->crops[] = new UkrSeedsFloraVegiesCrop();
      }
  
      public function getCrop($crop_id) {
          return $this->crops[$crop_id];
      }
  
      public static function getInstance() {
          if (null === self::$instance) {
              self::$instance = new self();
          }
          return self::$instance;
      }
  }