| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function generate(): Activity |
||
| 31 | { |
||
| 32 | $iri = $this->generateIri( |
||
| 33 | WEB_PATH, |
||
| 34 | 'xapi/portfolio/', |
||
| 35 | [ |
||
| 36 | 'user' => $this->category->getUser()->getId(), |
||
| 37 | 'category' => $this->category->getId(), |
||
| 38 | ] |
||
| 39 | ); |
||
| 40 | |||
| 41 | $langIso = api_get_language_isocode(); |
||
| 42 | |||
| 43 | $categoryDescription = $this->category->getDescription(); |
||
| 44 | |||
| 45 | $definitionDescription = $categoryDescription |
||
| 46 | ? LanguageMap::create([$langIso => $categoryDescription]) |
||
| 47 | : null; |
||
| 48 | |||
| 49 | return new Activity( |
||
| 50 | IRI::fromString($iri), |
||
| 51 | new Definition( |
||
| 52 | LanguageMap::create([$langIso => $this->category->getTitle()]), |
||
| 53 | $definitionDescription, |
||
| 54 | IRI::fromString('http://id.tincanapi.com/activitytype/category') |
||
| 55 | ) |
||
| 59 |