gabordemooij / RB4Plugins

Plugins for RedBeanPHP4
7 stars 3 forks source link

[BeanCan Resty] Correct way to extend rest methods #3

Closed marmz closed 2 years ago

marmz commented 2 years ago

As in subject, i'd like to add some rest apis to beanCan, for example make it call a CSVimport extension (something like R::CSVimport($data))

Which should be the correct way to add my custom calls? Should i extend \RedBeanPHP\SimpleModel ?

In some case, the subject af the call would not be a bean (see CSVimport example)

The rest url could be something like this:

POST => {site_id}/{table_name}/csv_import (acccept an array containing csv data)

gabordemooij commented 2 years ago

adjusted private methods to protected methods, that should help