CountryController.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. namespace App\Geo\Country;
  3. use \App\Core\Template\Output as Output;
  4. use \App\Geo\Country\Classes\Country as Country;
  5. class CountryController extends \DefaultController{
  6. protected $_class = Country::class;
  7. protected $_baseUrl = 'country';
  8. /**
  9. * Index
  10. * Show the main Country list
  11. */
  12. function index(){
  13. $list = Array();
  14. for($i = 0; $i <= 10; $i++){
  15. $obj = Array();
  16. $obj['id'] = $i;
  17. $obj['value'] = md5($i);
  18. $obj['description'] = sha1($i);
  19. $list[] = $obj;
  20. }
  21. Output::render('index', Array('list' => $list));
  22. }
  23. /**
  24. * Create
  25. *
  26. * Render the main Country formulary
  27. */
  28. function create(){
  29. Output::render('form', ['id' => 0]);
  30. }
  31. /**
  32. * Store
  33. *
  34. * Store the param on the database
  35. * @param Country $country
  36. */
  37. function store(Country $country){
  38. }
  39. /**
  40. * Search
  41. *
  42. * Store the param on the database
  43. * @param Country $country
  44. */
  45. function search(){
  46. }
  47. /**
  48. * Show
  49. *
  50. * Render one register
  51. *
  52. * @param Country $country
  53. */
  54. function show(Country $country){
  55. }
  56. /**
  57. * Edit
  58. *
  59. * Render the formular for a database Country
  60. *
  61. * @param Country $country
  62. */
  63. function edit(Country $country){
  64. Output::render('form', $country);
  65. }
  66. /**
  67. * Update
  68. * Store the changes of the param on the database
  69. *
  70. * @param Country $country
  71. */
  72. function update(Country $country){
  73. }
  74. /**
  75. * Destroy
  76. * If the object has soft delete.
  77. *
  78. * @param Country $country
  79. */
  80. function destroy(Country $country){
  81. }
  82. /**
  83. * Purge
  84. * Remove object even with soft delete.
  85. *
  86. * @param Country $country
  87. */
  88. function purge(Country $country){
  89. }
  90. function raw(){
  91. var_dump( Country::findOne('25')->with(['states']) );
  92. }
  93. }