ServiceInterface.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2020-01-23 09:53
  7. */
  8. namespace common\services;
  9. interface ServiceInterface
  10. {
  11. //backend list page
  12. public function getList(array $query = [], array $options=[]);
  13. //get model by primary key(usually table `id` column)
  14. public function getModel($id, array $options=[]);
  15. //get search model
  16. public function getSearchModel(array $options=[]);
  17. //get a new model, for create record
  18. public function newModel(array $options=[]);
  19. //backend execute add a new record
  20. public function create(array $postData, array $options=[]);
  21. //backend execute update a exists record
  22. public function update($id, array $postData, array $options=[]);
  23. //backend execute get record, if not exists will throw 404(NotFound) exception
  24. public function getDetail($id, array $options=[]);
  25. //backend execute delete a exists record
  26. public function delete($id, array $options=[]);
  27. //backend execute update a exists record sort
  28. public function sort($id, $sort, array $options=[]);
  29. }