Google Groups Home
Help | Sign in
Message from discussion #1050: Generated model of a hierarchy of behavior expressed in yaml is wrong.
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Doctrine  
View profile
 More options 16 May, 21:48
From: "Doctrine" <no-re...@phpdoctrine.org>
Date: Fri, 16 May 2008 20:48:05 -0000
Local: Fri 16 May 2008 21:48
Subject: [Doctrine] #1050: Generated model of a hierarchy of behavior expressed in yaml is wrong.
#1050: Generated model of a hierarchy of behavior expressed in yaml is wrong.
---------------------------------------------+----------------------------- -
 Reporter:  masterzen                        |       Owner:  jwage
     Type:  defect                           |      Status:  new  
 Priority:  major                            |   Milestone:  0.11.3
Component:  Behaviors                        |     Version:  0.11  
 Keywords:  hierarchy plugin patch testcase  |  
---------------------------------------------+----------------------------- -
 Since #936 is now fixed, we certainly want to be able to express a
 hierarchy of plugin/template/behaviors in YAML schemas and import them to
 generate the right models directly.

 Something along the line of:
 {{{
 ---
 Wiki:
   actAs:
     I18n:
       fields: [title, content]
       actAs:
         Versionable:
           fields: [title, content]
         Searchable:
           fields: [title, content]
         Sluggable:
           fields: [title]
   columns:
     title: string(255)
     content: string

 }}}

 Or even a sample of a more complex hierarchy as outlined here:
 {{{
 Question:
   actAs:
     I18n:
       fields: [...]
       actAs:
         Versionable:
           fields: [...]
           actAs:
             Timestampable:
               created:
                 name: created_at
                 type: timestamp
                 format:Y-m-d H:i:s
               updated:
                 disabled: true
             DoW_Doctrine_Template_Authorable:
         Searchable:
           fields: [text]
   columns:
     ....
 }}}

 Included in this ticket is a patch against 0.11RC2 (let me know for patch
 against current 0.11 branch) which enhances the Doctrine_Import_Builder to
 generate the following code samples (from example 1) in the generated
 models:
 {{{
 class BaseWiki extends Doctrine_Record
 {
   ...
   public function setUp()
   {
     parent::setUp();
     # adding behavior: I18n
     $i18n0 = new Doctrine_Template_I18n(array('fields' =>  array( 0 =>
 'title',  1 => 'content', )));
      #1 adding behavior: Versionable
      $versionable1 = new Doctrine_Template_Versionable(array('fields' =>
 array( 0 => 'title',  1 => 'content', )));
      $i18n0->addChild($versionable1);
      # adding behavior: Searchable
      $searchable1 = new Doctrine_Template_Searchable(array('fields' =>
 array( 0 => 'title',  1 => 'content', )));
      $i18n0->addChild($searchable1);
      # adding behavior: Sluggable
      $sluggable1 = new Doctrine_Template_Sluggable(array('fields' =>
 array( 0 => 'title', )));
      $i18n0->addChild($sluggable1);
     $this->actAs($i18n0);
   }
 ...
 }}}

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1050>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google