propelorm / Propel

Current stable (and outdated and unmaintained) version of Propel - Please use v2 https://github.com/propelorm/Propel2 --
http://www.propelorm.org
MIT License
841 stars 417 forks source link

Cannot use Sortable together with NestedSet #259

Closed Pepino483 closed 12 years ago

Pepino483 commented 12 years ago

When i use sortable behavior together with nestedset behavior on one table i get compile error..

This my table

  <table name="category" phpName="Category" package="Category.Category">
    <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
    <column name="scope_id" type="integer" />
    <column name="name" type="varchar" size="200" required="true" primaryString="true" />
    <behavior name="nested_set">
        <parameter name="use_scope" value="true" />
        <parameter name="scope_column" value="scope_id" />
    </behavior>
    <behavior name="sortable">
        <parameter name="use_scope" value="true" />
        <parameter name="scope_column" value="scope_id" />    
    </behavior>
  </table>

After generate php files run my app and get ,,Cannot redeclare BaseCategory::getScopeValue()" because every behaviour generating self function

<?php
public function getScopeValue()
{
    return $this->scope_id;
}
fzaninotto commented 12 years ago

Sortable and nested set are mutually exclusiven you shouldn't use both on the same table. Nested sets already allows sorting.