chok/sfMelodyPlugin — Issue #44: Possible issue with PropelORMAdapter
Author: richrosa
Created: 2011-12-23 17:22:07+00:00
State: open

In sfMelodyUserClass->getDbTokens(), the function looks for an array of db_tokens as supplied by the underlying ORM method findByUserId. The request is expecting an array of tokens related to user_id from the token table, but findByUserId only returns a single object.

To solve this, I overrode in sfMelodyPropelOrmAdapter.
public function findByUserId($user_id) {

$c = new Criteria;
$c->add(TokenPeer::USER_ID, $user_id);
return TokenPeer::doSelect($c);
}

If this fixes a bug, I'll make a pull request and fix it and close the bug.