Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Overload the default base class of object with namespaced class #209

Open
maxailloud opened this Issue · 0 comments

1 participant

@maxailloud

Using the table attribute baseClass is very usefull but it can't be use with a namespaced class.

My schema.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" namespace="BundleNamespace\Model" name="default">
  <table name="film" baseClass="\Namespace\MyBundle\Model\BaseObject">
    <behavior name="timestampable" />
    <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
    <column name="title" type="VARCHAR" size="255" />
  </table>
</database>

That's the error I get trying to do that:

[PHP Error] DOMDocument::schemaValidate(): Element 'table', attribute 'baseClass': [facet 'pattern'] 
The value '\Namespace\MyBundle\Model\BaseObject' is not accepted by the pattern '([\w_]+.?)+'. 
[line 442 of /home/mailloud/workspace/referentiels/vendor/propel/generator/lib/task/AbstractPropelDataModelTask.php]
@gzumba gzumba referenced this issue from a commit in gzumba/Propel
@gzumba gzumba Fix support of baseClass attribute for table with namespaces.
Fixes issue #209. Format is simply dotted notation, eg.

<database name="simple_database">
    <table name="inheriting_table" baseClass='Foo.Bar.Baz'>
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
    </table>
</database>

Note that the table inherited must extends \BaseObject
35fca44
@gzumba gzumba referenced this issue from a commit in gzumba/Propel
@gzumba gzumba Fix support of baseClass attribute for table with namespaces.
Fixes issue #209. Format is simply dotted notation, eg.

<database name="simple_database">
    <table name="inheriting_table" baseClass='Foo.Bar.Baz'>
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
    </table>
</database>

Note that the table inherited must extends \BaseObject
18cc6f1
@gzumba gzumba referenced this issue from a commit in gzumba/Propel
@gzumba gzumba Fix support of baseClass attribute for table with namespaces.
Fixes issue #209. Format is simply dotted notation, eg.

<database name="simple_database">
    <table name="inheriting_table" baseClass='Foo.Bar.Baz'>
        <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
    </table>
</database>

Note that the table inherited must extends \BaseObject
6a55370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.