Apologies in advance if this sounds stupid, but have you tried setting
this property in the "constructor" or it's cake equivalent?

On Sep 9, 4:28 pm, lyba <[email protected]> wrote:
> Any suggestions why it is not possible to join strings in a model
> file:
>
>         $foo = 'A'.'B';
>
> this produces error:
> Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
> in .\app\models\event.php on line 7
>
> A real life scenario:
> I have a model Event that has a self reference and is called under
> different aliases (Event, PreviousEvent, NextEvent).
> I need a virtual name for that model as an extract from the event
> description
>
> this works:
> public $virtualFields = array('name' => 'LEFT(description, 40)');
> but since model is called under different aliases in one request I get
> warning:
> Column 'description' in field list is ambiguous
>
> I thought this would work:
> public $virtualFields = array('name' => 'LEFT('. $this->name .'.description, 
> 40)');
>
> but then I discovered that joining strings in model does not work at
> all.

-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to