I don't have any requirement to use it, by this is a nice solution and
I have just discovered loadInfo.
Thank you.

2007/3/14, Mariano Iglesias <[EMAIL PROTECTED]>:
>
> You could use loadInfo() to fetch your model fields and implode the array.
>
> Assuming your model is Application, and the field you want to omit is
> 'contents', do (look to see that the only difference between 1.1 and 1.2
> version is the call to extract()):
>
> CakePHP 1.1:
>
> $info = $this->Application->loadInfo();
> $fields = $info->extract('name');
>
> $index = array_search('contents', $fields);
>
> if ($index !== false)
> {
>         unset($fields[$index]);
> }
>
> $fields = 'Application.' . implode(', Application.', $fields);
>
> $records = $this->Application->findAll(null, $fields);
>
> CakePHP 1.2:
>
> $info = $this->Application->loadInfo();
> $fields = $info->extract('{n}.name');
>
> $index = array_search('contents', $fields);
>
> if ($index !== false)
> {
>         unset($fields[$index]);
> }
>
> $fields = 'Application.' . implode(', Application.', $fields);
>
> $records = $this->Application->findAll(null, $fields);
>
> -MI
>
> ---------------------------------------------------------------------------
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>
> blog: http://www.MarianoIglesias.com.ar
>
>
> -----Mensaje original-----
> De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
> de wralph
> Enviado el: Martes, 13 de Marzo de 2007 11:56 p.m.
> Para: Cake PHP
> Asunto: Block field using find()
>
> I've got a large table (large in regards the number of columns)
> 'applications' with 40 columns. One of those columns is a BLOB, which
> holds the contents of a file (held in the database as there are two
> sides to the application, an internal and external - both of which use
> the same DB, but not on the same server).
>
> Anyway, I want to grab all the application data, minus the BLOB field,
> but don't wat to have to list every column name in my query. Is there
> anyway I can do this?
>
>
> >
>


-- 
--
Javier Ramírez Molina
UN Producto
Dirección I+D y Nuevos Productos
Ingeniería e Integración Avanzadas (Ingenia), S.A.
Parque Tecnológico de Andalucía
Tfno.: 34 952 029 300 (ext. 1409)
http://www.ingenia.es

La información transmitida en este mensaje está dirigida solamente a las
personas o entidades que figuran en el encabezamiento y puede contener
información confidencial, por lo que si usted lo recibiera por error, por
favor destrúyalo sin copiarlo, usarlo ni distribuirlo, comunicándolo
inmediatamente al emisor del mensaje.

The information transmitted in this message is only addressed to the persons
or institutions that appear in the heading and may contain confidential
information. If you receive it by error, please, destroy it without copying,
using nor distributing it, and communicate it immediately to the message
sender.

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

Reply via email to