Giter VIP home page Giter VIP logo

Comments (3)

webdevilopers avatar webdevilopers commented on August 17, 2024

I can see the property count inside the ODM Mapping of Resources/config/doctrine/BaseCategory.mongodb.xml:

<?xml version="1.0" encoding="utf-8"?>
<doctrine-mongo-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping
                    http://doctrine-project.org/schemas/orm/doctrine-mongo-mapping.xsd">

    <mapped-superclass name="Sonata\ClassificationBundle\Document\BaseCategory">

        <field name="name"          type="string"       fieldName="name"    />
        <field name="enabled"       type="boolean"      fieldName="enabled" />
        <field name="slug"          type="string"       fieldName="slug"    />

        <field name="description"   type="string"   fieldName="description"    />
        <field name="count"         type="int"      fieldName="count"          />

        <field name="createdAt"    type="timestamp"   fieldName="createdAt" />
        <field name="updatedAt"    type="timestamp"   fieldName="updatedAt" />

        <lifecycle-callbacks>
            <lifecycle-callback type="prePersist" method="prePersist"/>
            <lifecycle-callback type="preUpdate" method="preUpdate"/>
        </lifecycle-callbacks>

    </mapped-superclass>
</doctrine-mongo-mapping>

Since we extended our bundle we override some mapping, but only the ORM:

<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
    <!--
         This file has been generated by the EasyExtends bundle ( https://sonata-project.org/easy-extends )

         References :
            xsd                  : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd
            xml mapping          : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en
            association mapping  : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en
    -->
    <entity
        name="Application\Sonata\ClassificationBundle\Entity\Category"
        table="classification__category"
        repository-class="Doctrine\ORM\EntityRepository">

        <id name="id" type="integer" column="id">
            <generator strategy="AUTO"/>
        </id>

    </entity>

from sonataclassificationbundle.

RewoDevNull avatar RewoDevNull commented on August 17, 2024

Got the same error and additionally a "Property slug does not exist" error.
Got a fix for it:
Adding "$slug" into Model/Context.php and adding "$count" into Model/Category.php will fix this issue.

from sonataclassificationbundle.

gnorby88 avatar gnorby88 commented on August 17, 2024

So what's the right solution? Remove these properties from xml or add these properties to Model?

from sonataclassificationbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.