Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2.x Model hasChanged array #12713

Merged
merged 1 commit into from
May 8, 2017

Conversation

Jurigag
Copy link
Contributor

@Jurigag Jurigag commented Mar 15, 2017

Hello!

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the Contributing Guidelines?
  • I have checked that another pull request for this purpose does not exist.
  • I wrote some tests for this PR.

Small description of change: This is fixing issue as well adding option to check if array of fields was changed in models with ability to check if all provided fields were changed.

Thanks

@Jurigag Jurigag changed the title [WIP]Model hasChanged array [WIP]3.2.x Model hasChanged array Mar 15, 2017
@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch from bfe81c5 to 86a14a0 Compare March 15, 2017 15:50
@Jurigag Jurigag closed this Mar 15, 2017
@Jurigag Jurigag reopened this Mar 15, 2017
@@ -3853,7 +3853,7 @@ abstract class Model implements EntityInterface, ModelInterface, ResultInterface
*
* @param string|array fieldName
*/
public function hasChanged(var fieldName = null) -> boolean
public function hasChanged(var fieldName = null, boolean allFields = false) -> boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please amend PHPDoc with example and update CHANELOG.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea i will update changelog once there will be 3.2.x branch cuz i will need to update it then anyway.

@sergeyklay sergeyklay added this to the 3.2.0 milestone Mar 15, 2017
@Jurigag Jurigag changed the base branch from 3.1.x to 3.2.x March 23, 2017 08:39
@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch 2 times, most recently from cae32fb to 4ad2aa6 Compare March 23, 2017 10:54
@Jurigag
Copy link
Contributor Author

Jurigag commented Mar 23, 2017

rebased @sergeyklay

Copy link
Contributor

@sergeyklay sergeyklay left a comment

Choose a reason for hiding this comment

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

Could you please fix doc?

* $robot->type = "hydraulic";
* $hasChanged = $robot->hasChanged("type"); // returns true
* $hasChanged = $robot->hasChanged(["type", "name"]); // returns true
* $hasChanged = $robot->hasChanged(["type", "name", true]); // returns false
Copy link
Contributor

Choose a reason for hiding this comment

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

$robot->hasChanged(["type", "name"], true);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, okay i see space.

@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch from 4ad2aa6 to cca9cd1 Compare March 24, 2017 12:00
@Jurigag
Copy link
Contributor Author

Jurigag commented Mar 24, 2017

Fixed comment.

@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch from cca9cd1 to 1c6a7fb Compare March 27, 2017 11:07
@Jurigag Jurigag changed the title [WIP]3.2.x Model hasChanged array 3.2.x Model hasChanged array Mar 27, 2017
@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch 2 times, most recently from 39870c4 to 10c2c3f Compare April 3, 2017 17:51
@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch from 10c2c3f to 090064c Compare April 12, 2017 09:48
@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch 2 times, most recently from d8c8fe2 to 5465096 Compare April 27, 2017 14:54
@Jurigag
Copy link
Contributor Author

Jurigag commented Apr 27, 2017

Rebased @sergeyklay

@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch from de5f52e to 2fa99a3 Compare May 8, 2017 11:15
@Jurigag Jurigag force-pushed the 3.2.x-model-haschanged branch from 2fa99a3 to 7394bcc Compare May 8, 2017 11:16
@Jurigag
Copy link
Contributor Author

Jurigag commented May 8, 2017

Rebased @phalcon/framework-team

@sergeyklay sergeyklay merged commit 2323309 into phalcon:3.2.x May 8, 2017
@sergeyklay
Copy link
Contributor

Thank you

@Jurigag Jurigag deleted the 3.2.x-model-haschanged branch May 8, 2017 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants