On Apr 6, 2:19 am, "Thomas Rabaix" <[EMAIL PROTECTED]> wrote: > Does the getFilepath return a string value, or just echo the value ... > that will explain why the filepath is displayed at first
I am not sure I understand the difference? Hmmmm, time for some investigation... Okay, I see what you mean, Thomas. In my lib/FileToSession.php, I have this simple get: public function getFileName() { return $this->getFile()->getFileName(); } but for the filepath, it is very clumsily built as I am not so good with propel: public function getFilePath() { $sessionid = sfContext::getInstance()->getUser()- >getAttribute('sessionid'); $c = new Criteria(); $c->clearSelectColumns(); $c->addSelectColumn(FilePeer::FILE_PATH); $c->addJoin( FileToSessionPeer::FILE_ID, FilePeer::ID); $c->add(FileToSessionPeer::FILE_ID, $this->getFileId()); $c->addAnd(FileToSessionPeer::COURSE_SESSION_ID, $sessionid); $resultset = FilePeer::doSelectRS($c); $filepath = array(); while($resultset->next()) { $filepath[] = $resultset->getString(1); } foreach ($filepath as $value) { echo $value; } } and you can see that it does indeed ECHO a value as opposed to return it! Well, I could experiment with changing echo to return? I really struggled to get the filepath selection to work at all. FileToSession is a many-to-many through table to the File table: my nemesis! And I couldn't figure out how to pass the sessionid to the function other than through a user attribute var. Heh, a look in my messy closet! I'll try 'return' in this function and see if it makes a difference. And I'll listen carefully to any advice about better ways to build the above clumsy filepath function! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---