I have been working with Doctrine 1.2 and decided that we needed to use
GUIDs as IDs instead of the auto increment. I found a bug while extending
the software that I would like to give back.
In the class Doctine_Import_Schema there is a section called
_buildRelationships($array). I defined what I wanted my ID to look like
globally in the configuration file so that they are always the same but
since it is a GUID and when this method is called because the field isn't
defined in the class directly the fields don't match. So I added the
following section near the top of the method to handle if there is a
globally set identifier column to use those settings instead.
Code:
$default_type = 'integer';
$default_length = 8;
$attributes = \Doctrine_Manager::getInstance()->getAttributes();
if(!empty($attributes[\Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS]['type']))
{
$default_type =
$attributes[\Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS]['type'];
}
if(!empty($attributes[\Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS]['length']))
{
$default_length =
$attributes[\Doctrine_Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS]['length'];
}
--
You received this message because you are subscribed to the Google Groups
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.