Ticket #1072 (closed defect: fixed)
Relation testing throws an exception
| Reported by: | Max_Schreck | Owned by: | romanb |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Relations | Version: | 0.11.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
Test schema:
PaymentDetail:
tableName: payment_detail
columns:
name:
type: string(255)
notnull: true
options:
charset: utf8
BankTransaction:
tableName: bank_transaction
columns:
payment_detail_id:
type: integer
name:
type: string(255)
notnull: true
relations:
PaymentDetail:
local: payment_detail_id
foreignAlias: BankTransaction
foreignType: one
options:
charset: utf8
Test code:
if (!($bankTransaction = Doctrine::getTable('BankTransaction')->createQuery()->limit(1)->execute()->getFirst()))
{
$bankTransaction = new BankTransaction();
}
// If I test this here...
if ($bankTransaction->PaymentDetail)
{
}
$bankTransaction->name = uniqid();
$bankTransaction->save();
// ...and this here - it will throw an exception
// Doctrine_Record_Exception with message
// 'Unknown record property / related component
// "payment_detail_id" on "BankTransaction"'
if ($bankTransaction->payment_detail_id)
{
}
Attachments
Change History
Note: See
TracTickets for help on using
tickets.