Notice Error Undefined property with custom data source

2012-04-10 Thread Scott Koranda
I am using CakePHP 2.0.5.

I have subclassed DataSource to create my own data source and have
implemented the describe(), listSources(), and CRUD methods as
outlined at

http://book.cakephp.org/2.0/en/models/datasources.html

When using the data source to instantiate instances of an AppModel
subclass I am seeing the following:

Notice Error: Undefined property: MySource::$startQuote in [/path/to/
app/lib/Cake/Model/Model.php, line 1269]

Notice Error: Undefined property: MySource::$endQuote in [/path/to/app/
lib/Cake/Model/Model.php, line 1269]

Notice Error: Undefined property: MySource::$columns in [/path/to/app/
lib/Cake/Model/Model.php, line 1569]

Is it expected that I should see these errors?

Do I need to define $startQuote, $endQuote, and $columns for my data
source class? If so is there documentation I can follow so that I
understand how they will be used?

Thanks,

Scott

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Custom data source

2009-01-26 Thread Martin Westin


I would probably not go all the way back to a data source. At least
not at first. I would create a special Model that talked to the web
service. The reason is that I don't really think you will end up
supporting a majority of the data source features so it may be more
work than you want. How would you deal with find queries at the dso
level? Does the api support anything like a query? Will you have any
kind of write-access (save, delete...)? The more of these questions
you can answer yes to the more sense it would make to create a dso.


On Jan 25, 9:39 pm, Josip Dzolonga jdzolo...@gmail.com wrote:
 Hello everyone,

 So I'm designing a web site that has a very specific architecture.
 _Some_ of the data is handled by a Java RESTful web service (there is
 a database as well). There are actually two things stored which I
 would like to have as models:

 1) Users
 2) Documents

 However, there are permissions as well (which I don' t have to
 handle), meaning that not all users have access to all documents. The
 authentication is done with http basic auth, so if a user wants to
 access document XYZ, he performs a get on /documents/XYZ with his user
 and password. So, when a user logs in to the web site, the application
 will have to store the username and password in the session and then
 make requests in the background to the web service with them to access
 documents. What is the best way to implement this using CakePHP? I
 thought of designing a custom data source which will be given the
 username and password once the user logs in. Is this a good approach
 and can you please give any advises on this?

 Thank you in advance,
 Josip
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Custom data source

2009-01-25 Thread Josip Dzolonga

Hello everyone,

So I'm designing a web site that has a very specific architecture.
_Some_ of the data is handled by a Java RESTful web service (there is
a database as well). There are actually two things stored which I
would like to have as models:

1) Users
2) Documents

However, there are permissions as well (which I don' t have to
handle), meaning that not all users have access to all documents. The
authentication is done with http basic auth, so if a user wants to
access document XYZ, he performs a get on /documents/XYZ with his user
and password. So, when a user logs in to the web site, the application
will have to store the username and password in the session and then
make requests in the background to the web service with them to access
documents. What is the best way to implement this using CakePHP? I
thought of designing a custom data source which will be given the
username and password once the user logs in. Is this a good approach
and can you please give any advises on this?

Thank you in advance,
Josip

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---