public function fromAssets($assets, $indexBy = null): array
	{
		Craft::$app->getDeprecator()->log('craft.embeddedAssets.fromAssets', "The template method `craft.embeddedAssets.fromAssets` is now deprecated. Use `craft.embeddedAssets.get` instead.");

		$embeddedAssets = [];

		if (is_iterable($assets))
		{
			foreach ($assets as $asset)
			{
				$embeddedAsset = $asset instanceof Asset ?
					EmbeddedAssets::$plugin->methods->getEmbeddedAsset($asset) : null;

				if ($embeddedAsset)
				{
					if (is_string($indexBy) && $asset->hasProperty($indexBy))
					{
						$embeddedAssets[$asset->$indexBy] = $embeddedAsset;
					}
					else
					{
						$embeddedAssets[] = $embeddedAsset;
					}
				}
			}
		}

		return $embeddedAssets;
	}