Welcome Guest, Not a member yet? Register   Sign In
I want use Entity Method but encountered Error
#3

(This post was last modified: 02-05-2022, 05:53 PM by yoshi.)

Quote:iReddsEntity uses the $attributes property to store data. This storage is accessed either directly or through getters and setters.
Since you declared the properties corresponding to the fields, no getter/setter is called when accessing them. This means there is no access to the data.

Remove the properties and it will work.

    protected ?int $id;
    protected ?string $name;
    protected ?string $zipcode;
    protected ?string $address;
    protected ?string $tel;
    protected ?string $prefecture;
    protected ?string $school_code;
    protected ?int $school_category_id;


You can also remove methods. They don't make sense unless you need to mutate/calculate the data.
For type casting, you can use this Property Casting

thank you for your reply.
there was unnecessary declare.

I will always be saved
Reply


Messages In This Thread
RE: I want use Entity Method but encountered Error - by yoshi - 02-05-2022, 05:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB