aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sfIsisImporterRelations.class.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sfIsisImporterRelations.class.php b/lib/sfIsisImporterRelations.class.php
index 248bf99..49ec9f2 100644
--- a/lib/sfIsisImporterRelations.class.php
+++ b/lib/sfIsisImporterRelations.class.php
@@ -151,14 +151,13 @@ class sfIsisImporterRelations extends sfIsisImporterEntities {
*/
public function addManyToManyEntities(&$model, array $values, $relation, $key = 'name')
{
- $existing = array();
-
foreach ($values as $value)
{
+ $existing = $this->getEntity($relation, $value, $key);
+
// Prevent duplicate entries.
- if (!in_array($value, $existing))
+ if (!$existing)
{
- $existing[] = $value;
$this->addManyToMany($model, $value, $relation, $key);
}
else {