I think it would be handy to create user_relationships_approved and user_relationships_pending views as follows

CREATE VIEW user_relationships_approved AS SELECT * FROM user_relationships WHERE approved=1
CREATE VIEW user_relationships_pending AS SELECT * FROM user_relationships WHERE approved=0

or maybe even

CREATE VIEW user_relationships_approved AS
 SELECT ur.*, urt.* FROM user_relationships ur INNER JOIN user_relationships_types urt on ur.rtid=urt.rtid WHERE approved=1
CREATE VIEW user_relationships_pending AS
 SELECT ur.*, urt.* FROM user_relationships ur INNER JOIN user_relationships_types urt on ur.rtid=urt.rtid WHERE approved=0

To my eye, SELECT * from user_relationships_approved... is clearer than SELECT * from user_relationships WHERE approved=1 AND.... It's also less error prone – I keep forgetting to add that WHERE approved=0/1 clause to every SQL statement / load function call.

Comments

sprsquish’s picture

Status: Active » Closed (won't fix)

I'm going to let the individual developers build this functionality in to their sites if they want/need it. The module needs to stay as lean and mean as possible.