Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[WIP] Update library/Zend/Stdlib/Hydrator/ClassMethods.php #3754

Closed
wants to merge 10 commits into from

Conversation

mabuzagu
Copy link
Contributor

ucfirst at the previous point forces you to have lowercase first properties
whereas if you are dealing with an existing table that already has
Uppercase first, then the Hydrator wont work. The fix above maintains everything
you had before but also allows for the use of uppercase first property e.g.
protected $FirstName;  MSSQL tables usually have this naming convention

ucfirst at the previous point forces you to have lowercase first properties
whereas if you are dealing with an existing table that already has
Uppercase first, then the Hydrator wont work. The fix above maintains everything
you had before but also allows for the use of uppercase first property e.g. 
protected $FirstName;  MSSQL tables usually have this naming convention
} else {
$attribute = lcfirst($attribute);
$attributes[$attribute] = $this->extractValue($attribute, $object->$method());
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samsonasik
Copy link
Contributor

I think this make tests failure in tests\ZendTest\Stdlib\HydratorStrategyTest and tests\ZendTest\Stdlib\HydratorTest

@ralphschindler
Copy link
Member

Hi @mabuzagu
Can you please have a look at the above commentary and address their concerns?
Thanks!

@ghost ghost assigned EvanDotPro Feb 15, 2013
Formated according to formatting standars
@mabuzagu
Copy link
Contributor Author

Thanks for the comments samsonasik and ralph. I have made the changes and it looks like the tests are running ok

@weierophinney
Copy link
Member

@mabuzagu Please add a unit test for the new behavior, to ensure we don't have a future regression that removes this capability.

Thanks!


if(property_exists($object, $attribute)) {
$attributes[$attribute] = $this->extractValue($attribute, $object->$method());
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you perhaps correct the indenting here (and the line above this, and the block below as well)? If it all looks okay in your editor, please make sure you use spaces. Not tabs. (we try to adhere to PSR2, which uses 4 spaces per tab: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md )

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will do

@weierophinney
Copy link
Member

@mabuzagu Any progress on the unit tests? If you need help, jump into #zftalk.dev on Freenode IRC, and ask for assistance -- lots of folks who will be able to help you there!

@mabuzagu
Copy link
Contributor Author

Sorry about the delay. Pass couple week have been hell :). But I think this week I should be able to get to it. I started on a some time back but seemed my solution was still causing the UT to fail. So I need to look at it more closely. You will have something from me soon. Sorry for the delay

@weierophinney
Copy link
Member

@mabuzagu Will you be able to finish this? If not, I'll close, and you can re-submit when you have tests. At this point, your branch is getting more and more out-of-date, and I worry that the merge will be difficult.

@mabuzagu
Copy link
Contributor Author

I gave it a try and of course the unit tests failed :) Give me until the Monday. I should be able to lock myself somewhere and do it. I just need to different approach and some thorough testing. Thanks for your patience

@mabuzagu
Copy link
Contributor Author

@weierophinney. Its ready now. Tests are good to go. Thanks for your patience

@iquabius iquabius mentioned this pull request Apr 15, 2013
@iquabius
Copy link
Contributor

CS fixes for this are on #4229.

@ghost ghost assigned weierophinney Apr 15, 2013
weierophinney added a commit that referenced this pull request Apr 15, 2013
[WIP] Update library/Zend/Stdlib/Hydrator/ClassMethods.php
weierophinney added a commit that referenced this pull request Apr 15, 2013
@weierophinney
Copy link
Member

As this provides a new feature, I've merged it to the develop branch for release with 2.2.0. Thanks!

weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…ch-1

[WIP] Update library/Zend/Stdlib/Hydrator/ClassMethods.php
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants