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!
Maybe this can help : https://gist.github.com/ylastapis/2462502f0cd58855f0c94a3f754e7369
@ylastapis Hey! Thank you! Based on that i just found my mistake. I missplaced the phpcr file.
Most helpful comment
Maybe this can help : https://gist.github.com/ylastapis/2462502f0cd58855f0c94a3f754e7369