File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class Degree
2828 #[ORM \Column(length: 255 , unique: true )]
2929 private string $ name ;
3030
31- #[Gedmo \Slug(fields: ['name ' ], unique: true )]
31+ #[Gedmo \Slug(fields: ['name ' ], unique: true )]
3232 #[ORM \Column(length: 255 , unique: true )]
3333 private string $ slug ;
3434
Original file line number Diff line number Diff line change 2929use Vich \UploaderBundle \Mapping \Annotation as Vich ;
3030
3131use function array_unique ;
32+ use function get_object_vars ;
3233use function in_array ;
34+ use function property_exists ;
3335use function sprintf ;
3436
3537#[ORM \Table(name: 'fos_user ' )]
@@ -625,4 +627,25 @@ public function removeGroup(Group $group): self
625627
626628 return $ this ;
627629 }
630+
631+ /** @return array<string, mixed> */
632+ public function __serialize (): array
633+ {
634+ $ vars = get_object_vars ($ this );
635+ unset($ vars ['imageFile ' ]);
636+
637+ return $ vars ;
638+ }
639+
640+ /** @param array<string, mixed> $data */
641+ public function __unserialize (array $ data ): void
642+ {
643+ foreach ($ data as $ key => $ value ) {
644+ if (! property_exists ($ this , $ key )) {
645+ continue ;
646+ }
647+
648+ $ this ->$ key = $ value ;
649+ }
650+ }
628651}
You can’t perform that action at this time.
0 commit comments