It would be nice to be able to do something like the following:
<?php
/**
* @CacheUpdate(caches="users", key="#user.getUsername()", value="#user")
*/
public function saveUser(User $user)
{
// .. saves user and return void
}
Not sure about the "#" notation for value option since it could let think that it is an expression.