Blame view

src/lib/models.php 19.5 KB
dce46e80   Alex Savenko   first push project
1
2
3
4
5
6
  <?php
  
  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
  namespace
  {
f723ca00   Alex Savenko   test
7
8
9
  
      use models\basket;
  
dce46e80   Alex Savenko   first push project
10
11
12
13
14
15
16
17
18
19
20
21
22
23
      /**
       * models
       *
       * @author      Roman Telychko
       * @version     0.1.20130712
       */
      class models extends \db
      {
          /////////////////////////////////////////////////////////////////////////////
  
          protected   $_filters                       = false;
          protected   $_items                         = false;
          protected   $_properties                    = false;
          protected   $_orders                        = false;
012aa125   Administrator   add order_1c
24
          protected   $_orders_1c                     = false;
89ecf44a   Administrator   add getShipments
25
          protected   $_shipments                     = false;
dce46e80   Alex Savenko   first push project
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
          protected   $_pages                         = false;
          protected   $_news                          = false;
          protected   $_customers                     = false;
          protected   $_catalog                       = false;
          protected   $_admins                        = false;
          protected   $_partners                      = false;
          protected   $_callback                      = false;
          protected   $_seo_info                      = false;
          protected   $_slider                        = false;
          protected   $_navigation                    = false;
          protected   $_users_groups                  = false;
          protected   $_email_templates               = false;
          protected   $_event_email                   = false;
          protected   $_campaign                      = false;
          protected   $_admin_email                   = false;
          protected   $_admin_email_sections          = false;
          protected   $_delivery                      = false;
          protected   $_delivery_email                = false;
  		protected   $_rubrics_news					= false;
          protected   $_email_settings    			= false;
          protected   $_special_users                 = false;
          protected   $_prices                        = false;
          protected   $_actions                       = false;
          protected   $_preorders                     = false;
          protected   $_banner                        = false;
          protected   $_customer_ideas                = false;
          protected   $_promo_codes                   = false;
          protected   $_payment                       = false;
          protected   $_sales                         = false;
          protected   $_reviews                       = false;
          protected   $_modal                         = false;
          protected   $_manager_mail                  = false;
9586c455   Alex Savenko   base
58
59
          protected   $_promo_to_user                 = false;
          protected   $_discount                      = false;
f723ca00   Alex Savenko   test
60
          protected   $_basket                        = false;
dce46e80   Alex Savenko   first push project
61
62
63
64
65
66
67
68
69
70
71
  
  
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getFilters
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140321
           *
89ecf44a   Administrator   add getShipments
72
           * @return    	object
dce46e80   Alex Savenko   first push project
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
           */
          public function getFilters()
          {
              if( empty($this->_language) )
              {
                  $this->_filters = new \models\filters();
                  $this->_filters->setDi( $this->getDi() );
              }
  
              return $this->_filters;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getItems
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140327
           *
c7a9028a   Alex Savenko   products pick
93
           * @return    	\models\items
dce46e80   Alex Savenko   first push project
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
           */
          public function getItems()
          {
              if( empty($this->_items) )
              {
                  $this->_items = new \models\items();
                  $this->_items->setDi( $this->getDi() );
              }
  
              return $this->_items;
          }
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getRubricsNews
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140327
           *
89ecf44a   Administrator   add getShipments
113
           * @return    	object
dce46e80   Alex Savenko   first push project
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
           */
          public function getRubricsNews()
          {
              if( empty($this->_rubrics_news) )
              {
                  $this->_rubrics_news = new \models\RubricsNews();
                  $this->_rubrics_news->setDi( $this->getDi() );
              }
  
              return $this->_rubrics_news;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getProperties
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140404
           *
89ecf44a   Administrator   add getShipments
134
           * @return    	object
dce46e80   Alex Savenko   first push project
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
           */
          public function getProperties()
          {
              if( empty($this->_properties) )
              {
                  $this->_properties = new \models\properties();
                  $this->_properties->setDi( $this->getDi() );
              }
  
              return $this->_properties;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getOrders
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140422
           *
89ecf44a   Administrator   add getShipments
155
           * @return    	object
dce46e80   Alex Savenko   first push project
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
           */
          public function getOrders()
          {
              if( empty($this->_orders) )
              {
                  $this->_orders = new \models\orders();
                  $this->_orders->setDi( $this->getDi() );
              }
  
              return $this->_orders;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
012aa125   Administrator   add order_1c
171
172
173
174
175
           * models::getOrders1C
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140422
           *
89ecf44a   Administrator   add getShipments
176
           * @return    	object
012aa125   Administrator   add order_1c
177
178
179
180
181
182
183
184
185
186
187
           */
          public function getOrders1C()
          {
              if( empty($this->_orders_1c) )
              {
                  $this->_orders_1c = new \models\orders_1c();
                  $this->_orders_1c->setDi( $this->getDi() );
              }
  
              return $this->_orders_1c;
          }
89ecf44a   Administrator   add getShipments
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getShipments
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140422
           *
           * @return    	object
           */
          public function getShipments()
          {
              if( empty($this->_shipments) )
              {
                  $this->_shipments = new \models\shipments();
                  $this->_shipments->setDi( $this->getDi() );
              }
  
              return $this->_shipments;
          }
012aa125   Administrator   add order_1c
208
209
210
211
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
dce46e80   Alex Savenko   first push project
212
213
214
215
216
           * models::getPages
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140423
           *
89ecf44a   Administrator   add getShipments
217
           * @return    	object
dce46e80   Alex Savenko   first push project
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
           */
          public function getPages()
          {
              if( empty($this->_pages) )
              {
                  $this->_pages = new \models\pages();
                  $this->_pages->setDi( $this->getDi() );
              }
  
              return $this->_pages;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getNews
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140423
           *
89ecf44a   Administrator   add getShipments
238
           * @return    	object
dce46e80   Alex Savenko   first push project
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
           */
          public function getNews()
          {
              if( empty($this->_news) )
              {
                  $this->_news = new \models\news();
                  $this->_news->setDi( $this->getDi() );
              }
  
              return $this->_news;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getCustomers
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140425
           *
89ecf44a   Administrator   add getShipments
259
           * @return    	object
dce46e80   Alex Savenko   first push project
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
           */
          public function getCustomers()
          {
              if( empty($this->_customers) )
              {
                  $this->_customers = new \models\customers();
                  $this->_customers->setDi( $this->getDi() );
              }
  
              return $this->_customers;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getCatalog
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140428
           *
89ecf44a   Administrator   add getShipments
280
           * @return    	object
dce46e80   Alex Savenko   first push project
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
           */
          public function getCatalog()
          {
              if( empty($this->_catalog) )
              {
                  $this->_catalog = new \models\catalog();
                  $this->_catalog->setDi( $this->getDi() );
              }
  
              return $this->_catalog;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getAdmins
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140505
           *
89ecf44a   Administrator   add getShipments
301
           * @return    	object
dce46e80   Alex Savenko   first push project
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
           */
          public function getAdmins()
          {
              if( empty($this->_admins) )
              {
                  $this->_admins = new \models\admins();
                  $this->_admins->setDi( $this->getDi() );
              }
  
              return $this->_admins;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getPartners
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140506
           *
89ecf44a   Administrator   add getShipments
322
           * @return    	object
dce46e80   Alex Savenko   first push project
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
           */
          public function getPartners()
          {
              if( empty($this->_partners) )
              {
                  $this->_partners = new \models\partners();
                  $this->_partners->setDi( $this->getDi() );
              }
  
              return $this->_partners;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          /**
           * models::getCallback
           *
           * @author      Jane Bezmaternykh
           * @version     0.1.20140507
           *
89ecf44a   Administrator   add getShipments
343
           * @return    	object
dce46e80   Alex Savenko   first push project
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
           */
          public function getCallback()
          {
              if( empty($this->_callback) )
              {
                  $this->_callback = new \models\callback();
                  $this->_callback->setDi( $this->getDi() );
              }
  
              return $this->_callback;
          }
          ////////////////////////////////////////////////////////////////////////////
          /**
           * models::getSeoInfo
           *
           * @author      Vitaliy
           * @version     0.1.20140507
           *
89ecf44a   Administrator   add getShipments
362
           * @return    	object
dce46e80   Alex Savenko   first push project
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
           */
          public function getSeoInfo()
          {
              if( empty($this->_seo_info) )
              {
                  $this->_seo_info = new \models\seo_info();
                  $this->_seo_info->setDi( $this->getDi() );
              }
  
              return $this->_seo_info;
          }
  
          /////////////////////////////////////////////////////////////////////////////
  
          public function getSlider()
          {
              if( empty($this->_slider) )
              {
                  $this->_slider = new \models\slider();
                  $this->_slider->setDi( $this->getDi() );
              }
  
              return $this->_slider;
          }
          ////////////////////////////////////////////////////////////////////////////////
          public function getNavigation()
          {
              if( empty($this->_navigation) )
              {
                  $this->_navigation = new \models\navigation();
                  $this->_navigation->setDi( $this->getDi() );
              }
  
              return $this->_navigation;
          }
  
          ////////////////////////////////////////////////////////////////////////////////
          public function getUsersGroup()
          {
              if( empty($this->_users_groups) )
              {
                  $this->_users_groups = new \models\users_groups();
                  $this->_users_groups->setDi( $this->getDi() );
              }
  
              return $this->_users_groups;
          }
  
          public function getSpecialUsers()
          {
              if( empty($this->_special_users) )
              {
                  $this->_special_users = new \models\special_users();
                  $this->_special_users->setDi( $this->getDi() );
              }
  
              return $this->_special_users;
          }
  
          public function getPrices()
          {
              if( empty($this->_prices) )
              {
                  $this->_prices = new \models\prices();
                  $this->_prices->setDi( $this->getDi() );
              }
  
              return $this->_prices;
          }
  
          public function getActions()
          {
              if( empty($this->_actions))
              {
                  $this->_actions = new \models\actions();
                  $this->_actions->setDi($this->getDi());
              }
  
              return $this->_actions;
          }
  
          public function getPreOrders()
          {
              if( empty($this->_preorders))
              {
                  $this->_preorders = new \models\preorders();
                  $this->_preorders->setDi($this->getDi());
              }
  
              return $this->_preorders;
          }
  
          ////////////////////////////////////////////////////////////////////////////////
          public function getEmailTemplates()
          {
              if( empty($this->_email_templates) )
              {
                  $this->_email_templates = new \models\email_templates();
                  $this->_email_templates->setDi( $this->getDi() );
              }
  
              return $this->_email_templates;
          }
  
          ////////////////////////////////////////////////////////////////////////////////
          public function getEventEmail()
          {
              if( empty($this->_event_email) )
              {
                  $this->_event_email = new \models\event_email();
                  $this->_event_email->setDi( $this->getDi() );
              }
  
              return $this->_event_email;
          }
  
          public function getCampaign()
          {
              if( empty($this->_campaign) )
              {
                  $this->_campaign = new \models\campaign();
                  $this->_campaign->setDi( $this->getDi() );
              }
  
              return $this->_campaign;
          }
  
          public function getAdminEmail()
          {
              if( empty($this->_admin_email) )
              {
                  $this->_admin_email = new \models\admin_email();
                  $this->_admin_email->setDi( $this->getDi() );
              }
  
              return $this->_admin_email;
          }
  
          public function getAdminEmailSections()
          {
  
              if( empty($this->_admin_email_sections) )
              {
                  $this->_admin_email_sections = new \models\admin_email_sections();
                  $this->_admin_email_sections->setDi( $this->getDi() );
              }
  
              return $this->_admin_email_sections;
          }
  
          public function getDelivery()
          {
  
              if( empty($this->_delivery) )
              {
                  $this->_delivery = new \models\delivery();
                  $this->_delivery->setDi( $this->getDi() );
              }
  
              return $this->_delivery;
          }
  
          public function getDeliveryEmail()
          {
  
              if( empty($this->_delivery_email) )
              {
                  $this->_delivery_email = new \models\delivery_email();
                  $this->_delivery_email->setDi( $this->getDi() );
              }
  
              return $this->_delivery_email;
          }
          public function getEmailSettings()
          {
  
              if( empty($this->_email_settings) )
              {
                  $this->_email_settings = new \models\email_settings();
                  $this->_email_settings->setDi( $this->getDi() );
              }
  
              return $this->_email_settings;
          }
  
          public function getBanner()
          {
  
              if( empty($this->_banner) )
              {
                  $this->_banner = new \models\banner();
                  $this->_banner->setDi( $this->getDi() );
              }
  
              return $this->_banner;
          }
  
          public function getCustomerIdeas()
          {
              if( empty($this->_customer_ideas) )
              {
                  $this->_customer_ideas = new \models\customer_ideas();
                  $this->_customer_ideas->setDi( $this->getDi() );
              }
  
              return $this->_customer_ideas;
          }
  
          public function getPromoCodes()
          {
              if( empty($this->_promo_codes) )
              {
                  $this->_promo_codes = new \models\promo_codes();
                  $this->_promo_codes->setDi( $this->getDi() );
              }
  
              return $this->_promo_codes;
          }
  
9586c455   Alex Savenko   base
582
583
584
585
586
587
588
589
590
591
592
          public function getDiscount()
          {
              if( empty($this->_discount) )
              {
                  $this->_discount = new \models\discount();
                  $this->_discount->setDi( $this->getDi() );
              }
  
              return $this->_discount;
          }
  
447777f9   Alex Savenko   popup handler
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
          /**
           * models::getSubscribe
           *
           * @author      Alex Savenko
           * @version     0.1.20140507
           *
           * @return    	\models\subscribe
           */
          public function getSubscribe()
          {
              if( empty($this->_subscribe) )
              {
                  $this->_subscribe = new \models\subscribe();
                  $this->_subscribe->setDi( $this->getDi() );
              }
  
              return $this->_subscribe;
          }
  
dce46e80   Alex Savenko   first push project
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
          public function getPayment()
          {
              if( empty($this->_payment) )
              {
                  $this->_payment = new \models\payment();
                  $this->_payment->setDi( $this->getDi() );
              }
  
              return $this->_payment;
          }
  
          public function getSales()
          {
              if( empty($this->_sales) )
              {
                  $this->_sales = new \models\sales();
                  $this->_sales->setDi( $this->getDi() );
              }
  
              return $this->_sales;
          }
  
          public function getReviews()
          {
              if( empty($this->_reviews) )
              {
                  $this->_reviews = new \models\reviews();
                  $this->_reviews->setDi( $this->getDi() );
              }
  
              return $this->_reviews;
          }
          public function getModal()
          {
              if( empty($this->_modal) )
              {
                  $this->_modal = new \models\modal();
                  $this->_modal->setDi( $this->getDi() );
              }
  
              return $this->_modal;
          }
  
          public function getManagerMail()
          {
              if( empty($this->_manager_mail) )
              {
                  $this->_manager_mail = new \models\manager_mail();
                  $this->_manager_mail->setDi( $this->getDi() );
              }
  
              return $this->_manager_mail;
          }
  
          public function getPromoToUser()
          {
              if( empty($this->_promo_to_user) )
              {
                  $this->_promo_to_user = new \models\promo_to_user();
                  $this->_promo_to_user->setDi( $this->getDi() );
              }
  
              return $this->_promo_to_user;
          }
f723ca00   Alex Savenko   test
676
677
678
679
680
681
682
683
684
  
          public function getBasket()
          {
              if( empty($this->_basket) )
              {
                  $this->_basket = new basket();
                  $this->_basket->setDi( $this->getDi() );
              }
  
282e165b   Alex Savenko   creating model ba...
685
              return $this->_basket;
f723ca00   Alex Savenko   test
686
          }
dce46e80   Alex Savenko   first push project
687
688
689
690
      }
  }
  
  ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////