Source of file MediaDataFileExtension.php
Size: 1,087 Bytes - Last Modified: 2021-12-23T10:54:09+00:00
/var/www/docs.ssmods.com/process/src/code/MediaDataFileExtension.php
12345678910111213141516171819202122232425262728293031323334353637383940 | <?php /** * Provides extra file information functionality * * @author Damian Mooyman * @see File */ class MediaDataFileExtension extends DataObjectDecorator { /** * Retrieves the extracted media information for this file * @return IMediaFileInformation The extracted media file information */ public function MediaData() { return MediaDataManager::factory()->DataFor($this->owner->FullPath); } /** * Shortcut for retrieving the width of this media for non-image elements * @return integer|null Width of this media element, or null if not applicable */ function getWidth() { $media = $this->owner->MediaData(); if($media && $video = $media->Video()) return $video->getWidth(); } /** * Shortcut for retrieving the height of this media for non-height elements * @return integer|null Height of this media element, or null if not applicable */ function getHeight() { $media = $this->owner->MediaData(); if($media && $video = $media->Video()) return $video->getHeight(); } } |