Are you sure that $context is an instance of this repository's class?