Re: How to relate table with one of many others?

2013-09-30 Thread Kemal
Thank you

On Monday, September 30, 2013 5:39:42 PM UTC+3, Jeremy Burns wrote:
>
> Cake won't/can't but your code can make it happen.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 30 Sep 2013, at 13:55:01, Kemal > 
> wrote:
>
> I am using Mysql Workbench and it forces plural names. I will fix them. 
> Will cakephp decide whether it is a domain or a hosting looking by 
> order_type_id?
>
> On Monday, September 30, 2013 3:35:15 PM UTC+3, Jeremy Burns wrote:
>>
>> Scrub that - I see there is an orders_id field on hostings and domains. 
>> Sorry. However, some of your fields have incorrect names:
>>
>>
>>- domains->orders_id ought to be 'order_id'
>>- hostings->orders_id ought to be 'order_id'
>>- orders->orders_types_id ought to order_type_id
>>- clients_bills table name ought to be client_bills
>>- client_bills->clients_id ought to be client_id
>>
>>
>> I note that you have both clients_id and client_id on the orders table. 
>> I'm assuming that one would be the id used by the client? If so, the 
>> joining field will be order_id. I'd consider renaming orders_id to 
>> something that doesn't end in _id as Cake will try to find a related table 
>> and build an association with it; perhaps client_reference would be better?
>>
>> If you made those changes you could get your basic models built using 
>> cake bake.
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com 
>>
>> On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit <
>> jerem...@classoutfit.com> wrote:
>>
>> Surely there would be a 1->many relationship between:
>>
>>- orders_types (which ought to be called order_types) and orders
>>- domains to orders
>>- hostings to orders?
>>
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com 
>>
>> On 30 Sep 2013, at 13:05:18, Kemal  wrote:
>>
>> Hello,
>>
>> I have created a topic on stackoverflow but didn't get attention. So...
>>
>> I am little confused about my db design. I have orders table that may 
>> have records from one of many others. So is it OK to relate each tables 
>> with 1:1 to orders. Please look at orders domains andhostings table 
>> relations.
>>
>> My orders table rows has either a domain or hosting regarding to its 
>> orders_type value. There will be more than 10 products like domains, 
>> hostings etc. So creating a column on orders table for each product would 
>> not be a good practice.
>>
>> What is the best way to build my structure for CakePhp?
>>
>>
>>
>> <https://lh3.googleusercontent.com/-AbWgKx7GQz0/Ukln-HZdS7I/ERI/_yO9gr7hiow/s1600/eer.JPG>
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com.
>> To post to this group, send email to cake...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>> -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com.
>> To post to this group, send email to cake...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to relate table with one of many others?

2013-09-30 Thread Kemal
I am using Mysql Workbench and it forces plural names. I will fix them. 
Will cakephp decide whether it is a domain or a hosting looking by 
order_type_id?

On Monday, September 30, 2013 3:35:15 PM UTC+3, Jeremy Burns wrote:
>
> Scrub that - I see there is an orders_id field on hostings and domains. 
> Sorry. However, some of your fields have incorrect names:
>
>
>- domains->orders_id ought to be 'order_id'
>- hostings->orders_id ought to be 'order_id'
>- orders->orders_types_id ought to order_type_id
>- clients_bills table name ought to be client_bills
>- client_bills->clients_id ought to be client_id
>
>
> I note that you have both clients_id and client_id on the orders table. 
> I'm assuming that one would be the id used by the client? If so, the 
> joining field will be order_id. I'd consider renaming orders_id to 
> something that doesn't end in _id as Cake will try to find a related table 
> and build an association with it; perhaps client_reference would be better?
>
> If you made those changes you could get your basic models built using cake 
> bake.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit <
> jerem...@classoutfit.com > wrote:
>
> Surely there would be a 1->many relationship between:
>
>- orders_types (which ought to be called order_types) and orders
>- domains to orders
>- hostings to orders?
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 30 Sep 2013, at 13:05:18, Kemal > 
> wrote:
>
> Hello,
>
> I have created a topic on stackoverflow but didn't get attention. So...
>
> I am little confused about my db design. I have orders table that may 
> have records from one of many others. So is it OK to relate each tables 
> with 1:1 to orders. Please look at orders domains andhostings table 
> relations.
>
> My orders table rows has either a domain or hosting regarding to its 
> orders_type value. There will be more than 10 products like domains, 
> hostings etc. So creating a column on orders table for each product would 
> not be a good practice.
>
> What is the best way to build my structure for CakePhp?
>
>
>
> <https://lh3.googleusercontent.com/-AbWgKx7GQz0/Ukln-HZdS7I/ERI/_yO9gr7hiow/s1600/eer.JPG>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to relate table with one of many others?

2013-09-30 Thread Kemal
I am using Mysql Workbench and it forces plural names. I will fix them. 
Will cakephp decide whether it is a domain or a hosting looking by 
order_type_id?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to relate table with one of many others?

2013-09-30 Thread Kemal
I am using Mysql Workbench and it forces plural names. I will fix them. 
Will cakephp decide whether it is a domain or a hosting looking by 
order_type_id?

On Monday, September 30, 2013 3:35:15 PM UTC+3, Jeremy Burns wrote:
>
> Scrub that - I see there is an orders_id field on hostings and domains. 
> Sorry. However, some of your fields have incorrect names:
>
>
>- domains->orders_id ought to be 'order_id'
>- hostings->orders_id ought to be 'order_id'
>- orders->orders_types_id ought to order_type_id
>- clients_bills table name ought to be client_bills
>- client_bills->clients_id ought to be client_id
>
>
> I note that you have both clients_id and client_id on the orders table. 
> I'm assuming that one would be the id used by the client? If so, the 
> joining field will be order_id. I'd consider renaming orders_id to 
> something that doesn't end in _id as Cake will try to find a related table 
> and build an association with it; perhaps client_reference would be better?
>
> If you made those changes you could get your basic models built using cake 
> bake.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit <
> jerem...@classoutfit.com > wrote:
>
> Surely there would be a 1->many relationship between:
>
>- orders_types (which ought to be called order_types) and orders
>- domains to orders
>- hostings to orders?
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com 
>
> On 30 Sep 2013, at 13:05:18, Kemal > 
> wrote:
>
> Hello,
>
> I have created a topic on stackoverflow but didn't get attention. So...
>
> I am little confused about my db design. I have orders table that may 
> have records from one of many others. So is it OK to relate each tables 
> with 1:1 to orders. Please look at orders domains andhostings table 
> relations.
>
> My orders table rows has either a domain or hosting regarding to its 
> orders_type value. There will be more than 10 products like domains, 
> hostings etc. So creating a column on orders table for each product would 
> not be a good practice.
>
> What is the best way to build my structure for CakePhp?
>
>
>
> <https://lh3.googleusercontent.com/-AbWgKx7GQz0/Ukln-HZdS7I/ERI/_yO9gr7hiow/s1600/eer.JPG>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


How to relate table with one of many others?

2013-09-30 Thread Kemal
Hello,

I have created a topic on stackoverflow but didn't get attention. So...

I am little confused about my db design. I have orders table that may have 
records from one of many others. So is it OK to relate each tables with 1:1 
to orders. Please look at orders domains andhostings table relations.

My orders table rows has either a domain or hosting regarding to its 
orders_type value. There will be more than 10 products like domains, 
hostings etc. So creating a column on orders table for each product would 
not be a good practice.

What is the best way to build my structure for CakePhp?




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


How to use sql 'between' command with CakePhp requestAction()

2010-07-05 Thread Ahmet Kemal
Hello,

I have an element that grabs data from mysql. Here is my working code:

$this->requestAction('posts/index/sort:id/direction:desc');

I want to grab only posts between id 1 and 6. How can I run that query
via requestAction? Some of scripts that I have tried are below. None
is working:

$this->requestAction('posts/index/sort:id/direction:desc',
array('id between ? and ?' => array('1,6')));
or
$this->requestAction('posts/index/sort:id/between:1,6/
direction:desc');

You may see my project at http://bake.yemeklog.com/ I want this code
for third column (Last 30 days faves) All columns are elements.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to build 3 column page?

2010-07-03 Thread Ahmet Kemal
Hello,

I am new at CakePhp. I want to create a website that has 3 columns.
One column for latest 20 post, second column for top viewed posts this
week and third column for top viewed posts this month. I succeeded
coding one column but my mind frozen about finding a way to implement
other columns. Should I add code to index() controller or build
another controller and view for rest columns?

Thanks for assistance,

Kemal

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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