Reputation: 11
I'am looking for an option to hydrate my rows and keep only the value after the first underscore in order to get this :
Table :
user_id
user_name
Model
function getId()
function getName()
If I use the defaults paramaters my model functions are :
getUserId()
getUserName
Upvotes: 1
Views: 132
Reputation: 2901
You should create your hydrator like this:
$hydrator = new Zend\Stdlib\Hydrator\ClassMethods(); //without passing false to constructor
ClassMethods
has a property $underscoreSeparatedKeys
which is true
by default.
Upvotes: 1