Sylius: Override ImagineBlock issue

Created on 1 Jul 2016  ·  2Comments  ·  Source: Sylius/Sylius

Hi!

I trying to override the ImagineBlock, but something is missing. This is the result:

 This document is not managed by the PHPCR ODM.
500 Internal Server Error - ConstraintDefinitionException 

This is my config:

This is my config:
 sylius_content:
    driver: doctrine/phpcr-odm
    resources:
        imagine_block:
            classes:
                form: { default: 'AppBundle\Form\Type\ImagineBlockType' }
                model: AppBundle\Document\ImagineBlock 

The block:

<?php namespace AppBundle\Document;

use Sylius\Bundle\ContentBundle\Document\ImagineBlock as BaseImagineBlock;
use Sylius\Component\Resource\Model\ResourceInterface;

class ImagineBlock extends BaseImagineBlock implements ResourceInterface
{
    /**
     * @var string
     */
    protected $description;

    /**
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * @param string $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }

} 

And the mapping:

<?xml version="1.0" encoding="UTF-8" ?>

<doctrine-mapping
        xmlns="http://doctrine-project.org/schemas/phpcr-odm/phpcr-mapping"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://doctrine-project.org/schemas/phpcr-odm/phpcr-mapping
                            https://github.com/doctrine/phpcr-odm/raw/master/doctrine-phpcr-odm-mapping.xsd"
>

<document name="AppBundle\Document\ImagineBlock">
    <field name="description" type="string" />
</document>

</doctrine-mapping> 

What should i fix? Thanks for the help!

Help Wanted

Most helpful comment

All 2 comments

@ylastapis Hey! Thank you! Based on that i just found my mistake. I missplaced the phpcr file.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bnd170 picture bnd170  ·  3Comments

hmonglee picture hmonglee  ·  3Comments

stefandoorn picture stefandoorn  ·  3Comments

eb22fbb4 picture eb22fbb4  ·  3Comments

igormukhingmailcom picture igormukhingmailcom  ·  3Comments