atk4 / api

Implementation of RestAPI for Agile Data
https://agiletoolkit.org/
14 stars 12 forks source link

Add ability to set only few REST methods. #6

Closed DarkSide666 closed 5 years ago

DarkSide666 commented 6 years ago

for example: $restapi->rest('/country', new Model_Country($smbo->db), ['read']); only will set GET methods.

Also now it supports loadBy() like this:

api/country/2 = load(2)
api/country/code:GB = loadBy('code', 'GB')
api/country/name:United%20Kingdom = loadBy('name', 'United Kingdom')
api/country/:United+Kingdom = loadBy($model->title_field, 'United Kingdom')
codecov[bot] commented 6 years ago

Codecov Report

Merging #6 into develop will decrease coverage by 4.81%. The diff coverage is 2.85%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop       #6      +/-   ##
=============================================
- Coverage         40%   35.18%   -4.82%     
- Complexity        56       75      +19     
=============================================
  Files              1        1              
  Lines            140      162      +22     
=============================================
+ Hits              56       57       +1     
- Misses            84      105      +21
Impacted Files Coverage Δ Complexity Δ
src/Api.php 35.18% <2.85%> (-4.82%) 75 <28> (+19)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f7128f2...0439deb. Read the comment docs.