This is a fairly old and well tested concept, according to TCM at least.
It does have its limitations however, for instance kidney beans are not an all around kidney tonic, but are particular to Kidney Yin. Therefore they are not as appropriate for Kidney Yang problems.
Similarly, red apples are good for the heart, but it is Heart Blood which they nourish and less the other aspects.
But anyway, food is more neutral and you are unlikely to do great harm without eating abnormal amounts of these foods so certainly try this theory out for yourself and see how it works for you.