本文整理汇总了PHP中Media::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::__construct方法的具体用法?PHP Media::__construct怎么用?PHP Media::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Media
的用法示例。
在下文中一共展示了Media::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($file, $mimeType = null)
{
$message = "CssMedia::__construct - ";
$message .= "All functionality related to assets has been deprecated.";
trigger_error($message, E_USER_NOTICE);
parent::__construct($file, $mimeType);
}
示例2: __construct
public function __construct($params = null)
{
parent::__construct();
if (isset($params['utility'])) {
$this->utility = $params['utility'];
} else {
$this->utility = new Utility();
}
if (isset($params['url'])) {
$this->url = $params['url'];
} else {
$this->url = new Url();
}
if (isset($params['image'])) {
$this->image = $params['image'];
} else {
$this->image = getImage();
}
if (isset($params['user'])) {
$this->user = $params['user'];
} else {
$this->user = new User();
}
if (isset($params['config'])) {
$this->config = $params['config'];
}
}
示例3: __construct
/**
* Constructor
*
* @access public
* @author Oliver Lillie
* @param string $audio_file_path The path to the audio file.
* @param PHPVideoToolkit\Config $config The config object.
* @param PHPVideoToolkit\AudioFormant $audio_input_format The input format object to use, if any. Otherwise null
* @param boolean $ensure_audio_file If true an additional check is made to ensure the the given file is actually an audio file.
* @throws \LogicException If $ensure_audio_file is true but the file is not audio.
*/
public function __construct($audio_file_path, Config $config = null, AudioFormat $audio_input_format = null, $ensure_audio_file = true)
{
parent::__construct($audio_file_path, $config, $audio_input_format);
// validate this media file is an audio file
if ($ensure_audio_file === true && $this->_validateMedia('audio') === false) {
throw new \LogicException('You cannot use an instance of ' . get_class($this) . ' for "' . $audio_file_path . '" as the file is not an audio file. It is reported to be a ' . $this->readType());
}
}
示例4: __construct
/**
* Constructor
*
* @param Files The parent files collection
* @param string The filename
*/
public function __construct(Files $files, $filename)
{
$this->site = $files->site();
$this->page = $files->page();
$this->files = $files;
$this->root = $this->files->page()->root() . DS . $filename;
parent::__construct($this->root);
}
示例5: __construct
/** Create an album object.
*
* @param mixed $artist An artist object or string.
* @param string $name Name of this album.
* @param integer $id ID of this album.
* @param string $mbid MusicBrainz ID of this album.
* @param string $url Last.fm URL of this album.
* @param array $images An array of cover art images of different sizes.
* @param integer $listeners Number of listeners of this album.
* @param integer $playCount Play count of this album.
* @param integer $releaseDate Release date of this album.
* @param array $topTags An array of top tags of this album.
*
* @access public
*/
public function __construct($artist, $name, $id, $mbid, $url, array $images, $listeners, $playCount, $releaseDate, array $topTags)
{
parent::__construct($name, $mbid, $url, $images, $listeners, $playCount);
$this->artist = $artist;
$this->id = $id;
$this->releaseDate = $releaseDate;
$this->topTags = $topTags;
}
示例6: __construct
public function __construct($video_file_path, Config $config = null, ImageFormat $video_input_format = null, $ensure_image_file = true)
{
parent::__construct($video_file_path, $config, $video_input_format);
// validate this media file is a image file
if ($ensure_image_file === true && $this->_validateMedia('image') === false) {
throw new Exception('You cannot use an instance of ' . get_class($this) . ' for "' . $image_file_path . '" as the file is not a image file. It is reported to be a ' . $type);
}
}
示例7: __construct
/** Create an Artist object.
*
* @param string $name Name of this artist.
* @param string $mbid MusicBrainz ID of this artist.
* @param string $url Last.fm URL of this artist.
* @param array $images An array of cover art images of different sizes.
* @param boolean $streamable Is this artist streamable?
* @param integer $listeners Number of listeners of this artist.
* @param integer $playCount Play count of this artist.
* @param array $tags An array of tags of this artist.
* @param array $similar An array of similar artists.
* @param string $biography Biography of this artist.
* @param float $match Similarity value.
*
* @access public
*/
public function __construct($name, $mbid, $url, array $images, $streamable, $listeners, $playCount, array $tags, array $similar, $biography, $match)
{
parent::__construct($name, $mbid, $url, $images, $listeners, $playCount);
$this->streamable = $streamable;
$this->tags = $tags;
$this->similar = $similar;
$this->biography = $biography;
$this->match = $match;
}
示例8: __construct
public function __construct($object = null)
{
parent::__construct($object);
if ($object instanceof \stdClass) {
$this->setFile($object->file);
$this->setLastplayed($object->lastplayed);
$this->setPlot($object->plot);
}
}
示例9: __construct
public function __construct($path)
{
$this->kirby = kirby::instance();
if (is_a($path, 'Media')) {
parent::__construct($path->root(), $path->url());
} else {
parent::__construct(url::isAbsolute($path) ? null : $this->kirby->roots()->index() . DS . ltrim($path, DS), url::makeAbsolute($path));
}
}
示例10: __construct
public function __construct($video_file_path, Config $config = null, VideoFormat $video_input_format = null, $ensure_video_file = true)
{
parent::__construct($video_file_path, $config, $video_input_format);
// validate this media file is a video file
if ($ensure_video_file === true && $this->_validateMedia('video') === false) {
throw new Exception('You cannot use an instance of ' . get_class($this) . ' for "' . $video_file_path . '" as the file is not a video file. It is reported to be a ' . $type);
}
$this->_extracting_frames = false;
$this->_extracting_frame = false;
$this->_extracting_audio = false;
}
示例11: __construct
public function __construct(User $user)
{
// store the parent user object
$this->user = $user;
// this should rather be coming from the user object
$this->kirby = kirby::instance();
// try to find the avatar
if ($file = f::resolve($this->kirby->roots()->avatars() . DS . $user->username(), ['jpg', 'jpeg', 'gif', 'png'])) {
$filename = f::filename($file);
} else {
$filename = $user->username() . '.jpg';
$file = $this->kirby->roots()->avatars() . DS . $filename;
}
parent::__construct($file, $this->kirby->urls()->avatars() . '/' . $filename);
}
示例12: __construct
public function __construct($data = null, $mediaId = null, $type = null, $referenceId = null, $dimensions = null, $urls = null, $mimeType = null, $sourceUrl = null, $name = null, $fileSize = null, $creationTime = null, $MediaType = null)
{
parent::__construct();
$this->data = $data;
$this->mediaId = $mediaId;
$this->type = $type;
$this->referenceId = $referenceId;
$this->dimensions = $dimensions;
$this->urls = $urls;
$this->mimeType = $mimeType;
$this->sourceUrl = $sourceUrl;
$this->name = $name;
$this->fileSize = $fileSize;
$this->creationTime = $creationTime;
$this->MediaType = $MediaType;
}
示例13: __construct
public function __construct($durationMillis = null, $streamingUrl = null, $readyToPlayOnTheWeb = null, $mediaId = null, $type = null, $referenceId = null, $dimensions = null, $urls = null, $mimeType = null, $sourceUrl = null, $name = null, $fileSize = null, $creationTime = null, $MediaType = null)
{
parent::__construct();
$this->durationMillis = $durationMillis;
$this->streamingUrl = $streamingUrl;
$this->readyToPlayOnTheWeb = $readyToPlayOnTheWeb;
$this->mediaId = $mediaId;
$this->type = $type;
$this->referenceId = $referenceId;
$this->dimensions = $dimensions;
$this->urls = $urls;
$this->mimeType = $mimeType;
$this->sourceUrl = $sourceUrl;
$this->name = $name;
$this->fileSize = $fileSize;
$this->creationTime = $creationTime;
$this->MediaType = $MediaType;
}
示例14: __construct
public function __construct($durationMillis = null, $streamingUrl = null, $readyToPlayOnTheWeb = null, $industryStandardCommercialIdentifier = null, $advertisingId = null, $youTubeVideoIdString = null, $mediaId = null, $type = null, $referenceId = null, $dimensions = null, $urls = null, $mimeType = null, $sourceUrl = null, $name = null, $fileSize = null, $creationTime = null, $MediaType = null)
{
parent::__construct();
$this->durationMillis = $durationMillis;
$this->streamingUrl = $streamingUrl;
$this->readyToPlayOnTheWeb = $readyToPlayOnTheWeb;
$this->industryStandardCommercialIdentifier = $industryStandardCommercialIdentifier;
$this->advertisingId = $advertisingId;
$this->youTubeVideoIdString = $youTubeVideoIdString;
$this->mediaId = $mediaId;
$this->type = $type;
$this->referenceId = $referenceId;
$this->dimensions = $dimensions;
$this->urls = $urls;
$this->mimeType = $mimeType;
$this->sourceUrl = $sourceUrl;
$this->name = $name;
$this->fileSize = $fileSize;
$this->creationTime = $creationTime;
$this->MediaType = $MediaType;
}
示例15: __construct
/** Create an album object.
*
* @param mixed $artist An artist object or string.
* @param mixed $album An album object or string.
* @param string $name Name of this track.
* @param string $mbid MusicBrainz ID of this track.
* @param string $url Last.fm URL of this track.
* @param array $images An array of cover art images of different sizes.
* @param integer $listeners Number of listeners of this track.
* @param integer $playCount Play count of this album.
* @param integer $duration Duration of this track.
* @param array $topTags An array of top tags of this track.
* @param integer $id ID of this track.
* @param string $location Location of this track.
* @param boolean $streamable Track is streamable.
* @param boolean $fullTrack Track is a full streamable track.
* @param string $wiki Wiki data of this track.
* @param integer $lastPlayed When this track was last played.
*
* @access public
*/
public function __construct($artist, $album, $name, $mbid, $url, array $images, $listeners, $playCount, $duration, array $topTags, $id, $location, $streamable, $fullTrack, $wiki, $lastPlayed)
{
parent::__construct($name, $mbid, $url, $images, $listeners, $playCount);
$this->artist = $artist;
$this->album = $album;
$this->duration = $duration;
$this->topTags = $topTags;
$this->id = $id;
$this->location = $location;
$this->streamable = $streamable;
$this->fullTrack = $fullTrack;
$this->wiki = $wiki;
$this->lastPlayed = $lastPlayed;
}