I've seen this question asked in this group a few times, but I
couldn't really parse out an answer, so I'm asking again.
From what I've read of the source code, it /appears/ as though you
can set the datasource for a model to, for instance, use a web
service.
It appears as though it's not much harder than overriding create/read/
update/delete in a subclass of DataSource. However, I can't seem to
get the data source in use at all. I suspect this has to do with which
files get loaded when (h00ray for file-based source code!).
I'm also not quite sure where to put the code for this. I've shoved
it in app/vendors now, but that doesn't seem quite right, since it
ain't third party, but a first-party generic library.
So, I have this data source defined in 'app/vendors/
web_services_data_source.php', and I have a model which require()s it
(again, not very pretty, and I'd like to not have to do that in every
model), and that's fine, but when I try to load the page I get:
[SNIP]
Fatal error: ConnectionManager::getDataSource - Non-existent data
source WebServicesDataSource in /home/bjc/src/cake_test/htdocs/cake/
libs/model/connection_manager.php on line 110
[SNIP]
And I can't figure out why. By this point, my model has been loaded
and the data source module has been loaded by require() (I know,
because if I change the arg to require, it barfs without displaying
the message above). So why can't ConnectionManager find it?
I specify $this->setDataSource('WebServicesDataSource') in the
constructor of the model I'm using. I've also tried
'web_services_data_source', but it has the same error.
Can anyone give me any pointers?
-bjc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---