make the RedObject countable like an usual php array