public function importValue($value) { if ($value instanceof UnifiedContainer) { if ($value->isLazy()) { return $this->import(array($this->name => $value->getList())); } elseif ($value->getParentObject()->getId() && ($list = $value->getList())) { return $this->import(array($this->name => ArrayUtils::getIdsArray($list))); } else { return parent::importValue(null); } } if (is_array($value)) { try { if ($this->scalar) { Assert::isScalar(current($value)); } else { Assert::isInteger(current($value)); } return $this->import(array($this->name => $value)); } catch (WrongArgumentException $e) { return $this->import(array($this->name => ArrayUtils::getIdsArray($value))); } } return parent::importValue($value); }