Re: CakePHP: How to remove LEFT JOIN in updateAll()

2013-08-05 Thread Indrajeet Singh
Hi All,

You can change in function

class BriefcaseComponent extends Object{ 

function delete($id){ 
$names = array('deleted' => '0'); 
$conditions = array("FilesFolders.instance_id" = '$id); 
$this->FilesFolders->updateAll($names, $conditions); 

> } 
>
> } 
> ?> 



On Wednesday, 12 November 2008 13:27:10 UTC+5:30, Kryptonian wrote:
>
> Hi, I have this problem that if my model uses a var $belongsTo = array 
> (), my updateAll() generated statement was affected with this error 
> message: 
>
> UPDATE `files_folders` AS `FilesFolders` LEFT JOIN `course_files` AS 
> `CourseFile` ON (`FilesFolders`.`account_id` = `CourseFile`.`id`) SET 
> `FilesFolders`.`deleted` = 0 WHERE `FilesFolders`.`instance_id` = ‘8′ 
>
>
> My code: 
>  class FilesFolders extends AppModel 
> { 
> var $belongsTo = array( 
>'CourseFile' => array( 
>'className' => 'CourseFile', 
>'foreignKey' => 'account_id' 
>) 
> ); 
> } 
>
>
> class BriefcaseComponent extends Object{ 
>
> function delete($id){ 
> $names = array('deleted' => '0'); 
> $conditions = "FilesFolders.instance_id = '$id'"; 
> $this->controller->FilesFolders->updateAll($names, 
> $conditions); 
> } 
>
> } 
> ?> 
>
>
> How can i remove the “LEFT JOIN” statement in my Update statement? 
>
> Thanks 
>

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

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




Re: CakePHP: How to remove LEFT JOIN in updateAll()

2013-08-05 Thread Indrajeet Singh


On Wednesday, 12 November 2008 13:27:10 UTC+5:30, Kryptonian wrote:
>
> Hi, I have this problem that if my model uses a var $belongsTo = array 
> (), my updateAll() generated statement was affected with this error 
> message: 
>
> UPDATE `files_folders` AS `FilesFolders` LEFT JOIN `course_files` AS 
> `CourseFile` ON (`FilesFolders`.`account_id` = `CourseFile`.`id`) SET 
> `FilesFolders`.`deleted` = 0 WHERE `FilesFolders`.`instance_id` = ‘8′ 
>
>
> My code: 
>  class FilesFolders extends AppModel 
> { 
> var $belongsTo = array( 
>'CourseFile' => array( 
>'className' => 'CourseFile', 
>'foreignKey' => 'account_id' 
>) 
> ); 
> } 
>
>
> class BriefcaseComponent extends Object{ 
>
> function delete($id){ 
> $names = array('deleted' => '0'); 
> $conditions = "FilesFolders.instance_id = '$id'"; 
> $this->controller->FilesFolders->updateAll($names, 
> $conditions); 
> } 
>
> } 
> ?> 
>
>
> How can i remove the “LEFT JOIN” statement in my Update statement? 
>
> Thanks 
>

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

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




Re: CakePHP: How to remove LEFT JOIN in updateAll()

2008-11-12 Thread Serge Rodovnichenko


:-)

$this->controller->FilesFolders->unbindModel(array(
'belongsTo' => array_keys($this->controller->FilesFolders->belongsTo)
))

On 12 нояб, 10:57, Kryptonian <[EMAIL PROTECTED]> wrote:
> Hi, I have this problem that if my model uses a var $belongsTo = array
> (), my updateAll() generated statement was affected with this error
> message:
>
> UPDATE `files_folders` AS `FilesFolders` LEFT JOIN `course_files` AS
> `CourseFile` ON (`FilesFolders`.`account_id` = `CourseFile`.`id`) SET
> `FilesFolders`.`deleted` = 0 WHERE `FilesFolders`.`instance_id` = '8′
>
> My code:
>  class FilesFolders extends AppModel
> {
> var $belongsTo = array(
>'CourseFile' => array(
>'className' => 'CourseFile',
>'foreignKey' => 'account_id'
>)
> );
>
> }
>
> class BriefcaseComponent extends Object{
>
> function delete($id){
> $names = array('deleted' => '0');
> $conditions = "FilesFolders.instance_id = '$id'";
> $this->controller->FilesFolders->updateAll($names, 
> $conditions);
> }
>
> }
>
> ?>
>
> How can i remove the "LEFT JOIN" statement in my Update statement?
>
> 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: CakePHP: How to remove LEFT JOIN in updateAll()

2008-11-12 Thread Mathew

I've had the same problems with updateAll.

I can't remember if setting the recursive to -1 solved the problem.

$this->controller->FilesFolders->recursive = -1;

If that doesn't work you can call unBind.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



CakePHP: How to remove LEFT JOIN in updateAll()

2008-11-12 Thread Kryptonian

Hi, I have this problem that if my model uses a var $belongsTo = array
(), my updateAll() generated statement was affected with this error
message:

UPDATE `files_folders` AS `FilesFolders` LEFT JOIN `course_files` AS
`CourseFile` ON (`FilesFolders`.`account_id` = `CourseFile`.`id`) SET
`FilesFolders`.`deleted` = 0 WHERE `FilesFolders`.`instance_id` = ‘8′


My code:
 array(
   'className' => 'CourseFile',
   'foreignKey' => 'account_id'
   )
);
}


class BriefcaseComponent extends Object{

function delete($id){
$names = array('deleted' => '0');
$conditions = "FilesFolders.instance_id = '$id'";
$this->controller->FilesFolders->updateAll($names, $conditions);
}

}
?>


How can i remove the “LEFT JOIN” statement in my Update statement?

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