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

set data with check #11

Closed
chajr opened this issue Sep 29, 2014 · 1 comment
Closed

set data with check #11

chajr opened this issue Sep 29, 2014 · 1 comment

Comments

@chajr
Copy link
Owner

chajr commented Sep 29, 2014

when we set data class should check that data exists on the same key. If it exist check that data is the same as we want to set. When data is the same we don't change object status to modiefied

@chajr chajr added this to the version 0.2.0 milestone Oct 1, 2014
@chajr chajr mentioned this issue Oct 9, 2014
chajr added a commit that referenced this issue Oct 13, 2014
This version introduces multiple enhancements:

allow to set some special rules to check data with regular expression before add to object

Details of additions/deletions below:
--------------------------------------------------------------

Added:      examples/base_object/data_validation.php
            -- Added --
                data validation example

Modified:   Base/BlueObject.php
            -- Added --
                $_validationRules list of rules to check
                _validateDataKey search validation rule for given key and check data
                _validateData check data with given rule and set error information
                putValidationRule set regular expression for key find and validate data
                destroyValidationRule remove validation rule from list
                returnValidationRule return validation rule or all rules set in object
            -- Updated --
                _putData check data with validation, skip data if its invalid

Modified:   examples/base_object.php
            -- Added --
                data validation example
@chajr chajr closed this as completed Oct 13, 2014
@chajr
Copy link
Owner Author

chajr commented Nov 4, 2014

Issue is not done. Data in _putData method must be checked that exist in object and set status dataCahget on true only if not set or different that givien

@chajr chajr reopened this Nov 4, 2014
chajr added a commit that referenced this issue Nov 4, 2014
This version introduces multiple enhancements:

added changes from missing issue
change data only that data for given key was not set or data is different
also changed === null to is_null()

Details of additions/deletions below:
--------------------------------------------------------------

Modified:   Base/BlueObject.php
            -- Added --
                _changeData moved part of logic form _putData method (set data in object)
            -- Updated --
                _putData part of logic moved to _changeData also added checking that data is different that set in gicen key
                getData changed === null to is_null()
                hasData refactor changes
                compareData changed === null to is_null()
                unsetData changed === null to is_null()
                restoreData changed === null to is_null()

Modified:   examples/base_object/set_data.php
            -- Added --
                example of try to change data with the same value

Modified:   composer.json
            -- Updated --
                changed version from 0.2.1 to 0.2.2
@chajr chajr closed this as completed Nov 4, 2014
chajr added a commit that referenced this issue Nov 4, 2014
set data with check (issue #11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant