@@ -62,7 +62,8 @@ abstract class AbstractCondition extends \Magento\Framework\DataObject implement
62
62
protected $ _layout ;
63
63
64
64
/**
65
- * Base name for hidden elements
65
+ * Base name for hidden elements.
66
+ *
66
67
* @var string
67
68
*/
68
69
protected $ elementName = 'rule ' ;
@@ -116,8 +117,9 @@ public function getDefaultOperatorInputByType()
116
117
}
117
118
118
119
/**
119
- * Default operator options getter
120
- * Provides all possible operator options
120
+ * Default operator options getter.
121
+ *
122
+ * Provides all possible operator options.
121
123
*
122
124
* @return array
123
125
*/
@@ -141,6 +143,8 @@ public function getDefaultOperatorOptions()
141
143
}
142
144
143
145
/**
146
+ * Get rule form.
147
+ *
144
148
* @return Form
145
149
*/
146
150
public function getForm ()
@@ -149,6 +153,8 @@ public function getForm()
149
153
}
150
154
151
155
/**
156
+ * Get condition as array.
157
+ *
152
158
* @param array $arrAttributes
153
159
* @return array
154
160
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -195,6 +201,8 @@ public function getMappedSqlField()
195
201
}
196
202
197
203
/**
204
+ * Get condition as xml.
205
+ *
198
206
* @return string
199
207
*/
200
208
public function asXml ()
@@ -214,6 +222,8 @@ public function asXml()
214
222
}
215
223
216
224
/**
225
+ * Load condition from array.
226
+ *
217
227
* @param array $arr
218
228
* @return $this
219
229
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -229,6 +239,8 @@ public function loadArray($arr)
229
239
}
230
240
231
241
/**
242
+ * Load condition from xml.
243
+ *
232
244
* @param string|array $xml
233
245
* @return $this
234
246
*/
@@ -242,6 +254,8 @@ public function loadXml($xml)
242
254
}
243
255
244
256
/**
257
+ * Load attribute options.
258
+ *
245
259
* @return $this
246
260
*/
247
261
public function loadAttributeOptions ()
@@ -250,6 +264,8 @@ public function loadAttributeOptions()
250
264
}
251
265
252
266
/**
267
+ * Get attribute options.
268
+ *
253
269
* @return array
254
270
*/
255
271
public function getAttributeOptions ()
@@ -258,6 +274,8 @@ public function getAttributeOptions()
258
274
}
259
275
260
276
/**
277
+ * Get attribute select options.
278
+ *
261
279
* @return array
262
280
*/
263
281
public function getAttributeSelectOptions ()
@@ -270,6 +288,8 @@ public function getAttributeSelectOptions()
270
288
}
271
289
272
290
/**
291
+ * Get attribute name.
292
+ *
273
293
* @return string
274
294
*/
275
295
public function getAttributeName ()
@@ -278,6 +298,8 @@ public function getAttributeName()
278
298
}
279
299
280
300
/**
301
+ * Load operator options.
302
+ *
281
303
* @return $this
282
304
*/
283
305
public function loadOperatorOptions ()
@@ -300,6 +322,8 @@ public function getInputType()
300
322
}
301
323
302
324
/**
325
+ * Get operator select options.
326
+ *
303
327
* @return array
304
328
*/
305
329
public function getOperatorSelectOptions ()
@@ -316,6 +340,8 @@ public function getOperatorSelectOptions()
316
340
}
317
341
318
342
/**
343
+ * Get operator name.
344
+ *
319
345
* @return array
320
346
*/
321
347
public function getOperatorName ()
@@ -324,6 +350,8 @@ public function getOperatorName()
324
350
}
325
351
326
352
/**
353
+ * Load value options.
354
+ *
327
355
* @return $this
328
356
*/
329
357
public function loadValueOptions ()
@@ -333,6 +361,8 @@ public function loadValueOptions()
333
361
}
334
362
335
363
/**
364
+ * Get value select options.
365
+ *
336
366
* @return array
337
367
*/
338
368
public function getValueSelectOptions ()
@@ -380,6 +410,8 @@ public function isArrayOperatorType()
380
410
}
381
411
382
412
/**
413
+ * Get value.
414
+ *
383
415
* @return mixed
384
416
*/
385
417
public function getValue ()
@@ -395,6 +427,8 @@ public function getValue()
395
427
}
396
428
397
429
/**
430
+ * Get value name.
431
+ *
398
432
* @return array|string
399
433
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
400
434
*/
@@ -446,6 +480,8 @@ public function getNewChildSelectOptions()
446
480
}
447
481
448
482
/**
483
+ * Get new child name.
484
+ *
449
485
* @return string
450
486
*/
451
487
public function getNewChildName ()
@@ -454,6 +490,8 @@ public function getNewChildName()
454
490
}
455
491
456
492
/**
493
+ * Get this condition as html.
494
+ *
457
495
* @return string
458
496
*/
459
497
public function asHtml ()
@@ -467,6 +505,8 @@ public function asHtml()
467
505
}
468
506
469
507
/**
508
+ * Get this condition with subconditions as html.
509
+ *
470
510
* @return string
471
511
*/
472
512
public function asHtmlRecursive ()
@@ -475,6 +515,8 @@ public function asHtmlRecursive()
475
515
}
476
516
477
517
/**
518
+ * Get type element.
519
+ *
478
520
* @return AbstractElement
479
521
*/
480
522
public function getTypeElement ()
@@ -493,6 +535,8 @@ public function getTypeElement()
493
535
}
494
536
495
537
/**
538
+ * Get type element html.
539
+ *
496
540
* @return string
497
541
*/
498
542
public function getTypeElementHtml ()
@@ -501,6 +545,8 @@ public function getTypeElementHtml()
501
545
}
502
546
503
547
/**
548
+ * Get attribute element.
549
+ *
504
550
* @return $this
505
551
*/
506
552
public function getAttributeElement ()
@@ -528,6 +574,8 @@ public function getAttributeElement()
528
574
}
529
575
530
576
/**
577
+ * Get attribute element html.
578
+ *
531
579
* @return string
532
580
*/
533
581
public function getAttributeElementHtml ()
@@ -536,8 +584,9 @@ public function getAttributeElementHtml()
536
584
}
537
585
538
586
/**
539
- * Retrieve Condition Operator element Instance
540
- * If the operator value is empty - define first available operator value as default
587
+ * Retrieve Condition Operator element Instance.
588
+ *
589
+ * If the operator value is empty - define first available operator value as default.
541
590
*
542
591
* @return \Magento\Framework\Data\Form\Element\Select
543
592
*/
@@ -568,6 +617,8 @@ public function getOperatorElement()
568
617
}
569
618
570
619
/**
620
+ * Get operator element html.
621
+ *
571
622
* @return string
572
623
*/
573
624
public function getOperatorElementHtml ()
@@ -587,6 +638,8 @@ public function getValueElementType()
587
638
}
588
639
589
640
/**
641
+ * Get value element renderer.
642
+ *
590
643
* @return \Magento\Rule\Block\Editable
591
644
*/
592
645
public function getValueElementRenderer ()
@@ -598,6 +651,8 @@ public function getValueElementRenderer()
598
651
}
599
652
600
653
/**
654
+ * Get value element.
655
+ *
601
656
* @return $this
602
657
*/
603
658
public function getValueElement ()
@@ -615,6 +670,9 @@ public function getValueElement()
615
670
// date format intentionally hard-coded
616
671
$ elementParams ['input_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
617
672
$ elementParams ['date_format ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
673
+ $ elementParams ['placeholder ' ] = \Magento \Framework \Stdlib \DateTime::DATE_INTERNAL_FORMAT ;
674
+ $ elementParams ['autocomplete ' ] = 'off ' ;
675
+ $ elementParams ['readonly ' ] = 'true ' ;
618
676
}
619
677
return $ this ->getForm ()->addField (
620
678
$ this ->getPrefix () . '__ ' . $ this ->getId () . '__value ' ,
@@ -626,6 +684,8 @@ public function getValueElement()
626
684
}
627
685
628
686
/**
687
+ * Get value element html.
688
+ *
629
689
* @return string
630
690
*/
631
691
public function getValueElementHtml ()
@@ -634,6 +694,8 @@ public function getValueElementHtml()
634
694
}
635
695
636
696
/**
697
+ * Get add link html.
698
+ *
637
699
* @return string
638
700
*/
639
701
public function getAddLinkHtml ()
@@ -643,6 +705,8 @@ public function getAddLinkHtml()
643
705
}
644
706
645
707
/**
708
+ * Get remove link html.
709
+ *
646
710
* @return string
647
711
*/
648
712
public function getRemoveLinkHtml ()
@@ -655,6 +719,8 @@ public function getRemoveLinkHtml()
655
719
}
656
720
657
721
/**
722
+ * Get chooser container html.
723
+ *
658
724
* @return string
659
725
*/
660
726
public function getChooserContainerHtml ()
@@ -664,6 +730,8 @@ public function getChooserContainerHtml()
664
730
}
665
731
666
732
/**
733
+ * Get this condition as string.
734
+ *
667
735
* @param string $format
668
736
* @return string
669
737
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -674,6 +742,8 @@ public function asString($format = '')
674
742
}
675
743
676
744
/**
745
+ * Get this condition with subconditions as string.
746
+ *
677
747
* @param int $level
678
748
* @return string
679
749
*/
@@ -816,6 +886,8 @@ protected function _compareValues($validatedValue, $value, $strict = true)
816
886
}
817
887
818
888
/**
889
+ * Validate model.
890
+ *
819
891
* @param \Magento\Framework\Model\AbstractModel $model
820
892
* @return bool
821
893
*/
0 commit comments