Thanks for the code. I've tried the Behaviour with
$this->paginate['fields'] = array('Student.id', 'Student.vorname',
'Student.nachname', 'Student.geburtsjahr', 'Student.eintritt',
'Group.name AS Gruppe')
$this->set('students', $this->paginate('GroupsStudents', '`austritt` =
\'0000-00-00\''));
But I get some "Illegal Offset Type" errors. Strangely enough, my
table still renders correctly, just without the correct Group.name
"Gruppe".
I'll investigate this further (I don't really know what's happening
this being my first Cakephp Behaviour).
Meanwhile, If someone has an idea...
Greets,
Axl
On Nov 16, 6:28 pm, grigri <[EMAIL PROTECTED]> wrote:
> Try this:
>
> http://openpaste.org/en/3929/
>
> Use it like this:
>
> class Something extends AppModel {
> // ...
> var $actsAs = array('Farmer');
> // ...
>
> }
>
> // assume model Something has fields 'one' and 'two' but NOT a field
> called 'three':
>
> function action() {
> // These lines all do the same thing:
> $blurb = $this->Something->find('all', array('fields' =>
> 'Something.*, CONCAT(Something.one, Something.two) AS three'));
> $blurb = $this->Something->find('all', array('fields' =>
> 'Something.*, CONCAT(Something.one, Something.two) AS
> `Something`.`three`'));
> $blurb = $this->Something->find('all', array('fields' =>
> array('Something.*', 'CONCAT(Something.one, Something.two) AS
> `Something`.`three`'));
> $blurb = $this->Something->find('all', array('fields' =>
> array('Something.*', 'CONCAT(Something.one, Something.two)' =>
> '`Something.three`'));
>
> }
>
> // you'll get:
>
> Array
> (
> [0] => Array
> (
> [Something] => Array
> (
> [id] => 1
> [one] => foo
> [two] => bar
> [three] => foobar
> )
>
> )
> )
>
> I haven't fully tested it, but it seems to work ok.
>
> On Nov 16, 11:27 am, "Ricardo Valfreixo" <[EMAIL PROTECTED]> wrote:
>
> > Hey Axl,
>
> > I guess you're stuck there. I haven't figured out a way to do it without
> > hacking the base code directly. Remember that it's a pre-beta version. Maybe
> > it'll get a workaround or some other solution. For now, i guess that's the
> > only way to do it.
>
> > Zen
>
> > On Nov 16, 2007 11:22 AM, Axl <[EMAIL PROTECTED]> wrote:
>
> > > On Nov 14, 3:10 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> > > > Don't forget that there is an 'alpha with extreme prejudice' version
> > > > of the Cake 1.2 manual over athttp://tempdocs.cakephp.org
>
> > > I've studied it. And I've also found an answer to my question. But
> > > it's not in the docs but here:
>
> > >https://trac.cakephp.org/ticket/276
>
> > > The solution presented there seems less than elegant though. Is there
> > > really no way of using 'AS' in the Cakephp Model functions without
> > > changing the base code?
>
> > > Greets,
> > > Axl
>
> > --
> > ----------------- ----------------- ---------------
> > name: Ricardo Valfreixo
> > e-mail: [EMAIL PROTECTED]
> > msn: [EMAIL PROTECTED]
> > ----------------- ----------------- ---------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---