protected static function addRelationshipToQueue(IEntity $entity, PropertyMetadata $propertyMeta, IModel $model)
{
$isPersisted = $entity->isPersisted();
$rawValue = $entity->getRawProperty($propertyMeta->name);
if ($rawValue === null && ($propertyMeta->isNullable || $isPersisted)) {
return;
} elseif (!$entity->getProperty($propertyMeta->name)->isLoaded() && $isPersisted) {
return;
}
$value = $entity->getValue($propertyMeta->name);
$rel = $propertyMeta->relationship;
if ($value instanceof IEntity && !$value->isPersisted() && ($rel->type !== Relationship::ONE_HAS_ONE || $rel->isMain)) {
self::visitEntity($value, $model);
} elseif ($value !== null) {
self::$inputQueue[] = $value;
}
}