Re: About MapBuilders
Hans Lellelid <hans <at> velum.net>
2009-03-19 22:08:33 GMT
Hi Alvaro,
Ok -- I think I understand. This sounds relatively straightforward. If
you need an account for Trac / SVN, please send me an off-list email.
Hans
Alvaro Videla wrote:
> Hi Hans,
>
> For me the easiest way would be to add the method addTableMap to
> DatabaseMap, because this class is hardcoded inside
> Propel::initDatabaseMap, if not, then we have to see a way to use a
> factory, or to introduce some extra settings inside Propel, which at the
> moment I don't know how. This extra settings or factory will allow us to
> specify the DatabaseMap we want. Maybe inside the schema??
>
> Alvaro
>
>
> -----Original Message-----
> From: Hans Lellelid [mailto:hans <at> velum.net]
> Sent: Thursday, March 19, 2009 9:15 AM
> To: dev <at> propel.tigris.org
> Subject: Re: [propel-dev] About MapBuilders
>
> Hi Alvaro,
>
> It seems reasonable to provide a way to subclass DatabaseMap. Do you
> have a proposed patch?
>
> Hans
>
> Alvaro Videla wrote:
>
>> Hi list,
>>
>>
>>
>> In the company we are using Propel 1.2, and we implemented and APC
>> caching mechanism for the table map that are built inside
>> MapBuilder::doBuild.
>>
>>
>>
>> To be able to use our system we 'hacked' inside propel so instead of
>> creating a DatabaseMap instance inside Propel::initDatabaseMap we
>>
> create
>
>> one called MyDatabaseMap which extends DatabaseMap adding one method:
>>
>
>
>> MyDatabaseMap::addTableMap with the following implementation:
>>
>>
>>
>> public function addTableMap($tableMap, $tableName)
>>
>> {
>>
>> $this->tables[$tableName] = $tableMap;
>>
>> }
>>
>>
>>
>> We did this so in our custom MapBuilder we can do:
>>
>>
>>
>> $this->dbMap->addTableMap($tMap, 'users'); Our idea was to introduce
>>
> the
>
>> Table map from outside of DatabaseMap contrary to how it works using
>> DatabaseMap::addTable
>>
>>
>>
>> What's the chance to get this addTableMap method inside Propel 1.2
>> distribution? If it is not a problem It may also be considered to be
>> part of 1.3?
>>
>>
>>
>> Thanks,
>>
>>
>>
>
>
>> Alvaro
>>
>>
>
> ------------------------------------------------------
> http://propel.tigris.org/ds/viewMessage.do?dsForumId=1093&dsMessageId=13
> 52124
>
> To unsubscribe from this discussion, e-mail:
> [dev-unsubscribe <at> propel.tigris.org].
>
> ------------------------------------------------------
> http://propel.tigris.org/ds/viewMessage.do?dsForumId=1093&dsMessageId=1352386
>
> To unsubscribe from this discussion, e-mail: [dev-unsubscribe <at> propel.tigris.org].
>
------------------------------------------------------
http://propel.tigris.org/ds/viewMessage.do?dsForumId=1093&dsMessageId=1358318
To unsubscribe from this discussion, e-mail: [dev-unsubscribe <at> propel.tigris.org].