Author: mcantelon
Date: Tue Sep 4 13:54:41 2012
New Revision: 12258
Log:
Minor refactor to use helper function.
Modified:
trunk/lib/task/import/csvAuthorityRecordImportTask.class.php
Modified: trunk/lib/task/import/csvAuthorityRecordImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvAuthorityRecordImportTask.class.php Tue Sep
4 13:44:21 2012 (r12257)
+++ trunk/lib/task/import/csvAuthorityRecordImportTask.class.php Tue Sep
4 13:54:41 2012 (r12258)
@@ -230,16 +230,12 @@
&& $self->rowStatusVars['typeOfEntity']
)
{
- $entityTypes = $self->getStatus('actorTypes');
- $entityType =
ucfirst(strtolower($self->rowStatusVars['typeOfEntity']));
- $entityTypeId = array_search($entityType, $entityTypes);
-
- if ($entityTypeId)
- {
- $self->object->entityTypeId = $entityTypeId;
- } else {
- throw new sfException($entityType .' is not a valid entity
type.');
- }
+ $self->object->entityTypeId = $self->translateNameToTermId(
+ 'type of entity',
+ $self->rowStatusVars['typeOfEntity'],
+ array(),
+ $self->getStatus('actorTypes')
+ );
}
if (
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" 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/qubit-commits?hl=en.