public function __construct(string $id)
{
$this->id = $id;
$this->pics = new Collection();
}
<code>
public function __construct(string $id)
{
$this->id = $id;
$this->pics = new ArrayCollection();
}
</code>
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="MyBundle\HotelBundle\Model\Hotel" table="ex_hotels" repository-class="MyBundle\HotelBundle\Repository\HotelRepository">
<id name="id" type="guid">
<generator strategy="NONE"/>
</id>
<field name="title" type="string"/>
<field name="description" type="text"/>
<field name="startDate" type="datetime" nullable="true"/>
<field name="endDate" type="datetime" nullable="true"/>
<one-to-many field="pics" target-entity="MyBundle\HotelBundle\Model\Pic"
mapped-by="hotel">
<cascade>
<cascade-all/>
</cascade>
</one-to-many>
</entity>
</doctrine-mapping>
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="MyBundle\HotelBundle\Model\Pic" table="ex_pics" repository-class="MyBundle\HotelBundle\Repository\PicRepository">
<id name="id" type="integer" column="id">
<generator strategy="AUTO"/>
</id>
<field name="mediaFile" type="integer"/>
<many-to-one field="hotel" target-entity="MyBundle\HotelBundle\Model\Hotel" inversed-by="pics">
<cascade>
<cascade-all/>
</cascade>
<join-columns>
<join-column name="idHotels" on-delete="CASCADE" referenced-column-name="id" nullable="false"/>
</join-columns>
</many-to-one>
</entity>
</doctrine-mapping>
protected $pics;
public function __construct(string $id)
{
$this->id = $id;
$this->pics = new ArrayCollection();
public function addPic(? Collection $pics)
{
$this->pics[] = $pics;
return $this;
}
public function removePic($pics)
{
$this->pics->removeElement($pics);
}
public function getPics(): ? Collection
{
return $this->pics;
}
protected $hotel;
public function setHotel($hotel)
{
$this->hotel = $hotel;
return $this;
}
public function getHotel()
{
return $this->hotel;
}
\Doctrine\DBAL\Types\Type::overrideType('boolean', 'Doctrine\\DBAL\\Types\\IntegerType');
<div class="form-group col-sm-6">
как эту часть менятъ динамически?
есть где описание или пример как их делать?