Sunday, November 1, 2009

Re: Model->saveAll() return value issue

Hi nikolay,

> My confusion is caused by the return value ot saveAll function - 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.

Are your tables InnoDB? If they are, cake will wrap all queries in a
single transaction when you use saveAll, so if one fails, they all
fail.

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
-~----------~----~----~----~------~----~------~--~---

How to search inside http://code.cakephp.org/tickets ?

Hi all,

Am I crazy, or it is impossible to search inside the new ticket system
at http://code.cakephp.org/tickets? Wanted to report an issue, but I'm
unable to filter the ticket list to check whether it has been already
reported or not.

Of course it's possible to google "site:http://code.cakephp.org/
tickets keywords here", but this doesn't filter the issue list to
narrow it down to open tickets or other search criteria. This is a
pretty basic feature in every issue tracking system, so I'm sure I'm
just missing something important here.
--~--~---------~--~----~------------~-------~--~----~
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?

On Sun, Nov 1, 2009 at 10:44 PM, Jon Bennett <jmbennett@gmail.com> wrote:

> 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.

I wonder why you've done it that way though. If you're going to send
through gmail, why not use their mailservers (and excellent anti-spam
filtering!) for free?
http://www.google.com/apps/intl/en/group/index.html

[..snip..]

I'm still wondering how (let alone why) you can configure Gmail to relay via another SMTP server!?

- Gonzalo


--~--~---------~--~----~------------~-------~--~----~
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?

> 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.

I wonder why you've done it that way though. If you're going to send
through gmail, why not use their mailservers (and excellent anti-spam
filtering!) for free?
http://www.google.com/apps/intl/en/group/index.html

A major benefit of going this route is you separate your hosting and
email, which means switching hosting is a case of deploying your app
files and setting DNS, no messy email migration etc. It also means you
can give your clients a GUI to manage their email to create users etc,
taking you out of the loop for support :)

cheers,

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: help with bake

Bake models first, then controllers and views

On Oct 31, 6:18 pm, Patrick <agin.patr...@gmail.com> wrote:
> 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: Sanitize:: clean help

way tooooo complicated

dont sanitize it
and use h() for output (text, varchar)

that is way more handy than any other approach


On 1 Nov., 06:44, Kyle Decot <kdec...@gmail.com> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Re: Containable behaviour doesn't return all data

Ok, then try to change the contain condition to:

$options['contain'] = array(
'Team' => array(
'User'
)
);

That should give you the Team for the specified user, and the Users of
the Team.

I assume here that your models are associated as:
User hasAndBelongsToMany Team

Enjoy,
John

On Oct 31, 2:06 pm, "marco.rizze...@gmail.com"
<marco.rizze...@gmail.com> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---