Re: Schema migration in CakePHP-3

2015-03-10 Thread Gaurav Kumar
Thank you.

On Monday, March 9, 2015 at 10:33:28 AM UTC+5:30, Dakota wrote:
>
> How do you delete the table? If you simply run DROP TABLE too; then the 
> migration won't run again since Phinx still believes that the migration has 
> run. To undo a migration you need to run bin/cake migrations rollback

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


Debugging Nested Associations, Containable

2015-03-10 Thread Ricardo Vieitez
Hello,

I am trying to interrelate models from different data sources (Oracle and 
Active Directory in this case), and I am getting some funny behavior from 
recursive associations. Just to clarify: single level association work well.

So, consider model A belongsTo B, and model B hasMany A.

This is an example of the code that I’m trying to execute:

$this->B->find('first', array(
 'conditions' => array('id' => 
'1158'),
 'recursive' => -1,
 'contain' => array(
'A' => array(
   
'fields' => array(‘id’, …),
   'B' 
=> array(

  'fields' => array('id', …),

  'A' => array(

 'fields' => array(…),

  ),
   ),
),
 ),
  ));

If the code ran correctly, I’d be getting something that looks like a circular 
array. However, my code doesn’t work as expected and the innermost value (‘A’) 
is not present (i.e., my result array looks like [B => …, A => [‘field1’, …, B 
=> [‘field1’, ‘field2’, …]]]), not even as a NULL or empty array. If instead of 
using containable I set the ‘recursive’ property OR use containable but leave 
the fields unspecified, something even stranger happens at the recursion stops 
one level before that (which is this time an empty array, i.e., I get [B => …, 
A => [‘field1’, …, B => []]]).

If I misspell the name of the innermost A on purpose, I get a warning. This is 
leading me to think that things are somehow, but not quite entirely, working. 
How could I debug this to find out what the problematic code is? It could be 
somewhere in the custom datasources or the model definitions.

Thanks,

Ricardo Vieitez | Student Assistant - Network Administration
University of Florida Department of Housing and Residence Education
PO Box 112100 | Gainesville, FL 32611-2100
office 352.392.2171 x10355 | fax 352.392.6819 | 
ricar...@housing.ufl.edu
StrengthsQuest Top 5: Analytical, Strategic, Learner, Responsibility, Relator - 
Find Out More
Please consider the environment before printing this email.

-- 
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: localize table header

2015-03-10 Thread José Lorenzo
Check the other arguments of that function :)

On Tuesday, March 10, 2015 at 2:18:31 PM UTC+1, Radharadhya Dasa wrote:
>
> Hi,
>
> How to localize model field names in table header in CakePHP 3?
>
> echo $this->Paginator->sort('User.name') will give me "User name", but I 
> would need it localized.
>
> rrd
>

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


localize table header

2015-03-10 Thread Radharadhya Dasa
Hi,

How to localize model field names in table header in CakePHP 3?

echo $this->Paginator->sort('User.name') will give me "User name", but I 
would need it localized.

rrd

-- 
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: Condition with AND and ARRAY

2015-03-10 Thread michel martins
But worked with IN and it don't made the search correctly. 

When I click in filter tag it shows me all products with tags selected, and 
not the products with the combined tags.

Example: 

Product 1 - tags: mom - child - birthday
Product 2 - tags: mom - adult - party
Product 3 - tags: mom - child - party

If I select the tags mom and child, it shows me all products, when should 
show me only products 1 and 3. 

Em segunda-feira, 9 de março de 2015 18:37:11 UTC-3, José Lorenzo escreveu:
>
> If you execute the SQL above you will always get 0 results.
>
> I think that what cake does by default (using IN) is exactly the thing you 
> want, based on what you described (your hesitance on using UNION queries to 
> get all results)
>
> On Monday, March 9, 2015 at 8:54:09 PM UTC+1, michel martins wrote:
>>
>> I need for all products that have tag_id = array item
>>
>> SELECT * FROM produtos AS Produtos LEFT JOIN tags_produtos as 
>> TagsProdutos ON Produtos.id = TagsProdutos.produto_id  WHERE 
>> TagsProdutos.tag_id = 730 AND TagsProdutos.tag_id = 731 AND 
>> TagsProdutos.tag_id = 735
>>
>> I have doubts whether I do the sql above or use UNION between multiple 
>> queries.
>>
>> Table PRODUTOS
>> ID - PRODUTO
>>
>> Table TAGS_PRODUTOS
>> ID - PRODUTO_ID - TAG_ID 
>>
>> Table TAGS
>> ID - NAME
>>
>> $tags = array('0'=>'730', '1'=>'731', '2'=>'735')
>>
>

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