How to force Doctrine to update array type fields?
问题 I have a Doctrine entity with array type field: /** * @ORM\Table() */ class MyEntity { (...) /** * @var array $items * * @ORM\Column( type="array" ) */ private $items; /** * @param SomeItem $item */ public function addItem(SomeItem $item) { $this->items[] = $item; } (...) } If I add element to the array, this code works properly: $myEntityObject->addItems(new SomeItem()); $EntityManager->persist($myEntityObject); $EntityManager->flush(); $myEntityObject is saved to the database with correct