Hello Derick,

thank you very much :)

I've changed idProperty to "normal" properties.

The problem was, that i've used the ezc-Tools to create the definition
files.

// Creates a schema.xml from current database table.
// Needed for Persistent Object creation.
$schema = ezcDbSchema::createFromDb( $db );
$dest = APPLICATION_PATH . DS .
        'sources' . DS .
        'database' . DS .
        'schema.xml';
$schema->writeToFile( 'xml', $dest );

// console code to create definition files from previous created schema.xml
php rungenerator.php -s ./application/sources/database/schema.xml -f xml
./application/sources/database/persistence/


(Maybe) ezcDbSchema doesn't recognize the correct types of attributes if
there are multiple primary keys on a table.

greetings
René

Derick Rethans schrieb:
> On Wed, 28 Apr 2010, Christoph René Pardon wrote:
> 
>> There are some attributes missing in my statement.
>> The definition file looks like this:
>>
>> $def = new ezcPersistentObjectDefinition();
>> $def->table = 'yela_core_acl_rules';
>> $def->class = 'Yela_Persistence_Core_Acl_Rules';
>>
>> $def->idProperty               = new ezcPersistentObjectIdProperty();
>> $def->idProperty->columnName   = 'rule_id';
>> $def->idProperty->propertyName = 'rule_id';
>> $def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 
>> 'ezcPersistentSequenceGenerator' );
>> $def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_INT;
>>
>> $def->idProperty               = new ezcPersistentObjectIdProperty();
>> $def->idProperty->columnName   = 'group_id';
>> $def->idProperty->propertyName = 'group_id';
>> $def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 
>> 'ezcPersistentManualGenerator' );
>> $def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_INT;
>>
>> $def->idProperty               = new ezcPersistentObjectIdProperty();
>> $def->idProperty->columnName   = 'resource_id';
>> $def->idProperty->propertyName = 'resource_id';
>> $def->idProperty->generator    = new ezcPersistentGeneratorDefinition( 
>> 'ezcPersistentManualGenerator' );
>> $def->idProperty->propertyType = ezcPersistentObjectProperty::PHP_TYPE_INT;
> 
> You can only have one ID property, you're overwriting rule_id and 
> group_id so hence they don't show up in the statement. 
> 
> Derick
> 
> 
-- 
Components mailing list
Components@lists.ez.no
http://lists.ez.no/mailman/listinfo/components

Reply via email to