MenuToTheUser.php 870 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "menu_to_the_user".
  6. *
  7. * @property integer $id
  8. * @property string $menu_name
  9. */
  10. class MenuToTheUser extends \yii\db\ActiveRecord
  11. {
  12. /**
  13. * @inheritdoc
  14. */
  15. public static function tableName()
  16. {
  17. return 'menu_to_the_user';
  18. }
  19. /**
  20. * @inheritdoc
  21. */
  22. public function rules()
  23. {
  24. return [
  25. [['menu_name'], 'required'],
  26. [['menu_name'], 'string', 'max' => 255],
  27. ];
  28. }
  29. /**
  30. * @inheritdoc
  31. */
  32. public function attributeLabels()
  33. {
  34. return [
  35. 'id' => 'ID',
  36. 'menu_name' => Yii::t('app','Menu Name'),
  37. ];
  38. }
  39. public function getDocuments(){
  40. return $this->hasMany(DocumentsToTheUser::className(), ['menu_to_the_user_id' => 'id']);
  41. }
  42. }