this should be done using the Doctrine Common interface