1
votes

I do have the following schema.yaml:

Artikel:
connection: doctrine
tableName: artikel
columns:
id:
  type: integer(4)
  fixed: false
  unsigned: true
  primary: true
  autoincrement: true
bezeichnung:
  type: string(255)
  fixed: false
  unsigned: false
  primary: false
  notnull: true
  autoincrement: false
Portfolio:
connection: doctrine
tableName: portfolio
columns:
artikel_id:
  type: integer(4)
  fixed: false
  unsigned: true
  primary: true
  autoincrement: false
markt_id:
  type: integer(4)
  fixed: false
  unsigned: true
  primary: true
  autoincrement: false 
relations:
Artikel:
  local: id
  foreign: zustand_id
  type: many
Portfolio:
  local: id
  foreign: zustand_id
  type: many

My following (short) action.class.php file:

$this->unt_cat_list = Doctrine_Query::create()
                    ->from('portfolio p')
                    ->innerJoin('p.Artikel a')
                    ->Where('p.markt_id = ? ', array(3))
                    ->andWhere('a.id = ?', array(8))
                    ->execute();

My follwoing gottoSucccess.php file:

<?php foreach ($unt_cat_list as $cat_list1): ?>
<a href="<?php echo url_for('shop/category') . '/' . 'id/' . $cat_list1->getMarktId() ?>"><?php echo $cat_list1->getBezeichnung() ?></a>
<?php endforeach; ?>

Now my question: I want to show the column "Bezeichnung" (It means: description, so it is normal Text). The error is coming up with the following sentence:

Unknown record property / related component "bezeichnung" on "Portfolio"

It is working with this array (3) and (8) because entries in the db exist, so symfony is joining, am I right?

How can I list the column "Bezeichnung"? Can somebody help me?

1

1 Answers

2
votes

Bezeichnung is a column of the Artikel class, so you sould be doing, and $cat_list1 must be a Portfolio (because... I think it appears in your from clause). So what you should do is $cat_list1->getArtikel()->getBezeichnung() (das ist germglish ^^).