src/Variable.php
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;
	}
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;
	}
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 ; }
Retrieves the embedded asset models from an array of assets.

@deprecated Will be removed in next major version. Use the `get` method instead.

@param mixed $assets An iterable object of asset models.
@param null $indexBy Whether to index the resulting array by a property of the asset.
@return array
Retrieves the embedded asset models from an array of assets .