Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set only few REST methods. #6

Merged
merged 4 commits into from
Nov 21, 2018

Conversation

DarkSide666
Copy link
Member

@DarkSide666 DarkSide666 commented Jun 14, 2018

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')

for example:
$restapi->rest('/country', new Model_Country($smbo->db), ['read']);
only will set GET methods.
@DarkSide666 DarkSide666 requested a review from romaninsh June 14, 2018 12:36
@codecov
Copy link

codecov bot commented Jun 14, 2018

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.

Copy link
Member

@romaninsh romaninsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good changes. but please reflect in doc (or readme)

@romaninsh romaninsh merged commit 2e416cf into develop Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants