diff options
Diffstat (limited to 'app/class/optlist.php')
-rw-r--r-- | app/class/optlist.php | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/app/class/optlist.php b/app/class/optlist.php new file mode 100644 index 0000000..cf68fa7 --- /dev/null +++ b/app/class/optlist.php @@ -0,0 +1,114 @@ +<?php + +class Optlist extends Opt +{ + private $description = 0; + private $thumbnail = 0; + private $date = 0; + private $author = 0; + private $style = 0; + + + /** + * New constructor dedicated to parse input string + * + * @param string|array $parsedstring parsed query string + */ + public function __construct($datas = []) + { + if(is_string($datas)) { + $datas = parse_str($this->options, $datas); + + } + $this->hydrate($datas); + } + + + /** + * Get the query as http string + * + * @return string The resulted query + */ + public function getquery() : string + { + $class = get_class_vars(get_class($this)); + $object = get_object_vars($this); + $class['artvarlist'] = $object['artvarlist']; + $class['taglist'] = $object['taglist']; + $class['authorlist'] = $object['authorlist']; + $query = array_diff_assoc_recursive($object, $class); + + return urldecode(http_build_query($query)); + } + + /** + * Get the code to insert directly + */ + public function getcode() : string + { + return '%LIST?' . $this->getquery() . '%'; + } + + + + // _______________________________________ G E T _____________________________________ + + + public function description() + { + return $this->description; + } + + public function thumbnail() + { + return $this->thumbnail; + } + + public function date() + { + return $this->date; + } + + public function author() + { + return $this->author; + } + + public function style() + { + return $this->style; + } + + + + // _______________________________________ S E T _____________________________________ + + public function setdescription($description) + { + $this->description = intval($description); + } + + public function setthumbnail($thumbnail) + { + $this->thumbnail = intval($thumbnail); + } + + public function setdate($date) + { + $this->date = intval($date); + } + + public function setauthor($author) + { + $this->author = intval($author); + } + + public function setstyle($style) + { + $this->style = intval($style); + } +} + + + +?>
\ No newline at end of file |