Skip to content

Latest commit

 

History

History
120 lines (86 loc) · 2.56 KB

experimental-storage.md

File metadata and controls

120 lines (86 loc) · 2.56 KB

Experimental Content Bundle Storage

For the experimental storage the articles are stored using the SuluContentBundle.

Table of content

Installation

To use the experimental storage you need to have the SuluContentBundle installed.

composer require sulu/content-bundle

Then you can configure it:

sulu_article:
    article:
        storage: experimental

Routes

# config/routes/sulu_article_admin.yaml

## coming soon ...

Configuration

The following is showing the full configuration of the experimental article module:

sulu_product:
    storage: experimental

    # optional
    objects:
        article:
            model: 'Sulu\Bundle\ArticleBundle\Domain\Model\Article'
        article_content:
            model: 'Sulu\Bundle\ArticleBundle\Domain\Model\ArticleDimensionContent'

Override Entities

Override Article Entity

<?php
// src/Entity/Article.php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Sulu\Bundle\ArticleBundle\Domain\Model\Article as SuluArticle;

/**
 * @ORM\Table(name="ar_articles")
 * @ORM\Entity
 */
class Article extends SuluArticle
{
}

Configure your new model class:

# config/packages/sulu_article.yaml

sulu_article:
    objects:
        article:
            model: 'App\Entity\Article'

To add new fields to your entity have a look at the Doctrine Mapping Documentation;

Override Article Content Entity

<?php
// src/Entity/Article.php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Sulu\Bundle\ArticleBundle\Domain\Model\ArticleDimensionContent as SuluArticleDimensionContent;

/**
 * @ORM\Table(name="ar_articles_dimension_contents")
 * @ORM\Entity
 */
class ArticleDimensionContent extends SuluArticleDimensionContent
{
}

Configure your new model class:

# config/packages/sulu_article.yaml

sulu_article:
    objects:
        article_content:
            model: 'App\Entity\ArticleDimensionContent'

To add new fields to your entity have a look at the Doctrine Mapping Documentation;