예제 #1
0
 public function includeThemeUpdates(SiteState $siteState)
 {
     return $this->collection($this->filterUpdates($siteState->getSiteUpdates(), SiteUpdate::TYPE_THEME), $this->transformers->get(SiteUpdate::class));
 }
예제 #2
0
 /**
  * @param SiteState       $state
  * @param SiteStateResult $result
  *
  * @return SiteUpdate[]
  */
 private function getUpdates(SiteState $state, SiteStateResult $result)
 {
     if (!$result->updates) {
         return [];
     }
     $existingUpdates = $state->getSiteUpdates();
     $updates = [];
     foreach ($result->updates as $slug => $updateData) {
         if (isset($existingUpdates[$slug])) {
             $update = $existingUpdates[$slug];
         } else {
             $update = new SiteUpdate($state, $slug);
         }
         $update->setType($updateData->type)->setName($updateData->name)->setProject($updateData->project)->setPackage($updateData->package)->setExistingVersion($updateData->existingVersion)->setRecommendedVersion($updateData->recommendedVersion)->setRecommendedDownloadLink($updateData->recommendedDownloadLink)->setStatus($updateData->status)->setIncludes($updateData->includes)->setEnabled($updateData->enabled)->setBaseThemes($updateData->baseThemes)->setSubThemes($updateData->subThemes);
         $updates[$slug] = $update;
     }
     return $updates;
 }