CakePHP-Copula / Copula

(Previously ApiDatasources) An abstract datasource for use in conjunction with specific api datasources
55 stars 23 forks source link

Clean up handling of $schema #4

Open ProLoser opened 12 years ago

ProLoser commented 12 years ago

Right now I'm not really providing the object modeler with anything useful for $schema and $table related methods. I am curious what I'm losing by doing this (perhaps form field introspection) and if I should try and provide a way to support this?

abalonepaul commented 11 years ago

I'll be working on this with the Salesforce plugin. Right now I am able to pass simple SOQL queries by using some of the Core query building methods. I am using table, and plan to add schema functionality.

tenebrousedge commented 11 years ago

Currently the datasource will use any schema declared using a $schema variable in the model. It's only really useful for saving data, I think. The CakePHP API documentation will have you believe that you can set $_schema in your models, but for some reason it sets this to null when saving.

I'm not really sure if the current behavior is sufficient to close this issue. Please clarify desired functionality.

ProLoser commented 11 years ago

This is just something I planned to look into further because I wasn't sure what it provides and what we lose by leaving it out. @imsamurai had the solution of providing keys from the config map which I liked, but it may not be relevant or necessary.

ProLoser commented 11 years ago

Refer to this code as potential reference material: https://github.com/imsamurai/cakephp-httpsource-datasource/blob/master/Lib/Config/HttpSourceConfig.php#L176-L209