Notificacion.php 1.5 KB

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