yoesoff

php bin/console make:entity

Aug 7th, 2019
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.81 KB | None | 0 0
  1. ╭─yoesoff@yoesoff-ThinkPad-X220 ~/Documents/Oproject/Oapi  
  2. ╰─➤  php bin/console make:entity                
  3.  
  4.  Class name of the entity to create or update (e.g. GrumpyChef):
  5.  > User
  6.  
  7.  Mark this class as an API Platform resource (expose a CRUD API for it) (yes/no) [no]:
  8.  > yes
  9.  
  10.  created: src/Entity/User.php
  11.  created: src/Repository/UserRepository.php
  12.  
  13.  Entity generated! Now let's add some fields!
  14. You can always add more fields later manually or by re-running this command.
  15.  
  16. New property name (press <return> to stop adding fields):
  17. > username
  18.  
  19. Field type (enter ? to see all types) [string]:
  20. >
  21.  
  22. Field length [255]:
  23. > 100
  24.  
  25. Can this field be null in the database (nullable) (yes/no) [no]:
  26. >
  27.  
  28. updated: src/Entity/User.php
  29.  
  30. Add another property? Enter the property name (or press <return> to stop adding fields):
  31. > password
  32.  
  33. Field type (enter ? to see all types) [string]:
  34. >
  35.  
  36. Field length [255]:
  37. > 100
  38.  
  39. Can this field be null in the database (nullable) (yes/no) [no]:
  40. > no
  41.  
  42. updated: src/Entity/User.php
  43.  
  44. Add another property? Enter the property name (or press <return> to stop adding fields):
  45. > email
  46.  
  47. Field type (enter ? to see all types) [string]:
  48. >
  49.  
  50. Field length [255]:
  51. >
  52.  
  53. Can this field be null in the database (nullable) (yes/no) [no]:
  54. >
  55.  
  56. updated: src/Entity/User.php
  57.  
  58. Add another property? Enter the property name (or press <return> to stop adding fields):
  59. > isActive
  60.  
  61. Field type (enter ? to see all types) [boolean]:
  62. >
  63.  
  64. Can this field be null in the database (nullable) (yes/no) [no]:
  65. >
  66.  
  67. updated: src/Entity/User.php
  68.  
  69. Add another property? Enter the property name (or press <return> to stop adding fields):
  70. >
  71.  
  72.  
  73.          
  74.  Success!
  75.          
  76.  
  77. Next: When you're ready, create a migration with make:migration
Advertisement
Add Comment
Please, Sign In to add comment