Re: ajax autocomplete.

2006-06-15 Thread chenggn

Some body more care about time cost, learing cost, traing cost.

Some body just want get thing done quickly.

Do you know the race-rondiction issue in autocomplete?

You want type hello world

Depend on your typing speed, two requests was send to the server

(1) request /?q=hell

(2) request /?q=hello w

But second request returned first !

I didn't see any tutorial mentioned this issue.

I have tried script.aculo.us, and Yahoo UI AutoComplete, they just not
great as CAPXOUS.

Try their demo http://demo.script.aculo.us/ajax/autocompleter

try type hell, after the popup come out continue type to hello w,
see how idiot it is.

Nobody take resposnbility to the quality of those open source project,
they just ann We have autocomplete! use us!, they never told you the
detail.

Why would anyone pay $50 for something you can get for free with less
effort? 
So you mean oracle, bea, JIRA should just close the door?

I dont know are you still a student, or real application developer, but
your sound like a student.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: With a new release of Cake, comes new release notes - lets make them more useful - with Greasemonkey

2006-06-15 Thread Olivier Percebois-Garve

convenient. thanks.

Alister Bulman wrote:
 Hi,

 Lots of things annoy me - it's too hot and I don't have AirCon in my
 office, I'm not paid enough for all this s***, and there so much more
 that I can't control.

 One thing that used to mildly peeve me was CakePHP release notes, like
 the latest at http://cakeforge.org/frs/shownotes.php?release_id=105 .
 It's got details of the bug ID's and subversion changeset versions -
 but the page is plain text - so you couldn't start clicking through to
 find out what changed, or read the bug reports and the comments to
 find out if any of the changes would affect you - for good, or bad.

 I say used to peeve me because I've written this:
 http://abulman.co.uk/code/greasemonkey/cakeforgelinker.user.js  - A
 Greasemonkey script that will make links for the revision numbers, and
 ticket numbers, at least as much as it can easily recognise from a
 couple of quick regex search and replacements.  It could probably be a
 little quicker, and doubtless be more comprehensive, but I think it
 solves 90% of the problem, and that's a good 89% more than existed
 before...  For the rest - like the plain text URLs, try a GM script
 like http://userscripts.org/scripts/source/1024.user.js

 If you know - and have - Greasemonkey, click the link above, take a
 look and install it - then go to
 http://cakeforge.org/frs/shownotes.php?release_id=105 to see the
 results.

 If you don't know Greasemonkey, then go google it.  You'll find it's
 very useful.


 Now, excuse me, while I go check on what has changed in release #3083

 Alister

 http://abulman.co.uk/code/greasemonkey/cakeforgelinker.user.js

 

   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: $this-Model-findAll() with a model over 5000 records.

2006-06-15 Thread Grant Cox

To retrieve that many records and instantiate the classes, it is using
more than your PHP settings allow for a single script ( see
memory_limit in your php.ini , default is 8MB ).

So, you can either retrieve less records, or you can increase this
memory limit.  To only retrieve the 50 records that used to be the
default for findAll (but was removed around v1.0), then just have

$this-set('data', $this-Product-findAll(null,null,null,50));

Or, to increase the memory PHP can use for your script (if you do want
all 5000 records)

ini_set( 'memory_limit', '64M' );

(or whatever memory size seems appropriate for your server specs and
load)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problems Tutorial on AJAX Task List

2006-06-15 Thread Russ

im haing the same issue how did you fix it?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: ajax autocomplete.

2006-06-15 Thread RosSoft

I really need that you explains better why your solution is best,
because I don't find any bad thing in scriptaculous demo autocompleter,
do you?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



trying to create a form builder

2006-06-15 Thread cammo

Hi There,
I am trying to create a form builder in cakephp where multiple clients
can log in and create a form/survey and get the results of that survey.
 The problem I am having is that if each client creates a form with 10
custom fields I will need to have a seperate database table for each
form that is generated and also a table for each form to hold the
results.

Does anybody know of a better way to do this and/or if there are any
good tutorials, in cakephp or not on creating multiuser applications?

Any Help would be greatly appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: CakePHP 1.1.4.3083

2006-06-15 Thread davide
Larry E. Masters aka PhpNut wrote:
 ...
 CakeForge[3] when its a little more complete. Hopefully some people will be
 interested in contributing with some translations once we get it onto
 CakeForge. As of this writing, we are one ticket away from 1000. We
 ...

First of all: great job! :)

Then I'm here, concerning my life/job engagements, for translating it in
Italian.

What should/can I do?

Bye
D.





signature.asc
Description: OpenPGP digital signature


Could the RequestHandler recognized the requestAction ?

2006-06-15 Thread Olivier Percebois-Garve

Hi
I'm an heavy user of requestAction. When I'm in the requested method,
I'd like to know that this is being run by a requestAction and also the 
method where it is originating from.
I thought about an extension of the Requesthandler but there is maybe 
already a way.
Somebody has a idea on this ?

Olivvv

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: CakePHP Wiki: In Loving Memory

2006-06-15 Thread Larry E. Masters aka PhpNut
Manual site is CakePHP. And a custom parser for the docbook xml. The site also uses the cake caching.-- /*** @author Larry E. Masters* @var string $userName* @param string $realName* @returns string aka PhpNut
* @accesspublic*/ 
On 6/15/06, Mika [EMAIL PROTECTED] wrote:
In that list only bakery.CakeForge is gforge (http://gforge.org/)Manual is docbook (http://www.docbook.org/)Api is doxygen (
http://sourceforge.net/projects/doxygen/)Trac is trac (http://www.edgewall.com/trac/)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: CakePHP 1.1.4.3083

2006-06-15 Thread davide
I've downloaded this[1] version and testing it in a fresh environment
but I get the following error message:

Fatal error: Call to a member function on a non-object in
H:\www\cake-new\cake\libs\view\templates\layouts\default.thtml on line 57

XAMPP for windows 1.4.16 (Apache/2.0.54 (Win32) mod_autoindex_color
mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/4.4.0)

Regards
Davide

1. http://cakeforge.org/frs/download.php/204/cake_1.1.4.3083.tar.gz



signature.asc
Description: OpenPGP digital signature


Re: CakePHP 1.1.4.3083

2006-06-15 Thread Larry E. Masters aka PhpNut
This fixed package should correct your errorshttp://cakeforge.org/frs/?group_id=23release_id=105-- /*** @author Larry E. Masters
* @var string $userName* @param string $realName* @returns string aka PhpNut* @accesspublic*/On 6/15/06, davide 
[EMAIL PROTECTED] wrote:I've downloaded this[1] version and testing it in a fresh environment
but I get the following error message:Fatal error: Call to a member function on a non-object inH:\www\cake-new\cake\libs\view\templates\layouts\default.thtml on line 57XAMPP for windows 1.4.16 (Apache/2.0.54 (Win32) mod_autoindex_color
mod_ssl/2.0.54 OpenSSL/0.9.8 PHP/4.4.0)RegardsDavide1. http://cakeforge.org/frs/download.php/204/cake_1.1.4.3083.tar.gz
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: trying to create a form builder

2006-06-15 Thread Grant Cox

What I have used (but not quite for what you are doing) is to override
the beforeSave() and afterFind() functions to be able to save binary
data (arrays of information).  I think this should work ok for what you
want, as long as you aren't relying on other model functions that
directly look at the database (ie getColumnTypes(), hasField() ).

But the standard form controls (ie prepopulation, validation) just look
at the Model object after it is loaded, so you should have no problems
saving the field information as an array.

Just in case this is what you are after, I have put a paste of what I
currently use, to encode model data before being saved in the DB, and
decode when loaded.
http://www.cakephp.org/pastes/show/56c6f37eea4cba616418c649ee2eb84e


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: ajax autocomplete.

2006-06-15 Thread chenggn

Sorry I forgot the screencast

http://capxous.com/screencast/scriptaculous/

Not only scriptaculous , also Yahoo UI

http://capxous.com/screencast/yahoo/

RosSoft wrote:
 I really need that you explains better why your solution is best,
 because I don't find any bad thing in scriptaculous demo autocompleter,
 do you?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: CakePHP 1.1.4.3083

2006-06-15 Thread davide
Larry E. Masters aka PhpNut wrote:
 This fixed package should correct your errors
 http://cakeforge.org/frs/?group_id=23release_id=105

It works fine. :)

Thanks.
Davide




signature.asc
Description: OpenPGP digital signature


Re: ajax autocomplete.

2006-06-15 Thread Larry E. Masters aka PhpNut
Better pay $50 for each version of CakePHP I release.
That should have read:Better then donating, pay $50 for each version of CakePHP I release. -- /*** @author Larry E. Masters* @var string $userName* @param string $realName
* @returns string aka PhpNut* @accesspublic*/ 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Updating HABTM relationships

2006-06-15 Thread panyasan

It IS funny that nobody seems to have this problem since many-to-many
relationships are among the most useful features of relational
databases. I have also tried to understand the source code of the model
but it is so complex I'd rather spend my time differently. I would
welcome any moves on the sides of the CakePHP developers to make HABTM
associations even more useful...

Cheers, Christian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: trying to create a form builder

2006-06-15 Thread cammo

Thanks very much for your help Grant,
Not sure if that is exactly what I am after though,
Basically I want to allow multiple clients to have multiple forms in
the one app and to not have to create a new database to store each form
and also another to store the results for each one. I can see where
your method would be good, you could save the form in binary form and
store different forms in the one database. The only thing I think would
be a problem is when it comes to retrieving the stored data from the
database, wouldn't it be time consuming and/or rather messy to have to
decode each database record and then perform an operation on it to use
for reports etc...

I have a play around with it and see if I can adapt it to my needs.

Thanks again for you help It is much appreciated


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: With a new release of Cake, comes new release notes - lets make them more useful - with Greasemonkey

2006-06-15 Thread olle

Excellent, excellent!

I had to fix my broken Greasemonkey to get this working, but now I
actually did that, so I'm free to browse stuff faster. Thanks, Alister!

Greaseblog helped med:
http://greaseblog.blogspot.com/2005/12/troubleshooting-064.html

(I had that missing folder error.)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



recursive problem

2006-06-15 Thread [EMAIL PROTECTED]

I've got a find that I'm running that needs to have $recursive set to 3

however the other strands of my models don't go that deep and Cake
throws generateAssociation errors when it hits them and tries to go
deep

How do I get Cake to stop on the shallow routes but go the full depth
on the deep routes?

you can see my models, tables etc at
http://cakephp.org/pastes/show/e4c5088ed5c709653cc526dccac648be

thanks

Sarah


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: recursive problem

2006-06-15 Thread Larry E. Masters aka PhpNut
If you mean in your IndividualsController::index()$this-Individual-recursive = '-1'; //turn off all associations.$this-Individual-recursive = '0'; //retrieves only belongsToYou do not have to set them in the class like you have done using var $recursive = #;
-- /*** @author Larry E. Masters* @var string $userName* @param string $realName* @returns string aka PhpNut* @accesspublic*/ 
On 6/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I've got a find that I'm running that needs to have $recursive set to 3however the other strands of my models don't go that deep and Cakethrows generateAssociation errors when it hits them and tries to go
deepHow do I get Cake to stop on the shallow routes but go the full depthon the deep routes?you can see my models, tables etc at
http://cakephp.org/pastes/show/e4c5088ed5c709653cc526dccac648bethanksSarah

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: trying to create a form builder

2006-06-15 Thread cammo

Actually I found an open source application and looked at how they did
it, and I think I will try to adapt that it was more a database design
for me and trying to get my head around setting up the database in the
best way possible.

Cheers


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: ajax autocomplete.

2006-06-15 Thread Larry E. Masters aka PhpNut
chenggn,Did you join this list just to send a spam email selling you product?Seems like this is the case since you have one email to this group dated Jun 17 which is the day you joined.And prior to that you spamed others.
http://groups.google.com/groups/search?q=author:[EMAIL PROTECTED]-- /*** @author Larry E. Masters* @var string $userName
* @param string $realName* @returns string aka PhpNut* @accesspublic*/ 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: ajax autocomplete.

2006-06-15 Thread Larry E. Masters aka PhpNut
Please do research before assuming Open source is free for all.And I do consider your email spam and I am sure google will to since I already forwarded you multiple postings to other groups to them for review. And banned you from this group all together.
-- /*** @author Larry E. Masters* @var string $userName* @param string $realName* @returns string aka PhpNut* @accesspublic*/ 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: $this-Model-findAll() with a model over 5000 records.

2006-06-15 Thread Carlos Mauricio Samour

Thanks that did the trick!
Apreciate your help. I guess I will have to learn how pagination works
to display all that data.

On 6/15/06, Grant Cox [EMAIL PROTECTED] wrote:

 To retrieve that many records and instantiate the classes, it is using
 more than your PHP settings allow for a single script ( see
 memory_limit in your php.ini , default is 8MB ).

 So, you can either retrieve less records, or you can increase this
 memory limit.  To only retrieve the 50 records that used to be the
 default for findAll (but was removed around v1.0), then just have

 $this-set('data', $this-Product-findAll(null,null,null,50));

 Or, to increase the memory PHP can use for your script (if you do want
 all 5000 records)

 ini_set( 'memory_limit', '64M' );

 (or whatever memory size seems appropriate for your server specs and
 load)


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: $this-Model-findAll() with a model over 5000 records.

2006-06-15 Thread lorenzo


Carlos Mauricio Samour ha scritto:

 Hi everyone. I am having this problem trying to retrieve the data from
 one of my models.
 In my controller I use:
 function index(){
   $this-set('data', $this-Product-findAll());
   }

set to the findAll function a field array: get only the data you need !
$this-set('data',
$this-Product-findAll(null,array('id','name','price',description)));


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Self Joining Model

2006-06-15 Thread I. E. Smith-Heisters

Hi all,

I've found a few threads on related subjects, but none of them offer a
solution:

http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

I have a table that looks like this:

+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra
|
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | NULL| auto_increment
|
| name  | varchar(255) | YES  | | NULL|
|
| ui_name   | varchar(50)  |  | | |
|
| parent_id | int(10) unsigned | YES  | | NULL|
|
+---+--+--+-+-++

which represents nested menus. I would think it would be trivial to
allow each MenuItem to have children (whose parent_id is equal to its
id) by using hasMany.

So, first I tried this:
class MenuItem extends AppModel {
var $name = 'MenuItem';
var $useTable = 'tester';

var $validate = array (
'name' = VALID_NOT_EMPTY,
);
var $hasMany = 'MenuItem';
}

but that just overwrites the main node,
$this-MenuItem-read():
array(1) {
  [MenuItem]=
  array(0) {
  }
}

so I tried something like this instead:

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
)
);

which at least doesn't overwrite the main object, but still doesn't
populate the child array:
array(2) {
  [MenuItem]=
  array(4) {
[id]=
string(1) 4
[name]=
string(9) community
[ui_name]=
string(9) Community
[parent_id]=
NULL
  }
  [child]=
  array(0) {
  }
}
So then I tried a finderSQL parameter

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN 
tester AS two
ON one.id = two.parent_id'
)
);

but that has the same output on read() as the attempt with finderSQL
undefined. Unfortunately, I haven't found a single successful example
of using finderSQL, so it's hard to tell what sort of output the SQL
statement should have. I just grabbed and modded this statement from
one of the other threads I mentioned.

Okay, so then there's findAllThreaded and guiListTree. The former seems
to work (albeit it's kind of uncontrollable), but I really think this
part of the model belongs in the model definition.. The latter,
guiListTree doesn't seem to work as expected and is marked as
deprecated in the documentation..

So, does anyone have any suggestions for building a tree out of a
self-joining table?

Thanks much,
Ian Smith-Heisters


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Forms, helpers, odd inconsistency...

2006-06-15 Thread xhenxhe

I'm creating my first real form with cake. I'm using the html helper
and the form helper.

I have the following code snippet in my view:
?=$form-labelTag('User/username', 'Username:')?
?=$html-input('User/username', array('size'='30'))?

Here is what I get:
label for=user_usernameUsername:/label
input name=data[User][username]  size=30 value= type=text
id=UserUsername /

Wouldn't it be more consistent to have for=UserUsername or
id=user_username?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Application design : How do you tie your objects in your GUI ?

2006-06-15 Thread Olivier Percebois-Garve

Hi

Yeah its a noob question. How do you tie your objects in your GUI ?
How to you get on the same page for instance a menu, an article, and 
user-specific information ?

Maybe I missed something in Cake but my only way to do this is to use 
requestAction. I'm not sure how to scale if I have more complexity.

For now I would do the example above by having a method of 
CategoryController doing a requestAction on a method of 
ArticleController and then a second one on UserController. If I want to 
be able to query ArticleController and have the menu then I need to have 
in ArticleController some requestAction on CategoryController.
This way I build from ArticleController more or less the same interface 
as  from CategoryController.

In the end If want a complex and similar interface queried through 
different controller I'll have a lot a requestAction everywhere and it 
may be difficult to keep the overview. Ironically it seems easier to 
have such complex interface (lot of objects) by using Ajax.

I'm explaining in a confused way, but I you have understood something 
:-P  can you tell how you are doing your how mix ?

Olivvv

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread DJ Spark

I use this in my Gallery Model:

var $hasMany =  array(
'Galleries' = array(
'className' = 'Gallery',
'order' = 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));
var $belongsTo =  array(
'Galleries' = array(
'className' = 'Gallery',
'order' = 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));

First, note the 'Galleries' (you change that association name for any
other, just dont use  the model name). Second, you might want to know
more about $this-Model-findAllThreaded() . It returns a *VERY*
useful array , with ['child'] and everything. I *heart* CakePHP :)

 spakr


On 6/15/06, I. E. Smith-Heisters [EMAIL PROTECTED] wrote:

 Hi all,

 I've found a few threads on related subjects, but none of them offer a
 solution:

 http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
 http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
 http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

 I have a table that looks like this:

 +---+--+--+-+-++
 | Field | Type | Null | Key | Default | Extra
 |
 +---+--+--+-+-++
 | id| int(10) unsigned |  | PRI | NULL| auto_increment
 |
 | name  | varchar(255) | YES  | | NULL|
 |
 | ui_name   | varchar(50)  |  | | |
 |
 | parent_id | int(10) unsigned | YES  | | NULL|
 |
 +---+--+--+-+-++

 which represents nested menus. I would think it would be trivial to
 allow each MenuItem to have children (whose parent_id is equal to its
 id) by using hasMany.

 So, first I tried this:
 class MenuItem extends AppModel {
 var $name = 'MenuItem';
 var $useTable = 'tester';

 var $validate = array (
 'name' = VALID_NOT_EMPTY,
 );
 var $hasMany = 'MenuItem';
 }

 but that just overwrites the main node,
 $this-MenuItem-read():
 array(1) {
   [MenuItem]=
   array(0) {
   }
 }

 so I tried something like this instead:

 var $hasMany = array (
 'child' = array (
 'className' = 'MenuItem',
 )
 );

 which at least doesn't overwrite the main object, but still doesn't
 populate the child array:
 array(2) {
   [MenuItem]=
   array(4) {
 [id]=
 string(1) 4
 [name]=
 string(9) community
 [ui_name]=
 string(9) Community
 [parent_id]=
 NULL
   }
   [child]=
   array(0) {
   }
 }
 So then I tried a finderSQL parameter

 var $hasMany = array (
 'child' = array (
 'className' = 'MenuItem',
 'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN 
 tester AS two
 ON one.id = two.parent_id'
 )
 );

 but that has the same output on read() as the attempt with finderSQL
 undefined. Unfortunately, I haven't found a single successful example
 of using finderSQL, so it's hard to tell what sort of output the SQL
 statement should have. I just grabbed and modded this statement from
 one of the other threads I mentioned.

 Okay, so then there's findAllThreaded and guiListTree. The former seems
 to work (albeit it's kind of uncontrollable), but I really think this
 part of the model belongs in the model definition.. The latter,
 guiListTree doesn't seem to work as expected and is marked as
 deprecated in the documentation..

 So, does anyone have any suggestions for building a tree out of a
 self-joining table?

 Thanks much,
 Ian Smith-Heisters


 



-- 
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Could the RequestHandler recognized the requestAction ?

2006-06-15 Thread Olivier Percebois-Garve

Done. thank for confirming its not-too-bad idea.

RosSoft wrote:
 With little modification in object class, and dispatcher class, a new
 variable ($this-requested_by ?   ) can be set at the requested
 controller. If you really want this, post a ticket at trac


 

   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread I. E. Smith-Heisters

Wow. That was simple. If I had an award to give, I'd give it to you.

Thanks, so much.
-ian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Association question

2006-06-15 Thread John David Anderson (_psychic_)


On Jun 14, 2006, at 12:01 PM, Garth Braithwaite wrote:


 I have a users table with a list of users and info about each, one
 record is usertype_id which is a foreign key that relates to the
 usertypes table that contains id, and title, which is just a
 description of the type of user it is.
 I tried a few associations, but I am having some troubles.  I want to
 be able to have a list of the usertypes available for adding a new
 user, and using hasOne on the user model, and that works great
 (http://www.garthbraithwaite.com/blog/users/add),

Doesn't seem so right now, at least. I see a bunch of warnings.

Maybe paste us the two models and their tables so we can see what's  
going on.

-- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread Felix Geisendörfer




This is a sweet "hack" indeed! I'll keep it in mind when working with
difficult nested stuff again! I'll support the award idea ; ).

--
http://www.thinkingphp.org
http://www.fg-webdesign.de



DJ Spark schrieb:

  I use this in my Gallery Model:

var $hasMany =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));
var $belongsTo =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));

First, note the 'Galleries' (you change that association name for any
other, just dont use  the model name). Second, you might want to know
more about $this-Model-findAllThreaded() . It returns a *VERY*
useful array , with ['child'] and everything. I *heart* CakePHP :)

 spakr


On 6/15/06, I. E. Smith-Heisters [EMAIL PROTECTED] wrote:
  
  
Hi all,

I've found a few threads on related subjects, but none of them offer a
solution:

http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

I have a table that looks like this:

+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra
|
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | NULL| auto_increment
|
| name  | varchar(255) | YES  | | NULL|
|
| ui_name   | varchar(50)  |  | | |
|
| parent_id | int(10) unsigned | YES  | | NULL|
|
+---+--+--+-+-++

which represents nested menus. I would think it would be trivial to
allow each MenuItem to have children (whose parent_id is equal to its
id) by using hasMany.

So, first I tried this:
class MenuItem extends AppModel {
var $name = 'MenuItem';
var $useTable = 'tester';

var $validate = array (
'name' = VALID_NOT_EMPTY,
);
var $hasMany = 'MenuItem';
}

but that just overwrites the main node,
$this-MenuItem-read():
array(1) {
  ["MenuItem"]=
  array(0) {
  }
}

so I tried something like this instead:

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
)
);

which at least doesn't overwrite the main object, but still doesn't
populate the child array:
array(2) {
  ["MenuItem"]=
  array(4) {
["id"]=
string(1) "4"
["name"]=
string(9) "community"
["ui_name"]=
string(9) "Community"
["parent_id"]=
NULL
  }
  ["child"]=
  array(0) {
  }
}
So then I tried a finderSQL parameter

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN tester AS two
ON one.id = two.parent_id'
)
);

but that has the same output on read() as the attempt with finderSQL
undefined. Unfortunately, I haven't found a single successful example
of using finderSQL, so it's hard to tell what sort of output the SQL
statement should have. I just grabbed and modded this statement from
one of the other threads I mentioned.

Okay, so then there's findAllThreaded and guiListTree. The former seems
to work (albeit it's kind of uncontrollable), but I really think this
part of the model belongs in the model definition.. The latter,
guiListTree doesn't seem to work as expected and is marked as
deprecated in the documentation..

So, does anyone have any suggestions for building a tree out of a
self-joining table?

Thanks much,
Ian Smith-Heisters



  
  

  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: Application design : How do you tie your objects in your GUI ?

2006-06-15 Thread gwoo

Sounds like you should use elements.
Put the requestAction calls in the elements.
Add the elements in the places you need them.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Application design : How do you tie your objects in your GUI ?

2006-06-15 Thread Olivier Percebois-Garve

doh ! Didn't knew that something like that was possible. great !

gwoo wrote:
 Sounds like you should use elements.
 Put the requestAction calls in the elements.
 Add the elements in the places you need them.



 

   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread Olivier Percebois-Garve




How do you use the array returned by
$this-Model-findAllThreaded() ?

DJ Spark wrote:

  I use this in my Gallery Model:

var $hasMany =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));
var $belongsTo =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));

First, note the 'Galleries' (you change that association name for any
other, just dont use  the model name). Second, you might want to know
more about $this-Model-findAllThreaded() . It returns a *VERY*
useful array , with ['child'] and everything. I *heart* CakePHP :)

 spakr


On 6/15/06, I. E. Smith-Heisters [EMAIL PROTECTED] wrote:
  
  
Hi all,

I've found a few threads on related subjects, but none of them offer a
solution:

http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

I have a table that looks like this:

+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra
|
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | NULL| auto_increment
|
| name  | varchar(255) | YES  | | NULL|
|
| ui_name   | varchar(50)  |  | | |
|
| parent_id | int(10) unsigned | YES  | | NULL|
|
+---+--+--+-+-++

which represents nested menus. I would think it would be trivial to
allow each MenuItem to have children (whose parent_id is equal to its
id) by using hasMany.

So, first I tried this:
class MenuItem extends AppModel {
var $name = 'MenuItem';
var $useTable = 'tester';

var $validate = array (
'name' = VALID_NOT_EMPTY,
);
var $hasMany = 'MenuItem';
}

but that just overwrites the main node,
$this-MenuItem-read():
array(1) {
  ["MenuItem"]=
  array(0) {
  }
}

so I tried something like this instead:

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
)
);

which at least doesn't overwrite the main object, but still doesn't
populate the child array:
array(2) {
  ["MenuItem"]=
  array(4) {
["id"]=
string(1) "4"
["name"]=
string(9) "community"
["ui_name"]=
string(9) "Community"
["parent_id"]=
NULL
  }
  ["child"]=
  array(0) {
  }
}
So then I tried a finderSQL parameter

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN tester AS two
ON one.id = two.parent_id'
)
);

but that has the same output on read() as the attempt with finderSQL
undefined. Unfortunately, I haven't found a single successful example
of using finderSQL, so it's hard to tell what sort of output the SQL
statement should have. I just grabbed and modded this statement from
one of the other threads I mentioned.

Okay, so then there's findAllThreaded and guiListTree. The former seems
to work (albeit it's kind of uncontrollable), but I really think this
part of the model belongs in the model definition.. The latter,
guiListTree doesn't seem to work as expected and is marked as
deprecated in the documentation..

So, does anyone have any suggestions for building a tree out of a
self-joining table?

Thanks much,
Ian Smith-Heisters



  
  

  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: ajax autocomplete.

2006-06-15 Thread nate

I sound like a student??

You sound like a dumbass.

Open source software has the benefit of being reviewed and improved by
the entire community that utilizes it, versus proprietary code (i.e.
yours), which is obfuscated to hide how crappy it is.

It's obvious from the screencasts you posted that you slowed down the
videos of your competition's demos to make yourself look better.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread I. E. Smith-Heisters

I haven't had much success/use for/with it. I would guess write a
custom loop, or modify guiTreeList() as described here:

http://groups.google.com/group/cake-php/browse_thread/thread/2ad5bc9ec2f5158c/60198efd89f6e095?q=findAllThreaded+guiListTreernum=2#60198efd89f6e095

But I've been using Cake for less than a day, so someone else should
know better than me.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread Felix Geisendörfer




You have to write a recursive function when working with arrays from
findAllThreaded().

You basically loop through all the items and check if they have an
array called 'Children' (or sth like that). If so, you make the
function call itself with the children array as a parameter, if not,
you put in your code to display/modify/do stuff with the items
themselfs ...

--
http://www.thinkingphp.org
http://www.fg-webdesign.de



Olivier Percebois-Garve schrieb:

  
How do you use the array returned by
$this-Model-findAllThreaded() ?
  
DJ Spark wrote:
  
I use this in my Gallery Model:

var $hasMany =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));
var $belongsTo =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));

First, note the 'Galleries' (you change that association name for any
other, just dont use  the model name). Second, you might want to know
more about $this-Model-findAllThreaded() . It returns a *VERY*
useful array , with ['child'] and everything. I *heart* CakePHP :)

 spakr


On 6/15/06, I. E. Smith-Heisters [EMAIL PROTECTED] wrote:
  

  Hi all,

I've found a few threads on related subjects, but none of them offer a
solution:

http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

I have a table that looks like this:

+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra
|
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | NULL| auto_increment
|
| name  | varchar(255) | YES  | | NULL|
|
| ui_name   | varchar(50)  |  | | |
|
| parent_id | int(10) unsigned | YES  | | NULL|
|
+---+--+--+-+-++

which represents nested menus. I would think it would be trivial to
allow each MenuItem to have children (whose parent_id is equal to its
id) by using hasMany.

So, first I tried this:
class MenuItem extends AppModel {
var $name = 'MenuItem';
var $useTable = 'tester';

var $validate = array (
'name' = VALID_NOT_EMPTY,
);
var $hasMany = 'MenuItem';
}

but that just overwrites the main node,
$this-MenuItem-read():
array(1) {
  ["MenuItem"]=
  array(0) {
  }
}

so I tried something like this instead:

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
)
);

which at least doesn't overwrite the main object, but still doesn't
populate the child array:
array(2) {
  ["MenuItem"]=
  array(4) {
["id"]=
string(1) "4"
["name"]=
string(9) "community"
["ui_name"]=
string(9) "Community"
["parent_id"]=
NULL
  }
  ["child"]=
  array(0) {
  }
}
So then I tried a finderSQL parameter

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN tester AS two
ON one.id = two.parent_id'
)
);

but that has the same output on read() as the attempt with finderSQL
undefined. Unfortunately, I haven't found a single successful example
of using finderSQL, so it's hard to tell what sort of output the SQL
statement should have. I just grabbed and modded this statement from
one of the other threads I mentioned.

Okay, so then there's findAllThreaded and guiListTree. The former seems
to work (albeit it's kind of uncontrollable), but I really think this
part of the model belongs in the model definition.. The latter,
guiListTree doesn't seem to work as expected and is marked as
deprecated in the documentation..

So, does anyone have any suggestions for building a tree out of a
self-joining table?

Thanks much,
Ian Smith-Heisters






  
  
  
  
  


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: Self Joining Model

2006-06-15 Thread Olivier Percebois-Garve




Thanks Felix I wanted to make that sure.
Everyone its way... I don't see the benefit of findAllThreaded(). It
results in having two recursion, one made by cake, the second in the
app.
Recursion is very heavy for php, and crawling a tree 2 times seems to
me unnecessary.
I'm curious to see if the 'actAs' thing could bring us a better way to
handle this.

Felix Geisendrfer wrote:

  
  
You have to write a recursive function when working with arrays from
findAllThreaded().
  
You basically loop through all the items and check if they have an
array called 'Children' (or sth like that). If so, you make the
function call itself with the children array as a parameter, if not,
you put in your code to display/modify/do stuff with the items
themselfs ...
  
  --
  http://www.thinkingphp.org
  http://www.fg-webdesign.de
  
  
  
Olivier Percebois-Garve schrieb:
  

How do you use the array returned by
$this-Model-findAllThreaded() ?

DJ Spark wrote:

  I use this in my Gallery Model:

var $hasMany =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));
var $belongsTo =  array(
			'Galleries' = array(
'className' = 'Gallery',
'order'		= 'Galleries.ord ASC',
'foreignKey'   = 'parent_id'));

First, note the 'Galleries' (you change that association name for any
other, just dont use  the model name). Second, you might want to know
more about $this-Model-findAllThreaded() . It returns a *VERY*
useful array , with ['child'] and everything. I *heart* CakePHP :)

 spakr


On 6/15/06, I. E. Smith-Heisters [EMAIL PROTECTED] wrote:
  
  
Hi all,

I've found a few threads on related subjects, but none of them offer a
solution:

http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

I have a table that looks like this:

+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra
|
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | NULL| auto_increment
|
| name  | varchar(255) | YES  | | NULL|
|
| ui_name   | varchar(50)  |  | | |
|
| parent_id | int(10) unsigned | YES  | | NULL|
|
+---+--+--+-+-++

which represents nested menus. I would think it would be trivial to
allow each MenuItem to have children (whose parent_id is equal to its
id) by using hasMany.

So, first I tried this:
class MenuItem extends AppModel {
var $name = 'MenuItem';
var $useTable = 'tester';

var $validate = array (
'name' = VALID_NOT_EMPTY,
);
var $hasMany = 'MenuItem';
}

but that just overwrites the main node,
$this-MenuItem-read():
array(1) {
  ["MenuItem"]=
  array(0) {
  }
}

so I tried something like this instead:

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
)
);

which at least doesn't overwrite the main object, but still doesn't
populate the child array:
array(2) {
  ["MenuItem"]=
  array(4) {
["id"]=
string(1) "4"
["name"]=
string(9) "community"
["ui_name"]=
string(9) "Community"
["parent_id"]=
NULL
  }
  ["child"]=
  array(0) {
  }
}
So then I tried a finderSQL parameter

var $hasMany = array (
'child' = array (
'className' = 'MenuItem',
'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN tester AS two
ON one.id = two.parent_id'
)
);

but that has the same output on read() as the attempt with finderSQL
undefined. Unfortunately, I haven't found a single successful example
of using finderSQL, so it's hard to tell what sort of output the SQL
statement should have. I just grabbed and modded this statement from
one of the other threads I mentioned.

Okay, so then there's findAllThreaded and guiListTree. The former seems
to work (albeit it's kind of uncontrollable), but I really think this
part of the model belongs in the model definition.. The latter,
guiListTree doesn't seem to work as expected and is marked as
deprecated in the documentation..

So, does anyone have any suggestions for building a tree out of a
self-joining table?

Thanks much,
Ian Smith-Heisters



  
  

  




  
  
  



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake PHP group.  To post to this group, 

Check this out. www.1020.org for sale. very rare numeric domain and can be resold for a higher amount. Easy to remember - TEN TWENTY .ORG.

2006-06-15 Thread prince

Check this out. www.1020.org for sale. very rare numeric domain and can
be resold for a higher amount. Easy to remember - TEN TWENTY .ORG.
Check the stats - At this time, pure numeric domain websites occupied
some of the top Alexa global rankings. www.163.com at #13 (ahead of
Microsoft and AOL), www.3721.com at #44.

All  .coms are taken!
All  .nets are taken!
All  .orgs are taken. Don't believe me. Try searching at
www.godaddy.com.
There are 17576 LLL .coms.
But there are only 1  .coms.
 .coms are Rarer than LLL .coms. Average price of LLL.com = $2500,
but for NNN.com = $4500.(995.com went for $3 at sedo this month).
There are 17576 LLL .nets.
But there are only 1  .nets. Average price of .nets = .coms
price(stated above) - $1000
 .nets are Rarer than LLL .nets.
There are 17576 LLL.orgs.
But there are only 1  .orgs.Average price of .orgs = .coms
price - $2000
 .orgs are Rarer than LLL .orgs.

Just to remind ourselves there are 358,800  .coms (or nets, or orgs
EACH). 358,800 = 26*25*24*23

The seller only wants a resonable amount. No way near those figures.
And the value is only going to rise because the numbers are universal.
In chinese numbers are more easier to remember than their own letters.
Most chinese lotteries are 4 Numbers based. We use numbers to represent
a huge variety of things:
Area codes
Phone numbers
Zip codes
Lucky numbers
Radio and TV stations
Prices
Pronounceable words in some Asian languages.
Car models
Special meanings (666, 13, 420)
Words on mobile devices (ie. fly is 359 on a telephone
keypad).
Addresses
Businesses use numbers as part of their name all the time (Level 27
clothing, Hinez 57 varieties, club 200)
For more information check out
http://www.dnforum.com/f325/numeric-domains-coming-out-under-radar-thread-146042.html?highlight=numeric+ebay

Hurry up. And good luck. Need money urgently, otherwise no seller would
sell it when the value has been rising constantly for more than 2
years. At least check it out.This is not spam. I hate spam as much as
you do.
A FRIEND IN NEED, IS A FRIEND INDEED.

WWW.1020.ORG


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Self Joining Model

2006-06-15 Thread DJ Spark

after setting $galleries in my view with 'findAllThreaded()
?php foreach ($galleries as $row): ?
tr
  td style=text-align:left;?php echo
$html-link($row['Gallery']['title'],'/galleries/edit/' .
$row['Gallery']['id'])?/td
  td _root /td
/tr

?php if(!empty($row['children'])):  foreach ($row['children'] as $subGal): ?
tr
  td style=text-align:left;margin-left:20px;?php echo
$html-link($subGal['Gallery']['title'],'/galleries/edit/' .
$subGal['Gallery']['id'])?/td
  td ?php echo $subGal['Galleries']['title']; ? /td
/tr
?php endforeach; endif; ?
?php endforeach; ?

 Since I have only one level, it's all I need.
 Any suggestions from the hardcore coders, to make a n-level loop ?

 Spark


On 6/15/06, Olivier Percebois-Garve [EMAIL PROTECTED] wrote:

  How do you use the array returned by $this-Model-findAllThreaded() ?


  DJ Spark wrote:
  I use this in my Gallery Model:

 var $hasMany = array(
  'Galleries' = array(
  'className' = 'Gallery',
  'order' = 'Galleries.ord ASC',
  'foreignKey' = 'parent_id'));
 var $belongsTo = array(
  'Galleries' = array(
  'className' = 'Gallery',
  'order' = 'Galleries.ord ASC',
  'foreignKey' = 'parent_id'));

 First, note the 'Galleries' (you change that association name for any
 other, just dont use the model name). Second, you might want to know
 more about $this-Model-findAllThreaded() . It returns a *VERY*
 useful array , with ['child'] and everything. I *heart* CakePHP :)

  spakr


 On 6/15/06, I. E. Smith-Heisters [EMAIL PROTECTED] wrote:


  Hi all,

 I've found a few threads on related subjects, but none of them offer a
 solution:

 http://groups.google.com/group/cake-php/browse_thread/thread/8ad0ebbb9171b5a4/82f28d0b433191be?q=finderSQLrnum=7#82f28d0b433191be
 http://groups.google.com/group/cake-php/browse_thread/thread/ed9f11b62fd2d223/c46ddbf9860e0be6?q=finderSQLrnum=3#c46ddbf9860e0be6
 http://groups.google.com/group/cake-php/browse_frm/thread/aba68ec53a2ae064/9988348a93f13d1e#9988348a93f13d1e

 I have a table that looks like this:

 +---+--+--+-+-++
 | Field | Type | Null | Key | Default | Extra
 |
 +---+--+--+-+-++
 | id | int(10) unsigned | | PRI | NULL | auto_increment
 |
 | name | varchar(255) | YES | | NULL |
 |
 | ui_name | varchar(50) | | | |
 |
 | parent_id | int(10) unsigned | YES | | NULL |
 |
 +---+--+--+-+-++

 which represents nested menus. I would think it would be trivial to
 allow each MenuItem to have children (whose parent_id is equal to its
 id) by using hasMany.

 So, first I tried this:
 class MenuItem extends AppModel {
  var $name = 'MenuItem';
  var $useTable = 'tester';

  var $validate = array (
  'name' = VALID_NOT_EMPTY,
  );
  var $hasMany = 'MenuItem';
 }

 but that just overwrites the main node,
 $this-MenuItem-read():
 array(1) {
  [MenuItem]=
  array(0) {
  }
 }

 so I tried something like this instead:

  var $hasMany = array (
  'child' = array (
  'className' = 'MenuItem',
  )
  );

 which at least doesn't overwrite the main object, but still doesn't
 populate the child array:
 array(2) {
  [MenuItem]=
  array(4) {
  [id]=
  string(1) 4
  [name]=
  string(9) community
  [ui_name]=
  string(9) Community
  [parent_id]=
  NULL
  }
  [child]=
  array(0) {
  }
 }
 So then I tried a finderSQL parameter

  var $hasMany = array (
  'child' = array (
  'className' = 'MenuItem',
  'finderSQL' = 'SELECT * FROM tester AS one LEFT JOIN tester AS two
 ON one.id = two.parent_id'
  )
  );

 but that has the same output on read() as the attempt with finderSQL
 undefined. Unfortunately, I haven't found a single successful example
 of using finderSQL, so it's hard to tell what sort of output the SQL
 statement should have. I just grabbed and modded this statement from
 one of the other threads I mentioned.

 Okay, so then there's findAllThreaded and guiListTree. The former seems
 to work (albeit it's kind of uncontrollable), but I really think this
 part of the model belongs in the model definition.. The latter,
 guiListTree doesn't seem to work as expected and is marked as
 deprecated in the documentation..

 So, does anyone have any suggestions for building a tree out of a
 self-joining table?

 Thanks much,
 Ian Smith-Heisters







  




-- 
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



using cake with database sessions.

2006-06-15 Thread Carlos Mauricio Samour

Hello everyone. I have one quiestion regarding using sessions with my
database instead of php or cake.
I create the cake_sessions database with the sql script that is
located on app/config/sql.
I change the value in my core.php from define('CAKE_SESSION_SAVE',
'php') to define('CAKE_SESSION_SAVE', 'database') and I get this weird
output at the end of my pages.

Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
on line 244

Warning: mysql_query(): 77 is not a valid MySQL-Link resource in
/home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 126

Warning: mysql_errno(): 77 is not a valid MySQL-Link resource in
/home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 301

Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
on line 244

Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
on line 244

Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
on line 244

Warning: mysql_query(): 77 is not a valid MySQL-Link resource in
/home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 126

Warning: mysql_errno(): 77 is not a valid MySQL-Link resource in
/home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 301
I checked with the guys at the irc and they suggested to do a clean
install to see if my cake  was to old or something.
Well I did that and still got the same errors.
Can anyone tell me if I am missing some steps on enabling saving my
sessions on my db?
Thanks.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: using cake with database sessions.

2006-06-15 Thread Carlos Mauricio Samour

One more thing. If I set up the define('DEBUG', 0); I get no erros what so ever.

On 6/15/06, Carlos Mauricio Samour [EMAIL PROTECTED] wrote:
 Hello everyone. I have one quiestion regarding using sessions with my
 database instead of php or cake.
 I create the cake_sessions database with the sql script that is
 located on app/config/sql.
 I change the value in my core.php from define('CAKE_SESSION_SAVE',
 'php') to define('CAKE_SESSION_SAVE', 'database') and I get this weird
 output at the end of my pages.

 Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
 resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
 on line 244

 Warning: mysql_query(): 77 is not a valid MySQL-Link resource in
 /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 126

 Warning: mysql_errno(): 77 is not a valid MySQL-Link resource in
 /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 301

 Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
 resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
 on line 244

 Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
 resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
 on line 244

 Warning: mysql_real_escape_string(): 77 is not a valid MySQL-Link
 resource in /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php
 on line 244

 Warning: mysql_query(): 77 is not a valid MySQL-Link resource in
 /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 126

 Warning: mysql_errno(): 77 is not a valid MySQL-Link resource in
 /home/msamour/www/cake/cake/libs/model/dbo/dbo_mysql.php on line 301
 I checked with the guys at the irc and they suggested to do a clean
 install to see if my cake  was to old or something.
 Well I did that and still got the same errors.
 Can anyone tell me if I am missing some steps on enabling saving my
 sessions on my db?
 Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Post Ur Job Requirements/Resumes Free ........

2006-06-15 Thread nicecutegirl

Dear Employer/JobConsultant/JobSeeker,

NEW GREAT OFFER BY US

NOW ITS FREE TO SEARCH RESUME/JOB DATABASE AND CALL FOR INTERVIEW/APPLY
INTERVIEW

http://www.Net4Professionals.com

(HERE YOU WILL GET  FIVE TIMES MORE THAN EXPECTATION; FREE ...)

FOR EMPLOYERS
--


1) EMPLOYERS CAN CREATE/UPDATE YOUR JOB ACCOUNT FREE

2) EMPLOYERS CAN POST UPTO FIVE JOBS FREE FREE FREE

3) EMPLOYERS CAN CALL THRU THRU MONTHLY RESUMES/RESUME SEARCH FOR
INTERVIEW FREE

4) EMPLOYERS CAN SEND MESSAGES THRU MONTHLY RESUMES/RESUME SRERCH FREE

5) EMPLOYERS CAN ALSO WIN FREE MONTHLY GIFTS

FOR JOB SEEKERS
--


1)Create/Manage Your/Your Friend/Relative Resume FREE

2)Search Your Desired Job FREE

3)Apply Online FREE

4)Win FREE Gift every month

5)Send Messages To Employers Free

- This website is a combination of state of Art and Technology
- Build With Latest DotNET Technology
- Data on this website are Safe, Nobody can alter it on his/her system
except you 

REGARDS 
  
RITU


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



NEW IT JOBS

2006-06-15 Thread nicecutegirl

Hi Dear Members,

FOLLOWING R THE NEW JOBS OF THE DAY :

Sales Manager

Programmer(asp,.NET,C,JAVA)

Faculty for Computer Application, DTP and WEB

Software Develpoers((vb,asp.net)

Marketing(Medical)

Marketing Manager

Technical Support engineer(Lunix)

Customer Care

Softwrae Recruitments(VB 6.0 Dev, ASP.Net Dev, Web Designer, QA Lead)

Computer Operator

EDP Officer

part time consultant(SAP)

Computer Operetor

Software Developers

Java/ Oracle Developers

java or research developer engg.



PLS APPLY ONLINE ON www.net4professionals.com

*Looking For Better Jobs/Employee?

-Search Jobs/Resumes and Apply Online/Call 4 Interview FREE

-Browse Interveiw Calls Free

-Employers Can Post 5 Jobs Free And Also Win Free Gifts

http://www.net4professionals.com

(A2Z HR INFO SERVICES INDIA)
THE COMPLETE e-JOBS SOLUTIONS PROVIDER... 
  
REGARDS


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---