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
php symfony entity translation


source to share


No one has answered this question yet

Check out similar questions:

8
Configuring Translatable Doctrine2 Extension with Symfony2 Using YAML
6
Symfony2: PrePersist / PreUpdate event not firing
3
no transferable form with default entity translations found
2
JMS deserialization does not work with exclusion policy
2
Symfony 2 doctrine persist not working after map binding update
2
Undefined method Method name must start with findBy or findOneBy
1
Symfony2 doctrine join returns too much data
1
Symfony vichUploader tmp file does not exist
1
doctrine 2 many for many with translation
0
Symfony2 association error mapping



All Articles
Loading...
X
Show
Funny
Dev
Pics