本文整理匯總了PHP中DAOFactory::getVideoTypeDAO方法的典型用法代碼示例。如果您正苦於以下問題:PHP DAOFactory::getVideoTypeDAO方法的具體用法?PHP DAOFactory::getVideoTypeDAO怎麽用?PHP DAOFactory::getVideoTypeDAO使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DAOFactory
的用法示例。
在下文中一共展示了DAOFactory::getVideoTypeDAO方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fillVideo
public static function fillVideo(Video $video)
{
$videoType = DAOFactory::getVideoTypeDAO()->findById($video->getType());
$videoTypeName = $videoType->getName() . 'Filler';
$filler = new $videoTypeName($video);
$video = $filler->getVideoTO();
$video->setType($videoType->getName());
return $video;
}
示例2: detect
public function detect($url)
{
$host = parse_url($this->url, PHP_URL_HOST);
$videoTypes = DAOFactory::getVideoTypeDAO()->findAll();
foreach ($videoTypes as $type) {
if (stristr($host, $type->getName())) {
$this->type = $type;
$this->initializeService();
break;
}
}
// what if video is not of recognizable type?
// exception?
}