За последние 24 часа нас посетили 57920 программистов и 1845 роботов. Сейчас ищет 1081 программист ...

Помогите с Doctrine

Тема в разделе "Прочие вопросы по PHP", создана пользователем Nick0, 10 ноя 2008.

  1. Nick0

    Nick0 Активный пользователь

    С нами с:
    26 июл 2008
    Сообщения:
    55
    Симпатии:
    0
    Доброе время суток .

    У меня возникла проблема с Doctrine .

    У меня есть 2-е модели :
    PHP:
    1.  
    2. class Content extends Doctrine_Record
    3. {
    4.    public function setTableDefinition ()
    5.    {
    6.     $this->hasColumn('id','integer',4,array('notnull'=>true,'primary'=>true,'autoincrement'=>true,'unsigned'=>true));
    7.     $this->hasColumn('id_content','integer',4,array('unsigned'=>true));
    8.     $this->hasColumn('id_meta','integer',4,array('unsigned'=>true));
    9.     $this->hasColumn('Title','string',50);
    10.     $this->hasColumn('Date','string',50);
    11.     $this->hasColumn('Content','string',50);
    12.     $this->hasColumn('Author','string',50);
    13.     $this->hasColumn('Url','string',50);
    14.    }
    15.    public function setUp ()
    16.    {
    17.     $this->hasOne('Content_cat',array('local'=>'id_content','foreign'=>'id'));
    18.    }
    19. }
    20.  
    PHP:
    1.  
    2. class Content_cat extends Doctrine_Record
    3. {
    4.    public function setTableDefinition ()
    5.    {
    6.     $this->hasColumn('id','integer',4,array('notnull'=>true,'primary'=>true,'autoincrement'=>true,'unsigned'=>true));
    7.     $this->hasColumn('id_meta','integer',4,array('unsigned'=>true));
    8.     $this->hasColumn('imgFilePath','string',50);
    9.     $this->hasColumn('Title','string',50);
    10.     $this->hasColumn('Description','string',50);
    11.     $this->actAs('NestedSet');
    12.    }
    13.    public function setUp ()
    14.    {
    15.     $this->hasMany('Content',array('local'=>'id','foreign'=>'id_content'));
    16.    }
    17.  
    Из этого видно что с использованием Доктрины я пытаюсь сделать контент с вложениями.

    Вопрос такой как организовать сами вложения при создании бд из этих моделей в таблице Content_cat
    появилось 3-и поля дополнительных .

    Может кто работал с этим подскажите .