Symfony 2.5 Translate Loadable Field

How can I make an entity field "loadable" and "translatable" at the same time using the StofDoctrineExtensionsBundle?

this is what I was trying to do in essence:

product.php

/**
* Product
*
* @ORM\Table("product")
* @ORM\Entity(repositoryClass="My\Bundle\Entity\ProductRepository")
*
* @Vich\Uploadable
*/
class Product
{
....
/**
 * @Assert\File(
 *     maxSize="30M"
 * )
 * @Vich\UploadableField(mapping="product_file", fileNameProperty="fileName")
 *
 * @var File $file
 */
public $file;

/**
 *
 * @Gedmo\Translatable
 * @ORM\Column(type="string", length=255, name="file_name", nullable=true)
 *
 * @var string $fileName
 */
protected $fileName;

      

Unfortunately, this won't work.

+3


source to share





All Articles