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

Entity json-array casting not functioning as expected #1359

Closed
Iamscalla opened this issue Oct 26, 2018 · 2 comments
Closed

Entity json-array casting not functioning as expected #1359

Iamscalla opened this issue Oct 26, 2018 · 2 comments

Comments

@Iamscalla
Copy link
Contributor

Iamscalla commented Oct 26, 2018

the json-array casting decodes the json data when submitting to db.
an instance is this, [{"action_desription":"Order Approved by - \t@Staff[1]","action_time":"07-10-2018 14:14:28","action_ip":"127.0.0.1"}] which is what is supposed to return to the db, instead it attempts submitting the raw array

    ["action_desription"]=>"Order Approved by - @Staff[1]"
    ["action_time"]=> "07-10-2018 14:14:28"
    ["action_ip"]=> "127.0.0.1"

its issues revolves around the entity method toArray, which returns the raw data using the __get method.

@Iamscalla Iamscalla changed the title json-array not functioning as expected Entity json-array casting not functioning as expected Oct 26, 2018
@nowackipawel
Copy link
Contributor

nowackipawel commented Oct 27, 2018

Could you please check if you've got the same problem using 'array' as a casing method? (value should be serialized then).

Could you provide code where you're trying full entity and save data?

/BTW: I've noticed similar behavior when I am trying to assign value inside of entity class - it is normal in this case cuz __get / __set is not used then.

nowackipawel added a commit to nowackipawel/ci4-old that referenced this issue Oct 28, 2018
Turning cast for db save/update and validation inside of Model's::classToArray , will fix codeigniter4#1372 and probably codeigniter4#1359
@jim-parry
Copy link
Contributor

Closed by #1373?

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

No branches or pull requests

3 participants