Notificacion.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. const PLANTILLA_LIDER_EVENTO_URL = "laud_lider_dependencia_url";
  25. const PLANTILLA_LIDER_GLOBAL_URL = "laud_lider_global_url";
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public static function tableName() {
  30. return 'Notificacion';
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function rules() {
  36. return [
  37. [['envio', 'creado', 'modificado', 'detalle'], 'safe'],
  38. [['estatus'], 'string', 'max' => 10],
  39. ];
  40. }
  41. /**
  42. * {@inheritdoc}
  43. */
  44. public function attributeLabels() {
  45. return [
  46. 'id' => 'ID',
  47. 'envio' => 'Envio',
  48. 'estatus' => 'Estatus',
  49. 'creado' => 'Creado',
  50. 'modificado' => 'Modificado',
  51. 'detalle' => 'Detalle',
  52. ];
  53. }
  54. /**
  55. * Gets query for [[NotificacionUsuarios]].
  56. *
  57. * @return \yii\db\ActiveQuery
  58. */
  59. public function getNotificacionUsuarios() {
  60. return $this->hasMany(NotificacionUsuario::class, ['idNotificacion' => 'id']);
  61. }
  62. }