Pago.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "ConceptosObra".
  6. *
  7. * @property string $id
  8. * @property string $idObra
  9. * @property string $idConceptoObra
  10. * @property string|null $cantidad
  11. * @property string|null $descripcion
  12. * @property string $fechaCompra
  13. *
  14. */
  15. class Pago extends ModeloBase
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public static function tableName()
  21. {
  22. return 'Pago';
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function rules()
  28. {
  29. return [
  30. [['id','idObra','idConceptoObra'], 'required'],
  31. [['creado', 'modificado', 'eliminado','fechaPago'], 'safe'],
  32. [['cantidad'], 'integer'],
  33. [['cantidad'], 'default', 'value' => null],
  34. [['id', 'idObra','idConceptoObra'], 'string', 'max' => 36],
  35. [[ 'descripcion'], 'string', 'max' => 100],
  36. [['idObra'], 'exist', 'skipOnError' => true, 'targetClass' => Obra::class, 'targetAttribute' => ['idObra' => 'id']],
  37. [['idConceptoObra'], 'exist', 'skipOnError' => true, 'targetClass' => ConceptosObra::class, 'targetAttribute' => ['idConceptoObra' => 'id']],
  38. ];
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function attributeLabels()
  44. {
  45. return [
  46. 'id' => 'ID',
  47. 'idObra' => 'ID de la Obra',
  48. 'idConceptoObra' => 'ID del Concepto Obra',
  49. 'cantidad' => 'Cantidad',
  50. 'descripcion' => 'Descripcion',
  51. 'fechaPago' => 'Fecha de Pago',
  52. 'creado' => 'Creado',
  53. 'modificado' => 'Modificado',
  54. 'eliminado' => 'Eliminado',
  55. ];
  56. }
  57. }