add doctrine-related hook