getEntities method