Saturday, October 31, 2009

Re: Model->saveAll() return value issue

Here is a little more details about this:
when saveAll() is called with 'validate'=>'first' and
'atomic'=>'false' returned array is with double number of elements
than desired to store elements (if I try to save 5 elements, returned
array contains 10). I suspect that is for validation.
When saveAll() is called with 'validate'=>'only' returned array is as
expected - for every element that I want to save returns 0 or 1
according to validation.


On Oct 29, 4:14 pm, senser <nikolay.engyo...@gmail.com> wrote:
> There is another strange (in my opinion) behavior ofsaveAll() - as
> you can see in my previous post in second parameter I use
> 'validate'=>'first' to validate all records before save any (as is
> described in manual and api).
> But even if any of array elements doesn't pass validation, other
> elements are stored as well.... Is this a bug or I'm missing something
>
> On Oct 29, 12:52 pm, senser <nikolay.engyo...@gmail.com> wrote:
>
> > Hello guys,
>
> > I'm trying to use Model->saveAll() in one of my projects for saving
> > multiple model records (not associations). Hera is structured data I
> > try to save:
>
> > Array
> > (
> >     [Email] => Array
> >         (
> >             [0] => Array
> >                 (
> >                     [email_id] => 8
> >                     [employee_mailbox_id] => 77
> >                     [notes] =>
> >                 )
>
> >             [1] => Array
> >                 (
> >                     [email_id] => 8
> >                     [employee_mailbox_id] => 5
> >                     [notes] =>
> >                 )
>
> >             [2] => Array
> >                 (
> >                     [email_id] => 8
> >                     [employee_mailbox_id] => 1
> >                     [notes] =>
> >                 )
>
> > )
>
> > As you can see model name is "Email" and I want to store three records
> > in corresponding table at once with following controller code:
> > $this->Email->create($data['Email']);                     $result=$this->Email->saveAll
> > ($data['Email'], array('validate'=>'first', 'atomic'=>false));
>
> > My confusion is caused by the return value otsaveAllfunction - it is
> > array containing 5 elements but not 3. Elements with value 1 for
> > succeeded elements and 0 for unsuccessful stored elements suppose.
>
> > Am I wrong or missing something and how can I retrieve what elements
> > are stored successfully and what are failed.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Sanitize:: clean help

Try echo $form->input("description",array("value"=>html_entity_decode(@
$this->data["Model"]["description"])));

On Oct 31, 5:29 pm, "Dave" <make.cake.b...@gmail.com> wrote:
> Can someone help me out with this fairly simple question.
>
> I am doing:
>
> $clean = new Sanitize();
> $this->data = $clean->clean($this->data);
>
> Now if a user enters quotes brackets or what not it gets converted to
> &lt;script&gt; which is fine for saving to the db I suppose. But when they
> go back to edit the entry the input is &lt;script&gt; how can i convert it
> back to what it was before? So it is readable.
> I want the data to be safe for the db but also be able to be editable by the
> end user.
>
> I tried echo $form->input(html_entity_decode('description'));but still comes
> out all mangled
>
> Thanks
>
> Dave
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Routing Question

I have 2 routes defined for different groups. manage_ and editor_
 
Now I have a few functions that either group can access so i could easily just change the action name to edit rather than manage_edit and editor_edit
 
but how can i set it up so manage_edit and editor_edit both end up at edit but the user will see manage/edit or editor/edit
 
Thanks
 
Dave

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Sanitize:: clean help

Can someone help me out with this fairly simple question.
 
I am doing:
 
$clean = new Sanitize();
$this->data = $clean->clean($this->data);
 
Now if a user enters quotes brackets or what not it gets converted to &lt;script&gt; which is fine for saving to the db I suppose. But when they go back to edit the entry the input is &lt;script&gt; how can i convert it back to what it was before? So it is readable.
I want the data to be safe for the db but also be able to be editable by the end user.
 
I tried echo $form->input(html_entity_decode('description'));but still comes out all mangled
 
Thanks
 
Dave

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

I had never set up a linux system before I set up my current one. I
used the Linode/Slicehost guides and was up and running in a few
hours.

There are good guides on setting up your own mailserver as well. I
set up my mailserver using postfix and simply forward all mail to my
main gmail account. I have gmail set up so that when I reply, gmail
logs into my site's mailserver to send. Works like a charm.

On Oct 31, 3:29 am, Jon Bennett <jmbenn...@gmail.com> wrote:
> hi Tim,
>
> > I am thinking of Linode - they seem awesome. I am a little intimidated
> > about having to install my own LAMP stack though. I see their setup
> > guides - what system should I use though? I've used fedora and cent a
> > while back but I don't know what is the best to use for cake app type
> > hosting.
>
> I use Ubuntu (hardy I think), takes about an hour to get everything
> installed (quite poss longer first time though), including security
> stuff like deny hosts. Once it's set up, it's very easy to manage, you
> just run "sudo apt-get update" and "sudo apt-get upgrade" every few
> weeks to keep security patches in place. Adding a new site is as easy
> as creating the directories on the server, a vhost file and running
> "sudo a2ensite mydomain.com".
>
> I'd recommend not running a mail server though, instead get a free
> google apps account and run all email via google.
>
> hth
>
> Jon
>
> jon bennett -www.jben.net- blog.jben.net
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: star rating system implementation using PROTOTYPE + AJAX.

I'm having the same problem, as much as i know you have to use the
cakephp ajax helper but havn't found out how to retrieve the data in a
function.
-Armen

On Oct 31, 8:58 am, BeerMan <garej...@gmail.com> wrote:
> I'm trying to use the starbox star rating system in my page.
> As the tutorial on the website suggested I used the saveStar function
> to call a function in one of my controllers. the controller name is
> comments and the function name is addRate.
>
> the code I have below doesnt work because it is not accessing the
> comments controller. how do i fix this?
>
> function saveStar(event) {
>   new Ajax.Request('comments/addRate', {
>     parameters: event.memo,
>     onComplete: function(xhr) {
>       // optional callback
>     }
>   });
>
> }
>
> Also, how do i retrieve the data (event.memo) that is being send to
> the addRate function? should i use the $this->param['forum']['memo'] ?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: help with bake

Baking models and views work. After some experimentation, baking
controllers seems to work except when I specify 'yes' to the question
"would you like to include some basic class methods..."
Thank you for your help
Patrick

On Oct 31, 1:09 pm, Hols Kay <hol...@googlemail.com> wrote:
> Do you still get the same error after you've also baked your Posts
> views and model?
>
> On Oct 31, 4:30 pm, Patrick <agin.patr...@gmail.com> wrote:
>
>
>
> > Hi,
> > I'm new to  cakephp and I'm trying to bake for the first time (I'm
> > following an example for Golding's book "Beginning CakePHP" p.65). I
> > choose to bake a controller (the Posts controller) interactively, I
> > include some basic class methods and want to use sessions. I get the
> > following error:
>
> > PHP Fatal error: Class 'Post' not found in .../cake/cake/console/libs/
> > tasks/controller.php on line 255
>
> > Anybody can help me with that?
>
> > regards,
> > Patrick
>
> > CakePHP version 1.2.5 on Windows Vista, Apache server 2.2.9, PHP 5.2.10
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: help with bake

Do you still get the same error after you've also baked your Posts
views and model?

On Oct 31, 4:30 pm, Patrick <agin.patr...@gmail.com> wrote:
> Hi,
> I'm new to  cakephp and I'm trying to bake for the first time (I'm
> following an example for Golding's book "Beginning CakePHP" p.65). I
> choose to bake a controller (the Posts controller) interactively, I
> include some basic class methods and want to use sessions. I get the
> following error:
>
> PHP Fatal error: Class 'Post' not found in .../cake/cake/console/libs/
> tasks/controller.php on line 255
>
> Anybody can help me with that?
>
> regards,
> Patrick
>
> CakePHP version 1.2.5 on Windows Vista, Apache server 2.2.9, PHP 5.2.10
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

help with bake

Hi,
I'm new to cakephp and I'm trying to bake for the first time (I'm
following an example for Golding's book "Beginning CakePHP" p.65). I
choose to bake a controller (the Posts controller) interactively, I
include some basic class methods and want to use sessions. I get the
following error:

PHP Fatal error: Class 'Post' not found in .../cake/cake/console/libs/
tasks/controller.php on line 255

Anybody can help me with that?

regards,
Patrick

CakePHP version 1.2.5 on Windows Vista, Apache server 2.2.9, PHP 5.2.10
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

star rating system implementation using PROTOTYPE + AJAX.

I'm trying to use the starbox star rating system in my page.
As the tutorial on the website suggested I used the saveStar function
to call a function in one of my controllers. the controller name is
comments and the function name is addRate.

the code I have below doesnt work because it is not accessing the
comments controller. how do i fix this?

function saveStar(event) {
new Ajax.Request('comments/addRate', {
parameters: event.memo,
onComplete: function(xhr) {
// optional callback
}
});
}

Also, how do i retrieve the data (event.memo) that is being send to
the addRate function? should i use the $this->param['forum']['memo'] ?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Ajax Pagination - Highlight Sort and Direction

Hi all,

I'm using Cakephp v1.25 and I'm trying to find a way to highlight the
sort column and direction when using ajax pagination.

On a second note, is it possible to collect sort columns and
directions so a user can combine them?

thanks in advance.

Enrique


--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: how to create a new database

http://book.cakephp.org/view/4/Beginning-With-CakePHP

On Sat, Oct 31, 2009 at 2:39 AM, tassi <tasvinder48@gmail.com> wrote:

hii
m a beginner
i want help
plz tell me how to create a new database
and how to connect it to mysql.
plz tell
thnx
\





--
http://phpirate.net

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Auth Help

I have a test app I am building and created a few dummy accounts, added Auth and ACL and everything worked just fine.
 
So I copied app folder and placed them on the live server and dumped the database but now I cant log into any of my test accounts. I created a new user on the testing server and created the exact user (same username and password) on the live server and passwords are different.
 
testpass on dev server = 7340ec38fb72b91e2695e3799faaad15bad95324
 
testpass on live server = 770a5e89f64d198a61289255b185aa342bc71013
 
Code is the same, i made no changes. Security salt is the same. Is there something i am missing here that would cause this?
 
Dave

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Basic Authentication System

Hello,
Does anyone know of a code snippet for basic user regisration,
login, user management, groups, logout with cakephp? I am looking for
a foundation to build off of. Thanks in advance.

Franc
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Database Design Advice Needed - Multiple Companies having Accounting, Production and CRM components

You have quite an ambitious project. What you are wanting to create is
an integrated ERP system. Now you have the individual pieces but want
them integrated.

Is this system feasible in CakePHP? Absolutely! One database with
multiple tables would be fine, IMHO. (Even when developing on a
mainframe, in most cases, it is technically one database with
thousands of tables...We would segregate the tables into 'libraries'
by application but that was mostly for convenience of backup and
restore.)

However, you have a classic "make or buy" decision. Making a custom
ERP system for your companies is not for the faint of heart. You
didn't mention your team of developers and analysts. I came across
something yesterday that you may want to consider. This article
described an individual that is helping companies like yours:
http://www.bloomberg.com/apps/news?pid=20601109&sid=arPzMR.hhDq0.
Follow the links in the articles to products like Open ERP and you may
find that using their products will get you an integrated system you
desire, and be up and running making a profit sooner than rolling your
own.

Yes it is possible to do this in CakePHP. There are other business
decisions that come into play also.

On Oct 30, 6:15 pm, cakephp user <cakephpu...@gmail.com> wrote:
> Good day.  Please note that I am not a professional and the software
> I'm creating is for two small companies i own.  Please take it easy on
> me.  My plan is to create a cakephp app which has accounting,
> production (job tracking) and crm components.  I understand it sounds
> ambitious but I'd like to able to finish this project in the near
> future.  I need your advice on a good database design for this kind of
> system.
>
> I have 2 small businesses which would use this system independently.
> Each company will have their own customers and database users.  The
> customers tie all of the Accounting, Production and CRM Components
> together.
>
>               Companies --------------> Corresponding Database Users
>   (i.e. Company 1, Company 2)
>                       |
>                       |
>                Customers
>                       |
>    ----------------------------------------
>   |                   |                    |
> Accounting    Production     CRM
>
> I'd like to know a couple of things.
>
> 1. Do you think this kind of system is feasible to do with cakephp and
> mysql?  We are currently using different third party software for
> these components except the Production system which is done in php.
> Having no tie-in between the three creates discrepancies.
>
> 2. Database Design - Here is where I get stumped. While it's easy to
> put everything on one database, I am inclined to believe that this
> isn't in line with good database design practices.  I maybe wrong here
> but please give me your opinion.  Single database (with all of the
> levels in tables) or multiple databases?
>
> 3. If I were to use multiple databases, which ones would need their
> own database?  Should all components in the diagram have their own
> databases or should the databases be on a company level? (i.e. each
> company has its own mysql database)  Since customers tie in the
> Accounting, Production and CRM components, should it have a separate
> database as well as these three?
>
> Please take it easy on me.  I'd really appreciate some advice/feedback
> on my dilemma.  Thank you for your time.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: How to retrieve validation errors on model save?

If you are correctly validating within the model, add this to your
app_model.php file:
function validates($options = array()) {
// Debug validation
$errors = $this->invalidFields($options);
if (is_array($errors) && !empty($errors)) {
$this->log($errors, 'debug');
}
// Validate
return parent::validates($options);
}

Afterwards check /app/logs/debug.log for validation errors that might
have occured after you trigger a validation (or save)

On Oct 29, 10:08 pm, Will Poillion <lorew...@gmail.com> wrote:
> Simple question:
>
> I'm attempting to save a model, and the data to be saved is not
> passing the validation rules. How do I retrieve the validation error?
>
> if ($this->Ingredient->IngredientImage->save($this->data)) {
>         //success
> $this->Session->setFlash(__('The Ingredient Image has been saved',
> true));} else {
>
>         // retrieve validation error and return to view
>
> }
>
> Also, am I correct in assuming that setFlash is useless in an ajax
> call? I know I'm a noob but I'm not sure how I would use the setflash
> and flash functionality in an ajax call. Any clue as to how to do this
> would be most appreciated.
>
> Thanks!
> Will
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Containable behaviour doesn't return all data

I don't know the team_id I kow user_id.
I would find all users of all teams which user_id belongs.
I ask me if it is possible with only one find operation using
contanaible behaviour.

On 31 Ott, 11:27, John Andersen <j.andersen...@gmail.com> wrote:
> That is not what you are showing with your code.
> This part sets the condition of a user with an id, not a team with an
> id.
> Try to find from the team side, not the user side, if you know the
> team id!
> Example:
> $this->Team->find(...)
>
> or if you don't have the Team model in the controller:
> $this->User->Team->find(...)
>
> Enjoy,
>    John
>
> On Oct 31, 12:13 pm, "marco.rizze...@gmail.com"
>
> <marco.rizze...@gmail.com> wrote:
> > Yes I try to get all the users of the team with id=4 but I don't get
> > anything.
> > Where do i mistake?
>
> > On 30 Ott, 20:42, John Andersen <j.andersen...@gmail.com> wrote:
>
> > > You are using find('first', $options), so you only get one record!
> > > And the one record will be the one which has a team with a user!
> > > You don't get the team!
>
> > > I am guessing - are you trying to get all the users in the first team
> > > for the specified user?
> > > Enjoy,
> > >    John
>
> > > On Oct 30, 6:30 pm, "marco.rizze...@gmail.com"
>
> > > <marco.rizze...@gmail.com> wrote:
> > > > Hi
> > > > I use containable behaviour, but I don't get all data that I have
> > > > requested
> > > > My code is :
>
> > > >                 $options['fields'] = array('User.*');
> > > >                 $options['conditions'] = array('User.username' => $user_id);
> > > >                 $options['contain'] = array(
> > > >                         'Organization' => array(
> > > >                                 'fields'=>array('Team.*'),
> > > >                                 'User' => array(
> > > >                                         'fields' => array('User.*')
> > > >                                 )
> > > >                         )
> > > >                 );
> > > >                 pr($this->User->find('first',$options));
>
> > > > But I get only :
>
> > > > Array
> > > > (
> > > >     [User] => Array
> > > >         (
> > > >             [id] => 1
> > > >             .......
> > > >             .......
> > > >         )
>
> > > >     [Team] => Array
> > > >         (
> > > >             [0] => Array
> > > >                 (
> > > >                     [id] => 4
> > > >                     .......
> > > >                     .......
> > > >                     [UsersTeams] => Array
> > > >                         (
> > > >                             [id] => 1
> > > >                             [user_id] => 1
> > > >                             [team_id] => 4
> > > >                         )
> > > >                 )
> > > >         )
> > > > )
>
> > > > I don't get all users that are inside team
>
> > > > Between User and Team there is a hasAndBelongsToMany relation.
>
> > > > How can I do to get also all users that are in team?
>
> > > > Many Thanks
> > > > Marco
>
>
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Containable behaviour doesn't return all data

That is not what you are showing with your code.
This part sets the condition of a user with an id, not a team with an
id.
Try to find from the team side, not the user side, if you know the
team id!
Example:
$this->Team->find(...)

or if you don't have the Team model in the controller:
$this->User->Team->find(...)

Enjoy,
John

On Oct 31, 12:13 pm, "marco.rizze...@gmail.com"
<marco.rizze...@gmail.com> wrote:
> Yes I try to get all the users of the team with id=4 but I don't get
> anything.
> Where do i mistake?
>
> On 30 Ott, 20:42, John Andersen <j.andersen...@gmail.com> wrote:
>
> > You are using find('first', $options), so you only get one record!
> > And the one record will be the one which has a team with a user!
> > You don't get the team!
>
> > I am guessing - are you trying to get all the users in the first team
> > for the specified user?
> > Enjoy,
> >    John
>
> > On Oct 30, 6:30 pm, "marco.rizze...@gmail.com"
>
> > <marco.rizze...@gmail.com> wrote:
> > > Hi
> > > I use containable behaviour, but I don't get all data that I have
> > > requested
> > > My code is :
>
> > >                 $options['fields'] = array('User.*');
> > >                 $options['conditions'] = array('User.username' => $user_id);
> > >                 $options['contain'] = array(
> > >                         'Organization' => array(
> > >                                 'fields'=>array('Team.*'),
> > >                                 'User' => array(
> > >                                         'fields' => array('User.*')
> > >                                 )
> > >                         )
> > >                 );
> > >                 pr($this->User->find('first',$options));
>
> > > But I get only :
>
> > > Array
> > > (
> > >     [User] => Array
> > >         (
> > >             [id] => 1
> > >             .......
> > >             .......
> > >         )
>
> > >     [Team] => Array
> > >         (
> > >             [0] => Array
> > >                 (
> > >                     [id] => 4
> > >                     .......
> > >                     .......
> > >                     [UsersTeams] => Array
> > >                         (
> > >                             [id] => 1
> > >                             [user_id] => 1
> > >                             [team_id] => 4
> > >                         )
> > >                 )
> > >         )
> > > )
>
> > > I don't get all users that are inside team
>
> > > Between User and Team there is a hasAndBelongsToMany relation.
>
> > > How can I do to get also all users that are in team?
>
> > > Many Thanks
> > > Marco
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Containable behaviour doesn't return all data

Yes I try to get all the users of the team with id=4 but I don't get
anything.
Where do i mistake?

On 30 Ott, 20:42, John Andersen <j.andersen...@gmail.com> wrote:
> You are using find('first', $options), so you only get one record!
> And the one record will be the one which has a team with a user!
> You don't get the team!
>
> I am guessing - are you trying to get all the users in the first team
> for the specified user?
> Enjoy,
>    John
>
> On Oct 30, 6:30 pm, "marco.rizze...@gmail.com"
>
> <marco.rizze...@gmail.com> wrote:
> > Hi
> > I use containable behaviour, but I don't get all data that I have
> > requested
> > My code is :
>
> >                 $options['fields'] = array('User.*');
> >                 $options['conditions'] = array('User.username' => $user_id);
> >                 $options['contain'] = array(
> >                         'Organization' => array(
> >                                 'fields'=>array('Team.*'),
> >                                 'User' => array(
> >                                         'fields' => array('User.*')
> >                                 )
> >                         )
> >                 );
> >                 pr($this->User->find('first',$options));
>
> > But I get only :
>
> > Array
> > (
> >     [User] => Array
> >         (
> >             [id] => 1
> >             .......
> >             .......
> >         )
>
> >     [Team] => Array
> >         (
> >             [0] => Array
> >                 (
> >                     [id] => 4
> >                     .......
> >                     .......
> >                     [UsersTeams] => Array
> >                         (
> >                             [id] => 1
> >                             [user_id] => 1
> >                             [team_id] => 4
> >                         )
> >                 )
> >         )
> > )
>
> > I don't get all users that are inside team
>
> > Between User and Team there is a hasAndBelongsToMany relation.
>
> > How can I do to get also all users that are in team?
>
> > Many Thanks
> > Marco
>
>
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Converting Existing Project into Cake PHP

Hello,

Im working in a project, in which i have more than 150 Database
Tables, and expecting it may grow to 400 Tables in a Year.
For this project, i have more than 10 modules and even the modules
will grow in a good count.
Can i convert this project into Cake PHP.
I have just recently going through the Cake PHP, what i studied till
now is
Table name should be plural,
Primary Key - id
created
modified
above two fields to update created time and modified time. But most of
my tables are not in plural, and i can overwrite primary key by using
$primaryKey in model, but again created and modified are with
different names, How can i overwrite them.
How to handle above situation.
Most Importan Question is Is CakePHP suitable for going with this big
project, will it serve well.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

hi Tim,

> I am thinking of Linode - they seem awesome. I am a little intimidated
> about having to install my own LAMP stack though. I see their setup
> guides - what system should I use though? I've used fedora and cent a
> while back but I don't know what is the best to use for cake app type
> hosting.

I use Ubuntu (hardy I think), takes about an hour to get everything
installed (quite poss longer first time though), including security
stuff like deny hosts. Once it's set up, it's very easy to manage, you
just run "sudo apt-get update" and "sudo apt-get upgrade" every few
weeks to keep security patches in place. Adding a new site is as easy
as creating the directories on the server, a vhost file and running
"sudo a2ensite mydomain.com".

I'd recommend not running a mail server though, instead get a free
google apps account and run all email via google.

hth

Jon

jon bennett - www.jben.net - blog.jben.net

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

I've been using http://www.downtownhost.com for years now. I started
at shared and slowly progressed up to dedicated. Their customer
service is excellent!

On Oct 31, 2:10 am, Crazy <crazy...@gmail.com> wrote:
> The good thing about cake is that it will run anywhere.
>
> 99% of the hosts will run cake fine. So it all depends on how much you
> want to spend on the host. And what site you're running.
>
> There are some good cheap shared hosting companies around that will do
> the trick.
>
> Thinkhttp://www.hostgator.com/is still a good one, only costs $5/
> month.
>
> There are also others likehttp://www.dreamhost.com/($8.95/mo with
> ssh access)
>
> Been running a dedicated server for a couple of years now, so haven't
> kept up with all the shared hosting companies around
>
> On Oct 31, 3:28 am, TimG <t...@gurske.com> wrote:
>
> > I am thinking of Linode - they seem awesome. I am a little intimidated
> > about having to install my own LAMP stack though. I see their setup
> > guides - what system should I use though? I've used fedora and cent a
> > while back but I don't know what is the best to use for cake app type
> > hosting.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

The good thing about cake is that it will run anywhere.

99% of the hosts will run cake fine. So it all depends on how much you
want to spend on the host. And what site you're running.

There are some good cheap shared hosting companies around that will do
the trick.

Think http://www.hostgator.com/ is still a good one, only costs $5/
month.

There are also others like http://www.dreamhost.com/ ($8.95/mo with
ssh access)

Been running a dedicated server for a couple of years now, so haven't
kept up with all the shared hosting companies around

On Oct 31, 3:28 am, TimG <t...@gurske.com> wrote:
> I am thinking of Linode - they seem awesome. I am a little intimidated
> about having to install my own LAMP stack though. I see their setup
> guides - what system should I use though? I've used fedora and cent a
> while back but I don't know what is the best to use for cake app type
> hosting.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: caching Media View

Setting the 'cache' option will send the Cache-Control: max-
age=<time>, Expires=<converted time> and Pragma: cache headers. It
does not change the response HTTP 1.1 code to 304, nor does it set the
If-Modified-Since header.

-j.

On Oct 31, 2:17 am, tol <daviddevr...@gmail.com> wrote:
> Can someone tell me how caching in media views is supposed to work?
>
> example:
>         $this->view = 'Media';
>         $params = array(
>               'id' => $id,
>               'cache' => 100000,
>               'download' => false,
>               'extension' => 'jpg',
>               'path' => 'restricted' . DS . 'uservideo' . DS
>
>        );
>        $this->set($params);
>
> Works fine but I get the feeling its not caching. The headers of the
> images are 200 OK not 304
> Am I doing something wrong? Or am I misunderstanding / overlooking
> something?
> 'cache'=>true does not change anything either...
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Browse By Letter (a php question)

Hi,

> As of right now, I do it in a really bad way.. I have a loop that goes
> from A->Z which SELECT COUNTS each letter and throws everything in one
> array.
>
> What's a better way to do that? Instead of have 26 queries?

You search for "LIKE {letter}%", eg:

public function search($letter='a')
{
$conditions = array('Page.name LIKE'=>$letter.'%');
$this->data = $this->Page->find('all', array(
'conditions'=>$conditions
));
$this->autoRender = 0;
}

hth

Jon

--
jon bennett - www.jben.net - blog.jben.net

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Browse By Letter (a php question)

SELECT SUBSTR(productname, 0, 1), count(*)
FROM products
GROUP BY SUBSTR(productname, 0, 1)
ORDER BY SUBSTR(productname, 0, 1)

If you can create something like that in CakePHP, then you will get
each letter, plus the count of poducts.

If you don't need the count, just do something like:
SELECT DISTINCT SUBSTR(productname, 0, 1)
FROM products
ORDER BY SUBSTR(productname, 0, 1)

Do check that SUBSTR index starts from 0 or one!
Enjoy,
John

On Oct 31, 4:42 am, "gimperdan...@gmail.com" <gimperdan...@gmail.com>
wrote:
> I am working on a project where I would like to have a menu to search
> by Letters.
>
> For instance:
>
> A | B | C | D |E ....
>
> and so on...
>
> However I only want to show the letters that correspond to a product
> on the database.
>
> So if I have product:
>
> Apple, and Banana
>
> I would show the letters: A  | B
>
> As of right now, I do it in a really bad way.. I have a loop that goes
> from A->Z which SELECT COUNTS each letter and throws everything in one
> array.
>
> What's a better way to do that? Instead of have 26 queries?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Friday, October 30, 2009

how to create a new database

hii
m a beginner
i want help
plz tell me how to create a new database
and how to connect it to mysql.
plz tell
thnx
\

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: MySql to PDF export

On Fri, Oct 30, 2009 at 5:06 PM, rajinder
<rajinder.webinnovatorz@gmail.com> wrote:
>
> HI, can anyone help me................
>
> I want to export data from mysql to pdf file after clicking on a link
> (export to pdf)

http://bakery.cakephp.org/articles/view/creating-pdf-files-with-cakephp-and-tcpdf

--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Browse By Letter (a php question)

I am working on a project where I would like to have a menu to search
by Letters.

For instance:

A | B | C | D |E ....

and so on...

However I only want to show the letters that correspond to a product
on the database.

So if I have product:

Apple, and Banana

I would show the letters: A | B

As of right now, I do it in a really bad way.. I have a loop that goes
from A->Z which SELECT COUNTS each letter and throws everything in one
array.

What's a better way to do that? Instead of have 26 queries?

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

whether chagne "app/config/core.php" code

Hi All
I want add Auth in demo , I get a problem ,
whether chagne this code
" Configure::write('Acl.classname', 'DbAcl');
Configure::write('Acl.database', 'default');

//look like this :
//Configure::write('Acl.classname', 'IniAcl'); "
in "app/config/core.php" ?
anyone who know ,please tell me ! thanks!
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

I am thinking of Linode - they seem awesome. I am a little intimidated
about having to install my own LAMP stack though. I see their setup
guides - what system should I use though? I've used fedora and cent a
while back but I don't know what is the best to use for cake app type
hosting.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Framework for existing database and complicated joins Click to flag this post

Hello,

I have a big application (a social network) which has around 100
tables. It is currently developed using traditional coding styles
(i.e. no MVC or ORM).

- I need to know whether cakephp will allow me to have complex joins
without the need to build a proper object model (i.e. relations etc)?
I have previously worked with iBatis in java and that library provides
the capability with ease.

- In case CakePHP will not easily allow me to do this, which other
small size framework is suitable for my case (kohana, etc)?

Thanks,
Mac

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Database Design Advice Needed - Multiple Companies having Accounting, Production and CRM components

Good day. Please note that I am not a professional and the software
I'm creating is for two small companies i own. Please take it easy on
me. My plan is to create a cakephp app which has accounting,
production (job tracking) and crm components. I understand it sounds
ambitious but I'd like to able to finish this project in the near
future. I need your advice on a good database design for this kind of
system.

I have 2 small businesses which would use this system independently.
Each company will have their own customers and database users. The
customers tie all of the Accounting, Production and CRM Components
together.


Companies --------------> Corresponding Database Users
(i.e. Company 1, Company 2)
|
|
Customers
|
----------------------------------------
| | |
Accounting Production CRM

I'd like to know a couple of things.

1. Do you think this kind of system is feasible to do with cakephp and
mysql? We are currently using different third party software for
these components except the Production system which is done in php.
Having no tie-in between the three creates discrepancies.

2. Database Design - Here is where I get stumped. While it's easy to
put everything on one database, I am inclined to believe that this
isn't in line with good database design practices. I maybe wrong here
but please give me your opinion. Single database (with all of the
levels in tables) or multiple databases?

3. If I were to use multiple databases, which ones would need their
own database? Should all components in the diagram have their own
databases or should the databases be on a company level? (i.e. each
company has its own mysql database) Since customers tie in the
Accounting, Production and CRM components, should it have a separate
database as well as these three?

Please take it easy on me. I'd really appreciate some advice/feedback
on my dilemma. Thank you for your time.

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: not getting belongsTo objects

Try to set recursive to 2 in your find statement.

Better yet, use the Containable behaviour, it will save a lot of time
in the future.
See http://book.cakephp.org/view/474/Containable

Enjoy,
John

On Oct 30, 3:54 pm, mlecho <saltlessbr...@gmail.com> wrote:
> hi- i am so close on this one....
>
> Imagine three models...Event , Venue, and EventType. Currently, Event
> belongsTo Venue. Each event has a specific venue at which it will
> occur. If i nav to events/view/2, i get the expected Event object and
> it's Venue object. Great.
>
> It makes since in my mind that each EventType hasMany Event(s). If i
> nav to types/view/2, again, i get the correct Event(s) associated to
> that EventType.
>
> My problem is, when i pull a specific EventType, i don't get the venue
> object associated to the Event object. I get the related events, but i
> had hoped the Venue for which that Event occurs would also be bound to
> that specific Event. I am not sure what code you will need, but i can
> give anything...we can start with the Model for Type, and Event
>
> //Type Model
> <?php
>
> class Type extends AppModel {
>     var $name = 'Type';
>         var $hasMany = array(
>                 "Event"=>array(
>                         "foreignKey"=>"event_type",
>                         "order"=>array("date"=>"asc","start_time"=>"asc")
>                         )
>                 );
>
> }
>
> ?>
>
> //EVENT model
> <?php
>
> class Event extends AppModel {
>     var $name = 'Event';
>
>         var $belongsTo=array(
>                 "Venue"=>array(
>                         "foreignKey"=>"venue"
>                         ),
>                 "Type"=>array(
>                         "foreignKey"=>"event_type"
>                         )
>                 );
>
> }
>
> ?>
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: cookie data corrupted

How is the cookie settings?
Have you tried with a simple test, using not Auth.User, but another
key?
Enjoy,
John

On Oct 30, 6:32 pm, tobi_one <tobias.h...@gmail.com> wrote:
> Hi,
>
> I try to get cookies to work. I try to store data the usual way
>
> $cookie['username'] = $this->data['User']['username'];
> $cookie['password'] = $this->data['User']['password'];
> $this->Cookie->write('Auth.User',$cookie,true, '+2 weeks');
>
> when I retrieve the cookie data with
>
> $cookie = $this->Cookie->read('Auth.User');
> debug($cookie);
>
> the data is always corrupted.
>
> Array
> (
>     [Auth] => Array
>         (
>             [User] =>
>         )
>
> )
>
> There is no difference whether I switch off encryption of the cookie
> data, by setting the third value of Cookie->write to false. Any ideas,
> what I am missing?
>
> Cheers,
> tobi_one
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Database design

First of all - I suggest you drop the table_singular_name_id format
for your tables primary key and use the CakePHP expected primary key,
which is just named "id" - nothing else! That will make your life
easier!

Playing with your tables and relationships:
Student hasAndBelongsToMay Course - and vice verse.
Course hasMany Assignment - Assignment belongsTo Course.
Student hasAndBelongsToMany Assignment - and vice verse.

The mark is in the AssignmentStudent model - which is the
hasAndBelongsToMany model between Student and Assignment.

Enjoy,
John

On Oct 30, 3:11 pm, japaternoster <japaternos...@googlemail.com>
wrote:
> Hi,
>
> I am relatively new to database design and have only made some
> relatively simple CakePHP apps, but am currently working on a new
> project with some slightly more complicated database relationships.
>
> --Students----------------
> student_id
> student_name (I want to leave this as a single item)
> year
>
> --Courses----------------
> course_id
> name
> shortname
> type
>
> --Assignment----------------
> assignment_id
> type
> value
> description
>
> --Marks----------------
> mark_id
> result
>
> The idea is that each *student* takes x *courses* and each *course*
> has y *assignments*, so each *student* has a *mark* for an
> *assignment* of a *course*. Is this the easiest way of doing this?
>
> Also, what does this mean for HABTM/has many relationships?
>
> Thanks
>
> Jack
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Database design

Jack,

You will need another table to tie it all together. Something like:

----Students_Courses----
student_id
course_id
assignment_id
mark_id


I'm new to CakePHP so this might not be the best way to accomplish
this via Cake.

Patrick

On Fri, Oct 30, 2009 at 6:11 AM, japaternoster
<japaternoster@googlemail.com> wrote:
>
> Hi,
>
> I am relatively new to database design and have only made some
> relatively simple CakePHP apps, but am currently working on a new
> project with some slightly more complicated database relationships.
>
> --Students----------------
> student_id
> student_name (I want to leave this as a single item)
> year
>
> --Courses----------------
> course_id
> name
> shortname
> type
>
> --Assignment----------------
> assignment_id
> type
> value
> description
>
> --Marks----------------
> mark_id
> result
>
> The idea is that each *student* takes x *courses* and each *course*
> has y *assignments*, so each *student* has a *mark* for an
> *assignment* of a *course*. Is this the easiest way of doing this?
>
> Also, what does this mean for HABTM/has many relationships?
>
> Thanks
>
> Jack
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: HABTM query - count number of related entries

Yes it is possible!
You have to use a combination of count and group by! So look it up and
tell us what you will try!
Enjoy,
John

On Oct 30, 1:24 pm, Daniel <theworldof...@gmail.com> wrote:
> Hi. I've got two models, Tag and Story, each with a HABTM relation
> with each other (joined via a stories_tags table).
>
> What I'm looking for is the ability to do a find('all') on the Tag
> model, and within the results have a count of all the stories that are
> related to each tag.
>
> Is this possible to do? Thank you.
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Containable behaviour doesn't return all data

You are using find('first', $options), so you only get one record!
And the one record will be the one which has a team with a user!
You don't get the team!

I am guessing - are you trying to get all the users in the first team
for the specified user?
Enjoy,
John

On Oct 30, 6:30 pm, "marco.rizze...@gmail.com"
<marco.rizze...@gmail.com> wrote:
> Hi
> I use containable behaviour, but I don't get all data that I have
> requested
> My code is :
>
>                 $options['fields'] = array('User.*');
>                 $options['conditions'] = array('User.username' => $user_id);
>                 $options['contain'] = array(
>                         'Organization' => array(
>                                 'fields'=>array('Team.*'),
>                                 'User' => array(
>                                         'fields' => array('User.*')
>                                 )
>                         )
>                 );
>                 pr($this->User->find('first',$options));
>
> But I get only :
>
> Array
> (
>     [User] => Array
>         (
>             [id] => 1
>             .......
>             .......
>         )
>
>     [Team] => Array
>         (
>             [0] => Array
>                 (
>                     [id] => 4
>                     .......
>                     .......
>                     [UsersTeams] => Array
>                         (
>                             [id] => 1
>                             [user_id] => 1
>                             [team_id] => 4
>                         )
>                 )
>         )
> )
>
> I don't get all users that are inside team
>
> Between User and Team there is a hasAndBelongsToMany relation.
>
> How can I do to get also all users that are in team?
>
> Many Thanks
> Marco
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

ACL and/or Auth?

My application only has 1 level of authentication. Would ACL be
overkill for this? Will the Auth component take care of this?

Does CakePHP hold sessions for anonymous users? If so, is there a way
not to track sessions for anonymous users that havent logged in/
registered?

TIA
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Uploader Plugin now does Model attachments

Well whats your problem? The documentation is about as detailed as
possible.

On Oct 29, 9:28 pm, oka <okamuha...@gmail.com> wrote:
> On Oct 5, 7:29 am, Miles J <mileswjohn...@gmail.com> wrote:
>
> > Many have asked for a way to attach files to a Model to do automatic
> > file uploading and database saving, within myUploaderPlugin. Well
> > now you can, its really easy!
>
> >http://www.milesj.me/resources/script/uploader-plugin#Attaching-Files...
>
> > Let me know if you run into any problems.
>
> hai im newbie with cakephp and i try using uploader plugin..
> i having problem with instalation and using the plugin
> can you help me? thanks before
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

MediaTemple is terrible for the grid, just like Dreamhost is terrible
with their shared hosting. Ive had Cake on both and shared hosting
just doesnt work if you get high traffic.

I use a DH dedicated with Cake and it works great. I also have a MT
dedicated and it works great, go figure, lol.

On Oct 30, 9:42 am, CharlesTMunger <ryan.dy...@gmail.com> wrote:
> Linode FTW.  I used to be on SliceHost.  Linode is cheaper, for more
> resources, and more discrete upgrades (i.e., on SliceHost if you are
> on the $20 plan, you can double to the $40 and get 512 megs ram;
> Linode starts you at 360 megs ram for $20, and you can go to $30 for
> 540 megs or $40 for 720 megs; plus Linode allows you to install 32 bit
> OS, which will suck a lot less memory than the 64 bit that SliceHost
> requires you to do).
>
> On Oct 30, 10:15 am, Jon Bennett <jmbenn...@gmail.com> wrote:
>
> > > So I am once again looking for good hosting that is inexpensive and
> > > doesn't have all the limitations and frustrations that come with
> > > shared hosting.
>
> > > Who do you guys use?
>
> > I like Slicehosthttps://manage.slicehost.com/customers/new?referrer=72080a7f7a6ddeeda...
> > and Bytemark (uk)
>
> > j
>
> > --
> > jon bennett -www.jben.net-blog.jben.net
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

caching Media View

Can someone tell me how caching in media views is supposed to work?

example:
$this->view = 'Media';
$params = array(
'id' => $id,
'cache' => 100000,
'download' => false,
'extension' => 'jpg',
'path' => 'restricted' . DS . 'uservideo' . DS

);
$this->set($params);

Works fine but I get the feeling its not caching. The headers of the
images are 200 OK not 304
Am I doing something wrong? Or am I misunderstanding / overlooking
something?
'cache'=>true does not change anything either...
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Cake Hosting - Who is the best?

Linode FTW. I used to be on SliceHost. Linode is cheaper, for more
resources, and more discrete upgrades (i.e., on SliceHost if you are
on the $20 plan, you can double to the $40 and get 512 megs ram;
Linode starts you at 360 megs ram for $20, and you can go to $30 for
540 megs or $40 for 720 megs; plus Linode allows you to install 32 bit
OS, which will suck a lot less memory than the 64 bit that SliceHost
requires you to do).

On Oct 30, 10:15 am, Jon Bennett <jmbenn...@gmail.com> wrote:
> > So I am once again looking for good hosting that is inexpensive and
> > doesn't have all the limitations and frustrations that come with
> > shared hosting.
>
> > Who do you guys use?
>
> I like Slicehosthttps://manage.slicehost.com/customers/new?referrer=72080a7f7a6ddeeda...
> and Bytemark (uk)
>
> j
>
> --
> jon bennett -www.jben.net- blog.jben.net
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

RE: HABTM query - count number of related entries

I did something similar where I took the Post.id being viewed and extracted
the 'Tags' for that Post then did a find on Posts that had the same tags
using the Ad Hoc Joins Article in the bakery.

Not sure if it the best way but it worked for what I needed it for.

Dave

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Rick
Sent: October-30-09 10:57 AM
To: CakePHP
Subject: Re: HABTM query - count number of related entries


What are the field names of the related fields? I.e. Tag.? ==
Stories_tags.? == Story.?

On Oct 30, 7:24 am, Daniel <theworldof...@gmail.com> wrote:
> Hi. I've got two models, Tag and Story, each with a HABTM relation
> with each other (joined via a stories_tags table).
>
> What I'm looking for is the ability to do a find('all') on the Tag
> model, and within the results have a count of all the stories that are
> related to each tag.
>
> Is this possible to do? Thank you.


--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: RequireSecure Redirect Issues

You know, I actually think just by including Security as a component,
it makes my whole controller require Auth. With nothing added but
Security as a component, I can no longer access the controller pages -
I get redirected to my login page and a message ""You are not
authorized to access that
location."

If I log in the forceSSL and everything works perfectly. Does this
make any sense?


On Oct 30, 12:23 am, CharlesTMunger <ryan.dy...@gmail.com> wrote:
> I put the following code in one of my controllers, trying to force it
> to use SSL:
>
>         function beforeFilter() {
>                 $this->Security->blackHoleCallback = 'forceSSL';
>                 $this->Security->requireSecure();
>         }
>
>         function forceSSL() {
>                 $this->redirect('https://' . $_SERVER['SERVER_NAME'] . $this->here);
>         }
>
> But whenever I go to a page using this controller, I get redirected to
> my login page with the message "You are not authorized to access that
> location."
>
> I am using Auth in my appcontroller.  I'm guessing that has something
> to do with it.  But for the life of me I cannot figure it out.
>
> This is the code in my AppController for Auth:
>
>                 $this->Auth->fields = array('username' => 'email',
> 'password' => 'password');
>                 //$this->Auth->loginAction = array('controller' => 'users', 'action'
> => 'login');
>                 $this->Auth->loginRedirect = '/';
>                 $this->Auth->logoutRedirect = '/';
>                 $this->Auth->allow('*');
>                 $this->Auth->loginError = 'Invalid e-mail / password combination.
> Please try again';
>                 $this->Auth->autoRedirect = false;
>
>                 $this->Auth->authorize = 'controller';
--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---