How to extend Page Entity in SyliusCmsPlugin


#1

i an trying to extend BitBag\SyliusCmsPlugin\Entity\Page in my appBundle to add a single field
but i get this error
The table with name ‘devproject_v02_dev.bitbag_cms_page’ already exists.
here is my config.yml file

//app/config/config.yml
bit_bag_sylius_cms:
resources:
page:
classes:
model: AppBundle\Entity\Page

//Page.orm.yml
AppBundle\Entity\Page:
type: entity
table: bitbag_cms_page
fields:
image:
type: string
nullable: true

//Page.php
use BitBag\SyliusCmsPlugin\Entity\PageTranslation as BasePage;

class Page extends BasePage
{
/**
* @var string
*/
protected $image;

/**
 * @return mixed
 */
public function getImage()
{
    return $this->image;
}

/**
 * @param mixed $image
 */
public function setImage($image): void
{
    $this->image = $image;
}

}


#2

You must add to config.yml:

sylius_resource:
    resources:
        bitbag_sylius_cms_plugin.page:
            classes:
                model: AppBundle\Entity\Page

#3

page image has been added in version 1.3.0 :slightly_smiling_face:


#4

thanks solved my problem