$criteria->addSelectColumn(ContentPeer::TITLE);
$criteria->addSelectColumn(ContentPeer::UPDATED_AT);
$criteria->addSelectColumn(ContentPeer::CREATED_AT);

$this->contents = ContentPeer::doSelect($criteria);


I was trying also to give you the url to the Propel API docs but their 
sire is down so please search for propel api docs in google and they 
have a PEAR like documentation page with all Criteria() functions which 
are self explanatory usually (like the one above). Propel by default 
selects all columns as you have noticed already.

Kupo

Greg Freeman wrote:
> Hello, I'm new to propel and I have a question regarding the criteria.
> If I want to retrieve all rows in a table you can do something like
> this
>
> $this->contents = ContentPeer::doSelect(new Criteria());
>
> I was wondering how to write a criteria rule to only select certain
> fields from the table, (for example title, created_at and updated_at).
>
> Thanks
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to