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

Entity 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.
PHP Code:
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
Reply


Messages In This Thread
RE: I want use Entity Method but encountered Error - by iRedds - 02-05-2022, 07:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB