Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony 2.5翻译可上载字段_Php_Symfony_Entity_Translation_Stofdoctrineextensions - Fatal编程技术网

Php Symfony 2.5翻译可上载字段

Php Symfony 2.5翻译可上载字段,php,symfony,entity,translation,stofdoctrineextensions,Php,Symfony,Entity,Translation,Stofdoctrineextensions,如何使用StofDoctrineExtensionsBundle使实体字段同时“可上载”和“可翻译” 这就是我在实体中尝试做的: Product.php /** * Product * * @ORM\Table("product") * @ORM\Entity(repositoryClass="My\Bundle\Entity\ProductRepository") * * @Vich\Uploadable */ class Product { .... /** * @Assert\File(

如何使用StofDoctrineExtensionsBundle使实体字段同时“可上载”和“可翻译”

这就是我在实体中尝试做的:

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;
不幸的是,它不起作用