cycle/orm

๐Ÿ› Some redundant data in serialized entity

dmekhov opened this issue ยท 1 comments

No duplicates ๐Ÿฅฒ.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

This code

$item = $this->repository->findByPK(1);

return $this->response->json(
  [
   'data' => $item
  ]
);

returns

{
  "data": {
    "id": 1,
    "__cycle_orm_rel_map": {},
    "__cycle_orm_relation_props": {},
    "__cycle_orm_rel_data": []
  }
}

I expect that __cycle_orm_* fields will not be displayed

Version

ORM 2.2.2
PHP 8.2

Note
We can use some static or global WeakMap to move the internal properties outside