Hi,

I'm a new Symfony user and I have a problem for model relations. I
don't understand this :

** In my schema.yml

Reviewarticle:
  tableName: rewiewarticle
  actAs:
      Timestampable:
  columns:
    idrewiewentity:
      type: integer(4)
      primary: true
      autoincrement: true
    idarticle: integer(4)
    idcustomer: integer(4)
    rating: integer(4)
    viewed: integer(4)
    description: string(2147483647)
  relations:
    Customer:
      local: idCustomer
      foreign: idCustomer
      type: one
    Article:
      local: idArticle
      foreign: id
      type: one

** In  my action :
$this->listReview = Doctrine::getTable('Reviewarticle')-
>getReviewsFromArticle($this->article->getId());

** In my ReviewarticleTable class :
public function getReviewsFromArticle($id, $limit = 10)
        {
                return $this->createQuery('rev')
                        ->where('rev.idArticle = ?', $id)
                        ->orderBy('rev.created_at DESC')
                        ->limit($limit)
                        ->execute();
        }
** In my View

<? foreach ( $listReview as $id => $review ): ?>
       <div style="border:1px solid #000">
        <? echo $review->getArticle(); // DONT WORK WHY ????????? ?>
        <? echo $review->getDescription(); ?>
       </div>
<? endforeach; ?>

Many thanks for your replies,
Fab.Ln

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to