Re: saveAll does'nt work

2010-07-31 Thread Gildonei Mendes A. (Junior)
I'm also have some problems with saveAll. This are the content of this
data and the relations of my model.

# $this->data
Array
(
[Usuario] => Array
(
[PK_usuario] =>
[flPf] => 1
[strNome] => Gildonei Mendes Anacleto Junior
[strLogin] => root
[strSenha] => af47g5t
[strEmail] => jun...@sitecomarte.com.br
[intTelefone] =>
[intCelular] => (48)8413-4280
[flSexoMasc] => 1
[tpUsuario] => 2
[flAtivo] => 1
)

[UsuarioPf] => Array
(
[strRg] => 3879169
[intCpf] => 034.306.469-36
)

[Endereco] => Array
(
[0] => Array
(
[FK_estado] => 24
[FK_cidade] => 10
[strBairro] => Capoeiras
[strEndereco] => Srv. Alzira Ventura Vieira
[intNumero] => 40
[intCep] => 88090175
[strComplemento] => Bloco 04 Apto 301
)

)

)

# Model Usuario
class Usuario extends AppModel
{
public $name = 'Usuario';
public $useTable = 'usuarios';
public $primaryKey = 'PK_usuario';

public $hasOne = array(
'UsuarioPf' => array(
'className' => 'UsuarioPf',
'foreignKey' => 'PK_usuario',
'type' => 'LEFT'
),
'UsuarioPj' => array(
'className' => 'UsuarioPj',
'foreignKey' => 'PK_usuario',
'type' => 'LEFT'
)
);

#Model UsuarioPf
class UsuarioPf extends AppModel
{
public $name = 'UsuarioPf';
public $useTable = 'usuario_pfs';
public $primaryKey = 'PK_usuario';
public $displayField = 'intCpf';

public $belongsTo = array(
'Usuario' => array(
'className' => 'Usuario',
'foreignKey' => 'PK_usuario',
'type' => 'INNER'
)
);
# Model Endereco
class Endereco extends AppModel
{
public $name = 'Endereco';
public $useTable = 'enderecos';
public $primaryKey = 'PK_endereco';

public $belongsTo = array(
'Cidade' => array(
'className' => 'Cidade',
'foreignKey' => 'FK_cidade',
'type' => 'INNER'
),
'Usuario' => array(
'className' => 'Usuario',
'foreignKey' => 'FK_usuario',
'type' => 'INNER'
)
);

# SQL CallBacks
1   DESCRIBE `usuarios` 10  10  3
2   DESCRIBE `usuario_pfs`  3   3   4
3   DESCRIBE `usuario_pjs`  4   4   4
4   DESCRIBE `enderecos`7   7   4
5   DESCRIBE `cidades`  3   3   4
6   DESCRIBE `estados`  3   3   3
7   DESCRIBE `pagamentos`   4   4   4
8   DESCRIBE `setores`  5   5   4
9   DESCRIBE `imagens`  9   9   4
10  SELECT `Usuario`.`PK_usuario` FROM `usuarios` AS `Usuario` LEFT
JOIN `usuario_pfs` AS `UsuarioPf` ON (`UsuarioPf`.`PK_usuario` =
`Usuario`.`PK_usuario`) LEFT JOIN `usuario_pjs` AS `UsuarioPj` ON
(`UsuarioPj`.`PK_usuario` = `Usuario`.`PK_usuario`) WHERE `strLogin` =
'root' AND `Usuario`.`PK_usuario` <> "" LIMIT 1 0   0   1
11  START TRANSACTION   0   1
12  ROLLBACK0   1
13  SELECT `Estado`.`PK_estado`, `Estado`.`strNome` FROM `estados` AS
`Estado` WHERE 1 = 127  27  1
14  SELECT `Setor`.`PK_setor`, `Setor`.`strNome`,
`Setor`.`strDescricao`, `Setor`.`strController`, `Setor`.`flMenu` FROM
`setores` AS `Setor` WHERE `flMenu` = 1 10  10  1
15  SELECT `Imagem`.`PK_imagem`, `Imagem`.`FK_setor`,
`Imagem`.`FK_registro`, `Imagem`.`strNome`, `Imagem`.`strNomeDisco`,
`Imagem`.`strMime`, `Imagem`.`intSize`, `Imagem`.`intWidth`,
`Imagem`.`intHeight` FROM `imagens` AS `Imagem` WHERE
`Imagem`.`FK_setor` IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)  0   0   0

Does anyone can help us?

Ty.



On 30 jul, 04:04, Vijay Kumbhar  wrote:
> It is not working while saving the data while adding the data or while
> editing the existing data?
>
> I have the same problem with cakephp 1.3 but while editing the associated
> model data using saveAll.
> If it is not saving the data while editing then in cakephp 1.3 you have to
> specify the related model primary key with the edited record.
>
> You have to take the profile id field in you form. So that you can get it
> after posting the form.
>
> $this->User->UserProfile->id

Re: SQL don't appears

2010-07-30 Thread Gildonei Mendes A. (Junior)
Thank you men.

It works. =)

On 30 jul, 12:50, Vijay Kumbhar  wrote:
> Hello Gildonie,
>
> You have to add the following line in you layout,
>
> element('sql_dump'); ?>
>
> cake 1.3 doesn't directly displays the sql statements as like cake 1.2 if
> your debug mode is 2.
>
> On Fri, Jul 30, 2010 at 5:18 PM, Gildonei Mendes A. (Junior) <
>
>
>
> anjol...@gmail.com> wrote:
> > Hi,
>
> > I'm starting with CakePHP, and I'm using the latest version of cakePHP
> > (1.3.3), I configured my "core.php" with debug, 2, but the SQL
> > statements doesn't apper on the window.
>
> > A sample of the project is hosted at
> >http://www.sitecomarte.com.br/nutriaqua.
>
> > Some links aren't functional, I already try to find a solution for
> > this, but I coudn't find anything.
>
> > Does anyone can give a help?
>
> > TY a lot,
>
> > Junior
>
> > PS: Sorry the bad english.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> --
> Thanks & Regards,
> Vijayk.
>
> "You Bring the Dreams, We'll Bring the Means"

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

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


SQL don't appears

2010-07-30 Thread Gildonei Mendes A. (Junior)
Hi,

I'm starting with CakePHP, and I'm using the latest version of cakePHP
(1.3.3), I configured my "core.php" with debug, 2, but the SQL
statements doesn't apper on the window.

A sample of the project is hosted at http://www.sitecomarte.com.br/nutriaqua.

Some links aren't functional, I already try to find a solution for
this, but I coudn't find anything.

Does anyone can give a help?

TY a lot,

Junior

PS: Sorry the bad english.

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

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Problems with print_r

2009-08-19 Thread Gildonei Mendes A. (Junior)

  Hello,

I'm using cake to develop a great LMS tool.
When I try to use " print_r($this) ", I don't receive any response,
only a blank page.

Somebody knows if it's a PHP Problem or a Cake Problem ?

Thank's a lot

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---