Re: hasMany and find()

2014-11-17 Thread John Andersen
Ok, if you cannot modify the database tables, then the other option is to 
use sub-queries, see the CakePHP book at:
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#sub-queries

My understanding of this, is that you first construct the SQL statement for 
finding all the parent ids in the child table, then uses that SQL statement 
as a condition for finding all parent records with the id not being found 
by the previous SQL statement.

Hope that helps you out :)
Enjoy, John

On Monday, 17 November 2014 06:05:48 UTC+2, Kento Furui wrote:

 Thank you John.

 counterCache seems to be a good idea. 
 But there must be a way to do this *without adding a column* to an 
 existing table.
 [snip]


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


CakeDC Search plugin find in hasmany

2014-11-17 Thread Salines
Hi,
can someone show me how it looks correct $filterArgs settings if I need to 
search data in hasmany related model.

example, User hasMany Orders.

User model:


public $filterArgs = array(
'id' = array(
'type' = 'value'
),
'name' = array(
'type' = 'like'
),
'company' = array(
'type' = 'like'
),
'email' = array(
'type' = 'like'
)
// @Model Order 
'order_date' = array(
'type' = 'like',
'model' = 'Order',
'modelField' = 'order_date'
),

form field name is order_date..

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


Re: Plugin login problem

2014-11-17 Thread Jose
The Form::create() call was done incorrectly, it should be:

$this-Form-create('User', array('url' = array('admin' = false, 'plugin' 
= null, 'controller' = 'users', 'action' = 'login')));


On Thursday, November 6, 2014 5:11:36 AM UTC-5, Lucky1968 wrote:

 Hi,

 I'm using CakePHP 2.3.10 and I have a problem with a login form in my 
 header.
 When the login form is used from within a plugin view it sends the form to 
 /plugin_name/users/login instead of to /users/login.

 I have found numerous posts on this topic and all state the same: I need 
 to add *'plugin' = null* or *'plugin' = false* at some places. But that 
 I did already from the beginning and I still have the problem.

 Can anyone tell me what's wrong with my code?

 Here's my code:

 AppController.php
 public function beforeFilter() {
 ...
 $this-Auth-loginAction = array(*'plugin' = null*, 'controller' = 
 'users', 'action' = 'login');
 ...
 }

 UsersController.php
 public function beforeFilter() {
 parent::beforeFilter();
 ...
 }

 PluginAppController.php
 public function beforeFilter() {
 parent::beforeFilter();
 }

 In the element used by the selected layout:
 ?php echo $this-Form-create('User', array('admin' = false, *'plugin' 
 = null*, 'controller' = 'users', 'action' = 'login')); ?

 I also tried with *'plugin' = false* but the results are the same.

 Thanks for any help.



-- 
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: CakeDC Search plugin find in hasmany

2014-11-17 Thread Salines
Solved,


// @Model Order
'order_date' = array(
'type' = 'subquery',
'method' = 'orderDate',
'field' = 'User.id'
),


public function orderDate($data = array()) {
 
}

-- 
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: Postgresql for Oracle in CakePHP

2014-11-17 Thread mark_story
Hey Carlos,

The last version of CakePHP that had support for Oracle was 1.3. We've not 
been able to get support for oracle into 2.x or 3.0 primarily because of 
licensing issues and lack of experience. Because of how oracle is licensed 
adding it to one of our existing continuous integration systems has not 
been possible. Additionally, there isn't anyone on the core team that has a 
great deal of experience working with oracle. While there have been a few 
people asking on the mailing list, IRC and twitter about oracle support, no 
one has shared working code.

-Mark

On Wednesday, 12 November 2014 09:07:15 UTC-5, Carlos Henrique Amaral 
Santos wrote:

 Hi, 

 I'm working on a system, using CakePHP 1.1 and database PostgreSQL. 
 There's a change of the database from PostgreSQL for Oracle. Someone had 
 issue with something like it? Someone suggests some version of the Cake 
 that works well with Oracle?


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