NotificacionUsuario.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. *
  15. * @property Notificacion $notificacion
  16. * @property Usuario $usuario
  17. */
  18. class NotificacionUsuario extends \yii\db\ActiveRecord {
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public static function tableName() {
  23. return 'NotificacionUsuario';
  24. }
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public function rules() {
  29. return [
  30. [['idNotificacion', 'idUsuario'], 'default', 'value' => null],
  31. [['idNotificacion', 'idUsuario'], 'integer'],
  32. [['parametros', 'detalle'], 'safe'],
  33. [['nombre'], 'string', 'max' => 100],
  34. [['telefono'], 'string', 'max' => 10],
  35. [['idNotificacion'], 'exist', 'skipOnError' => true, 'targetClass' => Notificacion::class, 'targetAttribute' => ['idNotificacion' => 'id']],
  36. [['idUsuario'], 'exist', 'skipOnError' => true, 'targetClass' => Usuario::class, 'targetAttribute' => ['idUsuario' => 'id']],
  37. ];
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function attributeLabels() {
  43. return [
  44. 'id' => 'ID',
  45. 'idNotificacion' => 'Id Notificacion',
  46. 'idUsuario' => 'Id Usuario',
  47. 'nombre' => 'Nombre',
  48. 'telefono' => 'Telefono',
  49. 'parametros' => 'Parametros',
  50. 'detalle' => 'Detalle',
  51. ];
  52. }
  53. /**
  54. * Gets query for [[notificacion]].
  55. *
  56. * @return \yii\db\ActiveQuery
  57. */
  58. public function getNotificacion() {
  59. return $this->hasOne(Notificacion::class, ['id' => 'idNotificacion']);
  60. }
  61. /**
  62. * Gets query for [[usuario]].
  63. *
  64. * @return \yii\db\ActiveQuery
  65. */
  66. public function getUsuario() {
  67. return $this->hasOne(Usuario::class, ['id' => 'idUsuario']);
  68. }
  69. }