On Apr 19, 2:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Can someone help me out, the following code gives me a parse error but
> I don't know why
>
> class Benefactor extends AppModel {
> var $name = 'Benefactor';
> // var $testA =strtotime(date("n/1/Y"));
> var $hasMany = array(
> 'Picture', 'Blog',
> 'QuestionTo' => array(
> 'className' => 'Question',
> 'foreignKey' => 'benefactor_id',
> 'conditions' => 'Question.foruser = 1 AND Question.time>=
> '.strtotime(date('n/1/Y')).' ',
>
> 'order' => 'Comment.created DESC',
> 'limit' => '5',
> 'dependent'=> true
> )
> );'
>
> }
>
> it is this line:
> 'conditions' => 'Question.foruser = 1 AND Question.time
>
> >= '.strtotime(date('n/1/Y')).' ',
>
> I have no idea why, it seems to not like the "." concatenation but
> that should be valid in PHP yes?
Declarations cannot have expressions (here strtotime(date('n/1/
Y'))). You'd want to set property in __construct() method--where you
can use expressions. This is a basic PHP and you may want to improve
that.
--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---