HI william!there is no valable reason to do this "resend" of your message,
in that short interval (4 mails in 2 hours). If you did not got any replies,
it's maybe because some of us might not know what to answer, or maybe we're
out. it is still (was for me ) Saturday.

And, for your question, If you ask us how to solve it, then obviously you
have a logic problem. For a start i would split CVs from letters, and i
would use a relational table: to keep the track of what letter was attached
to the CV. From what i may understand from your question, it might be a job
offer website.


IF you use Propel:
You might wanna use 2 custom Peer functions that are using "doSelect"
function.

public static function getCVs(Criteria $c){
$cv = array();
$c = clone $c;
$results  = self::doSelect($c);
foreach ($results as $document){
if ($document->isCV()){
array_push($cv,$document)
}
}
return count($cv)>0 ? $cv : null;
}

public static function getLetters(){
$letter = array();
$c = clone $c;
$results  = self::doSelect($c);
foreach ($results as $document){
if ( ! $document->isCV()){
array_push($letter,$document)
}
}
return count($letter)>0 ? $letter : null;}


public static function doSelect($c){
if (!isset(self::$list_of_documents)){
$c = clone $c;
self::$list_of_documents = parent::doSelect($c)
}

return self::$list_of_documents;
}

if your problem was that you need to make 2 queries, well that's the
solution, however, but, i would suggest that $list_of_documents to be an
array having as key a hash after the serialization of the Criteria object.
Just to be sure that you will be able to make another doSelect intergation
with another Criteria.


Alecs


On Sat, Jun 20, 2009 at 2:33 PM, William <william.dura...@gmail.com> wrote:

>
> Hi,
>
> I have to do two list select from the same object model. How can i
> do ?
> I've an object Document which contains CVs and letters. I must split
> them in a form.
> A mail can have 0, 1 or 2 documents : the user have to make his own
> choice in a select for CVs and and an another select for letters.
> How can i do ? Might i use extra fields ? and merge result in action ?
>
> Thanks.
>
> >
>


-- 
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0748.543.798

--~--~---------~--~----~------------~-------~--~----~
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 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to