Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Class name prefixes and inheritance
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Eugene Janusov  
View profile   Translate to Translated (View Original)
 More options 14 Oct, 03:03
From: Eugene Janusov <esy...@gmail.com>
Date: Wed, 14 Oct 2009 13:03:12 +1100
Local: Wed 14 Oct 2009 03:03
Subject: Class name prefixes and inheritance

Hi,

I have been trying for a while to figure out, is there a way to use a
prefix for model class names or not (see also my message at
doctrine-user: http://bit.ly/30V7Ig).

I've found that Doctrine 1.2 has classPrefix option. Unfortunately for
me, this option is intended only for model builder, and other components
like Doctrine_Query don't use it at all.

But I've noticed that model builder currently produces incorrect class
definitions with this option.

I make use of column aggregation inheritance:

MyEntity:
   ...

MyExtendedEntity:
   inheritance:
     extends: MyEntity:
     type: column_aggregation
     ...

with such a schema and classPrefix option I get:

* Prefix_MyExtendedEntity extends Prefix_BaseMyExtendedEntity
* Prefix_BaseMyExtendedEntity extends Prefix_MyEntity
* Prefix_MyEntity extends Prefix_BaseMyEntity
* Prefix_BaseMyEntity extends sfDoctrineRecord

that is correct, but:

* MyExtendedEntityTable extends MyEntity
* MyEntityTable extends Doctrine_Table

although filenames are:

* base/Prefix_BaseMyEntityTable.class.php
* base/Prefix_BaseMyExtendedEntityTable.class.php
* Prefix_MyEntityTable.class.php
* Prefix_MyExtendedEntityTable.class.php

Moreover, specified prefix is also not taken into account for subclasses.

I've fixed both issues by slightly altering Doctrine_Import_Builder, see
attached patch.

--
Best regards,
Eugene Janusov.

  table_class_name_prefix.patch
2K Download

    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.
Lukas Kahwe Smith  
View profile   Translate to Translated (View Original)
 More options 14 Oct, 06:52
From: Lukas Kahwe Smith <m...@pooteeweet.org>
Date: Wed, 14 Oct 2009 07:52:08 +0200
Local: Wed 14 Oct 2009 06:52
Subject: Re: [doctrine-dev] Class name prefixes and inheritance

On 14.10.2009, at 04:03, Eugene Janusov wrote:

> Hi,

> I have been trying for a while to figure out, is there a way to use a
> prefix for model class names or not (see also my message at
> doctrine-user: http://bit.ly/30V7Ig).

> I've found that Doctrine 1.2 has classPrefix option. Unfortunately for
> me, this option is intended only for model builder, and other  
> components
> like Doctrine_Query don't use it at all.

yeah .. thats a pitty. i tried to extend Doctrine base classes to  
handle the class prefix also for all other areas, but it turned out to  
be quite a hassle. if anyone has a solution i would love to see it.

regards,
Lukas Kahwe Smith
m...@pooteeweet.org


    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.
Eugene Janusov  
View profile   Translate to Translated (View Original)
 More options 27 Oct, 03:30
From: Eugene Janusov <esy...@gmail.com>
Date: Tue, 27 Oct 2009 14:30:17 +1100
Local: Tues 27 Oct 2009 03:30
Subject: Re: [doctrine-dev] Re: Class name prefixes and inheritance
Jonathan,

What's about this?

On Wed, Oct 14, 2009 at 4:52 PM, Lukas Kahwe Smith <m...@pooteeweet.org> wrote:

> On 14.10.2009, at 04:03, Eugene Janusov wrote:

>> I have been trying for a while to figure out, is there a way to use a
>> prefix for model class names or not (see also my message at
>> doctrine-user: http://bit.ly/30V7Ig).

>> I've found that Doctrine 1.2 has classPrefix option. Unfortunately for
>> me, this option is intended only for model builder, and other
>> components
>> like Doctrine_Query don't use it at all.

> yeah .. thats a pitty. i tried to extend Doctrine base classes to
> handle the class prefix also for all other areas, but it turned out to
> be quite a hassle. if anyone has a solution i would love to see it.

--
Best regards,
Eugene Janusov.

    Reply    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.
End of messages
« Back to Discussions « Newer topic     Older topic »

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