Notificacion.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "Notificacion".
  6. *
  7. * @property int $id
  8. * @property string|null $envio
  9. * @property string|null $estatus
  10. * @property string|null $creado
  11. * @property string|null $modificado
  12. * @property string|null $detalle
  13. *
  14. * @property NotificacionUsuario[] $notificacionUsuarios
  15. */
  16. class Notificacion extends \yii\db\ActiveRecord {
  17. public const ESTATUS_NUEVO = "Nuevo";
  18. public const ESTATUS_ENVIANDO = "Enviando";
  19. public const ESTATUS_TERMINADO = "Terminado";
  20. public const ESTATUS_ERROR = "Error";
  21. const PLANTILLA_EVENTO = "laud_resumen_eventos";
  22. const PLANTILLA_LIDER_EVENTO = "laud_resumen_eventos_dependencia";
  23. const PLANTILLA_LIDER_GLOBAL = "laud_resumen_dependencias_lider_global";
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public static function tableName() {
  28. return 'Notificacion';
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function rules() {
  34. return [
  35. [['envio', 'creado', 'modificado', 'detalle'], 'safe'],
  36. [['estatus'], 'string', 'max' => 10],
  37. ];
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function attributeLabels() {
  43. return [
  44. 'id' => 'ID',
  45. 'envio' => 'Envio',
  46. 'estatus' => 'Estatus',
  47. 'creado' => 'Creado',
  48. 'modificado' => 'Modificado',
  49. 'detalle' => 'Detalle',
  50. ];
  51. }
  52. /**
  53. * Gets query for [[NotificacionUsuarios]].
  54. *
  55. * @return \yii\db\ActiveQuery
  56. */
  57. public function getNotificacionUsuarios() {
  58. return $this->hasMany(NotificacionUsuario::class, ['idNotificacion' => 'id']);
  59. }
  60. }