victoire icon indicating copy to clipboard operation
victoire copied to clipboard

[BusinessEntity] Transform properties

Open Charlie-Lucas opened this issue 7 years ago • 1 comments

I have an object that use vichmage to save a picture, but to display an image i must use a specific twig function to get the path and display the image and i cant set the properties imageable. Can we have a way to automatic transform a properties to an "*able" vic propertie or define a custom vicTransformer. Ex:


    /**
     * @var string
     *
     * @ORM\Column(name="logo", type="string", length=255, nullable=true)
     * @VIC\BusinessProperty("imageable")
     * @Vic\VicTransformer("VichToImage")
     */
    private $logo;

    /**
     *
     * @Vich\UploadableField(mapping="product_logo", fileNameProperty="logo")
     * @Assert\Image(
     *      minWidth = 300,
     *      minHeight = 92,
     * )
     *
     * @var File
     */
    private $logoFile;

Charlie-Lucas avatar Mar 27 '17 08:03 Charlie-Lucas

Yes we talk about having a "BusinessParamTransformer" to do it.

gregumo avatar Mar 28 '17 07:03 gregumo