Exemple #1
0
 /** @public-command-method */
 public function updateFrequency($oldTags, $newTags)
 {
     $oldTags = ArrayHelper::string2array($oldTags);
     $newTags = ArrayHelper::string2array($newTags);
     /*
     		array_values() returns all the values from the array and indexes the array numerically.
     		input:  array("size" => "XL", "color" => "gold");
     		output: Array ( [0] => XL , [1] => gold)
     */
     $this->addTags(array_values(array_diff($newTags, $oldTags)));
     $this->removeTags(array_values(array_diff($oldTags, $newTags)));
 }
Exemple #2
0
 public function getTags()
 {
     $tag_arr = ArrayHelper::string2array($this->tag);
     $processed = str_replace(Illust::uniqueTagPrefix, '', $tag_arr);
     return $processed;
 }
Exemple #3
0
 public function getFirstImgSrc()
 {
     $tag_arr = ArrayHelper::string2array($this->thumbnail_src);
     if (count($tag_arr) > 0) {
         return $tag_arr[0];
     } else {
         return null;
     }
 }