Point taken,
In this case I am wanting to make it as efficient as possible because Features(Client wide enabled functionality) and a very simliar type of concept Permissions(User enabled functionality) are going to be used extensively on the majority of pages.
e.g.
Code:
if has_feature('ManageUsers')
// do something
end
if has_feature('OtherFeature')
// do something else
end
I'm even considering baking this out or saving these values in session or something simliar so I only need to query all the features and permissions for a user on login.
Code SQL:
SELECT COALESCE(f.VALUE, fm.VALUE) AS VALUE
FROM feature_master AS fm
LEFT OUTER JOIN feature AS f
ON f.client_id=1
AND f.feature_master_id = fm.id
WHERE fm.feature_key IN ('ManageUsers','OtherFeature','AnotherFeature')
Given that info would you still make up to 10 queries per page for this data?
Thanks Louis,
Bookmarks