Skip to content

Instantly share code, notes, and snippets.

View escees's full-sized avatar

Kamil Ścisłowski escees

View GitHub Profile

Keybase proof

I hereby claim:

  • I am escees on github.
  • I am escees (https://keybase.io/escees) on keybase.
  • I have a public key ASDxm8mXlO5VAatQxTbWSgvW7oiT849fsRweofrnP2p5DAo

To claim this, I am signing this object:

@escees
escees / global-gitignore.md
Created April 7, 2021 05:45
Global .gitignore file for excluding your work environment-specific files

You don't have to add your .idea or .vs_code directories to your .gitignore file every time you start new project.

Make it global.

  1. Create file:
 touch ~/.gitignore
  1. Add what you want to ignore:
@escees
escees / UniqueDto.md
Last active October 12, 2022 06:16
UniqueDto Symfony constraint against entity passed as an argument.

UniqueDto Symfony constraint against entity passed as an argument.

UniqueEntity constraint is not able to validate field between associated DTO and entity and this is simple constraint that will check it uniqueness of the same field in DTO and Entity

This constraint is an easy way to implement validation against an entity for your DTO. You just need to remember that your fields in DTO should be named exactly the same as in the entity you want to validate against. Of course it could be more sophisticated like using map for field names in DTO and entity but for now it's enough.

class UniqueDTO extends Constraint