symfony
symfony forum
Home » support » General discussion » [Solved] Limiting table columns to retrieve
[Solved] Limiting table columns to retrieve [message #22865] Fri, 02 March 2007 22:14 Go to next message
sfxpt  is currently offline sfxpt
Messages: 339
Registered: January 2007
Location: Canada
Faithful Member
Hi,

Listing 8-13 at
http://www.symfony-project.com/book/trunk/08-Inside-the-Mode l-Layer#Retrieving%20Records%20with%20Criteria
shows how to retrieve records by criteria with conditions.

However, I am not able to find the way how to limit the fields it returns.

Ref: http://www.google.com/search?hl=en&domains=www.symfony-p roject.com%2Fbook%2Ftrunk%2F&q=%3A%3AdoSelect&btnG=S earch&sitesearch=www.symfony-project.com%2Fbook%2Ftrunk% 2F

Is there any way to limit the fields of the doSelect returns?

thx

*Edit*:

see posts below, and
http://www.symfony-project.com/forum/index.php/m/9234/
for doSelectRS usage example.

[Updated on: Tue, 06 March 2007 00:42]


http://xpt.sourceforge.net/techdocs/
http://xpt.sourceforge.net/tools/
Re: Limiting table columns to retrieve [message #22919 is a reply to message #22865 ] Sun, 04 March 2007 14:07 Go to previous messageGo to next message
Sephi77  is currently offline Sephi77
Messages: 109
Registered: January 2007
Location: Switzerland
Senior Member
IMO it's possible since Symfony retrieves all the information needed to construct an object. The object's integrity wouldn't be respected if you retrieve only certain columns (some informations about the object would be missing).
Re: Limiting table columns to retrieve [message #22921 is a reply to message #22865 ] Sun, 04 March 2007 14:26 Go to previous message
mikenolan  is currently offline mikenolan
Messages: 403
Registered: October 2006
Location: Lancashire, UK
Faithful Member
You can do it with the Criteria object using clearSelectColumns() and adding the required columns back in. As Sephi77 said it won't return enough information to create a valid object so you can use MyPeer::doSelectRS() to return a result set. More info in the propel docs:

http://propel.phpdb.org/docs/api/current/runtime/propel.util /Criteria.html
Previous Topic:sfPropelUnique Validator
Next Topic:Ruby 2 symfony (need a help)
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software