Ejemplo n.º 1
0
 private function getCredentialFromSpecialization($details)
 {
     $credential = new Credential();
     $credential->setName($details['name']);
     $credential->setPricePeriod(Credential::CREDENTIAL_PRICE_PERIOD_TOTAL);
     $credential->setPrice(0);
     $credential->setSlug($details['short_name'] . '-specialization');
     $credential->setInitiative($this->initiative);
     $credential->setUrl(sprintf(self::SPECIALIZATION_PAGE_URL, $details['short_name'], $details['id']));
     $credential->setOneLiner($details['subhead']);
     // Add the institutions
     foreach ($details['universities'] as $university) {
         $ins = $this->dbHelper->getInstitutionBySlug($university['short_name']);
         if ($ins) {
             $credential->addInstitution($ins);
         } else {
             $this->out("University Not Found - " . $university['name']);
         }
     }
     // Add the courses
     foreach ($details['topics'] as $topic) {
         $course = $this->dbHelper->getCourseByShortName('coursera_' . $topic['short_name']);
         if ($course) {
             $credential->addCourse($course);
         } else {
             $this->out("Course Not Found - " . $topic['name']);
         }
     }
     // Get Description
     $credential->setDescription($details['byline']);
     return $credential;
 }
Ejemplo n.º 2
0
 public function getCredential($xseries)
 {
     $credential = new Credential();
     $credential->setName($xseries['title']);
     $credential->setPricePeriod(Credential::CREDENTIAL_PRICE_PERIOD_TOTAL);
     $credential->setPrice(0);
     $credential->setSlug(UniversalHelper::getSlug($credential->getName()) . '-xseries');
     $credential->setInitiative($this->initiative);
     $credential->setUrl($xseries['url']);
     $credential->setOneLiner($xseries['field_xseries_subtitle']);
     $credential->setSubTitle($xseries['field_xseries_subtitle_short']);
     $credential->setDescription($xseries['body']['value'] . $xseries['field_xseries_overview']['value']);
     return $credential;
 }
Ejemplo n.º 3
0
 public function getCredentialFromNanodegree($nanodegree)
 {
     $credential = new Credential();
     $credential->setName($nanodegree['title']);
     $credential->setPricePeriod(Credential::CREDENTIAL_PRICE_PERIOD_MONTHLY);
     $credential->setPrice(200);
     $credential->setSlug($nanodegree['slug']);
     $credential->setInitiative($this->initiative);
     $credential->setUrl($nanodegree['homepage']);
     $credential->setOneLiner($nanodegree['short_summary']);
     $credential->setSubTitle($nanodegree['subtitle']);
     $credential->setWorkloadMax(10);
     $credential->setWorkloadMin(10);
     $credential->setWorkloadType(Credential::CREDENTIAL_WORKLOAD_TYPE_HOURS_PER_WEEK);
     $credential->setDurationMax($nanodegree['expected_duration']);
     $credential->setDurationMin($nanodegree['expected_duration']);
     // Collect the description
     $summary = $nanodegree['summary'];
     $expectedLearning = $nanodegree['expected_learning'];
     $requiredKnowledge = $nanodegree['required_knowledge'];
     $credential->setDescription("<p>{$summary}</p>" . "<h3 class='table-tab-content__title'>Why Take This Nanodegree?</h3>" . "<p>{$expectedLearning}</p>" . "<h3 class='table-tab-content__title'>Required Knowledge</h3>" . "<p>{$requiredKnowledge}</p>");
     return $credential;
 }