Add getEntityByCode to dbmanager