当前位置: 首页>>代码示例>>PHP>>正文


PHP Release::getAllReleasesForProject方法代码示例

本文整理汇总了PHP中Release::getAllReleasesForProject方法的典型用法代码示例。如果您正苦于以下问题:PHP Release::getAllReleasesForProject方法的具体用法?PHP Release::getAllReleasesForProject怎么用?PHP Release::getAllReleasesForProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Release的用法示例。


在下文中一共展示了Release::getAllReleasesForProject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(Project $project, $forceDisplay = false)
 {
     $image = new Image('images/series/' . $project->getID() . '.jpg');
     $image->setClass('projectPicture');
     $this->addComponent($image);
     $this->addComponent(new Title("Informations générales", 2));
     if ($project->hasExternalSource()) {
         $subtitle = new Title("Source : ", 4);
         $subtitle->addComponent($project->getExternalSource());
         $this->addComponent($subtitle);
     }
     $array = array(array("Titre Original", $project->getOriginalName()), array("Site officiel", $project->getOfficialWebsite()), array("Année de production", $project->getAiringYear()), array("Studio", $project->getStudio()), array("Auteur", $project->getAuthor()), array("Genre", $project->getGenre()), array("Synopsis", $project->getSynopsis()), array("Coproduction", $project->getCoproduction()), array("Vosta", $project->getVosta()));
     $infos = new SimpleTextComponent();
     $infos->setClass('projectInfos');
     foreach ($array as $data) {
         if ($data[1] !== null) {
             $text = new SimpleTextComponent("<b>" . $data[0] . "</b> ");
             $text->addComponent($data[1]);
             $infos->addLine($text);
         }
     }
     $this->addComponent($infos);
     if ($project->getComment() !== null) {
         $this->addComponent("<p></p>");
         $this->addComponent(new Title("Commentaire", 2));
         $this->addComponent(Format::convertTextToHtml($project->getComment()));
     }
     $this->addComponent("<p></p>");
     $link = Link::newWindowLink("http://zero.xooit.fr/t471-Liens-morts.htm", "Signaler un lien mort");
     $link->setClass('deadLinks');
     $this->addComponent($link);
     $this->addComponent("<p></p>");
     $this->addComponent(new Title($project->isDoujin() ? "Chapitres" : "Épisodes", 2));
     $releases = Release::getAllReleasesForProject($project->getID());
     usort($releases, array('Release', 'idSorter'));
     $list = new SimpleListComponent();
     $list->setClass("releaseList");
     foreach ($releases as $release) {
         $list->addComponent(new ReleaseComponent($release, $forceDisplay));
     }
     $this->addComponent($list);
     $linkedProjects = Project::getProjectsLinkedTo($project);
     if (!empty($linkedProjects)) {
         $this->addComponent("<p></p>");
         $this->addComponent(new Title("Voir aussi", 2));
         $list = new ProjectList();
         foreach ($linkedProjects as $link) {
             $list->addProject($link);
         }
         $list->sortByNames();
         $list = new ProjectListComponent($list);
         $list->useImage(true);
         $this->addComponent($list);
     }
     foreach ($project->getBonuses() as $bonus) {
         $this->addComponent("<p></p>");
         $this->addComponent(new Title("Bonus : " . $bonus->getTitle(), 2));
         $this->addComponent($bonus->getContent());
     }
     $groups = ProjectGroup::getGroupsForProject($project);
     foreach ($groups as $group) {
         foreach ($group->getBonuses() as $bonus) {
             $this->addComponent("<p></p>");
             $this->addComponent(new Title("Bonus : " . $bonus->getTitle(), 2));
             $this->addComponent($bonus->getContent());
         }
     }
     $this->addComponent("<p></p>");
     $url = $project->getDiscussionUrl();
     if ($url == null) {
         $url = new Url("http://zero.xooit.fr/posting.php?mode=reply&t=120");
     }
     $link = Link::newWindowLink($url, new Image("images/interface/avis.png", "Donne ton avis sur le forum !"));
     $link->setClass('discussionLink');
     $this->addComponent($link);
 }
开发者ID:KasaiDot,项目名称:Zero-Fansub-website,代码行数:76,代码来源:ProjectComponent.php

示例2: getRelease

 public static function getRelease($projectId, $releaseId)
 {
     foreach (Release::getAllReleasesForProject($projectId) as $release) {
         if ($release->getID() === $releaseId) {
             return $release;
         }
     }
     $project = Project::getProject($projectId);
     throw new Exception($releaseId . " is not a known release ID for " . $project->getName() . ".");
 }
开发者ID:KasaiDot,项目名称:Zero-Fansub-website,代码行数:10,代码来源:Release.php


注:本文中的Release::getAllReleasesForProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。