Re: Magic of UpdateAll

2014-07-17 Thread Maicon Pinto

This can help you?

$this-Picture-query(UPDATE User SET status='active';);


Em terça-feira, 17 de junho de 2014 09h10min30s UTC-3, સાદીકહસન પલસાણીયા 
escreveu:

 $this-loadModel('User');
 $this-User-updateAll(array('stauts'='active'),array());

 Above code equvivalent SQL query is generated like this

 UPDATE User SET status='active' WHERE 0 = 1;

 When I written updateAll in cakephp like below

 $this-loadModel('User');
 $this-User-updateAll(array('stauts'='active'));

 This code equvivalent SQL query is generated like this

 UPDATE User SET status='active';

 Why this happen I don't know. If I do not understand my question let me 
 know in comment. I explain in breif.


 Check reference : 
 http://stackoverflow.com/questions/24259110/magic-of-updateall?noredirect=1#comment37476920_24259110


-- 
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/d/optout.


Re: Start x skeleton x Crud

2014-05-27 Thread Maicon Pinto
Oie Arlei, 

O meu lugar é na documentação mesmo. 

Existe um tutorial para iniciantes. Se já souber como funciona o MVC, vai 
ser barbada.

http://book.cakephp.org/2.0/pt/getting-started.html

Qualquer coisa avisa.

Em domingo, 25 de maio de 2014 10h45min25s UTC-3, Arlei Ferreira Farnetani 
Junior escreveu:

 Pessoal, estou iniciando hoje no framework CakePHP.

 Gostaria de saber por onde vocês acham que eu deveria iniciar?

 Vi que na versão 3 tem um plugin Crud. Alguém sabe aonde eu
 possa encontrar um exemplo de uma aplicação/skeleton com esse
 Crud?


-- 
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/d/optout.


Re: CakePHP 1.2 Layout error

2013-01-02 Thread Maicon Pinto
Hello Marco,

Do you can to put of source code of your Layout?

;)

Em quarta-feira, 2 de janeiro de 2013 03h39min30s UTC-3, marco metal 
escreveu:

 Hi,

 I made a custom layout for admin panel. The problem is when i validated my 
 HTML i am getting an error 

 ** *Non-space characters found without seeing a doctype first. Expected 
 !DOCTYPE html.* 

 On Firefox the layout renders perfectly when i inspect it but on google 
 chrome its showing an empty space inside body tag and all the html tag is 
 going inside body tag.

 Any idea what the problem is?




-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: queries on HABTM relationships

2013-01-02 Thread Maicon Pinto
array('*id*'='can_access_admin') 

Do you have sure is ID? Usually ID is numeric. 

Em terça-feira, 1 de janeiro de 2013 19h23min58s UTC-3, Stefano Campanella 
escreveu:

 Hello all,
 this is my first time posting here. I recently started to study how to use 
 CakePHP and I'm trying to develop a website.
 In my website I am writing a custom authorize component where each user 
 get one or more groups and each group has one or more permissions 
 associated to it.
 I have problems in using the find() method.
 This is my structure:
 User hasAndBelongsToMany Group
 Group hasAndBelongsToMany Perm

 I have attached Containable to all the Models (in AppModel)

 now in my authorization component I need to check if a group has a 
 specific permission, and for this I use find():

 if(!isset($this-controller()-Group)){
   $this-controller()-loadModel('Group');
 }
 $n_perm=$this-controller()-Group-find('count',array(
   'conditions'=array('id'=1),
   'contain'=array(
 'Perm'=array(
   'conditions' = array('id'='can_access_admin')
 )
   ) 

 ));


 I would expect this to give me a result =1 if group 1 has the 
 'can_access_admin' permission, and =0 if the group has no such permission.
 This is not what actually happens, the only query that cakePHP shows is 
 this:

 SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `id` = 1

 And it is obviously not enough to find what I requested.

 Can anyone help me?

 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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Chat with CakePHP...

2012-02-23 Thread Maicon Pinto
Hello,
I'm working with cakephp, and I want to develop a chat. Does anyone here 
have a simple tutorial how to tip? 

Thanks...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


ACL - Access Control List - Lista de Controle de Acesso

2011-09-10 Thread Maicon Pinto
Galera, sei que o espaço aqui é em inglês, mas sei que tem uma galera 
brasileira, que posta aqui. Alguém aqui trabalha com ACL? Estou seguindo o 
exemplo abaixo:
http://book.cakephp.org/pt/view/1543/Sistema-Simples-com-controle-ACL-Lista-de-controle

Gostaria de implementar maior restrição à edição de posts, podendo ser 
editado somente por quem criou, ou algum gerente. 

Estou tentando usar o método afterSave() para adicionar permissão no modelo 
Post:
line 33: $this-Acl-allow(array('model' = 'User', 'foreign_key' = 
$this-data['Post']['user_id']), $node[0]['Aco']['id']);

Está exibindo este erro:
Undefined property:  Post::$Acl [APP\models\post.php, line 33]

Algum dica?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Different ACL permissions

2011-09-08 Thread Maicon Pinto
Eu não sei se isso pode ajudar, mas quando fiz este exemplo:

http://book.cakephp.org/view/1550/Setting-up-permissions

Faltava carregar o Modelo, desta forma:

$this-loadModel('Group');

sendo o código parcial:

function initDB() {
   *$this-loadModel('Group');*
   $group = $this-Group;

   $group-id = 1;

   (...)

}

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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