public static CacheableMetadata::createFromObject($object)
Creates a CacheableMetadata object from a depended object.
Parameters
\Drupal\Core\Cache\CacheableDependencyInterface|mixed $object: The object whose cacheability metadata to retrieve. If it implements CacheableDependencyInterface, its cacheability metadata will be used, otherwise, the passed in object must be assumed to be uncacheable, so max-age 0 is set.
Return value
static
File
core/lib/Drupal/Core/Cache/CacheableMetadata.php, lin