0
What does oasterisco mean in [*data], when I convert an object to array? What’s different about it compared to array[data] ?
Array
(
[0] => Source\Models\User Object
(
[entity:CoffeeCode\DataLayer\DataLayer:private] => users
[primary:CoffeeCode\DataLayer\DataLayer:private] => id
[required:CoffeeCode\DataLayer\DataLayer:private] => Array
(
)
[timestamps:CoffeeCode\DataLayer\DataLayer:private] => 1
[statement:protected] =>
[params:protected] =>
[group:protected] =>
[order:protected] =>
[limit:protected] =>
[offset:protected] =>
[fail:protected] =>
[data:protected] => stdClass Object
(
[id] => 30
[name] => Elvis
[passwd] => $2y$12$xNPOIrCoCS3uWqhudFvjRvkoRkzW
[email] => [email protected]
[franquia] => 90
[created_at] => 2020-02-22 21:33:52
[updated_at] => 2020-03-10 18:17:37
)
)
)
Converting to array:
$array = $array[0];
print_r((array)$session);
// e obtive
Array
(
[CoffeeCode\DataLayer\DataLayerentity] => users
[CoffeeCode\DataLayer\DataLayerprimary] => id
[CoffeeCode\DataLayer\DataLayerrequired] => Array
(
)
[CoffeeCode\DataLayer\DataLayertimestamps] => 1
[*statement] =>
[*params] =>
[*group] =>
[*order] =>
[*limit] =>
[*offset] =>
[*fail] =>
[*data] => stdClass Object
(
[id] => 30
[name] => Eliseu
[passwd] => $2y$12$x.2SDn17RMxce0EV3xaoDet/NPOIrC.oCS3uWqhudFvjRv.koRkzW
[email] => [email protected]
[franquia] => 94
[created_at] => 2021-02-22 21:33:52
[updated_at] => 2021-03-10 18:17:37
)
)
I created an extended one to extract from protected for public only non-sensitive and it worked, thank you.
– ElvisP
I returned to comment, today I learned to deal with objects, had a limitation because I used only array’s until then, thanks for the clarification.
– ElvisP