Add mix lookup, genre support, DJ enhancements.
This commit is contained in:
parent
2957dc0e46
commit
db1d26e122
11 changed files with 741 additions and 181 deletions
|
@ -3,9 +3,9 @@
|
|||
class Genre
|
||||
{
|
||||
|
||||
private $id = "" ;
|
||||
private $id = -1 ;
|
||||
private $enabled = "";
|
||||
private $count = "";
|
||||
private $count = 0;
|
||||
private $name = "";
|
||||
private $slug = "";
|
||||
private $db = "";
|
||||
|
@ -13,25 +13,15 @@ class Genre
|
|||
public function __construct($value, $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
if (intval($value)) {
|
||||
$this->id = $value;
|
||||
if ($this->load_by_id()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ctype_digit((string)$value)) {
|
||||
$this->id = (int)$value;
|
||||
return $this->load_by_id();
|
||||
} else {
|
||||
$this->slug = $value;
|
||||
if ($this->load_by_slug()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return $this->load_by_slug();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function load_by_id(): bool
|
||||
{
|
||||
$genre = $this->get_genre_by_id();
|
||||
|
@ -98,5 +88,14 @@ class Genre
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
public function get_img(): string
|
||||
{
|
||||
return "img/no-image1.png";
|
||||
}
|
||||
|
||||
public function get_count(): int
|
||||
{
|
||||
return $this->count;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue