Read doctrine's documentation about how to initialize a tree and read the
code to have a better understanding of how things are connected...


On Thu, Dec 4, 2008 at 4:34 PM, Teddy Maitre <[EMAIL PROTECTED]> wrote:

> i have :
>
> abstract class BaseEnvdomaine extends sfDoctrineRecord
> {
>   public function setTableDefinition()
>   {
>     $this->setTableName('envdomaine');
>     $this->hasColumn('id', 'integer', 8, array('type' => 'integer',
> 'autoincrement' => true, 'primary' => true, 'length' => '8'));
>     $this->hasColumn('designationdomaine', 'string', 40, array('type' =>
> 'string', 'length' => '40'));
>     $this->hasColumn('remarque', 'string', 2147483647, array('type' =>
> 'string', 'length' => '2147483647'));
>     $this->hasColumn('created_at', 'timestamp', null, array('type' =>
> 'timestamp'));
>     $this->hasColumn('updated_at', 'timestamp', null, array('type' =>
> 'timestamp'));
>     $this->hasColumn('enrarchive', 'boolean', null, array('type' =>
> 'boolean', 'notnull' => true));
>
>     $this->option('collate', 'utf8_bin');
>     $this->option('charset', 'utf8');
>   }
>
>   public function setUp()
>   {
>     $this->hasOne('Envpersonnel', array('local' => 'id',
>                                         'foreign' => 'domaine_id'));
>
>     $this->hasOne('Envservice', array('local' => 'id',
>                                       'foreign' => 'domaine_id'));
>
>     $this->hasOne('Envsite', array('local' => 'id',
>                                    'foreign' => 'domaine_id'));
>
>     $nestedset0 = new Doctrine_Template_NestedSet();
>     $this->actAs($nestedset0);
>   }
> }
>
> But it's great? And after...i declar in my layout the helper :
> <?php use_helper('DoctrineTree') ?>
>
> and to create my tree, what do i use?
>
> --- En date de : *Jeu 4.12.08, Thomas Rabaix <[EMAIL PROTECTED]>* a
> écrit :
>
> De: Thomas Rabaix <[EMAIL PROTECTED]>
> Objet: [symfony-users] Re: sfdoctrinetreeplugin
> À: [email protected]
> Date: Jeudi 4 Décembre 2008, 16h25
>
> Open you BaseEnvpersonnel and check for Doctrine_Template_NestedSet call.
> If so that works.
>
> On Thu, Dec 4, 2008 at 4:02 PM, Necho <[EMAIL PROTECTED]> wrote:
>
>>
>> Yes but i don't know to set the nestedset...I read the documentation
>> about nestedset on the Doctrine's documentation but i dont
>> understand..
>>
>> It's my schema.yml :
>>
>> Envdomaine:
>>  actAs: [NestedSet]
>>  columns:
>>    id:
>>      type:             integer(8)
>>      notnull:          true
>>      autoincrement:    true
>>      primary:          true
>>    designationdomaine:
>>      type:             string(40)
>>  relations:
>>    Envpersonnel:
>>      class :           Envpersonnel
>>      local:            id
>>      foreign:          domaine_id
>>      foreignAlias:     Envdomaines
>>      foreignType:      many
>>      type:             one
>>    Envservice:
>>      class :           Envservice
>>      local:            id
>>      foreign:          domaine_id
>>      foreignAlias:     Envdomaines
>>      foreignType:      many
>>      type:             one
>>    Envsite:
>>      class :           Envsite
>>      local:            id
>>      foreign:          domaine_id
>>      foreignAlias:     Envdomaines
>>      foreignType:      many
>>      type:             one
>>  options:
>>    collate: utf8_bin
>>    charset: utf8
>>
>> Envservice:
>>  actAs: [NestedSet]
>>  columns:
>>    id:
>>      type:             integer(8)
>>      notnull:          true
>>      autoincrement:    true
>>      primary:          true
>>    codeservice:
>>      type:             string(40)
>>    designationservice:
>>      type:             string(80)
>>    domaine_id:
>>      type:             integer(8)
>>  relations:
>>    Envpersonnel:
>>      class :           Envpersonnel
>>      local:            id
>>      foreign:          service_id
>>      foreignAlias:     Envservices
>>      foreignType:      many
>>      type:             one
>>  options:
>>    collate: utf8_bin
>>    charset: utf8
>>
>> Envsite:
>>  actAs: [NestedSet]
>>  columns:
>>    id:
>>      type:             integer(8)
>>      notnull:          true
>>      autoincrement:    true
>>      primary:          true
>>    designationsite:
>>      type:             string(80)
>>    domaine_id:
>>      type:             integer(8)
>>  relations:
>>    Envpersonnel:
>>      class :           Envpersonnel
>>      local:            id
>>      foreign:          site_id
>>      foreignAlias:     Envsites
>>      foreignType:      many
>>      type:             one
>>  options:
>>    collate: utf8_bin
>>    charset: utf8
>>
>> Envpersonnel:
>>  actAs: [NestedSet]
>>  columns:
>>    id:
>>      type:             integer(8)
>>      notnull:          true
>>      autoincrement:    true
>>      primary:          true
>>    numeropersonnel:
>>      type:             integer(4)
>>    initialespersonnel:
>>      type:             string(6)
>>    nompersonnel:
>>      type:             string(40)
>>    domaine_id:
>>      type:             integer(8)
>>    service_id:
>>      type:             integer(8)
>>    site_id:
>>      type:             integer(8)
>>  options:
>>    collate: utf8_bin
>>    charset: utf8
>>
>> I add this lign for NestedSet but i don't know if it does work !:
>>
>>  actAs: [NestedSet]
>>
>> On 4 déc, 15:48, "Nicolas Perriault" <[EMAIL PROTECTED]> wrote:
>> > On Wed, Dec 3, 2008 at 12:59 PM, Necho <[EMAIL PROTECTED]> wrote:
>> > > I would like to use the sfdoctrinetreeplugin...but i don't know the
>> > > documentation. I have symfony 1.2. Could i have more explication and a
>> > > simple example please?
>> >
>> > http://www.symfony-project.org/plugins/sfDoctrineTreePlugin/0_9_1?tab.
>> ..
>> >
>> > Isn't this sufficient to start?
>> >
>> > ++
>> >
>> > --
>> > Nicolas Perriaulthttp://prendreuncafe.com-http://symfonians.net-
>> http://sensiolabs.com
>> > Phone: +33 660 92 08 67
>>
>>
>
>
> --
> Thomas Rabaix
> Internet Consultant
>
>
>
>
> >
>


-- 
Thomas Rabaix
Internet Consultant

--~--~---------~--~----~------------~-------~--~----~
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