Re: App::import broken in RC3

2008-10-14 Thread [EMAIL PROTECTED]

As I understand it you have to change a few things.
When defining "file", "name" becomes simply a unique identifier. You
have to define the full path the the file in "file".

Also, I am not familiar with defining everything as an array either. I
have always sent two parmeters to App::import(). First the type as its
own parameter and second a string or an array.

Look at the examples again and you will see how to write the path to
the file.
http://book.cakephp.org/view/538/Loading-Vendor-Files

You can also choose to look at Daniel's nice roundup of pit-falls and
fixes when importing vendor files:
http://cakebaker.42dh.com/2008/03/26/loading-vendor-files/

/Martin


On Oct 14, 7:46 pm, Mathew <[EMAIL PROTECTED]> wrote:
> I'm a little confused how this got broken in RC3.
>
> I've looked at the changes from RC2 to RC3 in this url.
>
> https://trac.cakephp.org/changeset?new=trunk%2Fcake%2F1.2.x.x%2Fcake%...
>
> I don't see anything that should have broken my import statement, but
> when debugging the code I can see that it's not working.
>
> I got to line 837 in configure.php where is says "$directory = 
> $_this->__find($find, true);", and that returns null. I'm not sure it's
>
> suppose that have gotten that far.
>
> $find is equal to "rss_fetch.inc" which is my file, but the __find()
> method only checks the vendor folders. It appears to be ignoring the
> subfolder "magpierss" defined in the name parameter.
>
> Could I have been using the wrong parameters?
>
> How would I import this file from my plugins vendor folder?
>
> "/app/plugins/gems/vendor/magpierss/rss_fetch.inc"
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Saving HABTM data with checkboxes

2008-10-14 Thread Yodiaditya
I using checkbox and have try it...
This like Posts and Tags, both of them in HABTM relations.
for example, in form add post :

on View post :
create('Post');?>
.
input('Tag.Tag', array('type'=>'select',
'multiple'=>'checkbox', 'options'=>$tags, 'label'=>'Tags:')); ?>
...
end('Save');?>

on Post Controller :

function add() {
$this->set('tags', $this->Post->Tag->find('list'));
   if(!empty($this->data)) {
  $this->Post->save($this->data);
   }
}

Regards,
Yodiaditya - http://re.web.id

On 10/14/08, cem <[EMAIL PROTECTED]> wrote:
>
>
> Hi ;
>
> In my application one project can have more than one category .
> And there is a HABTM relationship between categories and Projects .
> How can I save more than one category for a project while creating a
> project how should I design the check boxes? Did anyone tried
> something similar 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Mysql Error when trying to execute a function in the model

2008-10-14 Thread David C. Zentgraf

So, did it fix it? It just seems like a typo somewhere.
Point being, if you mistype model names and/or methods, Cake makes  
them up as it goes along (automagic guesswork). An inexistent method  
name will be attempted to be interpreted as an SQL call (e.g. - 
 >findByUserName(), even though you don't have a method of that name).

On 15 Oct 2008, at 12:22, Earl0983 wrote:

>
> Thanks, but that was actually a typo on my part it should have said:
>
> $this->User->validateUserLogin($this->data['User']) )
>
> I was playing around with it to try to get it to work and that is when
> i changed it to Users.  Sorry for the confusion.
>
> On Oct 14, 11:18 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
>> On 15 Oct 2008, at 12:08, Earl0983 wrote:
>>
>>> $this->Users->validateUserLogin($this->data['User']) )
>>
>>  ^^
>> Model names are usually singular.
>>
>> Chrs,
>> Dav
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the best way to proceed and stay true to MVC/CakePHP philosophy

2008-10-14 Thread Chez17

Thanks! This is amazing advice. I am such a beginner and this was
fantastic. The array idea is so simple and brilliant, way easier. I
will try to look into doing what you suggest. Thanks again.

On Oct 14, 9:01 pm, ORCC <[EMAIL PROTECTED]> wrote:
> I think first that all you have to separate the "parsing" of the text
> and the execution of the command itself via components, namely:
>
> 1) Create a "CommandParser" component that has function to "parse" a
> command.
> 2) Create a "CommandExecutive" component that has a method for
> implement each of the commands.
>
> I suggest you to handle the user input in a unique action in the
> controlle. For example, create a send action where all the user text
> is sent:
>
> class ChatController extends AppController {
>             var $components =
> Array('CommandParser','CommandExecutive');
>
>             /*handles all text send by user*/
>             function send($text) {
>                   /*analize wherter the input is a command or is plain
> text*/
>                   if (CommandParser::isCommand($text)) {
>                         //is a command redirect for command execution
>                        //use the parser component to get the command
> and the parameter of the command
>                        $command = CommandParser::getCommand($text);
>                        $parameter = CommandParser::getParameter($te
>                        $this->redirect("/chat/command/$command/
> $parameter");
>
>                   }
>                   else {
>                        //is normal text, show
>                        $this->redirect("/chat/add/$text")
>                   }
>              }
>
>              //here is the rest of actions
>             function add ($text) {
>                  //perform logic of add text
>             }
>
>             function command ($command, $parameter) {
>                  //perform logic of command
>              }
>
> }
>
> For executing the command you can avoid the big switching statement by
> using an array of callbacks indexed with the command names. All
> callbacks are methods defined in the ActionExecutive component itself.
> For example:
>
> //this function may be in the controller
> function proccessCommand($text,$parameter) {
>        $command_list = Array (
>                     'help' => "displayHelp",
>                    'quit' => "quitUser",
>                    /* ... */
>                 );
>
>        /*verify if  it is a valid command*/
>        if (empty($command_list[$text])) {
>             return INVALID_COMMAND; /*this maybe a constant*/
>       }
>
>       $callback = $command_list[$text];
>       /*execute the command that is a method in a command executive
> component*/
>       $result = CommandExecutive::$callback($parameter);
>       return $result;
>
> }
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Mysql Error when trying to execute a function in the model

2008-10-14 Thread David C. Zentgraf

On 15 Oct 2008, at 12:08, Earl0983 wrote:

> $this->Users->validateUserLogin($this->data['User']) )

 ^^
Model names are usually singular.

Chrs,
Dav

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Mysql Error when trying to execute a function in the model

2008-10-14 Thread Earl0983

Thanks, but that was actually a typo on my part it should have said:

 $this->User->validateUserLogin($this->data['User']) )

I was playing around with it to try to get it to work and that is when
i changed it to Users.  Sorry for the confusion.

On Oct 14, 11:18 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> On 15 Oct 2008, at 12:08, Earl0983 wrote:
>
> > $this->Users->validateUserLogin($this->data['User']) )
>
>                  ^^
> Model names are usually singular.
>
> Chrs,
> Dav
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to Handle Special Fields on $this->query() statements - Forking from "MySQL Having Clausule "

2008-10-14 Thread David C. Zentgraf

I can't find the author anymore, but this extended MySQL driver was  
pasted in the bin a while back (I think). Pasting it again.

http://bin.cakephp.org/view/443659159

// Extended 'resultSet' to allow alias processing
// Fields should contain '((something)) AS Model__field'

Hope this helps.

On 15 Oct 2008, at 02:59, Dérico Filho wrote:

>
> Hello guys,
>
>
> So I asked a question about having clauses using $this->Model->find()
> method, and the answer was daunting, in my opinion: use in Model Class
> $this->query() method within a custom method... OK. I shall do it this
> way.
>
> One of the problems I face using $this->query() is:
>
> Whenever I have a special field, the result parser puts it in a
> different key.
>
> For instance:
>
> $qry = $this->query("SELECT `Table`.*, `Table`.field * 1000 as
> specialfield FROM ");
>
> it would return $qry as
> Array( 0 =>
> Array("Table" => Array("field" => "1", "field2" => "value"), 0 =>
> Array("specialfield" => "1000"), ...
> );
>
> What do I do?
>
> I array_walk the result, array_mergin Table with 0... eventually it
> turns into:
> Array( 0 =>
> Array("Table" => Array("field" => "1", "field2" => "value",
> "specialfield" => "1000"), ...
> );
>
> Is there any more practical way doing it?
>
> thanks you guys!
>
> []s
> Dérico Filho
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Mysql Error when trying to execute a function in the model

2008-10-14 Thread Earl0983

Hello All,
I have a controller(users_controller) and in the login() function i
call a function called "validateUserLogin" from the User model like
this:

...
$user = $this->Users->validateUserLogin($this->data['User']) )
...

However, when i try to go to this page i get the following error:

Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'validateUserLogin' at line 1 [CORE/cake/libs/
model/datasources/dbo_source.php, line 512]

Code | Context

$sql=   "validateUserLogin"
$error  =   "1064: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'validateUserLogin' at line 1"
$out=   null

$out = null;
if ($error) {
trigger_error("SQL Error: {$this->error}",
E_USER_WARNING);

DboSource::showQuery() - CORE/cake/libs/model/datasources/
dbo_source.php, line 512
DboSource::execute() - CORE/cake/libs/model/datasources/
dbo_source.php, line 202
DboSource::fetchAll() - CORE/cake/libs/model/datasources/
dbo_source.php, line 338
DboSource::query() - CORE/cake/libs/model/datasources/dbo_source.php,
line 299
Model::call__() - CORE/cake/libs/model/model.php, line 397
Overloadable::__call() - CORE/cake/libs/overloadable_php5.php, line 59
AppModel::validateUserLogin() - [internal], line ??
UsersController::login() - APP/controllers/users_controller.php, line
46
Object::dispatchMethod() - CORE/cake/libs/object.php, line 114
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 256
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 230
[main] - APP/webroot/index.php, line 90

Query: validateUserLogin


Does anyone know how to fix this?  Also, why is a query being run for
this?

Thanks in advance!!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the best way to proceed and stay true to MVC/CakePHP philosophy

2008-10-14 Thread Manolet Gmail
you can do a command controller, but anyway you should write the list of
commands,

there is a quick example (please correct it is just a guide)

class commandcontroller extends appcontroller{

function index($command = 'error'){
if(function_exist( $this->{$command}()) ){
$this->{$command}()
}else{
$this->error();
}
}

function commandOne(){
}
function commandTwo(){}
function error(){
echo "the command doesnt exist";
}

}

On Tue, Oct 14, 2008 at 6:50 PM, Chez17 <[EMAIL PROTECTED]> wrote:

>
> So I have an ajax chat application that I am working on. If a user
> types a comment the starts with '/' it sends the comment to the
> 'command' function in my controller (as opposed to a normal 'add'
> function for chats). For example if the user types "/help" it will
> list all the possible commands. Now the command function is going to
> have to parse the command and return the proper information. The way I
> did the first couple commands was just a switch statement. But I got
> to thinking if there was a better or more "cake" way to do it. Are
> there better ways then just a giant switch statement? Should I try to
> create my own component? What are your thoughts on this? Any help will
> be greatly appreciated.
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Filtering controller

2008-10-14 Thread machuidel

Hi David,

Thank you. That was very helpful.

I added the following route:

Router::connect('/countries/:country_id/cities/*', array('controller'
=> 'cities'));

This route points to the following function inside the "cities"
controller:

function index() {
$this->City->recursive = 0;
$this->set('cities', $this->paginate());
}

I was thinking about passing the "country_id" to the "paginate()"
function as its criteria.
Do you know of a better way to filter the data?

Cheers,
Mike

On Oct 15, 3:07 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> http://book.cakephp.org/view/542/Defining-Routes
>
> Your route would look something like:
>
> Router::connect('/countries/:country_id/cities/*', array('controller'  
> => 'cities', 'action' => 'someCityAction'));
>
> The 'country_id' will be available in $this->params in the controller.
>
> On 15 Oct 2008, at 08:31, machuidel wrote:
>
>
>
> > Hello,
>
> > How can I map a controller to an URL like "/countries/12/cities/" such
> > that the index of cities will be filtered by the specified country? I
> > would like that URL to dispatch the "city" controller (not the
> > "country" controller) with the specified country as its argument.
> > Something like:
>
> > class CityController extends AppController {
>
> >  ...
>
> >  function index_country ($country_id) {
> >     // Index of cities filtered by specified country
> >  }
>
> >  ...
>
> > }
>
> > Could not find any example of someone doing this in Cakephp.
>
> > Cheers,
> > Mike
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 2 apps, one cms and the other is the normal site -> site needs to get to the cms's webroot

2008-10-14 Thread Shackadoodl

Ok, tackled it.

so first i opened up my app/config/bootstrap file and put this at the
bottom:

define('ADMIN_DIR', ROOT . DS . 'admin');
define('SETTINGS_CACHE_FILE', TMP . 'settings' . DS . 'cache');

$modelPaths = array(ADMIN_DIR . DS . 'models' . DS);
$viewPaths = array(ADMIN_DIR . DS . 'views' . DS);
$controllerPaths = array(ADMIN_DIR . DS . 'controllers' . DS);
$behaviorPaths = array(ADMIN_DIR . DS . 'models' . DS . 'behaviors' .
DS);
$helperPaths = array(ADMIN_DIR . DS . 'views' . DS . 'helpers' . DS);
$componentPaths = array(ADMIN_DIR . DS . 'controllers' . DS .
'components' . DS);

in short i have a global where my admin dir is and then below it i
tell cake where to find __additional__ models

now however we have the problem of users freely getting access to the
admin and we can't have that now can we ;)

so open app/app_controller.php ( create it if it doesnt exist ), and
put in:

class AppController extends Controller
{
var $helpers = array('javascript', 'form', 'html', 'session',
'Ajax', 'Text');
var $components = array('RequestHandler', 'Cookie', 'Auth',
'Imagetoolbox');

var $uses = array('User');

function beforeFilter()
{
Security::setHash('md5');

$this->Auth->loginAction= array('controller' =>
'users', 'action' => 'login');
$this->Auth->loginRedirect  = array('controller' =>
'screens', 'action' => 'dashboard');
$this->Auth->logoutRedirect = array('controller' =>
'users', 'action' => 'login');
$this->Auth->loginError = 'Wrong username / password
combination';
$this->Auth->authError  = 'You must be logged in
before you can access the admin';
$this->Auth->authorize  = 'controller';
$this->Auth->autoRedirect   = false;

$cookie = $this->Cookie->read('User');

if (is_array($cookie) && !$this->Auth->user())
{
if ($this->User->checkLogin($cookie['username'],
$cookie['token']))
{
if (!$this->Auth->login($this->User))
{
$this->Cookie->del('User');
}
}
}

$this->layout = 'admin';
}
}

check up on the auth component for the usage, but remember that it
expects your login in the db to be called username
and the password to be called password. It autohashes passwords for
you when you add, edit, etc data.

now for every controllet that you have put this at the top:

function isAuthorized()
{
return true;
}

function beforeFilter()
{
$this->Auth->allow('index', 'preview');
parent::beforeFilter();
}

the isauthorized function ( true false ) means that the whole
controller needs to be authed or not ( for example your
controllers that server purely views should have this on false ).

The other function says which functions are allowed without
authorisation. you can also say $this->Auth->deny('functionname');
to say which functions do need authorisation.

Hope this clarifies things a bit. if you need more explanation, be
free to ask :)

On 15 okt, 03:19, Shackadoodl <[EMAIL PROTECTED]> wrote:
> I just went to sleep, but i couldnt sleep untill i fixed the bug, so
> now im back.
>
> The way im solving it now is with the bootstrap file indeed. I include
> the admin models, views,
> controllers etc into the normal app remotely, and everything seems to
> work. The only crap that
> im facing now is the auth component.
>
> When everything is fixed i will reply with a little howto for future
> reference.
>
> Could you also post your fix, i might learn something from it.
>
> Grtz shacka
>
> On Oct 15, 3:14 am, hydra12 <[EMAIL PROTECTED]> wrote:
>
> > I don't have access to my dev machine right now to check, but I think
> > you can do this in the bootstrap file.  I'll see if I can find more
> > tomorrow.
>
> > On Oct 14, 6:14 pm, Shackadoodl <[EMAIL PROTECTED]> wrote:
>
> > > Hi guys,
>
> > > Urgent question:
>
> > > I have a project with an extremely tight deadline, so rebuilding it
> > > all is out of the question.
>
> > > The problem is, that i have developped a cms ( which works just fine )
> > > next to the app folder. The structure looks like this
>
> > > -root
> > > --app
> > > --cms -> just a renamed copy off the app folder with the cms built
> > > into it
> > > --cake
> > > --vendors
>
> > > now when i access the cms throughwww.mysite.com/cmsitworksjust
> > > great, but the problem is that i need to build the frontend itself,
> > > and since the cms has all the images etc in its webroot, i cant get to
> > > them with the normal site.
>
> > > Is there any way that i can tell the app to look into the cms webroot
> > > folder as well or just go get its files there? Because the minute i
> > > mess with the advanced installation or with the htaccess files the
> > > norm

Re: 2 apps, one cms and the other is the normal site -> site needs to get to the cms's webroot

2008-10-14 Thread Shackadoodl

I just went to sleep, but i couldnt sleep untill i fixed the bug, so
now im back.

The way im solving it now is with the bootstrap file indeed. I include
the admin models, views,
controllers etc into the normal app remotely, and everything seems to
work. The only crap that
im facing now is the auth component.

When everything is fixed i will reply with a little howto for future
reference.

Could you also post your fix, i might learn something from it.

Grtz shacka

On Oct 15, 3:14 am, hydra12 <[EMAIL PROTECTED]> wrote:
> I don't have access to my dev machine right now to check, but I think
> you can do this in the bootstrap file.  I'll see if I can find more
> tomorrow.
>
> On Oct 14, 6:14 pm, Shackadoodl <[EMAIL PROTECTED]> wrote:
>
> > Hi guys,
>
> > Urgent question:
>
> > I have a project with an extremely tight deadline, so rebuilding it
> > all is out of the question.
>
> > The problem is, that i have developped a cms ( which works just fine )
> > next to the app folder. The structure looks like this
>
> > -root
> > --app
> > --cms -> just a renamed copy off the app folder with the cms built
> > into it
> > --cake
> > --vendors
>
> > now when i access the cms throughwww.mysite.com/cmsitworks just
> > great, but the problem is that i need to build the frontend itself,
> > and since the cms has all the images etc in its webroot, i cant get to
> > them with the normal site.
>
> > Is there any way that i can tell the app to look into the cms webroot
> > folder as well or just go get its files there? Because the minute i
> > mess with the advanced installation or with the htaccess files the
> > normal site fubars.
>
> > Can anyone help me?
>
> > Best Regards
> > Shackadoodl
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: 2 apps, one cms and the other is the normal site -> site needs to get to the cms's webroot

2008-10-14 Thread hydra12

I don't have access to my dev machine right now to check, but I think
you can do this in the bootstrap file.  I'll see if I can find more
tomorrow.

On Oct 14, 6:14 pm, Shackadoodl <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> Urgent question:
>
> I have a project with an extremely tight deadline, so rebuilding it
> all is out of the question.
>
> The problem is, that i have developped a cms ( which works just fine )
> next to the app folder. The structure looks like this
>
> -root
> --app
> --cms -> just a renamed copy off the app folder with the cms built
> into it
> --cake
> --vendors
>
> now when i access the cms throughwww.mysite.com/cmsit works just
> great, but the problem is that i need to build the frontend itself,
> and since the cms has all the images etc in its webroot, i cant get to
> them with the normal site.
>
> Is there any way that i can tell the app to look into the cms webroot
> folder as well or just go get its files there? Because the minute i
> mess with the advanced installation or with the htaccess files the
> normal site fubars.
>
> Can anyone help me?
>
> Best Regards
> Shackadoodl
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Filtering controller

2008-10-14 Thread David C. Zentgraf

http://book.cakephp.org/view/542/Defining-Routes

Your route would look something like:

Router::connect('/countries/:country_id/cities/*', array('controller'  
=> 'cities', 'action' => 'someCityAction'));

The 'country_id' will be available in $this->params in the controller.

On 15 Oct 2008, at 08:31, machuidel wrote:

>
> Hello,
>
> How can I map a controller to an URL like "/countries/12/cities/" such
> that the index of cities will be filtered by the specified country? I
> would like that URL to dispatch the "city" controller (not the
> "country" controller) with the specified country as its argument.
> Something like:
>
> class CityController extends AppController {
>
>  ...
>
>  function index_country ($country_id) {
> // Index of cities filtered by specified country
>  }
>
>  ...
>
> }
>
> Could not find any example of someone doing this in Cakephp.
>
> Cheers,
> Mike
>
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the best way to proceed and stay true to MVC/CakePHP philosophy

2008-10-14 Thread ORCC

I think first that all you have to separate the "parsing" of the text
and the execution of the command itself via components, namely:

1) Create a "CommandParser" component that has function to "parse" a
command.
2) Create a "CommandExecutive" component that has a method for
implement each of the commands.

I suggest you to handle the user input in a unique action in the
controlle. For example, create a send action where all the user text
is sent:

class ChatController extends AppController {
var $components =
Array('CommandParser','CommandExecutive');

/*handles all text send by user*/
function send($text) {
  /*analize wherter the input is a command or is plain
text*/
  if (CommandParser::isCommand($text)) {
//is a command redirect for command execution
   //use the parser component to get the command
and the parameter of the command
   $command = CommandParser::getCommand($text);
   $parameter = CommandParser::getParameter($te
   $this->redirect("/chat/command/$command/
$parameter");

  }
  else {
   //is normal text, show
   $this->redirect("/chat/add/$text")
  }
 }

 //here is the rest of actions
function add ($text) {
 //perform logic of add text
}

function command ($command, $parameter) {
 //perform logic of command
 }
}


For executing the command you can avoid the big switching statement by
using an array of callbacks indexed with the command names. All
callbacks are methods defined in the ActionExecutive component itself.
For example:

//this function may be in the controller
function proccessCommand($text,$parameter) {
   $command_list = Array (
'help' => "displayHelp",
   'quit' => "quitUser",
   /* ... */
);

   /*verify if  it is a valid command*/
   if (empty($command_list[$text])) {
return INVALID_COMMAND; /*this maybe a constant*/
  }

  $callback = $command_list[$text];
  /*execute the command that is a method in a command executive
component*/
  $result = CommandExecutive::$callback($parameter);
  return $result;
}


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Troubles doing a complex find

2008-10-14 Thread xavierunited

I am sorry but what is the point of this post? What is the problem?

On 10/14/2008, ORCC <[EMAIL PROTECTED]> wrote:
>
> AND logical operator is asociative, hence:
>
> 'OR' => Array (
>'AND' => Array ( /*put all conditions here*/)
>  )
>
> is equivalent, and here you don't rewrite the Array index.
>
>
> >
>


-- 
Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Troubles doing a complex find

2008-10-14 Thread ORCC

AND logical operator is asociative, hence:

'OR' => Array (
   'AND' => Array ( /*put all conditions here*/)
 )

is equivalent, and here you don't rewrite the Array index.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple table conditions HABTM

2008-10-14 Thread xavierunited

This keeps on show up in my email. The subject. I was wondering what
this was for?

On 10/14/2008, Brenton B <[EMAIL PROTECTED]> wrote:
>
> Not sure if this is close to what you need,
> http://www.bbartel.ca/blog/brenton/2008/oct/14/habtm-searching
> (will touch up formatting shortly).
>
> On Oct 14, 3:16 am, hariharan <[EMAIL PROTECTED]> wrote:
>> I am also stuck with the same problem . For HABTM or hasMany it doesnt
>> query with join. rather queries each and every table in an individual
>> manner, which is time consuming one.
>>
>> Another thing is cakephp does not support through association like
>> ROR.  suppose if I have two HABTM then i cant access the fields of the
>> extra table formed due to the relationships.
>>
>> eg user and group
>>
>> users  -> HASMANYANDBELONGSTO -> groups
>> groups -> HASMANYANDBELONGSTO -> users
>>
>> so the other table result due to this is groups_users. other than
>> group_id and user_id suppose if i want to store additional info such
>> as when did they joined group etc... i cant access those fields.
>>
>> help me.
>>
>> On Oct 8, 1:56 am, jmmg77 <[EMAIL PROTECTED]> wrote:
>>
>> > Okay,
>>
>> > Whenever I have a hasOne or belongsTo association, those models are
>> > included in the query whenever I do a find('all');
>>
>> > But, when I have any other type of association, find('all' only
>> > generates a query with the model I'm searching.
>> > This keeps me from filtering by fields in the related models.
>>
>> > ex:
>> > $funnypeople = $this->Individual->find('all', array('conditions' =>
>> > array('Personality.type' => 3)));
>>
>> > This example works find if a person only has one Personality Type.
>> > But what about this.
>>
>> > $racecardrivers = $this->Individual->find('all', array('conditions' =>
>> > array('Vehicle.type' => 2)));
>>
>> > The problem here is a person could own multiple vehicles, so belongsTo
>> > & hasOne don't work here.
>> > I would need hasMany or hasAndBelongsToMany, which makes those model
>> > inaccessible using find.
>>
>> > Any help would be greatly appreciated.  Thanks.
> >
>


-- 
Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple table conditions HABTM

2008-10-14 Thread Brenton B

Not sure if this is close to what you need,
http://www.bbartel.ca/blog/brenton/2008/oct/14/habtm-searching
(will touch up formatting shortly).

On Oct 14, 3:16 am, hariharan <[EMAIL PROTECTED]> wrote:
> I am also stuck with the same problem . For HABTM or hasMany it doesnt
> query with join. rather queries each and every table in an individual
> manner, which is time consuming one.
>
> Another thing is cakephp does not support through association like
> ROR.  suppose if I have two HABTM then i cant access the fields of the
> extra table formed due to the relationships.
>
> eg user and group
>
> users  -> HASMANYANDBELONGSTO -> groups
> groups -> HASMANYANDBELONGSTO -> users
>
> so the other table result due to this is groups_users. other than
> group_id and user_id suppose if i want to store additional info such
> as when did they joined group etc... i cant access those fields.
>
> help me.
>
> On Oct 8, 1:56 am, jmmg77 <[EMAIL PROTECTED]> wrote:
>
> > Okay,
>
> > Whenever I have a hasOne or belongsTo association, those models are
> > included in the query whenever I do a find('all');
>
> > But, when I have any other type of association, find('all' only
> > generates a query with the model I'm searching.
> > This keeps me from filtering by fields in the related models.
>
> > ex:
> > $funnypeople = $this->Individual->find('all', array('conditions' =>
> > array('Personality.type' => 3)));
>
> > This example works find if a person only has one Personality Type.
> > But what about this.
>
> > $racecardrivers = $this->Individual->find('all', array('conditions' =>
> > array('Vehicle.type' => 2)));
>
> > The problem here is a person could own multiple vehicles, so belongsTo
> > & hasOne don't work here.
> > I would need hasMany or hasAndBelongsToMany, which makes those model
> > inaccessible using find.
>
> > Any help would be greatly appreciated.  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread Brenton B

In the mean time:

http://www.bbartel.ca/blog/brenton/2008/oct/14/habtm-searching

Please forgive the horrible formatting, not sure what's going on
there, and don't have time right now to figure it out.

On Oct 14, 4:43 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> Stay tuned for article ... pending publication approval in the Bakery.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Question on the best way to proceed and stay true to MVC/CakePHP philosophy

2008-10-14 Thread Chez17

So I have an ajax chat application that I am working on. If a user
types a comment the starts with '/' it sends the comment to the
'command' function in my controller (as opposed to a normal 'add'
function for chats). For example if the user types "/help" it will
list all the possible commands. Now the command function is going to
have to parse the command and return the proper information. The way I
did the first couple commands was just a switch statement. But I got
to thinking if there was a better or more "cake" way to do it. Are
there better ways then just a giant switch statement? Should I try to
create my own component? What are your thoughts on this? Any help will
be greatly appreciated.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread Brenton B

Stay tuned for article ... pending publication approval in the Bakery.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with get product by user, function in products controller

2008-10-14 Thread Gabriel Kolbe

Hi Marcus

I have done the following, but it returns ALL the products NOT just
the user's is it possible to point out my error?
Thanks

My model (user)
var $hasMany = array(
'Product' => array('className' => 'Product',
'foreignKey' => 'product_id',

product controller
function viewbyuser() {
$products = $this->User->Product->find('all' , array('conditions' =>
array('user_id' => $this->Session->read('Auth.User.id') )));
$this->set('products', $this->paginate());  
}


On Tue, Oct 14, 2008 at 10:33 PM, Marcus Silva
<[EMAIL PROTECTED]> wrote:
>
> Ok,
>
> You might be able to do this:
>
>
> Add a relationship in your user model; example: User hasMany Product
> etc...
>
> Then in you controller you can do the following:
>
>
> $this->User->id = $id; //Passed in the function
>
> $userProducts = $this->User->Product->find('all',$params =
> array(   'conditions' => add any extra condition in here , it can be
> an array as well.   ));
>
>
> //then set the data to be available int he view.
>
> Better yet, you could write a custom function in the User model to get
> products for the user, that would save typying etc..
>
> in user.php //model
>
> function getProduct(){
> //The model must be associated before trying to do this.
>
> return $this->Product->find();
>
> }
>
> in the controller you do:
>
> $userProducts = $this->User->getProduct();  //SImple
>
> Hope it helps...
>
> Cheers
>
>
>
> gabriel wrote:
>> Hi, i hope someone can help me here please, I need help with my
>> controller function, I want to get products by user_id, unfortunately
>> I have no idea where to start, help will be greatfully received.
>>
>> Here is my code so far...
>>
>>
>> class ProductsController extends AppController {
>> var $name = 'Products';
>> var $uses = array('Product', 'Category', 'User');
>> var $components = array('Search','Files');
>>
>>   function view() {
>>   $this->Product->recursive = 0;
>>   $this->set('products', $this->paginate());
>>   $this->set('users', $this->User->read(null, $id));
>>
>>   }
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Filtering controller

2008-10-14 Thread machuidel

Hello,

How can I map a controller to an URL like "/countries/12/cities/" such
that the index of cities will be filtered by the specified country? I
would like that URL to dispatch the "city" controller (not the
"country" controller) with the specified country as its argument.
Something like:

class CityController extends AppController {

  ...

  function index_country ($country_id) {
 // Index of cities filtered by specified country
  }

  ...

}

Could not find any example of someone doing this in Cakephp.

Cheers,
Mike

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Troubles doing a complex find

2008-10-14 Thread Benni Graf

Hi there!
I'm getting some data via this statement:

$offtimes = $this->Offtime->find('all', array(
 'conditions'=>array(
  'AND'=>array(
   'Offtime.therapist_id'=>$therapistid, // appears in the query
   'OR'=>array(
'AND'=>array(
   // some conditions // don't appear in the query
),
'AND'=>array(
   // some other conditions // don't appear in the query
),
'AND'=>array(
   // more conditions - only those appear in the query!
)
   )
  )
 ),
 'recursive'=>-1
));

(left the actual conditions out for clarity)

Unfortunately, only the last of the 3 AND-block gets considered for
the query, the others are 'ignored' (they just don't appear in the
query). The querys given in debug2-mode show me that. Also when I
shuffle the order of the 3 AND-Blocks, only the last one appears in
the query... Any ideas?

Best regards and thanks for the Help!

Btw, if you want to post some code, I also posted this to the bin...:
http://bin.cakephp.org/saved/38480

Greetings, Benni.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



2 apps, one cms and the other is the normal site -> site needs to get to the cms's webroot

2008-10-14 Thread Shackadoodl

Hi guys,

Urgent question:

I have a project with an extremely tight deadline, so rebuilding it
all is out of the question.

The problem is, that i have developped a cms ( which works just fine )
next to the app folder. The structure looks like this

-root
--app
--cms -> just a renamed copy off the app folder with the cms built
into it
--cake
--vendors

now when i access the cms through www.mysite.com/cms it works just
great, but the problem is that i need to build the frontend itself,
and since the cms has all the images etc in its webroot, i cant get to
them with the normal site.

Is there any way that i can tell the app to look into the cms webroot
folder as well or just go get its files there? Because the minute i
mess with the advanced installation or with the htaccess files the
normal site fubars.

Can anyone help me?

Best Regards
Shackadoodl
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Troubles doing a complex find

2008-10-14 Thread the_woodsman

It looks to me like it's nothing to do with Cake - see your array:

 'OR'=>array(
'AND'=>array(
   // some conditions // don't appear in the query
),
'AND'=>array(
   // some other conditions // don't appear in the query
),
'AND'=>array(
   // more conditions - only those appear in the query!
)


The OR array has multiple settings under the key AND  - each of your
new ands overwrites the previous one, hence only the last conditions
appear.
I'm no expert, so take a look at 
http://book.cakephp.org/view/74/Complex-Find-Conditions
or search this group for good examples, but my guess would be that all
the conditions should go in just one AND array...



On Oct 14, 11:30 pm, Benni Graf <[EMAIL PROTECTED]> wrote:
> Hi there!
> I'm getting some data via this statement:
>
> $offtimes = $this->Offtime->find('all', array(
>  'conditions'=>array(
>   'AND'=>array(
>    'Offtime.therapist_id'=>$therapistid, // appears in the query
>    'OR'=>array(
>     'AND'=>array(
>        // some conditions // don't appear in the query
>     ),
>     'AND'=>array(
>        // some other conditions // don't appear in the query
>     ),
>     'AND'=>array(
>        // more conditions - only those appear in the query!
>     )
>    )
>   )
>  ),
>  'recursive'=>-1
> ));
>
> (left the actual conditions out for clarity)
>
> Unfortunately, only the last of the 3 AND-block gets considered for
> the query, the others are 'ignored' (they just don't appear in the
> query). The querys given in debug2-mode show me that. Also when I
> shuffle the order of the 3 AND-Blocks, only the last one appears in
> the query... Any ideas?
>
> Best regards and thanks for the Help!
>
> Btw, if you want to post some code, I also posted this to the 
> bin...:http://bin.cakephp.org/saved/38480
>
> Greetings, Benni.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $validate is killing a model (and my entire app). Very strange :/

2008-10-14 Thread Topper

Kill me.

$this->Session->setFlash('message', 'nonexistantlayout');

You were right.

I can't believe it was just a little typo... omg. Damn copy/paste

Thanks a lot man.

On 14 oct, 16:26, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 14, 4:36 am, Topper <[EMAIL PROTECTED]> wrote:
>
>
>
> > Cake's version: 1.1.20.7692
>
> > Hello. What you will read is something very weird that started to
> > happen today in the app I am currently building. It's not my 1st cake
> > app and I think I am not so newbie anymore. The story is:
>
> > I have a model, product.php, that of course belongs to a products
> > table. The table structure is:
>
> > CREATE TABLE `products` (
> >   `id` int(11) unsigned NOT NULL auto_increment,
> >   `nombre` tinytext,
> >   `created` datetime NOT NULL default '-00-00 00:00:00',
> >   `modified` datetime NOT NULL default '-00-00 00:00:00',
> >   PRIMARY KEY  (`id`)
> > ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
>
> > The product.php model code is:
>
> >  > class Product extends AppModel {
>
> >         var $name = 'Product';
>
> > }
>
> > ?>
>
> > I have an "add" function in the products controller that saves some
> > products. Everything worked neat, I added some products with the form,
> > etc ... until I added the $validate to the model. Just adding this:
>
> >  > class Product extends AppModel {
>
> >         var $name = 'Product';
> >         var $validate = array(
> >                 'nombre' => VALID_NOT_EMPTY
> >         );
>
> > }
>
> > ?>
>
> > ... and submitting the add form It literally KILLS my entire app (it
> > starts showing no access pages or missing layout errors). It only
> > solves after deleting the $validate lines and also deleting the
> > browser's cache.
>
> That sounds suspiciously like you have
> $this->Session->setFlash('message', 'nonexistantlayout');
>
> check in your controller if it passes validation, and if so dump the
> session contents.
>
> If you're convinced it's the validate function - debug it. although I
> very much doubt that'll be the real cause.
>
> hth,
>
> AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with get product by user, function in products controller

2008-10-14 Thread Marcus Silva

Ok,

You might be able to do this:


Add a relationship in your user model; example: User hasMany Product
etc...

Then in you controller you can do the following:


$this->User->id = $id; //Passed in the function

$userProducts = $this->User->Product->find('all',$params =
array(   'conditions' => add any extra condition in here , it can be
an array as well.   ));


//then set the data to be available int he view.

Better yet, you could write a custom function in the User model to get
products for the user, that would save typying etc..

in user.php //model

function getProduct(){
//The model must be associated before trying to do this.

return $this->Product->find();

}

in the controller you do:

$userProducts = $this->User->getProduct();  //SImple

Hope it helps...

Cheers



gabriel wrote:
> Hi, i hope someone can help me here please, I need help with my
> controller function, I want to get products by user_id, unfortunately
> I have no idea where to start, help will be greatfully received.
>
> Here is my code so far...
>
>
> class ProductsController extends AppController {
> var $name = 'Products';
> var $uses = array('Product', 'Category', 'User');
> var $components = array('Search','Files');
>
>   function view() {
>   $this->Product->recursive = 0;
>   $this->set('products', $this->paginate());
>   $this->set('users', $this->User->read(null, $id));
>
>   }
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with get product by user, function in products controller

2008-10-14 Thread Gabriel Kolbe

Thanks Marcus, I will try it, you are a star.

On Tue, Oct 14, 2008 at 10:33 PM, Marcus Silva
<[EMAIL PROTECTED]> wrote:
>
> Ok,
>
> You might be able to do this:
>
>
> Add a relationship in your user model; example: User hasMany Product
> etc...
>
> Then in you controller you can do the following:
>
>
> $this->User->id = $id; //Passed in the function
>
> $userProducts = $this->User->Product->find('all',$params =
> array(   'conditions' => add any extra condition in here , it can be
> an array as well.   ));
>
>
> //then set the data to be available int he view.
>
> Better yet, you could write a custom function in the User model to get
> products for the user, that would save typying etc..
>
> in user.php //model
>
> function getProduct(){
> //The model must be associated before trying to do this.
>
> return $this->Product->find();
>
> }
>
> in the controller you do:
>
> $userProducts = $this->User->getProduct();  //SImple
>
> Hope it helps...
>
> Cheers
>
>
>
> gabriel wrote:
>> Hi, i hope someone can help me here please, I need help with my
>> controller function, I want to get products by user_id, unfortunately
>> I have no idea where to start, help will be greatfully received.
>>
>> Here is my code so far...
>>
>>
>> class ProductsController extends AppController {
>> var $name = 'Products';
>> var $uses = array('Product', 'Category', 'User');
>> var $components = array('Search','Files');
>>
>>   function view() {
>>   $this->Product->recursive = 0;
>>   $this->set('products', $this->paginate());
>>   $this->set('users', $this->User->read(null, $id));
>>
>>   }
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



help with get product by user, function in products controller

2008-10-14 Thread gabriel

Hi, i hope someone can help me here please, I need help with my
controller function, I want to get products by user_id, unfortunately
I have no idea where to start, help will be greatfully received.

Here is my code so far...


class ProductsController extends AppController {
var $name = 'Products';
var $uses = array('Product', 'Category', 'User');
var $components = array('Search','Files');

function view() {
$this->Product->recursive = 0;
$this->set('products', $this->paginate());
$this->set('users', $this->User->read(null, $id));

}

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread [EMAIL PROTECTED]

It apears to be from 7389 "Removed almost all am() calls from core."
https://trac.cakephp.org/changeset?new=branches%2F1.2.x.x%2Fcake%2Flibs%2Fmodel%2Fmodel.php%407389&old=branches%2F1.2.x.x%2Fcake%2Flibs%2Fmodel%2Fmodel.php%407384

am() puts any string into a new array. When am() was swapped for
array_merge() that conversion was lost and Model::_deleteDependent()
started outputting type-mismatch errors. I spent a few minutes
rewriting all conditions I have defined in associations to be arrays.
That seems to cure it.

I expected this to be the new desired behaviour (even though the
function could handle bad parameters a little better) so I submitted a
few changes to The Book where association conditions are specified as
strings. If this indeed is not the new desired behaviour, then my
changes should of-course be ignored.


/Martin


On Oct 14, 5:31 pm, gwoo <[EMAIL PROTECTED]> wrote:
> Can you find a changeset that modified the behavior?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread [EMAIL PROTECTED]

also in this group there are great HABTM resource links in the FAQ -
http://groups.google.com/group/cake-php/web/faq?hl=en

side note - in PHP5 you can now access array values directly by using
foreach ($array as &$item){//notice the reference here
 $item['somekey'] = $someValue;
}

this has helped me in some HABTM and pagination problems as well.
I will be posting some code and examples soon, and i think the core
code could
benefit from this feature as well

just my 2cents

On Oct 14, 12:26 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> Yeah, that is an odd suggestion, but such is life. ;)
>
> Once I polish up my code I will be posting it, because clearly HABTM
> has some of ironing out to do if there are umpteen posts about it.
> This was a fun discussion, wasn't it?
>
> Disclaimer: I'm not knocking Cake as a whole, just some areas need
> some clarification ... which is expect for a framework at this stage
> in it's development.
>
> On Oct 14, 12:12 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Oct 14, 8:57 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > > Ooh, you mean "HABTM" in the _Cook_ book??? oooh, I see what
> > > you're saying now, that makes so much sense!! I can't believe I never
> > > read the tutorials to start with. How foolish of me not to have
> > > searched through everything.
>
> > > /sarcasm
>
> > > Sorry ... just had to get that out.
>
> > > Please read beyond the title of the discussion.
> > > I know I didn't give any specifics of what I'm trying to do, because
> > > I've got quite a few different scenarios all of which are quite
> > > complex and I'm looking for a nice fancy component to handle
> > > searching ... wherein "hackery" and "trickery" are not in the
> > > description. As an example, (using auto mechanics) I shouldn't have to
> > > duct tape my muffler because the crazy glue is melting.
>
> > > No worries though, because I couldn't find anything I've developed my
> > > own chunk of code to handle it ... I just wanted to see if there pre-
> > > existed anything in the wild before re-inventing it.
>
> > Forgive me for suggesting you'd need to know/learn how to solve it
> > once, to be able to solve it for all. Odd suggestion I know.
>
> > Glad to hear you solved your problem - you are the umpteenth person to
> > post to the group regarding habtm searching and you won't be the last
> > - why don't you post your solution somewhere, or add it to the bakery
> > for future reference.
>
> > Cheers,
>
> > AD

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ajax Redirect and setFlash Messages

2008-10-14 Thread Julián Lastiri

Well, i found that when i call redirect from an ajax request the
redirect is forwarded to the beforeRedirect method from RequestHandler
Component. This
method calls requestAction which sets bare in 1 and the dispatchers
does the following

if (!empty($this->params['bare'])) {
$controller->autoLayout = false;
}

When autoLayout is set to false the view doesn't call renderLayout

if ($layout && $this->autoLayout) {
$out = $this->renderLayout($out, $layout);

Anybody knows how do i tell cakephp to set autoLayout to true when i
call redirect from an ajax request ?

thanks


On Oct 14, 3:59 pm, Julián Lastiri <[EMAIL PROTECTED]> wrote:
> When i useredirectfrom anajaxrequest theajax.ctp is not rendered.
>
> I try calling setFlash with growl  layout but doesn't work.
>
> I have a content div in my webpage. When i submit the form i save the
> data, then set a Flash message andredirectto the index.
> The index is loaded in the content div, but the message is not shown.
> If i put some debug comments like echo "debugging" on theajax.ctp
> layout theses comments are not printed.
> So i suspect that the view is not rendering the layout properly.
>
> any idea ?
>
> On Oct 13, 10:18 pm, "Andras Kende" <[EMAIL PROTECTED]> wrote:
>
> > this worked great for 
> > me:http://blog.jaysalvat.com/articles/afficher-vos-messages-flash-cakeph...
> > delegantes-alertes-a-la-growl.php
>
> > did it for both flash and validation..
>
> > Andras
>
> > -Original Message-
> > From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> > Of Julián Lastiri
> > Sent: Monday, October 13, 2008 2:11 PM
> > To: CakePHP
> > Subject:AjaxRedirectand setFlash Messages
>
> > I'm using cakephp 1.2RC3
> > I want to show messages with setFlash method but when i useredirect
> > theajax.ctp layout is not rendered.
> > I'm using this code to show messages with jGrowl inside myajax.ctp
> > layout
>
> > check('Message.flash')): ?>
> > 
> > jQuery(document).ready(function(){
> >         jQuery.jGrowl( " > >read('Message.flash.message');?>", {
> >                 life: 2000,
> >                 sticky: false,
> >                 header: '',
> >                 theme: ''
> >         });
> > });
> > 
>
> > any idea ?
>
> > 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread Joel Perras

$ svn blame 
https://svn.cakephp.org/repo/branches/1.2.x.x/cake/libs/model/model.php

-J.

On Oct 14, 12:29 pm, Mathew <[EMAIL PROTECTED]> wrote:
> Is it possible to see all the changesets for RC3 on a specific file?
>
> For example; How can I browse the history of changes to the model.php
> file?
>
> I've been looking around the Cake website, I can see the SVN urls, the
> source code browser, but I'm looking for something like WebSVN.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to Handle Special Fields on $this->query() statements - Forking from "MySQL Having Clausule "

2008-10-14 Thread ORCC

Use Set classs for manipulating your find's results, particularly the
Set::combine method maybe helpful for you..

http://book.cakephp.org/view/662/combine

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple table conditions HABTM

2008-10-14 Thread Brenton B

What kind of SQL errors, if any, are being thrown?

On Oct 14, 3:16 am, hariharan <[EMAIL PROTECTED]> wrote:
> I am also stuck with the same problem . For HABTM or hasMany it doesnt
> query with join. rather queries each and every table in an individual
> manner, which is time consuming one.
>
> Another thing is cakephp does not support through association like
> ROR.  suppose if I have two HABTM then i cant access the fields of the
> extra table formed due to the relationships.
>
> eg user and group
>
> users  -> HASMANYANDBELONGSTO -> groups
> groups -> HASMANYANDBELONGSTO -> users
>
> so the other table result due to this is groups_users. other than
> group_id and user_id suppose if i want to store additional info such
> as when did they joined group etc... i cant access those fields.
>
> help me.
>
> On Oct 8, 1:56 am, jmmg77 <[EMAIL PROTECTED]> wrote:
>
> > Okay,
>
> > Whenever I have a hasOne or belongsTo association, those models are
> > included in the query whenever I do a find('all');
>
> > But, when I have any other type of association, find('all' only
> > generates a query with the model I'm searching.
> > This keeps me from filtering by fields in the related models.
>
> > ex:
> > $funnypeople = $this->Individual->find('all', array('conditions' =>
> > array('Personality.type' => 3)));
>
> > This example works find if a person only has one Personality Type.
> > But what about this.
>
> > $racecardrivers = $this->Individual->find('all', array('conditions' =>
> > array('Vehicle.type' => 2)));
>
> > The problem here is a person could own multiple vehicles, so belongsTo
> > & hasOne don't work here.
> > I would need hasMany or hasAndBelongsToMany, which makes those model
> > inaccessible using find.
>
> > Any help would be greatly appreciated.  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $validate is killing a model (and my entire app). Very strange :/

2008-10-14 Thread AD7six



On Oct 14, 4:36 am, Topper <[EMAIL PROTECTED]> wrote:
> Cake's version: 1.1.20.7692
>
> Hello. What you will read is something very weird that started to
> happen today in the app I am currently building. It's not my 1st cake
> app and I think I am not so newbie anymore. The story is:
>
> I have a model, product.php, that of course belongs to a products
> table. The table structure is:
>
> CREATE TABLE `products` (
>   `id` int(11) unsigned NOT NULL auto_increment,
>   `nombre` tinytext,
>   `created` datetime NOT NULL default '-00-00 00:00:00',
>   `modified` datetime NOT NULL default '-00-00 00:00:00',
>   PRIMARY KEY  (`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
>
> The product.php model code is:
>
>  class Product extends AppModel {
>
>         var $name = 'Product';
>
> }
>
> ?>
>
> I have an "add" function in the products controller that saves some
> products. Everything worked neat, I added some products with the form,
> etc ... until I added the $validate to the model. Just adding this:
>
>  class Product extends AppModel {
>
>         var $name = 'Product';
>         var $validate = array(
>                 'nombre' => VALID_NOT_EMPTY
>         );
>
> }
>
> ?>
>
> ... and submitting the add form It literally KILLS my entire app (it
> starts showing no access pages or missing layout errors). It only
> solves after deleting the $validate lines and also deleting the
> browser's cache.

That sounds suspiciously like you have
$this->Session->setFlash('message', 'nonexistantlayout');

check in your controller if it passes validation, and if so dump the
session contents.

If you're convinced it's the validate function - debug it. although I
very much doubt that'll be the real cause.

hth,

AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread Brenton B

Yeah, that is an odd suggestion, but such is life. ;)

Once I polish up my code I will be posting it, because clearly HABTM
has some of ironing out to do if there are umpteen posts about it.
This was a fun discussion, wasn't it?

Disclaimer: I'm not knocking Cake as a whole, just some areas need
some clarification ... which is expect for a framework at this stage
in it's development.

On Oct 14, 12:12 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 14, 8:57 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
>
>
> > Ooh, you mean "HABTM" in the _Cook_ book??? oooh, I see what
> > you're saying now, that makes so much sense!! I can't believe I never
> > read the tutorials to start with. How foolish of me not to have
> > searched through everything.
>
> > /sarcasm
>
> > Sorry ... just had to get that out.
>
> > Please read beyond the title of the discussion.
> > I know I didn't give any specifics of what I'm trying to do, because
> > I've got quite a few different scenarios all of which are quite
> > complex and I'm looking for a nice fancy component to handle
> > searching ... wherein "hackery" and "trickery" are not in the
> > description. As an example, (using auto mechanics) I shouldn't have to
> > duct tape my muffler because the crazy glue is melting.
>
> > No worries though, because I couldn't find anything I've developed my
> > own chunk of code to handle it ... I just wanted to see if there pre-
> > existed anything in the wild before re-inventing it.
>
> Forgive me for suggesting you'd need to know/learn how to solve it
> once, to be able to solve it for all. Odd suggestion I know.
>
> Glad to hear you solved your problem - you are the umpteenth person to
> post to the group regarding habtm searching and you won't be the last
> - why don't you post your solution somewhere, or add it to the bakery
> for future reference.
>
> Cheers,
>
> AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $validate is killing a model (and my entire app). Very strange :/

2008-10-14 Thread Topper

I'm still stuck with this.
At least I discovered that the problem is in the validation because
even if I delete the $validate lines of the model but add something
like this to the controller:

if (trim($this->data['Product']['nombre']) == ""){
$this->Product->invalidate('nombre_empty');
}


the app dies just like before.

Any suggestion will be very appreciated.

Regards
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread AD7six



On Oct 14, 8:57 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> Ooh, you mean "HABTM" in the _Cook_ book??? oooh, I see what
> you're saying now, that makes so much sense!! I can't believe I never
> read the tutorials to start with. How foolish of me not to have
> searched through everything.
>
> /sarcasm
>
> Sorry ... just had to get that out.
>
> Please read beyond the title of the discussion.
> I know I didn't give any specifics of what I'm trying to do, because
> I've got quite a few different scenarios all of which are quite
> complex and I'm looking for a nice fancy component to handle
> searching ... wherein "hackery" and "trickery" are not in the
> description. As an example, (using auto mechanics) I shouldn't have to
> duct tape my muffler because the crazy glue is melting.
>
> No worries though, because I couldn't find anything I've developed my
> own chunk of code to handle it ... I just wanted to see if there pre-
> existed anything in the wild before re-inventing it.

Forgive me for suggesting you'd need to know/learn how to solve it
once, to be able to solve it for all. Odd suggestion I know.

Glad to hear you solved your problem - you are the umpteenth person to
post to the group regarding habtm searching and you won't be the last
- why don't you post your solution somewhere, or add it to the bakery
for future reference.

Cheers,

AD


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ajax Redirect and setFlash Messages

2008-10-14 Thread Julián Lastiri

When i use redirect from an ajax request the ajax.ctp is not rendered.

I try calling setFlash with growl  layout but doesn't work.

I have a content div in my webpage. When i submit the form i save the
data, then set a Flash message and redirect to the index.
The index is loaded in the content div, but the message is not shown.
If i put some debug comments like echo "debugging" on the ajax.ctp
layout theses comments are not printed.
So i suspect that the view is not rendering the layout properly.


any idea ?





On Oct 13, 10:18 pm, "Andras Kende" <[EMAIL PROTECTED]> wrote:
> this worked great for 
> me:http://blog.jaysalvat.com/articles/afficher-vos-messages-flash-cakeph...
> delegantes-alertes-a-la-growl.php
>
> did it for both flash and validation..
>
> Andras
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
>
> Of Julián Lastiri
> Sent: Monday, October 13, 2008 2:11 PM
> To: CakePHP
> Subject:AjaxRedirectand setFlash Messages
>
> I'm using cakephp 1.2RC3
> I want to show messages with setFlash method but when i useredirect
> theajax.ctp layout is not rendered.
> I'm using this code to show messages with jGrowl inside myajax.ctp
> layout
>
> check('Message.flash')): ?>
> 
> jQuery(document).ready(function(){
>         jQuery.jGrowl( " >read('Message.flash.message');?>", {
>                 life: 2000,
>                 sticky: false,
>                 header: '',
>                 theme: ''
>         });
> });
> 
>
> any idea ?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread Brenton B

Ooh, you mean "HABTM" in the _Cook_ book??? oooh, I see what
you're saying now, that makes so much sense!! I can't believe I never
read the tutorials to start with. How foolish of me not to have
searched through everything.

/sarcasm

Sorry ... just had to get that out.

Please read beyond the title of the discussion.
I know I didn't give any specifics of what I'm trying to do, because
I've got quite a few different scenarios all of which are quite
complex and I'm looking for a nice fancy component to handle
searching ... wherein "hackery" and "trickery" are not in the
description. As an example, (using auto mechanics) I shouldn't have to
duct tape my muffler because the crazy glue is melting.

No worries though, because I couldn't find anything I've developed my
own chunk of code to handle it ... I just wanted to see if there pre-
existed anything in the wild before re-inventing it.


On Oct 14, 11:22 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 14, 8:17 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > There is nothing in the Cookbook about the "joins" key. Once martin
> > mentioned it I double checked. I then searched the code itself
> > (dbo_source.php) and lo-and-behold, it does exist. I have yet to take
> > a look and experiment to see what it does though.
>
> > Sorry if I hurt your feelings by venting that Cake isn't too popular
> > with me right now.
>
> Heh my feelings are fine. I'll be even more obvious given your reply.
>
> Open book.cakephp.org, type "habtm" in the search box and read the
> *whole* section. There are a number of examples of how to do exactly
> what you're asking.
>
> So given it's the first result in the first place to look for info; I
> don't think it's inappropriate spoon feed that info.
>
> AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Move existing app to Subversion

2008-10-14 Thread gravyface

I found a decent document online and did an import and it's working 
great now.  Not having any luck with Eclipse Tasks (it's not recognizing 
my todo tags).  You using tags?  It shows all of the Cake project todos, 
just not mine in my application project.

Mathew wrote:
> I've been using SVN with CakePHP for 2 years now, and it works great
> together.
> 
> I run Eclipse as my IDE on Windows, and use TortoiseSVN as my desktop
> client. I also have the SVN plugin for Eclipse.
> 
> My repository setup is simple.
> 
> /svn/trunk/website_name/...
> /svn/branch/branch_version/website_name/...
> 
> I do all my work off the trunk, and then move files to branches as I
> reach milestones. Some people do it the reverse, working off a branch
> and then merging with the trunk as they reach milestones. It's up to
> you to figure out which is best.
> 
> I found that TortoiseSVN allows me to quickly add files to the ignore
> list of SVN. Things like the cake temp folder for example.
> > 

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Move existing app to Subversion

2008-10-14 Thread Mathew

I've been using SVN with CakePHP for 2 years now, and it works great
together.

I run Eclipse as my IDE on Windows, and use TortoiseSVN as my desktop
client. I also have the SVN plugin for Eclipse.

My repository setup is simple.

/svn/trunk/website_name/...
/svn/branch/branch_version/website_name/...

I do all my work off the trunk, and then move files to branches as I
reach milestones. Some people do it the reverse, working off a branch
and then merging with the trunk as they reach milestones. It's up to
you to figure out which is best.

I found that TortoiseSVN allows me to quickly add files to the ignore
list of SVN. Things like the cake temp folder for example.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread AD7six



On Oct 14, 8:17 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> There is nothing in the Cookbook about the "joins" key. Once martin
> mentioned it I double checked. I then searched the code itself
> (dbo_source.php) and lo-and-behold, it does exist. I have yet to take
> a look and experiment to see what it does though.
>
> Sorry if I hurt your feelings by venting that Cake isn't too popular
> with me right now.

Heh my feelings are fine. I'll be even more obvious given your reply.

Open book.cakephp.org, type "habtm" in the search box and read the
*whole* section. There are a number of examples of how to do exactly
what you're asking.

So given it's the first result in the first place to look for info; I
don't think it's inappropriate spoon feed that info.

AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread Brenton B

There is nothing in the Cookbook about the "joins" key. Once martin
mentioned it I double checked. I then searched the code itself
(dbo_source.php) and lo-and-behold, it does exist. I have yet to take
a look and experiment to see what it does though.

Sorry if I hurt your feelings by venting that Cake isn't too popular
with me right now.

Thanks again martin for the tip about the "joins" key, hopefully
someone else will find it useful as well.


On Oct 14, 9:24 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Oct 14, 11:38 am, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > H ... will take a look, cheers.
>
> Or look inthe book habtm section (should have been pit stop 1) or
> search the group (should have been pit stop 2)
>
> Ironic that searching is the topic and is the thing that's missing.
>
> AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Hosting A Cake App On GoDaddy!

2008-10-14 Thread James K

Get the hell off GoDaddy - some of the worst, more incompetent hosting
you can buy.

I remember when I spent a week debating their staff over what version
of PHP was installed on a particular server. phpinfo() reported PHP 4,
but they continually insisted it was PHP 5. It took a week before they
finally moved us to a box with PHP 5 installed.

Then once we finally got things running, the site would be down almost
every single day for a minute or two.

...and slow... so, so slow. I think they must run these servers under
their desks on old Pentium 3 boxes or something.

Save yourself the headaches and just move over to a competent host.

On Oct 13, 9:08 am, AceStudio <[EMAIL PROTECTED]> wrote:
> A client of mine purchased a web hosting package on GoDaddy but after
> i uploaded the application on it... it wasn't working. i have been
> racking my head on how to make it work but all to no avail.
>
> I need to know who has successfully hosted on a GoDaddy server, so the
> person could tell me how he tweaked the server.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How to Handle Special Fields on $this->query() statements - Forking from "MySQL Having Clausule "

2008-10-14 Thread Dérico Filho

Hello guys,


So I asked a question about having clauses using $this->Model->find()
method, and the answer was daunting, in my opinion: use in Model Class
$this->query() method within a custom method... OK. I shall do it this
way.

One of the problems I face using $this->query() is:

Whenever I have a special field, the result parser puts it in a
different key.

For instance:

$qry = $this->query("SELECT `Table`.*, `Table`.field * 1000 as
specialfield FROM ");

it would return $qry as
Array( 0 =>
Array("Table" => Array("field" => "1", "field2" => "value"), 0 =>
Array("specialfield" => "1000"), ...
);

What do I do?

I array_walk the result, array_mergin Table with 0... eventually it
turns into:
Array( 0 =>
Array("Table" => Array("field" => "1", "field2" => "value",
"specialfield" => "1000"), ...
);

Is there any more practical way doing it?

thanks you guys!

[]s
Dérico Filho
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Yet another site powered by Cakephp

2008-10-14 Thread Xavier Mathews
True i'm sorry. No i'm not being sarcastic i just gave it some thought!

Xavier A. Mathews
Student/Developer/Web-Master
GG Client Based Tech Support Specialist
Hazel Crest Illinois
[EMAIL PROTECTED]
"Fear of a name, only increases fear of the thing itself."







On Tue, Oct 14, 2008 at 6:47 AM, villas <[EMAIL PROTECTED]> wrote:

>
> > Thats nice i am not sure that it was really worth posting tho.
>
> I disagree.  After reading your first comment on the thread,  I found
> RyOnLife's contribution fascinating!
> :-)
>
> On Oct 13, 9:36 pm, [EMAIL PROTECTED] wrote:
> > Thats nice i am not sure that it was really worth posting tho.
> >
> > On 10/13/2008, RyOnLife <[EMAIL PROTECTED]> wrote:
> >
> > > Just wanted to say I like the interface!! Plain and easy to navigate,
> but
> > > something cool about the simplicity.
> >
> > > Sayhello-2 wrote:
> >
> > >> Hello all,
> >
> > >> Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
> > >>www.sayhello.me. Sayhello is a new classified ads site to help you buy
> > >> and sell. We are initially launching in the Los Angeles market. Check
> > >> it out. Any suggestions and feedback are welcome.
> >
> > >> Thank you!
> > >>www.sayhello.me
> >
> > > --
> > > View this message in context:
> > >http://www.nabble.com/Yet-another-site-powered-by-Cakephp-tp19931969p.
> ..
> > > Sent from the CakePHP mailing list archive at Nabble.com.
> >
> > --
> > Xavier A. Mathews
> > Student/Developer/Web-Master
> > GG Client Based Tech Support Specialist
> > Hazel Crest Illinois
> > [EMAIL PROTECTED]
> > "Fear of a name, only increases fear of the thing itself."
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: MySQL Having Clausule

2008-10-14 Thread Dérico Filho

Just as I have done... Ok, tks.

On Oct 13, 5:50 pm, ORCC <[EMAIL PROTECTED]> wrote:
> If you have query with complex conditions, I suggest you to use the
> query() method directly
>
> $users = $this->User->query('YOUR SQL QUERY')
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: App::import broken in RC3

2008-10-14 Thread Mathew

I'm a little confused how this got broken in RC3.

I've looked at the changes from RC2 to RC3 in this url.

https://trac.cakephp.org/changeset?new=trunk%2Fcake%2F1.2.x.x%2Fcake%2Flibs%2Fconfigure.php%407690&old=trunk%2Fcake%2F1.2.x.x%2Fcake%2Flibs%2Fconfigure.php%407296

I don't see anything that should have broken my import statement, but
when debugging the code I can see that it's not working.

I got to line 837 in configure.php where is says "$directory = $_this-
>__find($find, true);", and that returns null. I'm not sure it's
suppose that have gotten that far.

$find is equal to "rss_fetch.inc" which is my file, but the __find()
method only checks the vendor folders. It appears to be ignoring the
subfolder "magpierss" defined in the name parameter.

Could I have been using the wrong parameters?

How would I import this file from my plugins vendor folder?

"/app/plugins/gems/vendor/magpierss/rss_fetch.inc"
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please explain scaffolding changes in RC3

2008-10-14 Thread Mathew

Thanks mark!

Streamlining is always good!

I got my templates working, and have to admit editing 1 view for both
add/edit is a lot less work.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please explain scaffolding changes in RC3

2008-10-14 Thread mark_story

This change was done, as Scaffolds were attempting to use too many
templates in addition there was the possibility for both separate
admin_action.scaffold as well as action.scaffold.  This was not
intended as you cannot scaffold both admin and non admin actions at
the same time.  As for merging the add/edit templates, this was done
to streamline the scaffold system and make it more analogous to the
bake templates.  Bake templates only have view, index, add/edit and
now scaffolds do as well.

All the documentation on book.cakephp.org is editable by the public,
all you need is a bakery account.

-Mark

On Oct 14, 12:14 pm, Mathew <[EMAIL PROTECTED]> wrote:
> I guess I should log in, and try to update the documentation.
>
> I assume this is possible right? Can the documentation be edited by
> the public?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/dispatcher.php, line 337]

2008-10-14 Thread [EMAIL PROTECTED]

Thanks for helping! I just repaced :url with :id and it works great
now!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread AD7six



On Oct 14, 11:38 am, Brenton B <[EMAIL PROTECTED]> wrote:
> H ... will take a look, cheers.

Or look inthe book habtm section (should have been pit stop 1) or
search the group (should have been pit stop 2)

Ironic that searching is the topic and is the thing that's missing.

AD
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread Mathew

Is it possible to see all the changesets for RC3 on a specific file?

For example; How can I browse the history of changes to the model.php
file?

I've been looking around the Cake website, I can see the SVN urls, the
source code browser, but I'm looking for something like WebSVN.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: TreeBehaviour unsets primary key of data before save

2008-10-14 Thread AD7six



On Oct 14, 12:16 am, acoustic_overdrive <[EMAIL PROTECTED]>
wrote:
> Hi AD,
>
> It's the Searchable Behaviour from here:
>
> http://code.google.com/p/searchable-behaviour-for-cakephp/source/brow...
>
> You can see on line 27 it uses the id field from the data.
>
> If that's the official guidance (that behaviours should look at Model->id 
> instead of $data[model][id]) then that's fine, I'll do as you
>
> suggest and modify this behaviour to use Model->id. Maybe that's
> something for the documentation?

The point is that behaviors should use either the same way the core
model does - not rely on one or the other.

> I just thought it was strange that something as important as the id
> field of the data would be fiddled with!

I can't remember the ticket, but having the id and the array key set
caused a problem. so the behavior checks both, sets the id, and off it
goes.

Again, if it's a problem test, ticket and trac.

cheers

AD

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Move existing app to Subversion

2008-10-14 Thread gravyface

Probably out of scope for the list, but I'm going to start using SVN for 
my existing Cake 1.2 app; I've installed the subclipse plugin for 
Eclipse PDT on Windows.  My dev server is a separate linux box that I've 
been working on through a mapped drive (the Apache document root is 
shared out). I have subversion installed, but not yet configured with a 
new repository.

I've been Googling around and found a couple of articles for moving 
other MVC framework-based applications into SVN, but it was more for the 
purpose of being able to grab nightly dev releases from the core 
project, whereas I'm interested in maintaining a repository for my 
application only.

I did read the bakery article on the subject, but it seems to imply that 
you already are familiar with using SVN to some degree and are working 
on a new project.  At one point, it mentions creating a new repository 
location in Eclipse but the path (file://c/SVN/mycakeapp) used as an 
example in the article seems to imply that the repository belongs in the 
SVN root, not the cake application root accessible by the webserver.

Should I create a new repository using my existing cake path?  If not, 
how does it handle checkouts?  i.e. if I check a file out, does it get 
placed in the correct application path so that changes made and saved 
are active/visible at runtime?  Also, since my application is running on 
a separate Linux machine, should I use SVN over SSH or enable Web access 
(DAV)?  Both machines are on the LAN behind a firewall; I have no plans 
of accessing the repository remotely in the near future.

I'm pretty new to SVN and have only used pre-configured lock-only 
version control software in the past. I was planning on contacting the 
SVN community for more support, just curious as to what/how the Cake 
crew has been handling their cake applications.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please explain scaffolding changes in RC3

2008-10-14 Thread Mathew

I guess I should log in, and try to update the documentation.

I assume this is possible right? Can the documentation be edited by
the public?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



App::import broken in RC3

2008-10-14 Thread Mathew

Hi,

While using RC2 the following import worked.

App::import(array('type'=>'Vendor','name'=>'gems.magpierss','file'=>'rss_fetch.inc'));

Now under RC3 App::import is return false.

This should load the file rss_fetch.inc from the \plugins\gems\vendors
\magpierss folder in my gems plugin.

Has the convention for the array changed in RC3, or is this a bug?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AW: localization

2008-10-14 Thread Liebermann, Anja Carolin

Hi Claudia,

Since you got it workling you might be able to help:

In the cookbook 
(http://manual.cakephp.org/view/162/Localizing-Your-Application) it says to 
include the L10n like this:
$uses('L10n');   
class RecipesController extends AppController { //... }

I am just wonderung: normally you include other classes (like other models) 
like this:
class RecipesController extends AppController { 
var $uses('Somemodel');
//... }
Does anyone know why this is different?

Anyway... Neither seams to work :-(

Thanks Anja

-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im Auftrag von Claudia
Gesendet: Mittwoch, 17. September 2008 16:02
An: CakePHP
Betreff: Re: localization


Hi there

I haven't read the article, so I am not sure whether this fits in with whatever 
the article says.
I always use utf-8 as character encoding and never had any troubles with Cake 
localisation.

In the views you simply use the function __() (or one of the other translation 
functions) to get the translations of your messages. Just remember to enable 
l10n in the corresponding controllers.

The models are a bit more complicated, as you cannot call a function in the 
declaration of a class member (the $validate array).
I simply gave the appModel a function loadValidation which is called in the 
constructor. This loadValidation() function then fills the class member 
$validate with the validation array.

Please note that I had to load L10n already in the bootstrap, as otherwise the 
error messages always appear in the default language (english).
I believe this is because the models are loaded before the controllers, but I 
am not sure.

I use Cake 1.2.0.5427alpha

Good luck

Claudia

On Sep 17, 2:28 am, cem <[EMAIL PROTECTED]> wrote:
> Hi ;
>   I am reading the localization article in the cakePHP . And in that 
> article it says that I have to include the uses('L10n'); in the 
> controllers I want to use . But I want to change the validation errors 
> in the models and some messages in the views what should I do ?
>
>  The second question about that is it is using the ISO639-2 character 
> encoding . What should I put in the doctype of my default.ctp ? Can 
> anyone give me an example of Doctypes in Cakephp ? For various 
> Languages please ?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



AW: xmlwriter

2008-10-14 Thread Liebermann, Anja Carolin
I would be interested as well in any help on this topic.
 
The cookbook isn't very verbose on this:
http://manual.cakephp.org/view/623/Xml
 
In the end I would like to make an XML export out of my database, but at
the moment I  don't know how to get expat on my development server
(WinXP) or on my production environment (Linux). And I have no clue how
to talk to expat or if cake does it for me.
 
Thanks for any help, hints and links in advance!
 
Anja
 



Von: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] Im
Auftrag von .
Gesendet: Sonntag, 12. Oktober 2008 05:53
An: Cake PHP
Betreff: xmlwriter


has anybody worked with xmlwriter (or similar) with cakephp? 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: URL Confusion in Auth and Form Helper (create method) in RC3

2008-10-14 Thread gwoo

Sorry, this is not a real bug. We missed the post to the group, so
thank you for following the rules. Your usage for $form->create is not
correct. It should be $form->create('CoreUser', array('url' =>
array('controller'=>'CoreUsers', 'action'=>'login')));
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please explain scaffolding changes in RC3

2008-10-14 Thread gwoo

The documentation is not correct.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread gwoo

Can you find a changeset that modified the behavior?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



How make logging for PHP Error and for MySQL in CAKEPHP

2008-10-14 Thread [EMAIL PROTECTED]

Hi
I would make a logging system so that I can register all PHP error and
MySQL Error .
For make that I have inside app_controller.php the function
beforeFilter that is :

function beforeFilter() {

ini_set('display_errors','0');
ini_set ('log_errors', 1);
ini_set ('error_log', ROOT."/".APP_DIR."/tmp/logs/error.log");
}

And I have set debug to 1.
In this way I can register all PHP errors but not the MYSQL Error.
I have two questions.
How can I register also the MySQL Error inside this file?
If I set debug to 0 then the error log doesn't work .In this case how
can I do a log system?
Many 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Multiple table conditions HABTM

2008-10-14 Thread hariharan

I am also stuck with the same problem . For HABTM or hasMany it doesnt
query with join. rather queries each and every table in an individual
manner, which is time consuming one.

Another thing is cakephp does not support through association like
ROR.  suppose if I have two HABTM then i cant access the fields of the
extra table formed due to the relationships.

eg user and group

users  -> HASMANYANDBELONGSTO -> groups
groups -> HASMANYANDBELONGSTO -> users

so the other table result due to this is groups_users. other than
group_id and user_id suppose if i want to store additional info such
as when did they joined group etc... i cant access those fields.

help me.

On Oct 8, 1:56 am, jmmg77 <[EMAIL PROTECTED]> wrote:
> Okay,
>
> Whenever I have a hasOne or belongsTo association, those models are
> included in the query whenever I do a find('all');
>
> But, when I have any other type of association, find('all' only
> generates a query with the model I'm searching.
> This keeps me from filtering by fields in the related models.
>
> ex:
> $funnypeople = $this->Individual->find('all', array('conditions' =>
> array('Personality.type' => 3)));
>
> This example works find if a person only has one Personality Type.
> But what about this.
>
> $racecardrivers = $this->Individual->find('all', array('conditions' =>
> array('Vehicle.type' => 2)));
>
> The problem here is a person could own multiple vehicles, so belongsTo
> & hasOne don't work here.
> I would need hasMany or hasAndBelongsToMany, which makes those model
> inaccessible using find.
>
> Any help would be greatly appreciated.  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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Email component SMTP solution: 501 5.1.3 Bad recipient address syntax

2008-10-14 Thread T M

If you find that you are receiving 5.1.x errors while trying to send
SMTP emails it may be that your mail server has either the parameter
strict_rfc821_envelopes = yes or adheres strictly to the ESMTP (RFC
5321) protocols which require email addresses to be enclosed in < > as
in "John Doe <[EMAIL PROTECTED]>".

Sendmail allows plain email addresses so you might find this error if
you migrate from a sendmail mailserver to a postfix (or other server).

The Email Component does not currently enclose the addresses in < >
but does use them if they are present in the string that is passed in.

Hope this helps somebody out there before they spend as much time on
the error as I did.

For sake of conventions (and adhering to the RFC), should the email
component format email address strings with the enclosing < > by
default?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Uploading files to "private" folder

2008-10-14 Thread oceanguy

I discovered something yesterday in the cookbook which is relevant
here, and awesome as well.  I can't believe I didn't see it before.

Media Views
http://book.cakephp.org/view/489/Media-Views

Enjoy

On Oct 12, 2:52 pm, Orhan Toy <[EMAIL PROTECTED]> wrote:
> Hi
>
> There a plenty of guides about uploading files to a database or to the
> public folder with Cake. But what if I just want to upload files to
> private folder? One solution could be to make my own folder somewhere
> in the root but is there a predefined directory for this purpose?
>
> What I mean about private is that you can't access the file directly
> via an url but instead it is the controller's job to get the file from
> the "private" folder and serve it to the user.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: email body/message does not come through

2008-10-14 Thread Gabriel Kolbe

found the answer... in the elements/email/text/thanks.cpt  do this
data['Contact']['content']; ?>

On Tue, Oct 14, 2008 at 1:46 PM, gabriel <[EMAIL PROTECTED]> wrote:
>
> Hi My emails works, but the message/body/content part of the email
> does not come through, the  $this->Email->template = 'thanks'; does
> not come through...can anyone please help.
>
>  class ContactsController extends AppController
> {
>var $name = "Contacts";
>var $uses = 'Contact';
>var $components = array('Email');
>
>
>  //-
>  function index(){
>$this->set('title_for_layout', 'Contacts');
>if(isset($this->data)) {
>if($this->Contact->create($this->data) && $this->Contact-
>>validates()){
>  //send e-mail
>  $this->_sendMail();
>}
>else {
>$this->Session->setFlash('Please correct the underlying errors');
>$this->redirect('/contacts/');
>  }
>  }
>  }
>
>  function _sendMail() {
>
>$senderEmail = $this->data['Contact']['mail'];
>
>$this->Email->to = $this->Session->read('Auth.User.email');
>$this->Email->subject = $this->data['Contact']['subject'];
>$this->Email->from = $senderEmail;
>$this->Email->replyTo = $this->Session->read('Auth.User.email');
> $this->Email->template = 'thanks';
>//Send as 'html', 'text' or 'both' (default is 'text')
>$this->Email->sendAs = 'text';
>//Set view variables as normal
>$this->set('fname', ucfirst($this->data['Contact']['fname']));
>$this->set('lname', ucfirst($this->data['Contact'] ['lname']));
>$this->set('mail', $senderEmail);
>$this->set('subject', $this->data['Contact']['subject']);
>
>//$this->$body=$this->data['Contact']['message']. "Email info: First
> Name: ". ucfirst($this->data['Contact']['fname']). "Last
> Name" .ucfirst($this->data['Contact'] ['lname']);
>//$this->set('message', $this->body);
>
>$this->set('content', $this->data['Contact']['content']);
>//Do not pass any args to send()
>if ( $this->Email->send() {
>$this->Session->setFlash('Your email was send successfully');
>$this->redirect('/contacts/');
>exit;
>} else {
>$this->Session->setFlash("There was error
>in sending the email. Please try again");
>$this->redirect('/contacts/');
>exit;
>}
>  }
> }
> ?>
>
> model
>
>  class Contact extends AppModel {
>
>  var $name = 'Contact';
>  var $useTable = false;
>  var $validate = array(
>'fname' => array('required' => VALID_NOT_EMPTY),
>'lname' => array('required' => VALID_NOT_EMPTY),
>'mail' => array('required' => VALID_NOT_EMPTY,
> 'validEmail'=>VALID_EMAIL),
>'subject' => array('required' => VALID_NOT_EMPTY),
>'content' => array('required' => VALID_NOT_EMPTY)
>  );
>   }
> ?>
>
> ###view 
>
> Contact Us
>
> create('Contact', array('url'=>'/contacts'));?>
> 
> echo $form->input('fname', array('label' => 'First Name', 'error' =>
> array('required' => 'Please specify your First name')));
> echo $form->input('lname', array('label' => 'Last Name', 'error' =>
> array('required' => 'Please specify your Last name')));
> echo $form->input('mail', array('label' => 'Email', 'error' =>
> array('required' => 'Please specify your email address', 'validEmail'
> => 'Insert a valid email')));
> echo $form->input('subject', array('label' => 'Subject', 'error' =>
> array('required' => 'Insert email subject')));
> echo $form->input('content', array('label' => 'Message', 'error' =>
> array('required' =>'Insert your message here'), 'type'=>'textarea',
> 'cols'=>30));
> ?>
> 
> 
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Behaviors called for COUNT queries in RC3

2008-10-14 Thread Pablo Viojo
Model::afterFind is called now for a findCount, I've read the code for
previous releases and it was called before. Is this a bug or a new feature?,
should I change all my afterfind methods?

Regards,

Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net

Are you Needish? ... http://needish.com



On Sun, Oct 12, 2008 at 2:16 PM, Mathew <[EMAIL PROTECTED]> wrote:

>
> Looks like RC3 has added an empty array for the model when a COUNT is
> performed.
>
> before I would do this in my afterFind method.
>
> foreach( $results as &$record )
> {
>  if(isset($record['Portfolio']))
>  {
>$record['Portfolio']['long_title'] = $this-
> >getTitle( $record['Portfolio'] );
>  }
> }
>
> Now, I have to check if $record['Portfolio'] is also not empty.
>
> Anyway, I hope this helps someone :)
>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: more problems with RC3 and tests

2008-10-14 Thread mark_story

PhpNut has fixed this in the SVN head, update to that if you are still
having troubles.

-Mark

On Oct 14, 3:34 am, "Christof Damian" <[EMAIL PROTECTED]> wrote:
> I noticed that this is fixed no in the repository. Can't wait for
> RC4/final now :-)
>
> 2008/10/7 Christof Damian <[EMAIL PROTECTED]>:
>
> > I found the changeset which introduced the problem anyway:
>
> >https://trac.cakephp.org/changeset/7596#file6
>
> >if (is_a($model, $class) || $model->alias == $class) 
> > {
> >$duplicate =& $model;
> >}
>
> > Remove the "|| $model->alias == $class" and the warnings are gone. Is
> > this maybe supposed to be: "&& $model->alias == $class" ?
>
> > 2008/10/7 Defranco <[EMAIL PROTECTED]>:
>
> >> Same problem here.
>
> >> The problem is that not only the documentation is suggesting this test
> >> case layout, but also bake when generating test case files (I think).
>
> >> rgds
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Saving HABTM data with checkboxes

2008-10-14 Thread cem

Hi ;

In my application one project can have more than one category .
And there is a HABTM relationship between categories and Projects .
How can I save more than one category for a project while creating a
project how should I design the check boxes? Did anyone tried
something similar 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CakePHP Install Problem

2008-10-14 Thread darwin2kx

Forget this.. I'm going to symfony.. it seems to be working right out
of the box.
--Thread Closed--
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation using controller

2008-10-14 Thread Smelly_Eddie

bookme try reading up on the cakephp manual or api regarding
validation. All your questions are answered very sufficiently there.

On Oct 13, 2:17 pm, bookme <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using Integrate CakePHP with Kcaptcha from bakery.
>
> Finding problem at the time of captcha validation from controller.
>
> I found below code
> $this->User->validate = array('captchaText' => array('Mycaptcha' =>
> array('method' => 'validateCaptcha', 'message' => 'your error
> message')));
>
> I tried to find out definition for this method but could not succeeded
>
> Can any one tell me what's Mycaptcha here and where should I write
> code for validateCaptcha function.
>
> I put this code at three different places but could not succeed, User
> model , captcha component or a helper validation.php
>
> Please tell me what 's Mycaptcha and where should i put code of
> validateCaptcha function.
>
> Or can somebody tell me how to set error message from controller ?
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: access session.userid in model?

2008-10-14 Thread Smelly_Eddie

Here's the short,
It is possible to retrieve any value from Session, so long as you
store it there first.

A simple search in this mail group or on the web would have revealed
this thread already discussing this topic in detail;
http://groups.google.com/group/cake-php/browse_thread/thread/8911d61137f80eb5/56bc09a3210ebe79?hl=en&lnk=st&q=%22Checking+user+session+in+model%22#56bc09a3210ebe79

Please search before posting :)

On Oct 13, 4:17 pm, rocket <[EMAIL PROTECTED]> wrote:
> im on cake 1.1 and was wondering if it is possible to access the
> session.(user.id) in the model.
>
> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



email body/message does not come through

2008-10-14 Thread gabriel

Hi My emails works, but the message/body/content part of the email
does not come through, the  $this->Email->template = 'thanks'; does
not come through...can anyone please help.

set('title_for_layout', 'Contacts');
if(isset($this->data)) {
if($this->Contact->create($this->data) && $this->Contact-
>validates()){
  //send e-mail
  $this->_sendMail();
}
else {
$this->Session->setFlash('Please correct the underlying errors');
$this->redirect('/contacts/');
  }
  }
  }

  function _sendMail() {

$senderEmail = $this->data['Contact']['mail'];

$this->Email->to = $this->Session->read('Auth.User.email');
$this->Email->subject = $this->data['Contact']['subject'];
$this->Email->from = $senderEmail;
$this->Email->replyTo = $this->Session->read('Auth.User.email');
 $this->Email->template = 'thanks';
//Send as 'html', 'text' or 'both' (default is 'text')
$this->Email->sendAs = 'text';
//Set view variables as normal
$this->set('fname', ucfirst($this->data['Contact']['fname']));
$this->set('lname', ucfirst($this->data['Contact'] ['lname']));
$this->set('mail', $senderEmail);
$this->set('subject', $this->data['Contact']['subject']);

//$this->$body=$this->data['Contact']['message']. "Email info: First
Name: ". ucfirst($this->data['Contact']['fname']). "Last
Name" .ucfirst($this->data['Contact'] ['lname']);
//$this->set('message', $this->body);

$this->set('content', $this->data['Contact']['content']);
//Do not pass any args to send()
if ( $this->Email->send() {
$this->Session->setFlash('Your email was send successfully');
$this->redirect('/contacts/');
exit;
} else {
$this->Session->setFlash("There was error
in sending the email. Please try again");
$this->redirect('/contacts/');
exit;
}
  }
}
?>

model

 array('required' => VALID_NOT_EMPTY),
'lname' => array('required' => VALID_NOT_EMPTY),
'mail' => array('required' => VALID_NOT_EMPTY,
'validEmail'=>VALID_EMAIL),
'subject' => array('required' => VALID_NOT_EMPTY),
'content' => array('required' => VALID_NOT_EMPTY)
  );
   }
?>

###view 

Contact Us

create('Contact', array('url'=>'/contacts'));?>
input('fname', array('label' => 'First Name', 'error' =>
array('required' => 'Please specify your First name')));
echo $form->input('lname', array('label' => 'Last Name', 'error' =>
array('required' => 'Please specify your Last name')));
echo $form->input('mail', array('label' => 'Email', 'error' =>
array('required' => 'Please specify your email address', 'validEmail'
=> 'Insert a valid email')));
echo $form->input('subject', array('label' => 'Subject', 'error' =>
array('required' => 'Insert email subject')));
echo $form->input('content', array('label' => 'Message', 'error' =>
array('required' =>'Insert your message here'), 'type'=>'textarea',
'cols'=>30));
?>


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: simple AJAX

2008-10-14 Thread qwanta

Before looking at the cakephp ajax helper, and the different js
frameworks (prototype, script.aculo.us, jquery etc) I suggest doing a
simple AJAX example in pure PHP/javascript. There's a great tutorial
here:
http://ajaxphp.packtpub.com/1825_01_Final.pdf

which is a chapter from this book http://ajaxphp.packtpub.com/

On Oct 14, 12:56 am, nayan <[EMAIL PROTECTED]> wrote:
> i am very new to cakePHP.i want to implement AJAX in my code so can
> any one suggest me simple tutorial or from where i have to start.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Yet another site powered by Cakephp

2008-10-14 Thread villas

> Thats nice i am not sure that it was really worth posting tho.

I disagree.  After reading your first comment on the thread,  I found
RyOnLife's contribution fascinating!
:-)

On Oct 13, 9:36 pm, [EMAIL PROTECTED] wrote:
> Thats nice i am not sure that it was really worth posting tho.
>
> On 10/13/2008, RyOnLife <[EMAIL PROTECTED]> wrote:
>
> > Just wanted to say I like the interface!! Plain and easy to navigate, but
> > something cool about the simplicity.
>
> > Sayhello-2 wrote:
>
> >> Hello all,
>
> >> Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
> >>www.sayhello.me. Sayhello is a new classified ads site to help you buy
> >> and sell. We are initially launching in the Los Angeles market. Check
> >> it out. Any suggestions and feedback are welcome.
>
> >> Thank you!
> >>www.sayhello.me
>
> > --
> > View this message in context:
> >http://www.nabble.com/Yet-another-site-powered-by-Cakephp-tp19931969p...
> > Sent from the CakePHP mailing list archive at Nabble.com.
>
> --
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Solution to sharing sessions subdomains!!!

2008-10-14 Thread Marcus Silva

No, not really, but will look into it. how about some example how you
manage your with memcache?

As to the above problem, i really dont't like it as the loggeg in
keeps logged in for a very long time (hours) by default.

hope you can share.

Cheers

On Oct 14, 6:51 am, benko <[EMAIL PROTECTED]> wrote:
> Hi Marcus,
>
> Have you considered using a central database to handle your sessions?
> If doing this causes a performance problem consider storing the
> sessions into a distributed cache like memcached.
>
> This should solve the problem quite easily without having to go and
> make changes to the CakePHP libs.
>
> Hope this helps
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread Brenton B

H ... will take a look, cheers.

On Oct 14, 12:04 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> If it is joins you are after, check out the "joins" key that you can
> add to queries. It is not documented much yet (because it is rarely
> needed) but it could be just what you need.
>
> I have had to set up a special type of search query and ended up
> creating my own function to handle my not so common search needs.
> I put it in the bin a while back. You can take a look at it to see
> "joins" in action. In that class the joins are used to create a big
> join with all the classes "belongsTo" associations and be able to pick
> out statistics in a "StarSchema" kind of way (aka OLAP, sort of).
>
> It is not exactly ready for public release but I was hoping someone
> would get something out of looking at the code.
>
> /Martin
>
> On Oct 14, 4:50 am, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > Indeed.
>
> > On Oct 12, 3:49 am, AD7six <[EMAIL PROTECTED]> wrote:
>
> > > On Oct 11, 11:41 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > > > Out of frustration: hate to say it, but Cake is quickly dropping on my
> > > > list of "usable frameworks" due to it's inability to efficiently
> > > > handle joins.
>
> > > Oh 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Solution to sharing sessions subdomains!!!

2008-10-14 Thread Jon Bennett

Hi mike,

> Have you considered using a central database to handle your sessions?
> If doing this causes a performance problem consider storing the
> sessions into a distributed cache like memcached.

do you have any links to show this in action? We have an app that's
about to go live which uses wildcard subdomains, 1 or 2 levels deep,
and would like to share sessions across them.

cheers,

jon


-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Bug or API change in Model in RC3: 'dependent' can delete ALL records for associated model

2008-10-14 Thread [EMAIL PROTECTED]

Hi,
I had to ask here before posting an unnecessary ticket.

In 1.2 RC3, Model::del() will delete all records in the table of an
associated model under these circumstances:
• dependent is set to true
• conditions is a string (as in the docs) and not an array as is the
new preferred way to write conditions for find().

var $hasOne = array(
'Profile' => array(
'className' => 'Profile',
'foreignKey'=> 'foreign_id',
'conditions'=> array('Profile.belongs_to = \'Client\''),
'dependent' => true
)
);

Will delete anything in the profiles table (WHERE 1=1), so the
definition must now be:

var $hasOne = array(
'Profile' => array(
'className' => 'Profile',
'foreignKey'=> 'foreign_id',
'conditions'=> array('Profile.belongs_to' => 'Client'),
'dependent' => true
)
);


If this is a bug it should have been caught already so i suspect it is
an intended change to the API. But if is is a change in the API and
the results from not noticing this change is the deletion of ALL
records in a table I would also have expected to have heard about it
already.

model.php line 1595 uses array_merge() when in RC2 am() is used. am()
converts strings to arrays internally whenever needed.

So are all string-conditions now universally incompatible?

/Martin
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: more problems with RC3 and tests

2008-10-14 Thread Christof Damian

I noticed that this is fixed no in the repository. Can't wait for
RC4/final now :-)

2008/10/7 Christof Damian <[EMAIL PROTECTED]>:
> I found the changeset which introduced the problem anyway:
>
> https://trac.cakephp.org/changeset/7596#file6
>
>if (is_a($model, $class) || $model->alias == $class) {
>$duplicate =& $model;
>}
>
> Remove the "|| $model->alias == $class" and the warnings are gone. Is
> this maybe supposed to be: "&& $model->alias == $class" ?
>
> 2008/10/7 Defranco <[EMAIL PROTECTED]>:
>>
>> Same problem here.
>>
>> The problem is that not only the documentation is suggesting this test
>> case layout, but also bake when generating test case files (I think).
>>
>> rgds
>> >>
>>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: HABTM goodness: searching!!

2008-10-14 Thread [EMAIL PROTECTED]


If it is joins you are after, check out the "joins" key that you can
add to queries. It is not documented much yet (because it is rarely
needed) but it could be just what you need.

I have had to set up a special type of search query and ended up
creating my own function to handle my not so common search needs.
I put it in the bin a while back. You can take a look at it to see
"joins" in action. In that class the joins are used to create a big
join with all the classes "belongsTo" associations and be able to pick
out statistics in a "StarSchema" kind of way (aka OLAP, sort of).

It is not exactly ready for public release but I was hoping someone
would get something out of looking at the code.

/Martin



On Oct 14, 4:50 am, Brenton B <[EMAIL PROTECTED]> wrote:
> Indeed.
>
> On Oct 12, 3:49 am, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Oct 11, 11:41 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > > Out of frustration: hate to say it, but Cake is quickly dropping on my
> > > list of "usable frameworks" due to it's inability to efficiently
> > > handle joins.
>
> > Oh 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---