OK, so I've come across a problem. I want to search for all properties 
between 200,000 and 205,000. So I thought I could do the following:

$c->add(PropertyPeer::PRICE, 200000, Criteria::GREATER_EQUAL);
$c->add(PropertyPeer::PRICE, 205000, Criteria::LESS_THAN);

But it seems that you can only have one criterion for each column. Is 
this really the case or have I done something wrong?

TIA.

Tom

Tom Haskins-Vaughan wrote:
> OK, fixed it. Though if anyone has a better way please feel free to 
> voice it :)
> 
> foreach (SearchPeer::retrieveByPk($searchId)->getSearchCriterions() as 
> $criterion)
> { 
> 
>    eval("\$c->add(self::LISTING_PRICE, ".$criterion->getValue().", 
> ".$criterion->getSearchOperator()->getSymfonyLabel().");");
> }
> 
> Tom Haskins-Vaughan wrote:
>> Hi there,
>>
>> I'd like to do the following:
>>
>> foreach (SearchPeer::retrieveByPk($searchId)->getSearchCriterions() as 
>> $criterion)
>> {
>>    $c->add(self::LISTING_PRICE, $criterion->getValue(), 
>> Criteria::$criterion->getSearchOperator);
>> }
>>
>> This of course gives me the error: Fatal error: Access to undeclared 
>> static property: Criteria::$criterion in ...
>>
>> But is there any way to get around it?
>>
>> TIA
>>
>> Tom
> 

-- 
Tom Haskins-Vaughan
Temple Street Media: Design and Development for the Web
[EMAIL PROTECTED] | www.templestreetmedia.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
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