pmtpenza

Untitled

Jul 16th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php
  2.  
  3. namespace backend\models;
  4.  
  5. use Yii;
  6. use yii\base\Model;
  7. use backend\models\TypeZakaz;
  8.  
  9.  
  10. class OrderForm extends Model
  11. {
  12. public $id, $type_zakaz_id, $deals_id;
  13.  
  14. public $isNewRecord =true;
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public function rules()
  19. {
  20. return [
  21. [['deals_id', 'type_zakaz_id'], 'integer'],
  22. ];
  23. }
  24.  
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function attributeLabels()
  29. {
  30. return [
  31. 'id' => 'ID',
  32. 'deals_id' => 'deals_id',
  33. 'type_zakaz_id' => 'type_zakaz_id',
  34. ];
  35. }
  36.  
  37. public static function loadModels($data, $formName)
  38. {
  39. $models = [];
  40. if ( isset($data[$formName]) && count($data[$formName]) > 0) {
  41. for ($i = 0; $i < count($data[$formName]); $i ++ ) {
  42. $models[$i] = new self();
  43. }
  44. self::loadMultiple($models, $data, $formName);
  45. }
  46. return $models;
  47. }
  48.  
  49.  
  50. }
Add Comment
Please, Sign In to add comment