-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #290 from N0D4N/more-info-on-favorites
More info on user's favorites
- Loading branch information
Showing
6 changed files
with
188 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
|
||
namespace Jikan\Model\User; | ||
|
||
/** | ||
* Class FavoriteAnime | ||
* | ||
* @package Jikan\Model\User | ||
*/ | ||
class FavoriteAnime extends FavoriteListEntry | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?php | ||
|
||
|
||
namespace Jikan\Model\User; | ||
|
||
use Jikan\Model\Common\ItemMeta; | ||
use Jikan\Model\Common\MalUrl; | ||
|
||
/** | ||
* Class FavoriteCharacter | ||
* | ||
* @package Jikan\Model\User | ||
*/ | ||
class FavoriteCharacter extends ItemMeta | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $titleName; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $titleUrl; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $titleType; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $titleMalId; | ||
|
||
|
||
/** | ||
* FavoriteCharacter constructor. | ||
* | ||
* @param string $name | ||
* @param string $url | ||
* @param string $imageUrl | ||
* @param MalUrl $malUrl | ||
*/ | ||
public function __construct(string $name, string $url, string $imageUrl, MalUrl $malUrl) | ||
{ | ||
parent::__construct($name, $url, $imageUrl); | ||
$this->titleName = $malUrl->getTitle(); | ||
$this->titleUrl = $malUrl->getUrl(); | ||
$this->titleType = $malUrl->getType(); | ||
$this->titleMalId = $malUrl->getMalId(); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitleUrl(): string | ||
{ | ||
return $this->titleUrl; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitleName(): string | ||
{ | ||
return $this->titleName; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitleType(): string | ||
{ | ||
return $this->titleType; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getTitleMalId(): int | ||
{ | ||
return $this->titleMalId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace Jikan\Model\User; | ||
|
||
use Jikan\Model\Common\ItemMeta; | ||
|
||
/** | ||
* Class FavoriteListEntry | ||
* | ||
* @package Jikan\Model\User | ||
*/ | ||
class FavoriteListEntry extends ItemMeta | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $type; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
private $startYear; | ||
|
||
/** | ||
* FavoriteListEntry constructor. | ||
* @param string $name | ||
* @param string $url | ||
* @param string $imageUrl | ||
* @param string $typeAndYear | ||
*/ | ||
public function __construct(string $name, string $url, string $imageUrl, string $typeAndYear) | ||
{ | ||
parent::__construct($name, $url, $imageUrl); | ||
$typeAndYearArr = explode("·", $typeAndYear); | ||
$this->type = trim($typeAndYearArr[0]); | ||
$this->startYear = (int) trim($typeAndYearArr[1]); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getEntityType(): string | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getStartYear(): int | ||
{ | ||
return $this->startYear; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
|
||
namespace Jikan\Model\User; | ||
|
||
/** | ||
* Class FavoriteManga | ||
* | ||
* @package Jikan\Model\User | ||
*/ | ||
class FavoriteManga extends FavoriteListEntry | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters