NotificacionUsuario.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "NotificacionUsuario".
  6. *
  7. * @property int $id
  8. * @property int|null $idNotificacion
  9. * @property int|null $idUsuario
  10. * @property string|null $nombre
  11. * @property string|null $telefono
  12. * @property string|null $parametros
  13. * @property string|null $detalle
  14. * @property string|null $plantilla
  15. *
  16. * @property Notificacion $notificacion
  17. * @property Usuario $usuario
  18. */
  19. class NotificacionUsuario extends \yii\db\ActiveRecord {
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public static function tableName() {
  24. return 'NotificacionUsuario';
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function rules() {
  30. return [
  31. [['idNotificacion', 'idUsuario'], 'default', 'value' => null],
  32. [['idNotificacion', 'idUsuario'], 'integer'],
  33. [['parametros', 'detalle'], 'safe'],
  34. [['nombre', 'plantilla'], 'string', 'max' => 100],
  35. [['telefono'], 'string', 'max' => 10],
  36. [['idNotificacion'], 'exist', 'skipOnError' => true, 'targetClass' => Notificacion::class, 'targetAttribute' => ['idNotificacion' => 'id']],
  37. [['idUsuario'], 'exist', 'skipOnError' => true, 'targetClass' => Usuario::class, 'targetAttribute' => ['idUsuario' => 'id']],
  38. ];
  39. }
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function attributeLabels() {
  44. return [
  45. 'id' => 'ID',
  46. 'idNotificacion' => 'Id Notificacion',
  47. 'idUsuario' => 'Id Usuario',
  48. 'nombre' => 'Nombre',
  49. 'telefono' => 'Telefono',
  50. 'parametros' => 'Parametros',
  51. 'detalle' => 'Detalle',
  52. 'plantilla' => 'Plantilla',
  53. ];
  54. }
  55. /**
  56. * Gets query for [[notificacion]].
  57. *
  58. * @return \yii\db\ActiveQuery
  59. */
  60. public function getNotificacion() {
  61. return $this->hasOne(Notificacion::class, ['id' => 'idNotificacion']);
  62. }
  63. /**
  64. * Gets query for [[usuario]].
  65. *
  66. * @return \yii\db\ActiveQuery
  67. */
  68. public function getUsuario() {
  69. return $this->hasOne(Usuario::class, ['id' => 'idUsuario']);
  70. }
  71. }