Notificacion.php 1.3 KB

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