repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1 value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
rl404/MAL-Scraper | src/MalScraper/Helper/Helper.php | Helper.imageUrlCleaner | public static function imageUrlCleaner($str)
{
preg_match('/(questionmark)|(qm_50)/', $str, $temp_image);
$str = $temp_image ? '' : $str;
$str = str_replace(['v.jpg', 't.jpg'], '.jpg', $str);
$str = str_replace('_thumb.jpg', '.jpg', $str);
$str = str_replace('userimages/thumbs', 'userimages', $str);
$str = preg_replace('/r\/\d{1,3}x\d{1,3}\//', '', $str);
$str = preg_replace('/\?.+/', '', $str);
return $str;
} | php | public static function imageUrlCleaner($str)
{
preg_match('/(questionmark)|(qm_50)/', $str, $temp_image);
$str = $temp_image ? '' : $str;
$str = str_replace(['v.jpg', 't.jpg'], '.jpg', $str);
$str = str_replace('_thumb.jpg', '.jpg', $str);
$str = str_replace('userimages/thumbs', 'userimages', $str);
$str = preg_replace('/r\/\d{1,3}x\d{1,3}\//', '', $str);
$str = preg_replace('/\?.+/', '', $str);
return $str;
} | [
"public",
"static",
"function",
"imageUrlCleaner",
"(",
"$",
"str",
")",
"{",
"preg_match",
"(",
"'/(questionmark)|(qm_50)/'",
",",
"$",
"str",
",",
"$",
"temp_image",
")",
";",
"$",
"str",
"=",
"$",
"temp_image",
"?",
"''",
":",
"$",
"str",
";",
"$",
... | Clean image URL.
@param string $str
@return string | [
"Clean",
"image",
"URL",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Helper/Helper.php#L150-L161 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Top/TopCharacterModel.php | TopCharacterModel.getEachRole | private function getEachRole($a)
{
$r = [];
$link = $a->find('a', 0);
$id = explode('/', $link->href);
$r['id'] = $id[4];
$r['title'] = $link->plaintext;
return $r;
} | php | private function getEachRole($a)
{
$r = [];
$link = $a->find('a', 0);
$id = explode('/', $link->href);
$r['id'] = $id[4];
$r['title'] = $link->plaintext;
return $r;
} | [
"private",
"function",
"getEachRole",
"(",
"$",
"a",
")",
"{",
"$",
"r",
"=",
"[",
"]",
";",
"$",
"link",
"=",
"$",
"a",
"->",
"find",
"(",
"'a'",
",",
"0",
")",
";",
"$",
"id",
"=",
"explode",
"(",
"'/'",
",",
"$",
"link",
"->",
"href",
")... | Get each role.
@param \simplehtmldom_1_5\simple_html_dom $a
@return array | [
"Get",
"each",
"role",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Top/TopCharacterModel.php#L158-L167 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Additional/StatModel.php | StatModel.getScoreVote | private function getScoreVote($each_score)
{
$vote = $each_score->find('td', 1)->find('span small', 0)->plaintext;
$vote = substr($vote, 1, strlen($vote) - 2);
return str_replace(' votes', '', $vote);
} | php | private function getScoreVote($each_score)
{
$vote = $each_score->find('td', 1)->find('span small', 0)->plaintext;
$vote = substr($vote, 1, strlen($vote) - 2);
return str_replace(' votes', '', $vote);
} | [
"private",
"function",
"getScoreVote",
"(",
"$",
"each_score",
")",
"{",
"$",
"vote",
"=",
"$",
"each_score",
"->",
"find",
"(",
"'td'",
",",
"1",
")",
"->",
"find",
"(",
"'span small'",
",",
"0",
")",
"->",
"plaintext",
";",
"$",
"vote",
"=",
"subst... | Get score vote.
@param \simplehtmldom_1_5\simple_html_dom $each_score
@return string | [
"Get",
"score",
"vote",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Additional/StatModel.php#L157-L163 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Additional/StatModel.php | StatModel.getScorePercent | private function getScorePercent($each_score)
{
$temp_vote = $each_score->find('td', 1)->find('span small', 0)->plaintext;
$percent = $each_score->find('td', 1)->find('span', 0)->plaintext;
$percent = str_replace([$temp_vote, '%', "\xc2\xa0"], '', $percent);
return trim($percent);
} | php | private function getScorePercent($each_score)
{
$temp_vote = $each_score->find('td', 1)->find('span small', 0)->plaintext;
$percent = $each_score->find('td', 1)->find('span', 0)->plaintext;
$percent = str_replace([$temp_vote, '%', "\xc2\xa0"], '', $percent);
return trim($percent);
} | [
"private",
"function",
"getScorePercent",
"(",
"$",
"each_score",
")",
"{",
"$",
"temp_vote",
"=",
"$",
"each_score",
"->",
"find",
"(",
"'td'",
",",
"1",
")",
"->",
"find",
"(",
"'span small'",
",",
"0",
")",
"->",
"plaintext",
";",
"$",
"percent",
"=... | Get score percent.
@param \simplehtmldom_1_5\simple_html_dom $each_score
@return string | [
"Get",
"score",
"percent",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Additional/StatModel.php#L172-L179 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Additional/StatModel.php | StatModel.getUserProgress | private function getUserProgress($each_user, $count = 3)
{
$progress = $each_user->find('td', $count)->plaintext;
return str_replace(' ', '', $progress);
} | php | private function getUserProgress($each_user, $count = 3)
{
$progress = $each_user->find('td', $count)->plaintext;
return str_replace(' ', '', $progress);
} | [
"private",
"function",
"getUserProgress",
"(",
"$",
"each_user",
",",
"$",
"count",
"=",
"3",
")",
"{",
"$",
"progress",
"=",
"$",
"each_user",
"->",
"find",
"(",
"'td'",
",",
"$",
"count",
")",
"->",
"plaintext",
";",
"return",
"str_replace",
"(",
"' ... | Get user progress.
@param \simplehtmldom_1_5\simple_html_dom $each_user
@param int $count
@return string | [
"Get",
"user",
"progress",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Additional/StatModel.php#L280-L285 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getNickname | private function getNickname()
{
$nickname = $this->_parser->find('h1', 0)->plaintext;
$nickname = trim(preg_replace('/\s+/', ' ', $nickname));
preg_match('/\"([^"])*/', $nickname, $nick);
if ($nick) {
return substr($nick[0], 1, strlen($nick[0]) - 2);
}
return '';
} | php | private function getNickname()
{
$nickname = $this->_parser->find('h1', 0)->plaintext;
$nickname = trim(preg_replace('/\s+/', ' ', $nickname));
preg_match('/\"([^"])*/', $nickname, $nick);
if ($nick) {
return substr($nick[0], 1, strlen($nick[0]) - 2);
}
return '';
} | [
"private",
"function",
"getNickname",
"(",
")",
"{",
"$",
"nickname",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'h1'",
",",
"0",
")",
"->",
"plaintext",
";",
"$",
"nickname",
"=",
"trim",
"(",
"preg_replace",
"(",
"'/\\s+/'",
",",
"' '",
... | Get character image.
@return string | [
"Get",
"character",
"image",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L82-L92 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getName | private function getName($isKanji = false)
{
$html = $this->_parser->find('#content table tr', 0);
$html = $html->find('td', 0)->next_sibling()->find('div[class=normal_header]', 0);
$name_kanji = $html->find('small', 0);
$name_kanji = $name_kanji ? $name_kanji->plaintext : '';
if ($isKanji) {
return preg_replace('/(\(|\))/', '', $name_kanji);
}
return trim(str_replace($name_kanji, '', $html->plaintext));
} | php | private function getName($isKanji = false)
{
$html = $this->_parser->find('#content table tr', 0);
$html = $html->find('td', 0)->next_sibling()->find('div[class=normal_header]', 0);
$name_kanji = $html->find('small', 0);
$name_kanji = $name_kanji ? $name_kanji->plaintext : '';
if ($isKanji) {
return preg_replace('/(\(|\))/', '', $name_kanji);
}
return trim(str_replace($name_kanji, '', $html->plaintext));
} | [
"private",
"function",
"getName",
"(",
"$",
"isKanji",
"=",
"false",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
";",
"$",
"html",
"=",
"$",
"html",
"->",
"find",
"(",
"'td'",
"... | Get character name.
@param bool $isKanji
@return string | [
"Get",
"character",
"name",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L101-L114 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getFavorite | private function getFavorite()
{
$favorite = $this->_parser->find('#content table tr', 0)->find('td', 0)->plaintext;
preg_match('/(Member Favorites: ).+/', $favorite, $parsed_favorite);
$favorite = trim($parsed_favorite[0]);
$parsed_favorite = explode(': ', $favorite);
return str_replace(',', '', $parsed_favorite[1]);
} | php | private function getFavorite()
{
$favorite = $this->_parser->find('#content table tr', 0)->find('td', 0)->plaintext;
preg_match('/(Member Favorites: ).+/', $favorite, $parsed_favorite);
$favorite = trim($parsed_favorite[0]);
$parsed_favorite = explode(': ', $favorite);
return str_replace(',', '', $parsed_favorite[1]);
} | [
"private",
"function",
"getFavorite",
"(",
")",
"{",
"$",
"favorite",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",
"0",
")",
"->",
"plaintext",
";",
"preg_match",
"(",
"'/(M... | Get number of user who favorite the character.
@return string | [
"Get",
"number",
"of",
"user",
"who",
"favorite",
"the",
"character",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L121-L129 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getAbout | private function getAbout()
{
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
preg_match('/(<div class="normal_header" style="height: 15px;">).*(<div class="normal_header">)/', $html, $about);
$html = $html->find('div[class=normal_header]', 0);
$about = str_replace($html->outertext, '', $about[0]);
$about = str_replace('<div class="normal_header">', '', $about);
preg_match('/(No biography written)/', $about, $temp_about);
if (!$temp_about) {
$about = str_replace(['<br>', '<br />', ' '], ["\n", "\n", ' '], $about);
$about = strip_tags($about);
return preg_replace('/\n[^\S\n]*/', "\n", $about);
} else {
return;
}
} | php | private function getAbout()
{
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
preg_match('/(<div class="normal_header" style="height: 15px;">).*(<div class="normal_header">)/', $html, $about);
$html = $html->find('div[class=normal_header]', 0);
$about = str_replace($html->outertext, '', $about[0]);
$about = str_replace('<div class="normal_header">', '', $about);
preg_match('/(No biography written)/', $about, $temp_about);
if (!$temp_about) {
$about = str_replace(['<br>', '<br />', ' '], ["\n", "\n", ' '], $about);
$about = strip_tags($about);
return preg_replace('/\n[^\S\n]*/', "\n", $about);
} else {
return;
}
} | [
"private",
"function",
"getAbout",
"(",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",
"0",
")",
"->",
"next_sibling",
"(",
")",
";",
"preg_match",
"(... | Get character about.
@return string | [
"Get",
"character",
"about",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L136-L155 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getVa | private function getVa()
{
$va = [];
$va_index = 0;
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
$va_area = $html->find('div[class=normal_header]', 1)->next_sibling();
if ($va_area->tag == 'table') {
while (true) {
$va_name_area = $va_area->find('td', 1);
$va[$va_index]['id'] = $this->getVaId($va_name_area);
$va[$va_index]['name'] = $this->getVaName($va_name_area);
$va[$va_index]['role'] = $this->getVaRole($va_name_area);
$va[$va_index]['image'] = $this->getVaImage($va_area);
$va_area = $va_area->next_sibling();
if ($va_area->tag != 'table') {
break;
} else {
$va_index++;
}
}
}
return $va;
} | php | private function getVa()
{
$va = [];
$va_index = 0;
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
$va_area = $html->find('div[class=normal_header]', 1)->next_sibling();
if ($va_area->tag == 'table') {
while (true) {
$va_name_area = $va_area->find('td', 1);
$va[$va_index]['id'] = $this->getVaId($va_name_area);
$va[$va_index]['name'] = $this->getVaName($va_name_area);
$va[$va_index]['role'] = $this->getVaRole($va_name_area);
$va[$va_index]['image'] = $this->getVaImage($va_area);
$va_area = $va_area->next_sibling();
if ($va_area->tag != 'table') {
break;
} else {
$va_index++;
}
}
}
return $va;
} | [
"private",
"function",
"getVa",
"(",
")",
"{",
"$",
"va",
"=",
"[",
"]",
";",
"$",
"va_index",
"=",
"0",
";",
"$",
"html",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",... | Get character voice actor list.
@return array | [
"Get",
"character",
"voice",
"actor",
"list",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L194-L218 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getVaId | private function getVaId($va_name_area)
{
$va_id = $va_name_area->find('a', 0)->href;
$parsed_va_id = explode('/', $va_id);
return $parsed_va_id[4];
} | php | private function getVaId($va_name_area)
{
$va_id = $va_name_area->find('a', 0)->href;
$parsed_va_id = explode('/', $va_id);
return $parsed_va_id[4];
} | [
"private",
"function",
"getVaId",
"(",
"$",
"va_name_area",
")",
"{",
"$",
"va_id",
"=",
"$",
"va_name_area",
"->",
"find",
"(",
"'a'",
",",
"0",
")",
"->",
"href",
";",
"$",
"parsed_va_id",
"=",
"explode",
"(",
"'/'",
",",
"$",
"va_id",
")",
";",
... | Get Va Id.
@param \simplehtmldom_1_5\simple_html_dom $va_name_area
@return string | [
"Get",
"Va",
"Id",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L227-L233 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/CharacterModel.php | CharacterModel.getAllInfo | private function getAllInfo()
{
$data = [
'id' => $this->getId(),
'image' => $this->getImage(),
'nickname' => $this->getNickname(),
'name' => $this->getName(),
'name_kanji' => $this->getName(true),
'favorite' => $this->getFavorite(),
'about' => $this->getAbout(),
'animeography' => $this->getMedia('anime'),
'mangaography' => $this->getMedia('manga'),
'va' => $this->getVa(),
];
return $data;
} | php | private function getAllInfo()
{
$data = [
'id' => $this->getId(),
'image' => $this->getImage(),
'nickname' => $this->getNickname(),
'name' => $this->getName(),
'name_kanji' => $this->getName(true),
'favorite' => $this->getFavorite(),
'about' => $this->getAbout(),
'animeography' => $this->getMedia('anime'),
'mangaography' => $this->getMedia('manga'),
'va' => $this->getVa(),
];
return $data;
} | [
"private",
"function",
"getAllInfo",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"'image'",
"=>",
"$",
"this",
"->",
"getImage",
"(",
")",
",",
"'nickname'",
"=>",
"$",
"this",
"->",
"getNickname",
... | Get character all information.
@return array | [
"Get",
"character",
"all",
"information",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/CharacterModel.php#L278-L294 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Additional/VideoModel.php | VideoModel.getEpisode | private function getEpisode()
{
$episode = [];
$episode_area = $this->_parser->find('.episode-video', 0);
if ($episode_area) {
foreach ($episode_area->find('.video-list-outer') as $v) {
$temp = [];
$link_area = $v->find('a', 0);
$temp['episode'] = $this->getEpisodeTitle($link_area, 0);
$temp['title'] = $this->getEpisodeTitle($link_area, 1);
$temp['link'] = $link_area->href;
$episode[] = $temp;
}
}
return $episode;
} | php | private function getEpisode()
{
$episode = [];
$episode_area = $this->_parser->find('.episode-video', 0);
if ($episode_area) {
foreach ($episode_area->find('.video-list-outer') as $v) {
$temp = [];
$link_area = $v->find('a', 0);
$temp['episode'] = $this->getEpisodeTitle($link_area, 0);
$temp['title'] = $this->getEpisodeTitle($link_area, 1);
$temp['link'] = $link_area->href;
$episode[] = $temp;
}
}
return $episode;
} | [
"private",
"function",
"getEpisode",
"(",
")",
"{",
"$",
"episode",
"=",
"[",
"]",
";",
"$",
"episode_area",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'.episode-video'",
",",
"0",
")",
";",
"if",
"(",
"$",
"episode_area",
")",
"{",
"fore... | Get anime episode.
@return array | [
"Get",
"anime",
"episode",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Additional/VideoModel.php#L97-L115 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Additional/VideoModel.php | VideoModel.getPromotion | private function getPromotion()
{
$promotion = [];
$promotion_area = $this->_parser->find('.promotional-video', 0);
if ($promotion_area) {
foreach ($promotion_area->find('.video-list-outer') as $v) {
$temp = [];
$link_area = $v->find('a', 0);
$temp['title'] = $this->getPromotionTitle($link_area);
$temp['link'] = $this->getPromotionLink($link_area);
$promotion[] = $temp;
}
}
return $promotion;
} | php | private function getPromotion()
{
$promotion = [];
$promotion_area = $this->_parser->find('.promotional-video', 0);
if ($promotion_area) {
foreach ($promotion_area->find('.video-list-outer') as $v) {
$temp = [];
$link_area = $v->find('a', 0);
$temp['title'] = $this->getPromotionTitle($link_area);
$temp['link'] = $this->getPromotionLink($link_area);
$promotion[] = $temp;
}
}
return $promotion;
} | [
"private",
"function",
"getPromotion",
"(",
")",
"{",
"$",
"promotion",
"=",
"[",
"]",
";",
"$",
"promotion_area",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'.promotional-video'",
",",
"0",
")",
";",
"if",
"(",
"$",
"promotion_area",
")",
... | Get anime promotion video.
@return array | [
"Get",
"anime",
"promotion",
"video",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Additional/VideoModel.php#L139-L156 | train |
rl404/MAL-Scraper | src/MalScraper/Model/Search/SearchCharacterPeopleModel.php | SearchCharacterPeopleModel.getNickname | private function getNickname($name_area)
{
$nickname = $name_area->find('small', 0);
return $nickname ? substr($nickname->plaintext, 1, strlen($nickname->plaintext) - 2) : '';
} | php | private function getNickname($name_area)
{
$nickname = $name_area->find('small', 0);
return $nickname ? substr($nickname->plaintext, 1, strlen($nickname->plaintext) - 2) : '';
} | [
"private",
"function",
"getNickname",
"(",
"$",
"name_area",
")",
"{",
"$",
"nickname",
"=",
"$",
"name_area",
"->",
"find",
"(",
"'small'",
",",
"0",
")",
";",
"return",
"$",
"nickname",
"?",
"substr",
"(",
"$",
"nickname",
"->",
"plaintext",
",",
"1"... | Get nickname.
@param \simplehtmldom_1_5\simple_html_dom $name_area
@return string | [
"Get",
"nickname",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/Search/SearchCharacterPeopleModel.php#L125-L130 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getImage | private function getImage()
{
$image = $this->_parser->find('#content table tr', 0)->find('td', 0)->find('img', 0);
return $image ? $image->src : '';
} | php | private function getImage()
{
$image = $this->_parser->find('#content table tr', 0)->find('td', 0)->find('img', 0);
return $image ? $image->src : '';
} | [
"private",
"function",
"getImage",
"(",
")",
"{",
"$",
"image",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",
"0",
")",
"->",
"find",
"(",
"'img'",
",",
"0",
")",
";",
... | Get people image.
@return string|bool | [
"Get",
"people",
"image",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L90-L95 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.setBiodata | private function setBiodata()
{
$html = $this->_parser->find('#content table tr', 0)->find('td', 0);
$biodata = $html->innertext;
$useless_biodata = '';
$useless_area = $html->find('div', 0);
for ($i = 0; $i < 4; $i++) {
$useless_biodata .= $useless_area->outertext;
$useless_area = $useless_area->next_sibling();
}
$biodata = str_replace($useless_biodata, '', $biodata);
$this->_biodata = preg_replace("/([\s])+/", ' ', $biodata);
} | php | private function setBiodata()
{
$html = $this->_parser->find('#content table tr', 0)->find('td', 0);
$biodata = $html->innertext;
$useless_biodata = '';
$useless_area = $html->find('div', 0);
for ($i = 0; $i < 4; $i++) {
$useless_biodata .= $useless_area->outertext;
$useless_area = $useless_area->next_sibling();
}
$biodata = str_replace($useless_biodata, '', $biodata);
$this->_biodata = preg_replace("/([\s])+/", ' ', $biodata);
} | [
"private",
"function",
"setBiodata",
"(",
")",
"{",
"$",
"html",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",
"0",
")",
";",
"$",
"biodata",
"=",
"$",
"html",
"->",
"inn... | Set people biodata.
@return void | [
"Set",
"people",
"biodata",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L102-L114 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getBiodata | private function getBiodata($type)
{
if ($type == 'Website') {
preg_match('/('.$type.":<\/span> <a)[^<]*/", $this->_biodata, $biodata);
if ($biodata) {
preg_match('/".+"/', $biodata[0], $biodata);
if ($biodata[0] != '"http://"') {
return str_replace('"', '', $biodata[0]);
}
}
}
preg_match('/('.$type.":<\/span>)[^<]*/", $this->_biodata, $biodata);
if ($biodata) {
$biodata = strip_tags($biodata[0]);
$biodata = explode(': ', $biodata);
$biodata = trim($biodata[1]);
if ($type == 'Alternate names') {
return explode(', ', $biodata);
}
if ($type == 'Member Favorites') {
return str_replace(',', '', $biodata);
}
return $biodata;
}
} | php | private function getBiodata($type)
{
if ($type == 'Website') {
preg_match('/('.$type.":<\/span> <a)[^<]*/", $this->_biodata, $biodata);
if ($biodata) {
preg_match('/".+"/', $biodata[0], $biodata);
if ($biodata[0] != '"http://"') {
return str_replace('"', '', $biodata[0]);
}
}
}
preg_match('/('.$type.":<\/span>)[^<]*/", $this->_biodata, $biodata);
if ($biodata) {
$biodata = strip_tags($biodata[0]);
$biodata = explode(': ', $biodata);
$biodata = trim($biodata[1]);
if ($type == 'Alternate names') {
return explode(', ', $biodata);
}
if ($type == 'Member Favorites') {
return str_replace(',', '', $biodata);
}
return $biodata;
}
} | [
"private",
"function",
"getBiodata",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"'Website'",
")",
"{",
"preg_match",
"(",
"'/('",
".",
"$",
"type",
".",
"\":<\\/span> <a)[^<]*/\"",
",",
"$",
"this",
"->",
"_biodata",
",",
"$",
"biodata",
... | Get people biodata.
@param string $type Biodata type
@return string|array | [
"Get",
"people",
"biodata",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L123-L152 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getMore | private function getMore()
{
$more = $this->_parser->find('#content table tr', 0)->find('td', 0);
$more = $more->find('div[class^=people-informantion-more]', 0)->plaintext;
return preg_replace('/\n[^\S\n]*/', "\n", $more);
} | php | private function getMore()
{
$more = $this->_parser->find('#content table tr', 0)->find('td', 0);
$more = $more->find('div[class^=people-informantion-more]', 0)->plaintext;
return preg_replace('/\n[^\S\n]*/', "\n", $more);
} | [
"private",
"function",
"getMore",
"(",
")",
"{",
"$",
"more",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",
"0",
")",
";",
"$",
"more",
"=",
"$",
"more",
"->",
"find",
... | Get people more information.
@return string | [
"Get",
"people",
"more",
"information",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L159-L165 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getVa | private function getVa()
{
$va = [];
$va_index = 0;
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
$va_area = $html->find('.normal_header', 0)->next_sibling();
if ($va_area->tag == 'table') {
if ($va_area->find('tr')) {
foreach ($va_area->find('tr') as $each_va) {
// anime
$anime_image_area = $each_va->find('td', 0);
$anime_area = $each_va->find('td', 1);
$va[$va_index]['anime']['image'] = $this->getAnimeImage($anime_image_area);
$va[$va_index]['anime']['id'] = $this->getAnimeId($anime_area);
$va[$va_index]['anime']['title'] = $this->getAnimeTitle($anime_area);
// character
$character_image_area = $each_va->find('td', 3);
$character_area = $each_va->find('td', 2);
$va[$va_index]['character']['image'] = $this->getAnimeImage($character_image_area);
$va[$va_index]['character']['id'] = $this->getAnimeId($character_area);
$va[$va_index]['character']['name'] = $this->getAnimeTitle($character_area);
$va[$va_index]['character']['role'] = $this->getAnimeRole($character_area);
$va_index++;
}
}
}
return $va;
} | php | private function getVa()
{
$va = [];
$va_index = 0;
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
$va_area = $html->find('.normal_header', 0)->next_sibling();
if ($va_area->tag == 'table') {
if ($va_area->find('tr')) {
foreach ($va_area->find('tr') as $each_va) {
// anime
$anime_image_area = $each_va->find('td', 0);
$anime_area = $each_va->find('td', 1);
$va[$va_index]['anime']['image'] = $this->getAnimeImage($anime_image_area);
$va[$va_index]['anime']['id'] = $this->getAnimeId($anime_area);
$va[$va_index]['anime']['title'] = $this->getAnimeTitle($anime_area);
// character
$character_image_area = $each_va->find('td', 3);
$character_area = $each_va->find('td', 2);
$va[$va_index]['character']['image'] = $this->getAnimeImage($character_image_area);
$va[$va_index]['character']['id'] = $this->getAnimeId($character_area);
$va[$va_index]['character']['name'] = $this->getAnimeTitle($character_area);
$va[$va_index]['character']['role'] = $this->getAnimeRole($character_area);
$va_index++;
}
}
}
return $va;
} | [
"private",
"function",
"getVa",
"(",
")",
"{",
"$",
"va",
"=",
"[",
"]",
";",
"$",
"va_index",
"=",
"0",
";",
"$",
"html",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
")",
"->",
"find",
"(",
"'td'",
",",... | Get people voice actor list.
@return array | [
"Get",
"people",
"voice",
"actor",
"list",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L172-L205 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getAnimeRole | private function getAnimeRole($anime_area, $staff = false)
{
if ($staff) {
return $anime_area->find('small', 0)->plaintext;
}
return $anime_area->find('div', 0)->plaintext;
} | php | private function getAnimeRole($anime_area, $staff = false)
{
if ($staff) {
return $anime_area->find('small', 0)->plaintext;
}
return $anime_area->find('div', 0)->plaintext;
} | [
"private",
"function",
"getAnimeRole",
"(",
"$",
"anime_area",
",",
"$",
"staff",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"staff",
")",
"{",
"return",
"$",
"anime_area",
"->",
"find",
"(",
"'small'",
",",
"0",
")",
"->",
"plaintext",
";",
"}",
"retur... | Get anime role.
@param \simplehtmldom_1_5\simple_html_dom $anime_area
@param bool $staff (Optional)
@return string | [
"Get",
"anime",
"role",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L256-L263 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getStaff | private function getStaff($manga = false)
{
$staff = [];
$staff_index = 0;
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
if ($manga) {
$staff_area = $html->find('.normal_header', 2)->next_sibling();
} else {
$staff_area = $html->find('.normal_header', 1)->next_sibling();
}
if ($staff_area->tag == 'table') {
foreach ($staff_area->find('tr') as $each_staff) {
$anime_image_area = $each_staff->find('td', 0);
$staff_area = $each_staff->find('td', 1);
$staff[$staff_index]['image'] = $this->getAnimeImage($anime_image_area);
$staff[$staff_index]['id'] = $this->getAnimeId($staff_area);
$staff[$staff_index]['title'] = $this->getAnimeTitle($staff_area);
$staff[$staff_index]['role'] = $this->getAnimeRole($staff_area, true);
$staff_index++;
}
}
return $staff;
} | php | private function getStaff($manga = false)
{
$staff = [];
$staff_index = 0;
$html = $this->_parser->find('#content table tr', 0)->find('td', 0)->next_sibling();
if ($manga) {
$staff_area = $html->find('.normal_header', 2)->next_sibling();
} else {
$staff_area = $html->find('.normal_header', 1)->next_sibling();
}
if ($staff_area->tag == 'table') {
foreach ($staff_area->find('tr') as $each_staff) {
$anime_image_area = $each_staff->find('td', 0);
$staff_area = $each_staff->find('td', 1);
$staff[$staff_index]['image'] = $this->getAnimeImage($anime_image_area);
$staff[$staff_index]['id'] = $this->getAnimeId($staff_area);
$staff[$staff_index]['title'] = $this->getAnimeTitle($staff_area);
$staff[$staff_index]['role'] = $this->getAnimeRole($staff_area, true);
$staff_index++;
}
}
return $staff;
} | [
"private",
"function",
"getStaff",
"(",
"$",
"manga",
"=",
"false",
")",
"{",
"$",
"staff",
"=",
"[",
"]",
";",
"$",
"staff_index",
"=",
"0",
";",
"$",
"html",
"=",
"$",
"this",
"->",
"_parser",
"->",
"find",
"(",
"'#content table tr'",
",",
"0",
"... | Get people staff list.
@param bool $staff (Optional)
@return array | [
"Get",
"people",
"staff",
"list",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L272-L297 | train |
rl404/MAL-Scraper | src/MalScraper/Model/General/PeopleModel.php | PeopleModel.getAllInfo | private function getAllInfo()
{
$data = [
'id' => $this->getId(),
'name' => $this->getName(),
'image' => $this->getImage(),
'given_name' => $this->getBiodata('Given name'),
'family_name' => $this->getBiodata('Family name'),
'alternative_name' => $this->getBiodata('Alternate names'),
'birthday' => $this->getBiodata('Birthday'),
'website' => $this->getBiodata('Website'),
'favorite' => $this->getBiodata('Member Favorites'),
'more' => $this->getMore(),
'va' => $this->getVa(),
'staff' => $this->getStaff(),
'published_manga' => $this->getStaff(true),
];
return $data;
} | php | private function getAllInfo()
{
$data = [
'id' => $this->getId(),
'name' => $this->getName(),
'image' => $this->getImage(),
'given_name' => $this->getBiodata('Given name'),
'family_name' => $this->getBiodata('Family name'),
'alternative_name' => $this->getBiodata('Alternate names'),
'birthday' => $this->getBiodata('Birthday'),
'website' => $this->getBiodata('Website'),
'favorite' => $this->getBiodata('Member Favorites'),
'more' => $this->getMore(),
'va' => $this->getVa(),
'staff' => $this->getStaff(),
'published_manga' => $this->getStaff(true),
];
return $data;
} | [
"private",
"function",
"getAllInfo",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"'id'",
"=>",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"'name'",
"=>",
"$",
"this",
"->",
"getName",
"(",
")",
",",
"'image'",
"=>",
"$",
"this",
"->",
"getImage",
"(",
... | Get people all information.
@return array | [
"Get",
"people",
"all",
"information",
"."
] | 3e378a60dfaaef94949bccce4ff06f9399869bee | https://github.com/rl404/MAL-Scraper/blob/3e378a60dfaaef94949bccce4ff06f9399869bee/src/MalScraper/Model/General/PeopleModel.php#L304-L323 | train |
marc1706/fast-image-size | lib/Type/TypeTif.php | TypeTif.setByteType | public function setByteType($signature)
{
if ($signature === self::TIF_SIGNATURE_INTEL)
{
$this->typeLong = 'V';
$this->typeShort = 'v';
$this->size['type'] = IMAGETYPE_TIFF_II;
}
else
{
$this->typeLong = 'N';
$this->typeShort = 'n';
$this->size['type'] = IMAGETYPE_TIFF_MM;
}
} | php | public function setByteType($signature)
{
if ($signature === self::TIF_SIGNATURE_INTEL)
{
$this->typeLong = 'V';
$this->typeShort = 'v';
$this->size['type'] = IMAGETYPE_TIFF_II;
}
else
{
$this->typeLong = 'N';
$this->typeShort = 'n';
$this->size['type'] = IMAGETYPE_TIFF_MM;
}
} | [
"public",
"function",
"setByteType",
"(",
"$",
"signature",
")",
"{",
"if",
"(",
"$",
"signature",
"===",
"self",
"::",
"TIF_SIGNATURE_INTEL",
")",
"{",
"$",
"this",
"->",
"typeLong",
"=",
"'V'",
";",
"$",
"this",
"->",
"typeShort",
"=",
"'v'",
";",
"$... | Set byte type based on signature in header
@param string $signature Header signature | [
"Set",
"byte",
"type",
"based",
"on",
"signature",
"in",
"header"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeTif.php#L114-L128 | train |
marc1706/fast-image-size | lib/Type/TypeTif.php | TypeTif.setSizeInfo | protected function setSizeInfo($dimensionType, $fieldLength, $ifdValue)
{
// Set size of field
$fieldSize = $fieldLength === self::TIF_TAG_TYPE_SHORT ? $this->typeShort : $this->typeLong;
// Get actual dimensions from IFD
if ($dimensionType === self::TIF_TAG_IMAGE_HEIGHT)
{
$this->size = array_merge($this->size, unpack($fieldSize . 'height', $ifdValue));
}
else if ($dimensionType === self::TIF_TAG_IMAGE_WIDTH)
{
$this->size = array_merge($this->size, unpack($fieldSize . 'width', $ifdValue));
}
} | php | protected function setSizeInfo($dimensionType, $fieldLength, $ifdValue)
{
// Set size of field
$fieldSize = $fieldLength === self::TIF_TAG_TYPE_SHORT ? $this->typeShort : $this->typeLong;
// Get actual dimensions from IFD
if ($dimensionType === self::TIF_TAG_IMAGE_HEIGHT)
{
$this->size = array_merge($this->size, unpack($fieldSize . 'height', $ifdValue));
}
else if ($dimensionType === self::TIF_TAG_IMAGE_WIDTH)
{
$this->size = array_merge($this->size, unpack($fieldSize . 'width', $ifdValue));
}
} | [
"protected",
"function",
"setSizeInfo",
"(",
"$",
"dimensionType",
",",
"$",
"fieldLength",
",",
"$",
"ifdValue",
")",
"{",
"// Set size of field",
"$",
"fieldSize",
"=",
"$",
"fieldLength",
"===",
"self",
"::",
"TIF_TAG_TYPE_SHORT",
"?",
"$",
"this",
"->",
"t... | Set size info
@param int $dimensionType Type of dimension. Either width or height
@param int $fieldLength Length of field. Either short or long
@param string $ifdValue String value of IFD field | [
"Set",
"size",
"info"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeTif.php#L137-L151 | train |
marc1706/fast-image-size | lib/Type/TypeIco.php | TypeIco.isValidIco | protected function isValidIco($data)
{
// Get header
$header = unpack('vreserved/vtype/vimages', $data);
return $header['reserved'] === self::ICO_RESERVED && $header['type'] === self::ICO_TYPE && $header['images'] > 0 && $header['images'] <= 255;
} | php | protected function isValidIco($data)
{
// Get header
$header = unpack('vreserved/vtype/vimages', $data);
return $header['reserved'] === self::ICO_RESERVED && $header['type'] === self::ICO_TYPE && $header['images'] > 0 && $header['images'] <= 255;
} | [
"protected",
"function",
"isValidIco",
"(",
"$",
"data",
")",
"{",
"// Get header",
"$",
"header",
"=",
"unpack",
"(",
"'vreserved/vtype/vimages'",
",",
"$",
"data",
")",
";",
"return",
"$",
"header",
"[",
"'reserved'",
"]",
"===",
"self",
"::",
"ICO_RESERVE... | Return whether image is a valid ICO file
@param string $data Image data string
@return bool True if file is a valid ICO file, false if not | [
"Return",
"whether",
"image",
"is",
"a",
"valid",
"ICO",
"file"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeIco.php#L55-L61 | train |
marc1706/fast-image-size | lib/Type/TypeJpeg.php | TypeJpeg.getSizeInfo | protected function getSizeInfo()
{
$size = array();
// since we check $i + 1 we need to stop one step earlier
$this->dataLength = strlen($this->data) - 1;
$sofStartRead = true;
// Look through file for SOF marker
for ($i = 2; $i < $this->dataLength; $i++)
{
$marker = $this->getNextMarker($i, $sofStartRead);
if (in_array($marker, $this->sofMarkers))
{
// Extract size info from SOF marker
return $this->extractSizeInfo($i);
}
else
{
// Extract length only
$markerLength = $this->extractMarkerLength($i);
if ($markerLength < 2)
{
return $size;
}
$i += $markerLength - 1;
continue;
}
}
return $size;
} | php | protected function getSizeInfo()
{
$size = array();
// since we check $i + 1 we need to stop one step earlier
$this->dataLength = strlen($this->data) - 1;
$sofStartRead = true;
// Look through file for SOF marker
for ($i = 2; $i < $this->dataLength; $i++)
{
$marker = $this->getNextMarker($i, $sofStartRead);
if (in_array($marker, $this->sofMarkers))
{
// Extract size info from SOF marker
return $this->extractSizeInfo($i);
}
else
{
// Extract length only
$markerLength = $this->extractMarkerLength($i);
if ($markerLength < 2)
{
return $size;
}
$i += $markerLength - 1;
continue;
}
}
return $size;
} | [
"protected",
"function",
"getSizeInfo",
"(",
")",
"{",
"$",
"size",
"=",
"array",
"(",
")",
";",
"// since we check $i + 1 we need to stop one step earlier",
"$",
"this",
"->",
"dataLength",
"=",
"strlen",
"(",
"$",
"this",
"->",
"data",
")",
"-",
"1",
";",
... | Get size info from image data
@return array An array with the image's size info or an empty array if
size info couldn't be found | [
"Get",
"size",
"info",
"from",
"image",
"data"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeJpeg.php#L90-L124 | train |
marc1706/fast-image-size | lib/Type/TypeJpeg.php | TypeJpeg.extractMarkerLength | protected function extractMarkerLength($i)
{
// Extract length only
list(, $unpacked) = unpack("H*", substr($this->data, $i, self::LONG_SIZE));
// Get width and height from unpacked size info
$markerLength = hexdec(substr($unpacked, 0, 4));
return $markerLength;
} | php | protected function extractMarkerLength($i)
{
// Extract length only
list(, $unpacked) = unpack("H*", substr($this->data, $i, self::LONG_SIZE));
// Get width and height from unpacked size info
$markerLength = hexdec(substr($unpacked, 0, 4));
return $markerLength;
} | [
"protected",
"function",
"extractMarkerLength",
"(",
"$",
"i",
")",
"{",
"// Extract length only",
"list",
"(",
",",
"$",
"unpacked",
")",
"=",
"unpack",
"(",
"\"H*\"",
",",
"substr",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"i",
",",
"self",
"::",
"L... | Extract marker length from data
@param int $i Current index
@return int Length of current marker | [
"Extract",
"marker",
"length",
"from",
"data"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeJpeg.php#L132-L141 | train |
marc1706/fast-image-size | lib/Type/TypeJpeg.php | TypeJpeg.extractSizeInfo | protected function extractSizeInfo($i)
{
// Extract size info from SOF marker
list(, $unpacked) = unpack("H*", substr($this->data, $i - 1 + self::LONG_SIZE, self::LONG_SIZE));
// Get width and height from unpacked size info
$size = array(
'width' => hexdec(substr($unpacked, 4, 4)),
'height' => hexdec(substr($unpacked, 0, 4)),
);
return $size;
} | php | protected function extractSizeInfo($i)
{
// Extract size info from SOF marker
list(, $unpacked) = unpack("H*", substr($this->data, $i - 1 + self::LONG_SIZE, self::LONG_SIZE));
// Get width and height from unpacked size info
$size = array(
'width' => hexdec(substr($unpacked, 4, 4)),
'height' => hexdec(substr($unpacked, 0, 4)),
);
return $size;
} | [
"protected",
"function",
"extractSizeInfo",
"(",
"$",
"i",
")",
"{",
"// Extract size info from SOF marker",
"list",
"(",
",",
"$",
"unpacked",
")",
"=",
"unpack",
"(",
"\"H*\"",
",",
"substr",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"i",
"-",
"1",
"+"... | Extract size info from data
@param int $i Current index
@return array Size info of current marker | [
"Extract",
"size",
"info",
"from",
"data"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeJpeg.php#L149-L161 | train |
marc1706/fast-image-size | lib/Type/TypeJpeg.php | TypeJpeg.getNextMarker | protected function getNextMarker(&$i, &$sofStartRead)
{
$this->skipStartPadding($i, $sofStartRead);
do {
if ($i >= $this->dataLength)
{
return self::JPEG_EOI_MARKER;
}
$marker = $this->data[$i];
$i++;
} while ($marker == self::SOF_START_MARKER);
return $marker;
} | php | protected function getNextMarker(&$i, &$sofStartRead)
{
$this->skipStartPadding($i, $sofStartRead);
do {
if ($i >= $this->dataLength)
{
return self::JPEG_EOI_MARKER;
}
$marker = $this->data[$i];
$i++;
} while ($marker == self::SOF_START_MARKER);
return $marker;
} | [
"protected",
"function",
"getNextMarker",
"(",
"&",
"$",
"i",
",",
"&",
"$",
"sofStartRead",
")",
"{",
"$",
"this",
"->",
"skipStartPadding",
"(",
"$",
"i",
",",
"$",
"sofStartRead",
")",
";",
"do",
"{",
"if",
"(",
"$",
"i",
">=",
"$",
"this",
"->"... | Get next JPEG marker in file
@param int $i Current index
@param bool $sofStartRead Flag whether SOF start padding was already read
@return string Next JPEG marker in file | [
"Get",
"next",
"JPEG",
"marker",
"in",
"file"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeJpeg.php#L171-L185 | train |
marc1706/fast-image-size | lib/Type/TypeJpeg.php | TypeJpeg.skipStartPadding | protected function skipStartPadding(&$i, &$sofStartRead)
{
if (!$sofStartRead)
{
while ($this->data[$i] !== self::SOF_START_MARKER)
{
$i++;
}
}
} | php | protected function skipStartPadding(&$i, &$sofStartRead)
{
if (!$sofStartRead)
{
while ($this->data[$i] !== self::SOF_START_MARKER)
{
$i++;
}
}
} | [
"protected",
"function",
"skipStartPadding",
"(",
"&",
"$",
"i",
",",
"&",
"$",
"sofStartRead",
")",
"{",
"if",
"(",
"!",
"$",
"sofStartRead",
")",
"{",
"while",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"i",
"]",
"!==",
"self",
"::",
"SOF_START_MARK... | Skip over any possible padding until we reach a byte without SOF start
marker. Extraneous bytes might need to require proper treating.
@param int $i Current index
@param bool $sofStartRead Flag whether SOF start padding was already read | [
"Skip",
"over",
"any",
"possible",
"padding",
"until",
"we",
"reach",
"a",
"byte",
"without",
"SOF",
"start",
"marker",
".",
"Extraneous",
"bytes",
"might",
"need",
"to",
"require",
"proper",
"treating",
"."
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeJpeg.php#L194-L203 | train |
marc1706/fast-image-size | lib/Type/TypeWbmp.php | TypeWbmp.validWBMP | protected function validWBMP($data)
{
return ord($data[0]) === 0 && ord($data[1]) === 0 && $data !== substr(TypeJp2::JPEG_2000_SIGNATURE, 0, self::LONG_SIZE);
} | php | protected function validWBMP($data)
{
return ord($data[0]) === 0 && ord($data[1]) === 0 && $data !== substr(TypeJp2::JPEG_2000_SIGNATURE, 0, self::LONG_SIZE);
} | [
"protected",
"function",
"validWBMP",
"(",
"$",
"data",
")",
"{",
"return",
"ord",
"(",
"$",
"data",
"[",
"0",
"]",
")",
"===",
"0",
"&&",
"ord",
"(",
"$",
"data",
"[",
"1",
"]",
")",
"===",
"0",
"&&",
"$",
"data",
"!==",
"substr",
"(",
"TypeJp... | Return if supplied data might be part of a valid WBMP file
@param bool|string $data
@return bool True if data might be part of a valid WBMP file, else false | [
"Return",
"if",
"supplied",
"data",
"might",
"be",
"part",
"of",
"a",
"valid",
"WBMP",
"file"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeWbmp.php#L49-L52 | train |
marc1706/fast-image-size | lib/Type/TypePsd.php | TypePsd.validPsd | protected function validPsd($data, $version)
{
return substr($data, 0, self::LONG_SIZE) === self::PSD_SIGNATURE && $version[1] === 1;
} | php | protected function validPsd($data, $version)
{
return substr($data, 0, self::LONG_SIZE) === self::PSD_SIGNATURE && $version[1] === 1;
} | [
"protected",
"function",
"validPsd",
"(",
"$",
"data",
",",
"$",
"version",
")",
"{",
"return",
"substr",
"(",
"$",
"data",
",",
"0",
",",
"self",
"::",
"LONG_SIZE",
")",
"===",
"self",
"::",
"PSD_SIGNATURE",
"&&",
"$",
"version",
"[",
"1",
"]",
"===... | Return whether file is a valid PSD file
@param string $data Image data string
@param array $version Version array
@return bool True if image is a valid PSD file, false if not | [
"Return",
"whether",
"file",
"is",
"a",
"valid",
"PSD",
"file"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypePsd.php#L61-L64 | train |
marc1706/fast-image-size | lib/FastImageSize.php | FastImageSize.getImageSize | public function getImageSize($file, $type = '')
{
// Reset values
$this->resetValues();
// Treat image type as unknown if extension or mime type is unknown
if (!preg_match('/\.([a-z0-9]+)$/i', $file, $match) && empty($type))
{
$this->getImagesizeUnknownType($file);
}
else
{
$extension = (empty($type) && isset($match[1])) ? $match[1] : preg_replace('/.+\/([a-z0-9-.]+)$/i', '$1', $type);
$this->getImageSizeByExtension($file, $extension);
}
return sizeof($this->size) > 1 ? $this->size : false;
} | php | public function getImageSize($file, $type = '')
{
// Reset values
$this->resetValues();
// Treat image type as unknown if extension or mime type is unknown
if (!preg_match('/\.([a-z0-9]+)$/i', $file, $match) && empty($type))
{
$this->getImagesizeUnknownType($file);
}
else
{
$extension = (empty($type) && isset($match[1])) ? $match[1] : preg_replace('/.+\/([a-z0-9-.]+)$/i', '$1', $type);
$this->getImageSizeByExtension($file, $extension);
}
return sizeof($this->size) > 1 ? $this->size : false;
} | [
"public",
"function",
"getImageSize",
"(",
"$",
"file",
",",
"$",
"type",
"=",
"''",
")",
"{",
"// Reset values",
"$",
"this",
"->",
"resetValues",
"(",
")",
";",
"// Treat image type as unknown if extension or mime type is unknown",
"if",
"(",
"!",
"preg_match",
... | Get image dimensions of supplied image
@param string $file Path to image that should be checked
@param string $type Mimetype of image
@return array|bool Array with image dimensions if successful, false if not | [
"Get",
"image",
"dimensions",
"of",
"supplied",
"image"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/FastImageSize.php#L84-L102 | train |
marc1706/fast-image-size | lib/FastImageSize.php | FastImageSize.getImagesizeUnknownType | protected function getImagesizeUnknownType($filename)
{
// Grab the maximum amount of bytes we might need
$data = $this->getImage($filename, 0, Type\TypeJpeg::JPEG_MAX_HEADER_SIZE, false);
if ($data !== false)
{
$this->loadAllTypes();
foreach ($this->type as $imageType)
{
$imageType->getSize($filename);
if (sizeof($this->size) > 1)
{
break;
}
}
}
} | php | protected function getImagesizeUnknownType($filename)
{
// Grab the maximum amount of bytes we might need
$data = $this->getImage($filename, 0, Type\TypeJpeg::JPEG_MAX_HEADER_SIZE, false);
if ($data !== false)
{
$this->loadAllTypes();
foreach ($this->type as $imageType)
{
$imageType->getSize($filename);
if (sizeof($this->size) > 1)
{
break;
}
}
}
} | [
"protected",
"function",
"getImagesizeUnknownType",
"(",
"$",
"filename",
")",
"{",
"// Grab the maximum amount of bytes we might need",
"$",
"data",
"=",
"$",
"this",
"->",
"getImage",
"(",
"$",
"filename",
",",
"0",
",",
"Type",
"\\",
"TypeJpeg",
"::",
"JPEG_MAX... | Get dimensions of image if type is unknown
@param string $filename Path to file | [
"Get",
"dimensions",
"of",
"image",
"if",
"type",
"is",
"unknown"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/FastImageSize.php#L109-L127 | train |
marc1706/fast-image-size | lib/FastImageSize.php | FastImageSize.getImageSizeByExtension | protected function getImageSizeByExtension($file, $extension)
{
$extension = strtolower($extension);
$this->loadExtension($extension);
if (isset($this->classMap[$extension]))
{
$this->classMap[$extension]->getSize($file);
}
} | php | protected function getImageSizeByExtension($file, $extension)
{
$extension = strtolower($extension);
$this->loadExtension($extension);
if (isset($this->classMap[$extension]))
{
$this->classMap[$extension]->getSize($file);
}
} | [
"protected",
"function",
"getImageSizeByExtension",
"(",
"$",
"file",
",",
"$",
"extension",
")",
"{",
"$",
"extension",
"=",
"strtolower",
"(",
"$",
"extension",
")",
";",
"$",
"this",
"->",
"loadExtension",
"(",
"$",
"extension",
")",
";",
"if",
"(",
"... | Get image size by file extension
@param string $file Path to image that should be checked
@param string $extension Extension/type of image | [
"Get",
"image",
"size",
"by",
"file",
"extension"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/FastImageSize.php#L135-L143 | train |
marc1706/fast-image-size | lib/FastImageSize.php | FastImageSize.loadExtension | protected function loadExtension($extension)
{
if (isset($this->classMap[$extension]))
{
return;
}
foreach ($this->supportedTypes as $imageType => $extensions)
{
if (in_array($extension, $extensions, true))
{
$this->loadType($imageType);
}
}
} | php | protected function loadExtension($extension)
{
if (isset($this->classMap[$extension]))
{
return;
}
foreach ($this->supportedTypes as $imageType => $extensions)
{
if (in_array($extension, $extensions, true))
{
$this->loadType($imageType);
}
}
} | [
"protected",
"function",
"loadExtension",
"(",
"$",
"extension",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"classMap",
"[",
"$",
"extension",
"]",
")",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"supportedTypes",
"as",... | Load an image type by extension
@param string $extension Extension of image | [
"Load",
"an",
"image",
"type",
"by",
"extension"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/FastImageSize.php#L228-L241 | train |
marc1706/fast-image-size | lib/FastImageSize.php | FastImageSize.loadType | protected function loadType($imageType)
{
if (isset($this->type[$imageType]))
{
return;
}
$className = '\FastImageSize\Type\Type' . mb_convert_case(mb_strtolower($imageType), MB_CASE_TITLE);
$this->type[$imageType] = new $className($this);
// Create class map
foreach ($this->supportedTypes[$imageType] as $ext)
{
/** @var Type\TypeInterface */
$this->classMap[$ext] = $this->type[$imageType];
}
} | php | protected function loadType($imageType)
{
if (isset($this->type[$imageType]))
{
return;
}
$className = '\FastImageSize\Type\Type' . mb_convert_case(mb_strtolower($imageType), MB_CASE_TITLE);
$this->type[$imageType] = new $className($this);
// Create class map
foreach ($this->supportedTypes[$imageType] as $ext)
{
/** @var Type\TypeInterface */
$this->classMap[$ext] = $this->type[$imageType];
}
} | [
"protected",
"function",
"loadType",
"(",
"$",
"imageType",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"type",
"[",
"$",
"imageType",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"className",
"=",
"'\\FastImageSize\\Type\\Type'",
".",
"mb_conv... | Load an image type
@param string $imageType Mimetype | [
"Load",
"an",
"image",
"type"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/FastImageSize.php#L248-L264 | train |
marc1706/fast-image-size | lib/Type/TypeWebp.php | TypeWebp.getWebpSize | protected function getWebpSize($data, $format)
{
switch ($format)
{
case self::WEBP_FORMAT_SIMPLE:
$this->size = unpack('vwidth/vheight', substr($data, 10, 4));
break;
case self::WEBP_FORMAT_LOSSLESS:
// Lossless uses 14-bit values so we'll have to use bitwise shifting
$this->size = array(
'width' => ord($data[5]) + ((ord($data[6]) & 0x3F) << 8) + 1,
'height' => (ord($data[6]) >> 6) + (ord($data[7]) << 2) + ((ord($data[8]) & 0xF) << 10) + 1,
);
break;
case self::WEBP_FORMAT_EXTENDED:
// Extended uses 24-bit values cause 14-bit for lossless wasn't weird enough
$this->size = array(
'width' => ord($data[8]) + (ord($data[9]) << 8) + (ord($data[10]) << 16) + 1,
'height' => ord($data[11]) + (ord($data[12]) << 8) + (ord($data[13]) << 16) + 1,
);
break;
}
} | php | protected function getWebpSize($data, $format)
{
switch ($format)
{
case self::WEBP_FORMAT_SIMPLE:
$this->size = unpack('vwidth/vheight', substr($data, 10, 4));
break;
case self::WEBP_FORMAT_LOSSLESS:
// Lossless uses 14-bit values so we'll have to use bitwise shifting
$this->size = array(
'width' => ord($data[5]) + ((ord($data[6]) & 0x3F) << 8) + 1,
'height' => (ord($data[6]) >> 6) + (ord($data[7]) << 2) + ((ord($data[8]) & 0xF) << 10) + 1,
);
break;
case self::WEBP_FORMAT_EXTENDED:
// Extended uses 24-bit values cause 14-bit for lossless wasn't weird enough
$this->size = array(
'width' => ord($data[8]) + (ord($data[9]) << 8) + (ord($data[10]) << 16) + 1,
'height' => ord($data[11]) + (ord($data[12]) << 8) + (ord($data[13]) << 16) + 1,
);
break;
}
} | [
"protected",
"function",
"getWebpSize",
"(",
"$",
"data",
",",
"$",
"format",
")",
"{",
"switch",
"(",
"$",
"format",
")",
"{",
"case",
"self",
"::",
"WEBP_FORMAT_SIMPLE",
":",
"$",
"this",
"->",
"size",
"=",
"unpack",
"(",
"'vwidth/vheight'",
",",
"subs... | Get webp size info depending on format type and set size array values
@param string $data Data string
@param string $format Format string | [
"Get",
"webp",
"size",
"info",
"depending",
"on",
"format",
"type",
"and",
"set",
"size",
"array",
"values"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeWebp.php#L116-L140 | train |
marc1706/fast-image-size | lib/Type/TypeIff.php | TypeIff.getIffSignature | protected function getIffSignature($data)
{
$signature = substr($data, 0, self::LONG_SIZE);
// Check if image is IFF
if ($signature !== self::IFF_HEADER_AMIGA && $signature !== self::IFF_HEADER_MAYA)
{
return false;
}
else
{
return $signature;
}
} | php | protected function getIffSignature($data)
{
$signature = substr($data, 0, self::LONG_SIZE);
// Check if image is IFF
if ($signature !== self::IFF_HEADER_AMIGA && $signature !== self::IFF_HEADER_MAYA)
{
return false;
}
else
{
return $signature;
}
} | [
"protected",
"function",
"getIffSignature",
"(",
"$",
"data",
")",
"{",
"$",
"signature",
"=",
"substr",
"(",
"$",
"data",
",",
"0",
",",
"self",
"::",
"LONG_SIZE",
")",
";",
"// Check if image is IFF",
"if",
"(",
"$",
"signature",
"!==",
"self",
"::",
"... | Get IFF signature from data string
@param string|bool $data Image data string
@return false|string Signature if file is a valid IFF file, false if not | [
"Get",
"IFF",
"signature",
"from",
"data",
"string"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeIff.php#L80-L93 | train |
marc1706/fast-image-size | lib/Type/TypeIff.php | TypeIff.setTypeConstraints | protected function setTypeConstraints($signature)
{
// Amiga version of IFF
if ($signature === 'FORM')
{
$this->btmhd = self::IFF_AMIGA_BTMHD;
$this->btmhdSize = self::LONG_SIZE;
$this->byteType = self::PACK_UNSIGNED_SHORT;
}
// Maya version
else
{
$this->btmhd = self::IFF_MAYA_BTMHD;
$this->btmhdSize = self::LONG_SIZE * 2;
$this->byteType = self::PACK_UNSIGNED_LONG;
}
} | php | protected function setTypeConstraints($signature)
{
// Amiga version of IFF
if ($signature === 'FORM')
{
$this->btmhd = self::IFF_AMIGA_BTMHD;
$this->btmhdSize = self::LONG_SIZE;
$this->byteType = self::PACK_UNSIGNED_SHORT;
}
// Maya version
else
{
$this->btmhd = self::IFF_MAYA_BTMHD;
$this->btmhdSize = self::LONG_SIZE * 2;
$this->byteType = self::PACK_UNSIGNED_LONG;
}
} | [
"protected",
"function",
"setTypeConstraints",
"(",
"$",
"signature",
")",
"{",
"// Amiga version of IFF",
"if",
"(",
"$",
"signature",
"===",
"'FORM'",
")",
"{",
"$",
"this",
"->",
"btmhd",
"=",
"self",
"::",
"IFF_AMIGA_BTMHD",
";",
"$",
"this",
"->",
"btmh... | Set type constraints for current image
@param string $signature IFF signature of image | [
"Set",
"type",
"constraints",
"for",
"current",
"image"
] | c755656bd42c8fb5bfc277e86a2ca05f9edbf091 | https://github.com/marc1706/fast-image-size/blob/c755656bd42c8fb5bfc277e86a2ca05f9edbf091/lib/Type/TypeIff.php#L100-L116 | train |
himiklab/yii2-easy-thumbnail-image-helper | EasyThumbnailImage.php | EasyThumbnailImage.thumbnail | public static function thumbnail($filename, $width, $height, $mode = self::THUMBNAIL_OUTBOUND, $quality = null,
$checkRemFileMode = self::CHECK_REM_MODE_NONE)
{
return Image::getImagine()
->open(static::thumbnailFile($filename, $width, $height, $mode, $quality, $checkRemFileMode));
} | php | public static function thumbnail($filename, $width, $height, $mode = self::THUMBNAIL_OUTBOUND, $quality = null,
$checkRemFileMode = self::CHECK_REM_MODE_NONE)
{
return Image::getImagine()
->open(static::thumbnailFile($filename, $width, $height, $mode, $quality, $checkRemFileMode));
} | [
"public",
"static",
"function",
"thumbnail",
"(",
"$",
"filename",
",",
"$",
"width",
",",
"$",
"height",
",",
"$",
"mode",
"=",
"self",
"::",
"THUMBNAIL_OUTBOUND",
",",
"$",
"quality",
"=",
"null",
",",
"$",
"checkRemFileMode",
"=",
"self",
"::",
"CHECK... | Creates and caches the image thumbnail and returns `ImageInterface`.
If one of thumbnail dimensions is set to `null`, another one is calculated automatically based on aspect ratio of
original image. Note that calculated thumbnail dimension may vary depending on the source image in this case.
If both dimensions are specified, resulting thumbnail would be exactly the width and height specified. How it's
achieved depends on the mode.
If `self::THUMBNAIL_OUTBOUND` mode is used, which is default, then the thumbnail is scaled so that
its smallest side equals the length of the corresponding side in the original image. Any excess outside of
the scaled thumbnail’s area will be cropped, and the returned thumbnail will have the exact width and height
specified.
If thumbnail mode is `self::THUMBNAIL_INSET`, the original image is scaled down so it is fully
contained within the thumbnail dimensions. The rest is filled with background that could be configured via
[[Image::$thumbnailBackgroundColor]] or [[EasyThumbnail::$thumbnailBackgroundColor]],
and [[Image::$thumbnailBackgroundAlpha]] or [[EasyThumbnail::$thumbnailBackgroundAlpha]].
If thumbnail mode is `self::THUMBNAIL_INSET_BOX`, the original image is scaled down so it is fully contained
within the thumbnail dimensions. The specified $width and $height (supplied via $size) will be considered
maximum limits. Unless the given dimensions are equal to the original image’s aspect ratio, one dimension in the
resulting thumbnail will be smaller than the given limit.
@param string $filename the image file path or path alias or URL
@param integer $width the width in pixels to create the thumbnail
@param integer $height the height in pixels to create the thumbnail
@param string $mode mode of resizing original image to use in case both width and height specified
@param integer $quality
@param integer $checkRemFileMode check file version on remote server
@return \Imagine\Image\ImageInterface
@throws FileNotFoundException
@throws InvalidConfigException
@throws \yii\httpclient\Exception | [
"Creates",
"and",
"caches",
"the",
"image",
"thumbnail",
"and",
"returns",
"ImageInterface",
"."
] | 3e7439107ee761a6c37bcd44566a89ba77e743ea | https://github.com/himiklab/yii2-easy-thumbnail-image-helper/blob/3e7439107ee761a6c37bcd44566a89ba77e743ea/EasyThumbnailImage.php#L80-L85 | train |
himiklab/yii2-easy-thumbnail-image-helper | EasyThumbnailImage.php | EasyThumbnailImage.thumbnailFileUrl | public static function thumbnailFileUrl($filename, $width, $height, $mode = self::THUMBNAIL_OUTBOUND,
$quality = null, $checkRemFileMode = self::CHECK_REM_MODE_NONE)
{
$cacheUrl = Yii::getAlias('@web/' . static::$cacheAlias);
$thumbnailFilePath = static::thumbnailFile($filename, $width, $height, $mode, $quality, $checkRemFileMode);
\preg_match('#[^\\' . DIRECTORY_SEPARATOR . ']+$#', $thumbnailFilePath, $matches);
$fileName = $matches[0];
return $cacheUrl . '/' . \substr($fileName, 0, 2) . '/' . $fileName;
} | php | public static function thumbnailFileUrl($filename, $width, $height, $mode = self::THUMBNAIL_OUTBOUND,
$quality = null, $checkRemFileMode = self::CHECK_REM_MODE_NONE)
{
$cacheUrl = Yii::getAlias('@web/' . static::$cacheAlias);
$thumbnailFilePath = static::thumbnailFile($filename, $width, $height, $mode, $quality, $checkRemFileMode);
\preg_match('#[^\\' . DIRECTORY_SEPARATOR . ']+$#', $thumbnailFilePath, $matches);
$fileName = $matches[0];
return $cacheUrl . '/' . \substr($fileName, 0, 2) . '/' . $fileName;
} | [
"public",
"static",
"function",
"thumbnailFileUrl",
"(",
"$",
"filename",
",",
"$",
"width",
",",
"$",
"height",
",",
"$",
"mode",
"=",
"self",
"::",
"THUMBNAIL_OUTBOUND",
",",
"$",
"quality",
"=",
"null",
",",
"$",
"checkRemFileMode",
"=",
"self",
"::",
... | Creates and caches the image thumbnail and returns URL from thumbnail file.
If one of thumbnail dimensions is set to `null`, another one is calculated automatically based on aspect ratio of
original image. Note that calculated thumbnail dimension may vary depending on the source image in this case.
If both dimensions are specified, resulting thumbnail would be exactly the width and height specified. How it's
achieved depends on the mode.
If `self::THUMBNAIL_OUTBOUND` mode is used, which is default, then the thumbnail is scaled so that
its smallest side equals the length of the corresponding side in the original image. Any excess outside of
the scaled thumbnail’s area will be cropped, and the returned thumbnail will have the exact width and height
specified.
If thumbnail mode is `self::THUMBNAIL_INSET`, the original image is scaled down so it is fully
contained within the thumbnail dimensions. The rest is filled with background that could be configured via
[[Image::$thumbnailBackgroundColor]] or [[EasyThumbnail::$thumbnailBackgroundColor]],
and [[Image::$thumbnailBackgroundAlpha]] or [[EasyThumbnail::$thumbnailBackgroundAlpha]].
If thumbnail mode is `self::THUMBNAIL_INSET_BOX`, the original image is scaled down so it is fully contained
within the thumbnail dimensions. The specified $width and $height (supplied via $size) will be considered
maximum limits. Unless the given dimensions are equal to the original image’s aspect ratio, one dimension in the
resulting thumbnail will be smaller than the given limit.
@param string $filename the image file path or path alias or URL
@param integer $width the width in pixels to create the thumbnail
@param integer $height the height in pixels to create the thumbnail
@param string $mode mode of resizing original image to use in case both width and height specified
@param integer $quality
@param integer $checkRemFileMode check file version on remote server
@return string
@throws FileNotFoundException
@throws InvalidConfigException
@throws \yii\httpclient\Exception | [
"Creates",
"and",
"caches",
"the",
"image",
"thumbnail",
"and",
"returns",
"URL",
"from",
"thumbnail",
"file",
"."
] | 3e7439107ee761a6c37bcd44566a89ba77e743ea | https://github.com/himiklab/yii2-easy-thumbnail-image-helper/blob/3e7439107ee761a6c37bcd44566a89ba77e743ea/EasyThumbnailImage.php#L224-L234 | train |
wp-cli/super-admin-command | src/Super_Admin_Command.php | Super_Admin_Command.list_subcommand | public function list_subcommand( $_, $assoc_args ) {
$super_admins = self::get_admins();
if ( 'list' === $assoc_args['format'] ) {
foreach ( $super_admins as $user_login ) {
WP_CLI::line( $user_login );
}
} else {
$output_users = array();
foreach ( $super_admins as $user_login ) {
$output_user = new stdClass();
$output_user->user_login = $user_login;
$output_users[] = $output_user;
}
$formatter = new \WP_CLI\Formatter( $assoc_args, $this->fields );
$formatter->display_items( $output_users );
}
} | php | public function list_subcommand( $_, $assoc_args ) {
$super_admins = self::get_admins();
if ( 'list' === $assoc_args['format'] ) {
foreach ( $super_admins as $user_login ) {
WP_CLI::line( $user_login );
}
} else {
$output_users = array();
foreach ( $super_admins as $user_login ) {
$output_user = new stdClass();
$output_user->user_login = $user_login;
$output_users[] = $output_user;
}
$formatter = new \WP_CLI\Formatter( $assoc_args, $this->fields );
$formatter->display_items( $output_users );
}
} | [
"public",
"function",
"list_subcommand",
"(",
"$",
"_",
",",
"$",
"assoc_args",
")",
"{",
"$",
"super_admins",
"=",
"self",
"::",
"get_admins",
"(",
")",
";",
"if",
"(",
"'list'",
"===",
"$",
"assoc_args",
"[",
"'format'",
"]",
")",
"{",
"foreach",
"("... | Lists users with super admin capabilities.
## OPTIONS
[--format=<format>]
: Render output in a particular format.
---
default: list
options:
- list
- table
- csv
- json
- count
- yaml
---
## EXAMPLES
# List user with super-admin capabilities
$ wp super-admin list
supervisor
administrator
@subcommand list | [
"Lists",
"users",
"with",
"super",
"admin",
"capabilities",
"."
] | bd1543c9a3360d0e21d7e00e1c597964bd805d7c | https://github.com/wp-cli/super-admin-command/blob/bd1543c9a3360d0e21d7e00e1c597964bd805d7c/src/Super_Admin_Command.php#L61-L80 | train |
wp-cli/super-admin-command | src/Super_Admin_Command.php | Super_Admin_Command.add | public function add( $args, $_ ) {
$successes = 0;
$errors = 0;
$users = $this->fetcher->get_many( $args );
if ( count( $users ) !== count( $args ) ) {
$errors = count( $args ) - count( $users );
}
$user_logins = wp_list_pluck( $users, 'user_login' );
$super_admins = self::get_admins();
$num_super_admins = count( $super_admins );
foreach ( $user_logins as $user_login ) {
if ( in_array( $user_login, $super_admins, true ) ) {
WP_CLI::warning( "User '{$user_login}' already has super-admin capabilities." );
continue;
}
$super_admins[] = $user_login;
$successes++;
}
if ( count( $super_admins ) === $num_super_admins ) {
if ( $errors ) {
$user_count = count( $args );
WP_CLI::error( "Couldn't grant super-admin capabilities to {$errors} of {$user_count} users." );
} else {
WP_CLI::success( 'Super admins remain unchanged.' );
}
} else {
if ( update_site_option( 'site_admins', $super_admins ) ) {
if ( $errors ) {
$user_count = count( $args );
WP_CLI::error( "Only granted super-admin capabilities to {$successes} of {$user_count} users." );
} else {
$message = $successes > 1 ? 'users' : 'user';
WP_CLI::success( "Granted super-admin capabilities to {$successes} {$message}." );
}
} else {
WP_CLI::error( 'Site options update failed.' );
}
}
} | php | public function add( $args, $_ ) {
$successes = 0;
$errors = 0;
$users = $this->fetcher->get_many( $args );
if ( count( $users ) !== count( $args ) ) {
$errors = count( $args ) - count( $users );
}
$user_logins = wp_list_pluck( $users, 'user_login' );
$super_admins = self::get_admins();
$num_super_admins = count( $super_admins );
foreach ( $user_logins as $user_login ) {
if ( in_array( $user_login, $super_admins, true ) ) {
WP_CLI::warning( "User '{$user_login}' already has super-admin capabilities." );
continue;
}
$super_admins[] = $user_login;
$successes++;
}
if ( count( $super_admins ) === $num_super_admins ) {
if ( $errors ) {
$user_count = count( $args );
WP_CLI::error( "Couldn't grant super-admin capabilities to {$errors} of {$user_count} users." );
} else {
WP_CLI::success( 'Super admins remain unchanged.' );
}
} else {
if ( update_site_option( 'site_admins', $super_admins ) ) {
if ( $errors ) {
$user_count = count( $args );
WP_CLI::error( "Only granted super-admin capabilities to {$successes} of {$user_count} users." );
} else {
$message = $successes > 1 ? 'users' : 'user';
WP_CLI::success( "Granted super-admin capabilities to {$successes} {$message}." );
}
} else {
WP_CLI::error( 'Site options update failed.' );
}
}
} | [
"public",
"function",
"add",
"(",
"$",
"args",
",",
"$",
"_",
")",
"{",
"$",
"successes",
"=",
"0",
";",
"$",
"errors",
"=",
"0",
";",
"$",
"users",
"=",
"$",
"this",
"->",
"fetcher",
"->",
"get_many",
"(",
"$",
"args",
")",
";",
"if",
"(",
"... | Grants super admin privileges to one or more users.
## OPTIONS
<user>...
: One or more user IDs, user emails, or user logins.
## EXAMPLES
$ wp super-admin add superadmin2
Success: Granted super-admin capabilities. | [
"Grants",
"super",
"admin",
"privileges",
"to",
"one",
"or",
"more",
"users",
"."
] | bd1543c9a3360d0e21d7e00e1c597964bd805d7c | https://github.com/wp-cli/super-admin-command/blob/bd1543c9a3360d0e21d7e00e1c597964bd805d7c/src/Super_Admin_Command.php#L95-L137 | train |
wp-cli/super-admin-command | src/Super_Admin_Command.php | Super_Admin_Command.remove | public function remove( $args, $_ ) {
$super_admins = self::get_admins();
if ( ! $super_admins ) {
WP_CLI::error( 'No super admins to revoke super-admin privileges from.' );
}
$users = $this->fetcher->get_many( $args );
$user_logins = $users ? array_values( array_unique( wp_list_pluck( $users, 'user_login' ) ) ) : array();
$user_logins_count = count( $user_logins );
if ( $user_logins_count < count( $args ) ) {
$flipped_user_logins = array_flip( $user_logins );
// Fetcher has already warned so don't bother here, but continue with any args that are possible login names to cater for invalid users in the site options meta.
$user_logins = array_merge(
$user_logins,
array_unique(
array_filter(
$args,
function ( $v ) use ( $flipped_user_logins ) {
// Exclude numeric and email-like logins (login names can be email-like but ignore this given the circumstances).
return ! isset( $flipped_user_logins[ $v ] ) && ! is_numeric( $v ) && ! is_email( $v );
}
)
)
);
$user_logins_count = count( $user_logins );
}
if ( ! $user_logins ) {
WP_CLI::error( 'No valid user logins given to revoke super-admin privileges from.' );
}
$update_super_admins = array_diff( $super_admins, $user_logins );
if ( $update_super_admins === $super_admins ) {
WP_CLI::error( $user_logins_count > 1 ? 'None of the given users is a super admin.' : 'The given user is not a super admin.' );
}
update_site_option( 'site_admins', $update_super_admins );
$successes = count( $super_admins ) - count( $update_super_admins );
if ( $successes === $user_logins_count ) {
$message = $user_logins_count > 1 ? 'users' : 'user';
$msg = "Revoked super-admin capabilities from {$user_logins_count} {$message}.";
} else {
$msg = "Revoked super-admin capabilities from {$successes} of {$user_logins_count} users.";
}
if ( ! $update_super_admins ) {
$msg .= ' There are no remaining super admins.';
}
WP_CLI::success( $msg );
} | php | public function remove( $args, $_ ) {
$super_admins = self::get_admins();
if ( ! $super_admins ) {
WP_CLI::error( 'No super admins to revoke super-admin privileges from.' );
}
$users = $this->fetcher->get_many( $args );
$user_logins = $users ? array_values( array_unique( wp_list_pluck( $users, 'user_login' ) ) ) : array();
$user_logins_count = count( $user_logins );
if ( $user_logins_count < count( $args ) ) {
$flipped_user_logins = array_flip( $user_logins );
// Fetcher has already warned so don't bother here, but continue with any args that are possible login names to cater for invalid users in the site options meta.
$user_logins = array_merge(
$user_logins,
array_unique(
array_filter(
$args,
function ( $v ) use ( $flipped_user_logins ) {
// Exclude numeric and email-like logins (login names can be email-like but ignore this given the circumstances).
return ! isset( $flipped_user_logins[ $v ] ) && ! is_numeric( $v ) && ! is_email( $v );
}
)
)
);
$user_logins_count = count( $user_logins );
}
if ( ! $user_logins ) {
WP_CLI::error( 'No valid user logins given to revoke super-admin privileges from.' );
}
$update_super_admins = array_diff( $super_admins, $user_logins );
if ( $update_super_admins === $super_admins ) {
WP_CLI::error( $user_logins_count > 1 ? 'None of the given users is a super admin.' : 'The given user is not a super admin.' );
}
update_site_option( 'site_admins', $update_super_admins );
$successes = count( $super_admins ) - count( $update_super_admins );
if ( $successes === $user_logins_count ) {
$message = $user_logins_count > 1 ? 'users' : 'user';
$msg = "Revoked super-admin capabilities from {$user_logins_count} {$message}.";
} else {
$msg = "Revoked super-admin capabilities from {$successes} of {$user_logins_count} users.";
}
if ( ! $update_super_admins ) {
$msg .= ' There are no remaining super admins.';
}
WP_CLI::success( $msg );
} | [
"public",
"function",
"remove",
"(",
"$",
"args",
",",
"$",
"_",
")",
"{",
"$",
"super_admins",
"=",
"self",
"::",
"get_admins",
"(",
")",
";",
"if",
"(",
"!",
"$",
"super_admins",
")",
"{",
"WP_CLI",
"::",
"error",
"(",
"'No super admins to revoke super... | Removes super admin privileges from one or more users.
## OPTIONS
<user>...
: One or more user IDs, user emails, or user logins.
## EXAMPLES
$ wp super-admin remove superadmin2
Success: Revoked super-admin capabilities. | [
"Removes",
"super",
"admin",
"privileges",
"from",
"one",
"or",
"more",
"users",
"."
] | bd1543c9a3360d0e21d7e00e1c597964bd805d7c | https://github.com/wp-cli/super-admin-command/blob/bd1543c9a3360d0e21d7e00e1c597964bd805d7c/src/Super_Admin_Command.php#L152-L202 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboGoogleTraffic.php | XiboGoogleTraffic.create | public function create($name, $duration, $useDuration, $useDisplayLocation, $longitude, $latitude, $zoom, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->useDisplayLocation = $useDisplayLocation;
$this->longitude = $longitude;
$this->latitude = $latitude;
$this->zoom = $zoom;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating Google Traffic widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/googleTraffic/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | php | public function create($name, $duration, $useDuration, $useDisplayLocation, $longitude, $latitude, $zoom, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->useDisplayLocation = $useDisplayLocation;
$this->longitude = $longitude;
$this->latitude = $latitude;
$this->zoom = $zoom;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating Google Traffic widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/googleTraffic/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"useDisplayLocation",
",",
"$",
"longitude",
",",
"$",
"latitude",
",",
"$",
"zoom",
",",
"$",
"playlistId",
")",
"{",
"$",
"this",
"->",
"userId... | Create Google Traffic Widget.
@param string $name Optional widget name
@param int $duration Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $useDisplayLocation Flag Use the location configured on the Display?
@param double $longitude The longitude for this Google Traffic widget, only pass if useDisplayLocation set to 0
@param double $latitude he latitude for this Google Traffic widget, only pass if useDisplayLocation set to 0
@param int $zoom How far should the map be zoomed in? The higher the value the closer the zoom, 1 represents the entire globe
@param int $playlistId Playlist ID
@return XiboGoogleTraffic | [
"Create",
"Google",
"Traffic",
"Widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboGoogleTraffic.php#L80-L95 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboGoogleTraffic.php | XiboGoogleTraffic.edit | public function edit($name, $duration, $useDuration, $useDisplayLocation, $longitude, $latitude, $zoom, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->useDisplayLocation = $useDisplayLocation;
$this->longitude = $longitude;
$this->latitude = $latitude;
$this->zoom = $zoom;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing Google Traffic widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $duration, $useDuration, $useDisplayLocation, $longitude, $latitude, $zoom, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->useDisplayLocation = $useDisplayLocation;
$this->longitude = $longitude;
$this->latitude = $latitude;
$this->zoom = $zoom;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing Google Traffic widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"useDisplayLocation",
",",
"$",
"longitude",
",",
"$",
"latitude",
",",
"$",
"zoom",
",",
"$",
"widgetId",
")",
"{",
"$",
"this",
"->",
"userId",
... | Edit Google Traffic widget
@param string $name Optional widget name
@param int $duration Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $useDisplayLocation Flag Use the location configured on the Display?
@param double $longitude The longitude for this Google Traffic widget, only pass if useDisplayLocation set to 0
@param double $latitude he latitude for this Google Traffic widget, only pass if useDisplayLocation set to 0
@param int $zoom How far should the map be zoomed in? The higher the value the closer the zoom, 1 represents the entire globe
@param int $widgetId Widget ID
@return XiboGoogleTraffic | [
"Edit",
"Google",
"Traffic",
"widget"
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboGoogleTraffic.php#L109-L124 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboGoogleTraffic.php | XiboGoogleTraffic.delete | public function delete()
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->getLogger()->info('Deleting widget ID ' . $this->widgetId);
$this->doDelete('/playlist/widget/' . $this->widgetId , $this->toArray());
return true;
} | php | public function delete()
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->getLogger()->info('Deleting widget ID ' . $this->widgetId);
$this->doDelete('/playlist/widget/' . $this->widgetId , $this->toArray());
return true;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
"->",
"getMe",
"(",
")",
"->",
"getId",
"(",
")",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
... | Delete the widget. | [
"Delete",
"the",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboGoogleTraffic.php#L130-L137 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDisplayProfile.php | XiboDisplayProfile.create | public function create($name, $type, $isDefault)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->type = $type;
$this->isDefault = $isDefault;
$this->getLogger()->info('Creating Display Profile ' . $name);
$response = $this->doPost('/displayprofile', $this->toArray());
return $this->hydrate($response);
} | php | public function create($name, $type, $isDefault)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->type = $type;
$this->isDefault = $isDefault;
$this->getLogger()->info('Creating Display Profile ' . $name);
$response = $this->doPost('/displayprofile', $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"isDefault",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
"->",
"getMe",
"(",
")",
"->",
"getId",
"(",
")",
";",
"$",
"... | Create Display Profile.
@param string $name Display Profile name
@param string $type Display Profile type windws|android|lg
@param int $isDefault Flag indicating whether this is the default profile for the client type
@return XiboDisplayProfile | [
"Create",
"Display",
"Profile",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDisplayProfile.php#L98-L108 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDisplayProfile.php | XiboDisplayProfile.edit | public function edit($name, $type, $isDefault, $versionMediaId = 0)
{
$this->name = $name;
$this->type = $type;
$this->isDefault = $isDefault;
$this->versionMediaId = $versionMediaId;
$this->getLogger()->info('Editing Display profile ' . $this->displayProfileId);
$response = $this->doPut('/displayprofile/' . $this->displayProfileId, $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $type, $isDefault, $versionMediaId = 0)
{
$this->name = $name;
$this->type = $type;
$this->isDefault = $isDefault;
$this->versionMediaId = $versionMediaId;
$this->getLogger()->info('Editing Display profile ' . $this->displayProfileId);
$response = $this->doPut('/displayprofile/' . $this->displayProfileId, $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"type",
",",
"$",
"isDefault",
",",
"$",
"versionMediaId",
"=",
"0",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"type",
"=",
"$",
"type",
";",
"$",
"t... | Edit Display Profile.
@param string $name Display Profile name
@param string $type Display Profile type windws|android|lg
@param int $isDefault Flag indicating whether this is the default profile for the client type
@param int $versionMediaId The Media ID of the Player Software installer
@return XiboDisplayProfile | [
"Edit",
"Display",
"Profile",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDisplayProfile.php#L119-L129 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDisplayProfile.php | XiboDisplayProfile.delete | public function delete()
{
$this->getLogger()->info('Deleting Display profile ID ' . $this->displayProfileId);
$this->doDelete('/displayprofile/' . $this->displayProfileId);
return true;
} | php | public function delete()
{
$this->getLogger()->info('Deleting Display profile ID ' . $this->displayProfileId);
$this->doDelete('/displayprofile/' . $this->displayProfileId);
return true;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Deleting Display profile ID '",
".",
"$",
"this",
"->",
"displayProfileId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"'/displayprofile/'",
".",... | Delete Display Profile.
@return bool | [
"Delete",
"Display",
"Profile",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDisplayProfile.php#L136-L142 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDisplayProfile.php | XiboDisplayProfile.copy | public function copy($displayProfileId, $name)
{
$this->name = $name;
$this->displayProfileId = $displayProfileId;
$this->getLogger()->info('Creating a Copy of Display Profile ' . $name);
$response = $this->doPost('/displayprofile/' . $displayProfileId . '/copy', [
'name' => $name
]);
return $this->hydrate($response);
} | php | public function copy($displayProfileId, $name)
{
$this->name = $name;
$this->displayProfileId = $displayProfileId;
$this->getLogger()->info('Creating a Copy of Display Profile ' . $name);
$response = $this->doPost('/displayprofile/' . $displayProfileId . '/copy', [
'name' => $name
]);
return $this->hydrate($response);
} | [
"public",
"function",
"copy",
"(",
"$",
"displayProfileId",
",",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"displayProfileId",
"=",
"$",
"displayProfileId",
";",
"$",
"this",
"->",
"getLogger",
"(",
")"... | Copy Display Profile.
@param int $displayProfileId The Display Profile ID to copy
@param string $name Display Profile name
@return XiboDisplayProfile | [
"Copy",
"Display",
"Profile",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDisplayProfile.php#L151-L162 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboEmbedded.php | XiboEmbedded.create | public function create($name, $duration, $useDuration, $transparency, $scaleContent, $embedHtml, $embedScript, $embedStyle, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->transparency = $transparency;
$this->scaleContent = $scaleContent;
$this->embedHtml = $embedHtml;
$this->embedScript = $embedScript;
$this->embedStyle = $embedStyle;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating Embed HTML widget' . $name . ' in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/embedded/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | php | public function create($name, $duration, $useDuration, $transparency, $scaleContent, $embedHtml, $embedScript, $embedStyle, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->transparency = $transparency;
$this->scaleContent = $scaleContent;
$this->embedHtml = $embedHtml;
$this->embedScript = $embedScript;
$this->embedStyle = $embedStyle;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating Embed HTML widget' . $name . ' in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/embedded/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"transparency",
",",
"$",
"scaleContent",
",",
"$",
"embedHtml",
",",
"$",
"embedScript",
",",
"$",
"embedStyle",
",",
"$",
"playlistId",
")",
"{",... | Create a new Embedded HTML widget.
@param string $name Widget Name
@param int $duration Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $transparency Flag should the HTML be shown with transparent background? - Not available on Windows players
@param int $scaleContent Flag should the embedded content be scaled along with the layout
@param string $embedHtml The HTML to embed
@param string $embedScript HEAD content to embed, including script tags
@param string $embedStyle Custom Style Sheets (CSS)
@param int $playlistId The playlist ID to which this widget should be assigned
@return XiboEmbedded | [
"Create",
"a",
"new",
"Embedded",
"HTML",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboEmbedded.php#L84-L100 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboEmbedded.php | XiboEmbedded.edit | public function edit($name, $duration, $useDuration, $transparency, $scaleContent, $embedHtml, $embedScript, $embedStyle, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->transparency = $transparency;
$this->scaleContent = $scaleContent;
$this->embedHtml = $embedHtml;
$this->embedScript = $embedScript;
$this->embedStyle = $embedStyle;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing Embed HTML widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $duration, $useDuration, $transparency, $scaleContent, $embedHtml, $embedScript, $embedStyle, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->transparency = $transparency;
$this->scaleContent = $scaleContent;
$this->embedHtml = $embedHtml;
$this->embedScript = $embedScript;
$this->embedStyle = $embedStyle;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing Embed HTML widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"transparency",
",",
"$",
"scaleContent",
",",
"$",
"embedHtml",
",",
"$",
"embedScript",
",",
"$",
"embedStyle",
",",
"$",
"widgetId",
")",
"{",
"... | Edit existing HTML widget.
@param string $name Widget Name
@param int $duration Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $transparency Flag should the HTML be shown with transparent background? - Not available on Windows players
@param int $scaleContent Flag should the embedded content be scaled along with the layout
@param string $embedHtml The HTML to embed
@param string $embedScript HEAD content to embed, including script tags
@param string $embedStyle Custom Style Sheets (CSS)
@param int $widgetId The Widget ID to edit
@return XiboEmbedded | [
"Edit",
"existing",
"HTML",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboEmbedded.php#L116-L132 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboResolution.php | XiboResolution.create | public function create($resolution, $width, $height)
{
$this->resolution = $resolution;
$this->width = $width;
$this->height = $height;
$this->getLogger()->info('Creating a new Resolution '. $this->resolution);
$response = $this->doPost('/resolution', $this->toArray());
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | php | public function create($resolution, $width, $height)
{
$this->resolution = $resolution;
$this->width = $width;
$this->height = $height;
$this->getLogger()->info('Creating a new Resolution '. $this->resolution);
$response = $this->doPost('/resolution', $this->toArray());
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"resolution",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"this",
"->",
"resolution",
"=",
"$",
"resolution",
";",
"$",
"this",
"->",
"width",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"height",
... | Create new Resolution.
@param string $resolution Resolution name
@param int $width Resolution Width
@param int $height Resolution Height
@return XiboResolution | [
"Create",
"new",
"Resolution",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboResolution.php#L97-L106 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboResolution.php | XiboResolution.edit | public function edit($resolution, $width, $height)
{
$this->resolution = $resolution;
$this->width = $width;
$this->height = $height;
$this->getLogger()->info('Editing resolution ID ' . $this->resolutionId);
$response = $this->doPut('/resolution/' . $this->resolutionId, $this->toArray());
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | php | public function edit($resolution, $width, $height)
{
$this->resolution = $resolution;
$this->width = $width;
$this->height = $height;
$this->getLogger()->info('Editing resolution ID ' . $this->resolutionId);
$response = $this->doPut('/resolution/' . $this->resolutionId, $this->toArray());
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"resolution",
",",
"$",
"width",
",",
"$",
"height",
")",
"{",
"$",
"this",
"->",
"resolution",
"=",
"$",
"resolution",
";",
"$",
"this",
"->",
"width",
"=",
"$",
"width",
";",
"$",
"this",
"->",
"height",
"=... | Edit existing resolution.
@param string $resolution Resolution name
@param int $width Resolution Width
@param int $height Resolution Height
@return XiboResolution | [
"Edit",
"existing",
"resolution",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboResolution.php#L116-L125 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboResolution.php | XiboResolution.delete | public function delete()
{
$this->getLogger()->info('Deleting resolution ID ' . $this->resolutionId);
$this->doDelete('/resolution/' . $this->resolutionId);
return true;
} | php | public function delete()
{
$this->getLogger()->info('Deleting resolution ID ' . $this->resolutionId);
$this->doDelete('/resolution/' . $this->resolutionId);
return true;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Deleting resolution ID '",
".",
"$",
"this",
"->",
"resolutionId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"'/resolution/'",
".",
"$",
"th... | Delete the resolution.
@return bool | [
"Delete",
"the",
"resolution",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboResolution.php#L132-L138 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboAudio.php | XiboAudio.edit | public function edit($name, $useDuration, $duration, $mute, $loop, $widgetId)
{
$this->name = $name;
$this->useDuration = $useDuration;
$this->duration = $duration;
$this->mute = $mute;
$this->loop = $loop;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | php | public function edit($name, $useDuration, $duration, $mute, $loop, $widgetId)
{
$this->name = $name;
$this->useDuration = $useDuration;
$this->duration = $duration;
$this->mute = $mute;
$this->loop = $loop;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"useDuration",
",",
"$",
"duration",
",",
"$",
"mute",
",",
"$",
"loop",
",",
"$",
"widgetId",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"useDuration",
... | Edit Audio Widget.
@param string $name Name of the widget
@param int $useDuration Flag (0, 1) Set to 1 if the duration parameter is passed as well
@param int $duration Duration of the widget
@param int $mute Flag (0, 1) Set the widget to mute
@param int $loop Flag (0, 1) Set the widget to loop
@param int $widgetId Id of the widget to edit
@return XiboAudio | [
"Edit",
"Audio",
"Widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboAudio.php#L69-L83 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboAudio.php | XiboAudio.delete | public function delete()
{
$this->getLogger()->info('Deleting widget ID ' . $this->widgetId);
$this->doDelete('/playlist/widget/' . $this->widgetId , $this->toArray());
return true;
} | php | public function delete()
{
$this->getLogger()->info('Deleting widget ID ' . $this->widgetId);
$this->doDelete('/playlist/widget/' . $this->widgetId , $this->toArray());
return true;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Deleting widget ID '",
".",
"$",
"this",
"->",
"widgetId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"'/playlist/widget/'",
".",
"$",
"this"... | Delete the Widget | [
"Delete",
"the",
"Widget"
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboAudio.php#L108-L114 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboTicker.php | XiboTicker.create | public function create($sourceId, $uri, $dataSetId, $duration, $useDuration, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->sourceId = $sourceId;
$this->uri = $uri;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->dataSetId = $dataSetId;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating Ticker widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/ticker/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | php | public function create($sourceId, $uri, $dataSetId, $duration, $useDuration, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->sourceId = $sourceId;
$this->uri = $uri;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->dataSetId = $dataSetId;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating Ticker widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/ticker/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"sourceId",
",",
"$",
"uri",
",",
"$",
"dataSetId",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"playlistId",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"("... | Create new Ticker widget.
@param int $sourceId The Ticker source ID, 1 for rss feed, 2 for dataset
@param string $uri The Feed URI, For sourceId=1, the link for the rss feed
@param int $duration The Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $dataSetId The DataSet ID for sourceId=2
@param int $playlistId The playlist ID
@return XiboTicker | [
"Create",
"new",
"Ticker",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboTicker.php#L161-L174 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboTicker.php | XiboTicker.editFeed | public function editFeed($name, $duration, $useDuration, $updateInterval, $effect, $speed, $copyright = '', $numItems, $takeItemsFrom, $durationIsPerItem, $itemsSideBySide, $itemsPerPage, $dateFormat, $allowedAttributes, $stripTags, $backgroundColor, $disableDateSort, $textDirection, $noDataMessage, $templateId, $overrideTemplate, $template, $css = '', $javaScript = '', $randomiseItems, $widgetId)
{
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->updateInterval = $updateInterval;
$this->effect = $effect;
$this->speed = $speed;
$this->copyright = $copyright;
$this->numItems = $numItems;
$this->takeItemsFrom = $takeItemsFrom;
$this->durationIsPerItem = $durationIsPerItem;
$this->itemsSideBySide = $itemsSideBySide;
$this->itemsPerPage = $itemsPerPage;
$this->dateFormat = $dateFormat;
$this->allowedAttributes = $allowedAttributes;
$this->stripTags = $stripTags;
$this->backgroundColor = $backgroundColor;
$this->disableDateSort = $disableDateSort;
$this->textDirection = $textDirection;
$this->noDataMessage = $noDataMessage;
$this->templateId = $templateId;
$this->overrideTemplate = $overrideTemplate;
$this->template = $template;
$this->css = $css;
$this->javaScript = $javaScript;
$this->randomiseItems = $randomiseItems;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | php | public function editFeed($name, $duration, $useDuration, $updateInterval, $effect, $speed, $copyright = '', $numItems, $takeItemsFrom, $durationIsPerItem, $itemsSideBySide, $itemsPerPage, $dateFormat, $allowedAttributes, $stripTags, $backgroundColor, $disableDateSort, $textDirection, $noDataMessage, $templateId, $overrideTemplate, $template, $css = '', $javaScript = '', $randomiseItems, $widgetId)
{
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->updateInterval = $updateInterval;
$this->effect = $effect;
$this->speed = $speed;
$this->copyright = $copyright;
$this->numItems = $numItems;
$this->takeItemsFrom = $takeItemsFrom;
$this->durationIsPerItem = $durationIsPerItem;
$this->itemsSideBySide = $itemsSideBySide;
$this->itemsPerPage = $itemsPerPage;
$this->dateFormat = $dateFormat;
$this->allowedAttributes = $allowedAttributes;
$this->stripTags = $stripTags;
$this->backgroundColor = $backgroundColor;
$this->disableDateSort = $disableDateSort;
$this->textDirection = $textDirection;
$this->noDataMessage = $noDataMessage;
$this->templateId = $templateId;
$this->overrideTemplate = $overrideTemplate;
$this->template = $template;
$this->css = $css;
$this->javaScript = $javaScript;
$this->randomiseItems = $randomiseItems;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"editFeed",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"updateInterval",
",",
"$",
"effect",
",",
"$",
"speed",
",",
"$",
"copyright",
"=",
"''",
",",
"$",
"numItems",
",",
"$",
"takeItemsFrom",
","... | Edit Ticker with RSS FEED source.
@param string $name Optional Widget name
@param int $duration Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $updateInterval Update interval in minutes
@param string $effect Effect that will be used to transitions between items, available options: fade, fadeout, scrollVert, scollHorz, flipVert, flipHorz, shuffle, tileSlide, tileBlind, marqueeUp, marqueeDown, marqueeRight, marqueeLeft
@param int $speed The transition speed of the selected effect in milliseconds (1000 = normal) or the Marquee speed in a low to high scale (normal = 1)
@param string $copyright Copyright information to display as the last item in this feed. can be styled with the #copyright CSS selector
@param int $numItems The number of RSS items you want to display
@param string $takeItemsFrom Take the items form the beginning or the end of the list, available options: start, end
@param int $durationIsPerItem Flag The duration specified is per item, otherwise it is per feed
@param int $itemsSideBySide Should items be shown side by side
@param int $itemsPerPage When in single mode, how many items per page should be shown
@param string $dateFormat The date format to apply to all dates returned by the ticker
@param string $allowedAttributes A comma separated list of attributes that should not be stripped from the feed
@param string $stripTags A comma separated list of attributes that should be stripped from the feed
@param string $backgroundColor A HEX color to use as the background color of this widget
@param int $disableDateSort Flag Should the date sort applied to the feed be disabled?
@param string $textDirection Which direction does the text in the feed use? Available options: ltr, rtl
@param string $noDataMessage A message to display when no data is returned from the source
@param string $templateId Template you’d like to apply, options available: title-only, prominent-title-with-desc-and-name-separator, media-rss-with-title, media-rss-wth-left-hand-text, media-rss-image-only
@param int $overrideTemplate override template checkbox
@param string $template Template for each item, replaces [itemsTemplate] in main template
@param string $css Optional StyleSheet CSS
@param string $javaScript Optional CSS
@param int $randomiseItems Flag whether to randomise the feed
@param int $widgetId The Widget ID
@return XiboTicker | [
"Edit",
"Ticker",
"with",
"RSS",
"FEED",
"source",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboTicker.php#L207-L240 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboTicker.php | XiboTicker.editDataSet | public function editDataSet($name, $duration, $useDuration, $updateInterval, $effect, $speed, $durationIsPerItem, $itemsSideBySide, $itemsPerPage, $upperLimit, $lowerLimit, $dateFormat, $backgroundColor, $noDataMessage, $template, $css = '', $filter, $ordering, $useOrderingClause, $useFilteringClause, $widgetId)
{
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->updateInterval = $updateInterval;
$this->effect = $effect;
$this->speed = $speed;
$this->durationIsPerItem = $durationIsPerItem;
$this->itemsSideBySide = $itemsSideBySide;
$this->itemsPerPage = $itemsPerPage;
$this->upperLimit = $upperLimit;
$this->lowerLimit = $lowerLimit;
$this->dateFormat = $dateFormat;
$this->backgroundColor = $backgroundColor;
$this->noDataMessage = $noDataMessage;
$this->template = $template;
$this->css = $css;
$this->filter = $filter;
$this->ordering = $ordering;
$this->useOrderingClause = $useOrderingClause;
$this->useFilteringClause = $useFilteringClause;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | php | public function editDataSet($name, $duration, $useDuration, $updateInterval, $effect, $speed, $durationIsPerItem, $itemsSideBySide, $itemsPerPage, $upperLimit, $lowerLimit, $dateFormat, $backgroundColor, $noDataMessage, $template, $css = '', $filter, $ordering, $useOrderingClause, $useFilteringClause, $widgetId)
{
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->updateInterval = $updateInterval;
$this->effect = $effect;
$this->speed = $speed;
$this->durationIsPerItem = $durationIsPerItem;
$this->itemsSideBySide = $itemsSideBySide;
$this->itemsPerPage = $itemsPerPage;
$this->upperLimit = $upperLimit;
$this->lowerLimit = $lowerLimit;
$this->dateFormat = $dateFormat;
$this->backgroundColor = $backgroundColor;
$this->noDataMessage = $noDataMessage;
$this->template = $template;
$this->css = $css;
$this->filter = $filter;
$this->ordering = $ordering;
$this->useOrderingClause = $useOrderingClause;
$this->useFilteringClause = $useFilteringClause;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"editDataSet",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"updateInterval",
",",
"$",
"effect",
",",
"$",
"speed",
",",
"$",
"durationIsPerItem",
",",
"$",
"itemsSideBySide",
",",
"$",
"itemsPerPage",
"... | Edit Ticker widget with dataSet source
@param string $name Optional Widget name
@param int $duration Widget Duration
@param int $useDuration Flag indicating whether to use custom duration
@param int $updateInterval Update interval in minutes
@param string $effect Effect that will be used to transitions between items, available options: fade, fadeout, scrollVert, scollHorz, flipVert, flipHorz, shuffle, tileSlide, tileBlind, marqueeUp, marqueeDown, marqueeRight, marqueeLeft
@param int $speed The transition speed of the selected effect in milliseconds (1000 = normal) or the Marquee speed in a low to high scale (normal = 1)
@param int $durationIsPerItem Flag The duration specified is per item, otherwise it is per feed
@param int $itemsSideBySide Should items be shown side by side
@param int $itemsPerPage When in single mode, how many items per page should be shown
@param int $upperLimit Upper low limit for this dataSet, 0 for nor limit
@param int $lowerLimit lower low limit for this dataSet, 0 for nor limit
@param string $dateFormat The date format to apply to all dates returned by the ticker
@param string $backgroundColor A HEX color to use as the background color of this widget
@param string $noDataMessage A message to display when no data is returned from the source
@param string $template Template for each item, replaces [itemsTemplate] in main template
@param string $css Optional StyleSheet CSS
@param string $filter SQL clause for filter this dataSet
@param string $ordering SQL clause for how this dataSet should be ordered
@param int $useOrderingClause Use advanced order clause - set to 1 if ordering is provided
@param int $useFilteringClause Use advanced filter clause - set to 1 if filter is provided
@param int $widgetId The Widget ID
@return XiboTicker | [
"Edit",
"Ticker",
"widget",
"with",
"dataSet",
"source"
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboTicker.php#L270-L298 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSetView.php | XiboDataSetView.create | public function create($dataSetId, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->dataSetId = $dataSetId;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating DataSet View widget and assigning it to playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/dataSetView/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | php | public function create($dataSetId, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->dataSetId = $dataSetId;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating DataSet View widget and assigning it to playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/dataSetView/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"dataSetId",
",",
"$",
"playlistId",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
"->",
"getMe",
"(",
")",
"->",
"getId",
"(",
")",
";",
"$",
"this",
"->",
"... | Create a new dataSetView widget.
@param int $dataSetId The dataSet ID to use as a source for dataSetView widget
@param int $playlistId The playlist ID to which this dataSetView widget should be added
@return XiboDataSetView | [
"Create",
"a",
"new",
"dataSetView",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSetView.php#L110-L119 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSetView.php | XiboDataSetView.edit | public function edit($name, $duration, $useDuration, $dataSetColumnId = [], $updateInterval, $rowsPerPage, $showHeadings, $upperLimit = 0, $lowerLimit = 0, $filter = null, $ordering = null, $templateId = 'empty', $overrideTemplate = 0, $useOrderingClause = 0, $useFilteringClause = 0, $noDataMessage = '', $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->dataSetColumnId = $dataSetColumnId;
$this->updateInterval = $updateInterval;
$this->rowsPerPage = $rowsPerPage;
$this->showHeadings = $showHeadings;
$this->upperLimit = $upperLimit;
$this->lowerLimit = $lowerLimit;
$this->filter = $filter;
$this->ordering = $ordering;
$this->templateId = $templateId;
$this->overrideTemplate = $overrideTemplate;
$this->useOrderingClause = $useOrderingClause;
$this->useFilteringClause = $useFilteringClause;
$this->noDataMessage = $noDataMessage;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId, $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $duration, $useDuration, $dataSetColumnId = [], $updateInterval, $rowsPerPage, $showHeadings, $upperLimit = 0, $lowerLimit = 0, $filter = null, $ordering = null, $templateId = 'empty', $overrideTemplate = 0, $useOrderingClause = 0, $useFilteringClause = 0, $noDataMessage = '', $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->dataSetColumnId = $dataSetColumnId;
$this->updateInterval = $updateInterval;
$this->rowsPerPage = $rowsPerPage;
$this->showHeadings = $showHeadings;
$this->upperLimit = $upperLimit;
$this->lowerLimit = $lowerLimit;
$this->filter = $filter;
$this->ordering = $ordering;
$this->templateId = $templateId;
$this->overrideTemplate = $overrideTemplate;
$this->useOrderingClause = $useOrderingClause;
$this->useFilteringClause = $useFilteringClause;
$this->noDataMessage = $noDataMessage;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId, $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"dataSetColumnId",
"=",
"[",
"]",
",",
"$",
"updateInterval",
",",
"$",
"rowsPerPage",
",",
"$",
"showHeadings",
",",
"$",
"upperLimit",
"=",
"0",
... | Edit the DataSetView widget.
@param string $name Optional widget name
@param int $duration Widget Duration
@param int $useDuration Flag whether to use custom duration
@param array $dataSetColumnId An array of dataSetColumnIds to assign
@param int $updateInterval Widget update interval in minutes
@param int $rowsPerPage Number of rows per page, 0 for no pages
@param int $showHeadings Flag Should the table show the Heading?
@param int $upperLimit Upper row limit for this dataSet, 0 for no limit
@param int $lowerLimit Lower row limit for this dataSet, 0 for no limit
@param string $filter SQL clause to filter the dataSet
@param string $ordering SQL clause to order the dataSet
@param string $templateId Template to apply, available options: empty, light-green
@param int $overrideTemplate Flag whether to override the template
@param int $useOrderingClause Flag whether to use advanced ordering, set to 1 if ordring is provided
@param int $useFilteringClause Flag whether to use advanced filer, set to 1 ifd filter is provided
@param string $noDataMessage A message to display when there is no data returned from the source
@param int $widgetId The Widget ID to edit
@return XiboDataSetView | [
"Edit",
"the",
"DataSetView",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSetView.php#L143-L168 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.get | public function get(array $params = [])
{
$entries = [];
$this->getLogger()->info('Getting list of dataSets ');
$response = $this->doGet($this->url, $params);
foreach ($response as $item) {
$entries[] = clone $this->hydrate($item);
}
return $entries;
} | php | public function get(array $params = [])
{
$entries = [];
$this->getLogger()->info('Getting list of dataSets ');
$response = $this->doGet($this->url, $params);
foreach ($response as $item) {
$entries[] = clone $this->hydrate($item);
}
return $entries;
} | [
"public",
"function",
"get",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"entries",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Getting list of dataSets '",
")",
";",
"$",
"response",
"=",
"$",
... | Get the list of dataSets.
@param array $params filter the results by: dataSetId, dataSet, code, embeddable parameter embed=columns
@return array|XiboDataSet | [
"Get",
"the",
"list",
"of",
"dataSets",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L119-L130 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.getById | public function getById($id)
{
$this->getLogger()->info('Getting dataSet ID ' . $id);
$response = $this->doGet($this->url, [
'dataSetId' => $id
]);
if (count($response) <= 0)
throw new XiboApiException('Expecting a single record, found ' . count($response));
return clone $this->hydrate($response[0]);
} | php | public function getById($id)
{
$this->getLogger()->info('Getting dataSet ID ' . $id);
$response = $this->doGet($this->url, [
'dataSetId' => $id
]);
if (count($response) <= 0)
throw new XiboApiException('Expecting a single record, found ' . count($response));
return clone $this->hydrate($response[0]);
} | [
"public",
"function",
"getById",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Getting dataSet ID '",
".",
"$",
"id",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"doGet",
"(",
"$",
"this",
"->",
"ur... | Get the DataSet by DataSetId.
@param int $id the DataSetId to find
@return XiboDataSet
@throws XiboApiException | [
"Get",
"the",
"DataSet",
"by",
"DataSetId",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L139-L150 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.create | public function create($name, $description, $code = '', $isRemote = 0, $method = '', $uri = '', $postData = '', $authentication = '', $username = '', $password = '', $refreshRate = null, $clearRate = null, $runsAfter = null, $dataRoot = '', $summarize = '', $summarizeField = '')
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->dataSet = $name;
$this->description = $description;
$this->code = $code;
$this->isRemote = $isRemote;
$this->method = $method;
$this->uri = $uri;
$this->postData = $postData;
$this->authentication = $authentication;
$this->username = $username;
$this->password = $password;
$this->refreshRate = $refreshRate;
$this->clearRate = $clearRate;
$this->runsAfter = $runsAfter;
$this->dataRoot = $dataRoot;
$this->summarize = $summarize;
$this->summarizeField = $summarizeField;
$this->getLogger()->info('Creating dataSet ' . $name);
$response = $this->doPost('/dataset', $this->toArray());
return $this->hydrate($response);
} | php | public function create($name, $description, $code = '', $isRemote = 0, $method = '', $uri = '', $postData = '', $authentication = '', $username = '', $password = '', $refreshRate = null, $clearRate = null, $runsAfter = null, $dataRoot = '', $summarize = '', $summarizeField = '')
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->dataSet = $name;
$this->description = $description;
$this->code = $code;
$this->isRemote = $isRemote;
$this->method = $method;
$this->uri = $uri;
$this->postData = $postData;
$this->authentication = $authentication;
$this->username = $username;
$this->password = $password;
$this->refreshRate = $refreshRate;
$this->clearRate = $clearRate;
$this->runsAfter = $runsAfter;
$this->dataRoot = $dataRoot;
$this->summarize = $summarize;
$this->summarizeField = $summarizeField;
$this->getLogger()->info('Creating dataSet ' . $name);
$response = $this->doPost('/dataset', $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"description",
",",
"$",
"code",
"=",
"''",
",",
"$",
"isRemote",
"=",
"0",
",",
"$",
"method",
"=",
"''",
",",
"$",
"uri",
"=",
"''",
",",
"$",
"postData",
"=",
"''",
",",
"$",
"authe... | Create the DataSet.
@param string $name New name for the dataSet
@param string $description New Description for the dataSet
@param string $code New code for this DataSet
@param int $isRemote Flag (0, 1) is this remote DataSet?
@param string $method For isRemote=1, The Request Method GET or POST
@param string $uri For isRemote=1, The URI, without query parameters
@param string $postData For isRemote=1, Query parameter encoded data to add to the request
@param string $authentication For isRemote=1, HTTP Authentication method None|Basic|Digest
@param string $username for isRemote=1, HTTP Authentication User Name
@param string $password for isRemote=1, HTTP Authentication Password
@param int $refreshRate for isRemote=1, How often in seconds should this remote DataSet be refreshed
@param int $clearRate for isRemote=1, How often in seconds should this remote DataSet be truncated
@param int $runsAfter for isRemote=1, Optional dataSetId which should be run before this remote DataSet
@param string $dataRoot for isRemote=1, The root of the data in the Remote source which is used as the base for all remote columns
@param string $summarize for isRemote=1, Should the data be aggregated? None|Summarize|Count
@param string $summarizeField for isRemote=1, Which field should be used to summarize
@return XiboDataSet | [
"Create",
"the",
"DataSet",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L173-L197 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.edit | public function edit($dataSetId, $name, $description, $code = '', $isRemote = 0, $method = '', $uri = '', $postData = '', $authentication = '', $username = '', $password = '', $refreshRate = null, $clearRate = null, $runsAfter = null, $dataRoot = '', $summarize = '', $summarizeField = '')
{
$this->dataSetId = $dataSetId;
$this->dataSet = $name;
$this->description = $description;
$this->code = $code;
$this->isRemote = $isRemote;
$this->method = $method;
$this->uri = $uri;
$this->postData = $postData;
$this->authentication = $authentication;
$this->username = $username;
$this->password = $password;
$this->refreshRate = $refreshRate;
$this->clearRate = $clearRate;
$this->runsAfter = $runsAfter;
$this->dataRoot = $dataRoot;
$this->summarize = $summarize;
$this->summarizeField = $summarizeField;
$this->getLogger()->info('Editing dataSet ID ' . $this->dataSetId);
$response = $this->doPut('/dataset/' . $dataSetId, $this->toArray());
return $this->hydrate($response);
} | php | public function edit($dataSetId, $name, $description, $code = '', $isRemote = 0, $method = '', $uri = '', $postData = '', $authentication = '', $username = '', $password = '', $refreshRate = null, $clearRate = null, $runsAfter = null, $dataRoot = '', $summarize = '', $summarizeField = '')
{
$this->dataSetId = $dataSetId;
$this->dataSet = $name;
$this->description = $description;
$this->code = $code;
$this->isRemote = $isRemote;
$this->method = $method;
$this->uri = $uri;
$this->postData = $postData;
$this->authentication = $authentication;
$this->username = $username;
$this->password = $password;
$this->refreshRate = $refreshRate;
$this->clearRate = $clearRate;
$this->runsAfter = $runsAfter;
$this->dataRoot = $dataRoot;
$this->summarize = $summarize;
$this->summarizeField = $summarizeField;
$this->getLogger()->info('Editing dataSet ID ' . $this->dataSetId);
$response = $this->doPut('/dataset/' . $dataSetId, $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"dataSetId",
",",
"$",
"name",
",",
"$",
"description",
",",
"$",
"code",
"=",
"''",
",",
"$",
"isRemote",
"=",
"0",
",",
"$",
"method",
"=",
"''",
",",
"$",
"uri",
"=",
"''",
",",
"$",
"postData",
"=",
"... | Edit the DataSet.
@param int $dataSetId The Id of the dataSet to edit
@param string $name New name for the dataSet
@param string $description New Description for the dataSet
@param string $code New code for this DataSet
@param int $isRemote Flag (0, 1) is this remote DataSet?
@param string $method For isRemote=1, The Request Method GET or POST
@param string $uri For isRemote=1, The URI, without query parameters
@param string $postData For isRemote=1, Query parameter encoded data to add to the request
@param string $authentication For isRemote=1, HTTP Authentication method None|Basic|Digest
@param string $username for isRemote=1, HTTP Authentication User Name
@param string $password for isRemote=1, HTTP Authentication Password
@param int $refreshRate for isRemote=1, How often in seconds should this remote DataSet be refreshed
@param int $clearRate for isRemote=1, How often in seconds should this remote DataSet be truncated
@param int $runsAfter for isRemote=1, Optional dataSetId which should be run before this remote DataSet
@param string $dataRoot for isRemote=1, The root of the data in the Remote source which is used as the base for all remote columns
@param string $summarize for isRemote=1, Should the data be aggregated? None|Summarize|Count
@param string $summarizeField for isRemote=1, Which field should be used to summarize
@return XiboDataSet | [
"Edit",
"the",
"DataSet",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L221-L245 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.deleteWData | public function deleteWData()
{
$this->getLogger()->info('Forcefully deleting dataSet ID ' . $this->dataSetId);
$this->doDelete('/dataset/' . $this->dataSetId, [
'deleteData' => 1
]);
return true;
} | php | public function deleteWData()
{
$this->getLogger()->info('Forcefully deleting dataSet ID ' . $this->dataSetId);
$this->doDelete('/dataset/' . $this->dataSetId, [
'deleteData' => 1
]);
return true;
} | [
"public",
"function",
"deleteWData",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Forcefully deleting dataSet ID '",
".",
"$",
"this",
"->",
"dataSetId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"'/dataset/'",
".",
"$"... | Force delete dataSet that contains a data in it.
@return bool | [
"Force",
"delete",
"dataSet",
"that",
"contains",
"a",
"data",
"in",
"it",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L266-L274 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.copy | public function copy($dataSetId, $dataSet, $description = '', $code ='')
{
$this->dataSetId = $dataSetId;
$this->dataSet = $dataSet;
$this->description = $description;
$this->code = $code;
$this->getLogger()->info('Copy dataSet ID ' . $dataSetId);
$response = $this->doPost('/dataset/copy/' . $dataSetId, $this->toArray());
return $this->hydrate($response);
} | php | public function copy($dataSetId, $dataSet, $description = '', $code ='')
{
$this->dataSetId = $dataSetId;
$this->dataSet = $dataSet;
$this->description = $description;
$this->code = $code;
$this->getLogger()->info('Copy dataSet ID ' . $dataSetId);
$response = $this->doPost('/dataset/copy/' . $dataSetId, $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"copy",
"(",
"$",
"dataSetId",
",",
"$",
"dataSet",
",",
"$",
"description",
"=",
"''",
",",
"$",
"code",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"dataSetId",
"=",
"$",
"dataSetId",
";",
"$",
"this",
"->",
"dataSet",
"=",
"$",... | Copy DataSet.
@param int $dataSetId Id of the dataSet to copy
@param string $dataSet Name of the copied dataSet
@param string $description Description of the copied dataSet
@param string $code Code for the new dataSet
@return XiboDataSet | [
"Copy",
"DataSet",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L285-L296 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.editColumn | public function editColumn($heading, $listContent, $columnOrder, $dataTypeId, $dataSetColumnTypeId, $formula, $remoteField = '', $showFilter = 0, $showSort = 0)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->heading = $heading;
$this->listContent = $listContent;
$this->columnOrder = $columnOrder;
$this->dataTypeId = $dataTypeId;
$this->dataSetColumnTypeId = $dataSetColumnTypeId;
$this->formula = $formula;
$this->remoteField = $remoteField;
$this->showFilter = $showFilter;
$this->showSort = $showSort;
$this->getLogger()->info('Editing column ID ' . $this->dataSetColumnId . ' From dataSet ID ' . $this->dataSetId);
$response = $this->doPut('/dataset/'. $this->dataSetId . '/column/' . $this->dataSetColumnId, $this->toArray());
return $this->hydrate($response);
} | php | public function editColumn($heading, $listContent, $columnOrder, $dataTypeId, $dataSetColumnTypeId, $formula, $remoteField = '', $showFilter = 0, $showSort = 0)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->heading = $heading;
$this->listContent = $listContent;
$this->columnOrder = $columnOrder;
$this->dataTypeId = $dataTypeId;
$this->dataSetColumnTypeId = $dataSetColumnTypeId;
$this->formula = $formula;
$this->remoteField = $remoteField;
$this->showFilter = $showFilter;
$this->showSort = $showSort;
$this->getLogger()->info('Editing column ID ' . $this->dataSetColumnId . ' From dataSet ID ' . $this->dataSetId);
$response = $this->doPut('/dataset/'. $this->dataSetId . '/column/' . $this->dataSetColumnId, $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"editColumn",
"(",
"$",
"heading",
",",
"$",
"listContent",
",",
"$",
"columnOrder",
",",
"$",
"dataTypeId",
",",
"$",
"dataSetColumnTypeId",
",",
"$",
"formula",
",",
"$",
"remoteField",
"=",
"''",
",",
"$",
"showFilter",
"=",
"0",
... | Edit Column.
@param string $heading The heading for the column
@param string $listContent A comma separated list of content for dropdowns
@param int $columnOrder Display order for this column
@param int $dataTypeId The data type ID for this column 1 - String, 2 - Number, 3 - Date, 4 - External Image, 5 - Internal Image
@param int $dataSetColumnTypeId The column type for this column 1 - Value, 2 - Formula, 3 - Remote
@param string $formula MySQL SELECT syntax formula for this column if the column type is set to formula
@param string $remoteField Only for dataSetColumnTypeId=3, JSON-String to select Data from the remote DataSet
@param int $showFilter Flag indicating whether this column should present a filter on DataEntry
@param int $showSort Flag indicating whether this column should allow sorting on DataEntry
@return XiboDataSet
@return XiboDataSet | [
"Edit",
"Column",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L368-L385 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSet.php | XiboDataSet.deleteColumn | public function deleteColumn()
{
$this->getLogger()->info('Deleting column ID ' . $this->dataSetColumnId . ' From dataSet ID ' . $this->dataSetId);
$this->doDelete('/dataset/' . $this->dataSetId . '/column/' . $this->dataSetColumnId);
return true;
} | php | public function deleteColumn()
{
$this->getLogger()->info('Deleting column ID ' . $this->dataSetColumnId . ' From dataSet ID ' . $this->dataSetId);
$this->doDelete('/dataset/' . $this->dataSetId . '/column/' . $this->dataSetColumnId);
return true;
} | [
"public",
"function",
"deleteColumn",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Deleting column ID '",
".",
"$",
"this",
"->",
"dataSetColumnId",
".",
"' From dataSet ID '",
".",
"$",
"this",
"->",
"dataSetId",
")",
";",
... | Delete Column.
@return bool | [
"Delete",
"Column",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSet.php#L392-L398 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSetRow.php | XiboDataSetRow.get | public function get($dataSetId)
{
$this->dataSetId = $dataSetId;
$this->getLogger()->info('Getting row data from dataSet ID ' . $dataSetId);
$response = $this->doGet('/dataset/data/'. $this->dataSetId);
return $response;
} | php | public function get($dataSetId)
{
$this->dataSetId = $dataSetId;
$this->getLogger()->info('Getting row data from dataSet ID ' . $dataSetId);
$response = $this->doGet('/dataset/data/'. $this->dataSetId);
return $response;
} | [
"public",
"function",
"get",
"(",
"$",
"dataSetId",
")",
"{",
"$",
"this",
"->",
"dataSetId",
"=",
"$",
"dataSetId",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Getting row data from dataSet ID '",
".",
"$",
"dataSetId",
")",
";",
... | Get a data for the specified dataSetId.
@param int $dataSetId The DataSetId
@return XiboDataSetRow | [
"Get",
"a",
"data",
"for",
"the",
"specified",
"dataSetId",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSetRow.php#L50-L57 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSetRow.php | XiboDataSetRow.create | public function create($dataSetId, $columnId, $rowData)
{
$this->dataSetId = $dataSetId;
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->getLogger()->info('Creating row in dataSet ID ' . $dataSetId . ' Column ID ' . $columnId);
$response = $this->doPost('/dataset/data/'. $dataSetId, [
'dataSetColumnId_' . $columnId => $rowData
]);
return $response;
} | php | public function create($dataSetId, $columnId, $rowData)
{
$this->dataSetId = $dataSetId;
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->getLogger()->info('Creating row in dataSet ID ' . $dataSetId . ' Column ID ' . $columnId);
$response = $this->doPost('/dataset/data/'. $dataSetId, [
'dataSetColumnId_' . $columnId => $rowData
]);
return $response;
} | [
"public",
"function",
"create",
"(",
"$",
"dataSetId",
",",
"$",
"columnId",
",",
"$",
"rowData",
")",
"{",
"$",
"this",
"->",
"dataSetId",
"=",
"$",
"dataSetId",
";",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
... | Create Row.
@param string $rowData The data to add to the specified column
@param int $dataSetId The DataSetId
@param int $columnId The dataSetColumnId
@return XiboDataSetRow | [
"Create",
"Row",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSetRow.php#L67-L77 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDataSetRow.php | XiboDataSetRow.edit | public function edit($dataSetId, $columnId, $rowData)
{
$this->dataSetId = $dataSetId;
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->getLogger()->info('Editing row ID' . $this->rowId . ' In dataSet ID ' . $dataSetId . ' Column ID' . $columnId);
$response = $this->doPut('/dataset/data/'. $this->dataSetId . $this->rowId, [
'dataSetColumnId_' . $columnId => $rowData
]);
return $response;
} | php | public function edit($dataSetId, $columnId, $rowData)
{
$this->dataSetId = $dataSetId;
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->getLogger()->info('Editing row ID' . $this->rowId . ' In dataSet ID ' . $dataSetId . ' Column ID' . $columnId);
$response = $this->doPut('/dataset/data/'. $this->dataSetId . $this->rowId, [
'dataSetColumnId_' . $columnId => $rowData
]);
return $response;
} | [
"public",
"function",
"edit",
"(",
"$",
"dataSetId",
",",
"$",
"columnId",
",",
"$",
"rowData",
")",
"{",
"$",
"this",
"->",
"dataSetId",
"=",
"$",
"dataSetId",
";",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
... | Edit Row.
@param string $rowData The data to edit to the specified column
@param int $dataSetId The DataSetId
@param int $columnId The dataSetColumnId
@return XiboDataSetRow | [
"Edit",
"Row",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDataSetRow.php#L87-L97 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboCampaign.php | XiboCampaign.create | public function create($campaign)
{
$this->getLogger()->debug('Getting Resource Owner');
$this->ownerId = $this->getEntityProvider()->getMe()->getId();
$this->campaign = $campaign;
// Rewrite parameter mismatch
$array = $this->toArray();
$array['name'] = $array['campaign'];
$this->getLogger()->info('Creating Campaign ' . $this->campaign);
$response = $this->doPost($this->url, $array);
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | php | public function create($campaign)
{
$this->getLogger()->debug('Getting Resource Owner');
$this->ownerId = $this->getEntityProvider()->getMe()->getId();
$this->campaign = $campaign;
// Rewrite parameter mismatch
$array = $this->toArray();
$array['name'] = $array['campaign'];
$this->getLogger()->info('Creating Campaign ' . $this->campaign);
$response = $this->doPost($this->url, $array);
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"campaign",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'Getting Resource Owner'",
")",
";",
"$",
"this",
"->",
"ownerId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
"->",... | Add a new campaign with specified name.
@param string $campaign name of the campaign
@return XiboCampaign | [
"Add",
"a",
"new",
"campaign",
"with",
"specified",
"name",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboCampaign.php#L98-L112 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboCampaign.php | XiboCampaign.edit | public function edit($campaign)
{
$this->getLogger()->debug('Getting Resource Owner');
$this->ownerId = $this->getEntityProvider()->getMe()->getId();
$this->campaign = $campaign;
// Rewrite parameter mismatch
$array = $this->toArray();
$array['name'] = $array['campaign'];
$this->getLogger()->info('Editing Campaign ID ' . $this->campaignId);
$response = $this->doPut($this->url . '/' . $this->campaignId, $array);
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | php | public function edit($campaign)
{
$this->getLogger()->debug('Getting Resource Owner');
$this->ownerId = $this->getEntityProvider()->getMe()->getId();
$this->campaign = $campaign;
// Rewrite parameter mismatch
$array = $this->toArray();
$array['name'] = $array['campaign'];
$this->getLogger()->info('Editing Campaign ID ' . $this->campaignId);
$response = $this->doPut($this->url . '/' . $this->campaignId, $array);
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"campaign",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"debug",
"(",
"'Getting Resource Owner'",
")",
";",
"$",
"this",
"->",
"ownerId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
"->",
... | Edit campaign and change its name to the specified one.
@param string $campaign name of the campaign
@return XiboCampaign | [
"Edit",
"campaign",
"and",
"change",
"its",
"name",
"to",
"the",
"specified",
"one",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboCampaign.php#L120-L134 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboCampaign.php | XiboCampaign.delete | public function delete()
{
$this->getLogger()->info('Deleting Campaign ID ' . $this->campaignId);
$this->doDelete($this->url . '/' . $this->campaignId);
return true;
} | php | public function delete()
{
$this->getLogger()->info('Deleting Campaign ID ' . $this->campaignId);
$this->doDelete($this->url . '/' . $this->campaignId);
return true;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Deleting Campaign ID '",
".",
"$",
"this",
"->",
"campaignId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"$",
"this",
"->",
"url",
".",
... | Deletes the campaign.
@return bool | [
"Deletes",
"the",
"campaign",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboCampaign.php#L141-L147 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboCampaign.php | XiboCampaign.assignLayout | public function assignLayout($layoutId = [], $displayOrder = [], $unassignLayoutId = [])
{
// TODO Check if $layoutId and $displayOrderId have the same length, throw error otherwise
if ($layoutId != [] && $unassignLayoutId == []) {
for ($i = 0; $i < count($layoutId); $i++) {
$response = $this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'layoutId' => [
[
'layoutId' => $layoutId[$i],
'displayOrder' => $displayOrder[$i]
]
]
]);
$this->getLogger()->info('Assigning Layout ID ' . $layoutId[$i] . ' To Campaign ID ' . $this->campaignId);
}
} elseif ($layoutId != [] && $unassignLayoutId != []) {
for ($i = 0; $i < count($layoutId); $i++) {
for ($j = 0; $j < count($unassignLayoutId); $j++) {
$response = $this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'layoutId' => [
[
'layoutId' => $layoutId[$i],
'displayOrder' => $displayOrder[$i]
]
],
'unassignLayoutId' => [
[
'layoutId' => $unassignLayoutId[$j],
]
]
]);
$this->getLogger()->info('Assigning Layout ID ' . $layoutId[$i] . ' To Campaign ID ' . $this->campaignId);
$this->getLogger()->info('Removing assignment Layout ID ' . $unassignLayoutId[$j] . ' From Campaign ID ' . $this->campaignId);
}
}
} elseif ($layoutId == [] && $unassignLayoutId != []) {
for ($j = 0; $j < count($unassignLayoutId); $j++) {
$response = $this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'unassignLayoutId' => [
[
'layoutId' => $unassignLayoutId[$j],
]
]
]);
$this->getLogger()->info('Removing assignment Layout ID ' . $unassignLayoutId[$j] . ' From Campaign ID ' . $this->campaignId);
}
}
// TODO Throw an error if nothing is passed / found
return $this;
} | php | public function assignLayout($layoutId = [], $displayOrder = [], $unassignLayoutId = [])
{
// TODO Check if $layoutId and $displayOrderId have the same length, throw error otherwise
if ($layoutId != [] && $unassignLayoutId == []) {
for ($i = 0; $i < count($layoutId); $i++) {
$response = $this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'layoutId' => [
[
'layoutId' => $layoutId[$i],
'displayOrder' => $displayOrder[$i]
]
]
]);
$this->getLogger()->info('Assigning Layout ID ' . $layoutId[$i] . ' To Campaign ID ' . $this->campaignId);
}
} elseif ($layoutId != [] && $unassignLayoutId != []) {
for ($i = 0; $i < count($layoutId); $i++) {
for ($j = 0; $j < count($unassignLayoutId); $j++) {
$response = $this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'layoutId' => [
[
'layoutId' => $layoutId[$i],
'displayOrder' => $displayOrder[$i]
]
],
'unassignLayoutId' => [
[
'layoutId' => $unassignLayoutId[$j],
]
]
]);
$this->getLogger()->info('Assigning Layout ID ' . $layoutId[$i] . ' To Campaign ID ' . $this->campaignId);
$this->getLogger()->info('Removing assignment Layout ID ' . $unassignLayoutId[$j] . ' From Campaign ID ' . $this->campaignId);
}
}
} elseif ($layoutId == [] && $unassignLayoutId != []) {
for ($j = 0; $j < count($unassignLayoutId); $j++) {
$response = $this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'unassignLayoutId' => [
[
'layoutId' => $unassignLayoutId[$j],
]
]
]);
$this->getLogger()->info('Removing assignment Layout ID ' . $unassignLayoutId[$j] . ' From Campaign ID ' . $this->campaignId);
}
}
// TODO Throw an error if nothing is passed / found
return $this;
} | [
"public",
"function",
"assignLayout",
"(",
"$",
"layoutId",
"=",
"[",
"]",
",",
"$",
"displayOrder",
"=",
"[",
"]",
",",
"$",
"unassignLayoutId",
"=",
"[",
"]",
")",
"{",
"// TODO Check if $layoutId and $displayOrderId have the same length, throw error otherwise",
"if... | Assign layout to the campaign.
@param array $layoutId Array of layouts Ids to assign to this campaign
@param array $displayOrder Array of Display Order numbers for the layouts to assign
@param array $unassignLayoutId Array of layouts Ids to unassign from the campaign
@return XiboCampaign | [
"Assign",
"layout",
"to",
"the",
"campaign",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboCampaign.php#L157-L209 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboCampaign.php | XiboCampaign.unassignLayout | public function unassignLayout($unassignLayoutId = [])
{
for ($j = 0; $j < count($unassignLayoutId); $j++) {
$this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'unassignLayoutId' => [
[
'layoutId' => $unassignLayoutId[$j],
]
]
]);
$this->getLogger()->info('Removing assignment Layout ID ' . $unassignLayoutId[$j] . ' From Campaign ID ' . $this->campaignId);
}
return $this;
} | php | public function unassignLayout($unassignLayoutId = [])
{
for ($j = 0; $j < count($unassignLayoutId); $j++) {
$this->doPost('/campaign/layout/assign/' . $this->campaignId, [
'unassignLayoutId' => [
[
'layoutId' => $unassignLayoutId[$j],
]
]
]);
$this->getLogger()->info('Removing assignment Layout ID ' . $unassignLayoutId[$j] . ' From Campaign ID ' . $this->campaignId);
}
return $this;
} | [
"public",
"function",
"unassignLayout",
"(",
"$",
"unassignLayoutId",
"=",
"[",
"]",
")",
"{",
"for",
"(",
"$",
"j",
"=",
"0",
";",
"$",
"j",
"<",
"count",
"(",
"$",
"unassignLayoutId",
")",
";",
"$",
"j",
"++",
")",
"{",
"$",
"this",
"->",
"doPo... | Unassign layout from the campaign.
@param array $unassignLayoutId Array of layouts Ids to unassign from the campaign
@return XiboCampaign | [
"Unassign",
"layout",
"from",
"the",
"campaign",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboCampaign.php#L217-L232 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboShellCommand.php | XiboShellCommand.create | public function create($name, $duration, $useDuration, $windowsCommand, $linuxCommand, $launchThroughCmd, $terminateCommand, $useTaskkill, $commandCode, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->windowsCommand = $windowsCommand;
$this->linuxCommand = $linuxCommand;
$this->launchThroughCmd = $launchThroughCmd;
$this->terminateCommand = $terminateCommand;
$this->useTaskkill = $useTaskkill;
$this->commandCode = $commandCode;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating new Schell Command widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/shellCommand/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | php | public function create($name, $duration, $useDuration, $windowsCommand, $linuxCommand, $launchThroughCmd, $terminateCommand, $useTaskkill, $commandCode, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->windowsCommand = $windowsCommand;
$this->linuxCommand = $linuxCommand;
$this->launchThroughCmd = $launchThroughCmd;
$this->terminateCommand = $terminateCommand;
$this->useTaskkill = $useTaskkill;
$this->commandCode = $commandCode;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating new Schell Command widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/shellCommand/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"windowsCommand",
",",
"$",
"linuxCommand",
",",
"$",
"launchThroughCmd",
",",
"$",
"terminateCommand",
",",
"$",
"useTaskkill",
",",
"$",
"commandCode... | Create new Shell Command Widget.
@param string $name Optional widget name
@param int $duration Widget duration
@param int $useDuration Flag indicating whether to use custom duration
@param string $windowsCommand Enter a Windows command line compatible command
@param string $linuxCommand Enter a Android / Linux command line compatible command
@param int $launchThroughCmd Flag Windows only, Should the player launch this command through the windows command line (cmd.exe)? This is useful for batch files, if you try to terminate this command only the command line will be terminated
@param int $terminateCommand Flag Should the player forcefully terminate the command after the duration specified, 0 to let the command terminate naturally
@param int $useTaskkill Flag Windows only, should the player use taskkill to terminate commands
@param string $commandCode Enter a reference code for exiting command in CMS
@param int $playlistId Playlist ID
@return XiboShellCommand | [
"Create",
"new",
"Shell",
"Command",
"Widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboShellCommand.php#L88-L105 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboShellCommand.php | XiboShellCommand.edit | public function edit($name, $duration, $useDuration, $windowsCommand, $linuxCommand, $launchThroughCmd, $terminateCommand, $useTaskkill, $commandCode, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->windowsCommand = $windowsCommand;
$this->linuxCommand = $linuxCommand;
$this->launchThroughCmd = $launchThroughCmd;
$this->terminateCommand = $terminateCommand;
$this->useTaskkill = $useTaskkill;
$this->commandCode = $commandCode;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing a widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $duration, $useDuration, $windowsCommand, $linuxCommand, $launchThroughCmd, $terminateCommand, $useTaskkill, $commandCode, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->duration = $duration;
$this->useDuration = $useDuration;
$this->windowsCommand = $windowsCommand;
$this->linuxCommand = $linuxCommand;
$this->launchThroughCmd = $launchThroughCmd;
$this->terminateCommand = $terminateCommand;
$this->useTaskkill = $useTaskkill;
$this->commandCode = $commandCode;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing a widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"useDuration",
",",
"$",
"windowsCommand",
",",
"$",
"linuxCommand",
",",
"$",
"launchThroughCmd",
",",
"$",
"terminateCommand",
",",
"$",
"useTaskkill",
",",
"$",
"commandCode",... | Edit existing Shell Command Widget.
@param string $name Optional widget name
@param int $duration Widget duration
@param int $useDuration Flag indicating whether to use custom duration
@param string $windowsCommand Enter a Windows command line compatible command
@param string $linuxCommand Enter a Android / Linux command line compatible command
@param int $launchThroughCmd Flag Windows only, Should the player launch this command through the windows command line (cmd.exe)? This is useful for batch files, if you try to terminate this command only the command line will be terminated
@param int $terminateCommand Flag Should the player forcefully terminate the command after the duration specified, 0 to let the command terminate naturally
@param int $useTaskkill Flag Windows only, should the player use taskkill to terminate commands
@param string $commandCode Enter a reference code for exiting command in CMS
@param int $widgetId the Widget ID
@return XiboShellCommand | [
"Edit",
"existing",
"Shell",
"Command",
"Widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboShellCommand.php#L122-L139 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.create | public function create($name, $fileLocation, $oldMediaId = null, $updateInLayouts = null, $deleteOldRevisions = null)
{
$this->getLogger()->debug('Preparing media payload ');
$payload = [
[
'name' => 'name',
'contents' => $name
],
[
'name' => 'files',
'contents' => fopen($fileLocation, 'r')
]
];
$this->getLogger()->info('Uploading new media file ' . $name);
if ($oldMediaId != null) {
$this->getLogger()->debug('Replacing old media ID ' .$oldMediaId);
$payload[] = [
'name' => 'oldMediaId',
'contents' => $oldMediaId
];
$this->getLogger()->debug('Updating Media in all layouts it is assigned to');
$payload[] = [
'name' => 'updateInLayouts',
'contents' => $updateInLayouts
];
$this->getLogger()->debug('Deleting Old Revisions');
$payload[] = [
'name' => 'deleteOldRevisions',
'contents' => $deleteOldRevisions
];
}
$response = $this->doPost('/library', ['multipart' => $payload]);
if (isset($response['files'][0]['mediaId']))
$this->getLogger()->debug('Uploaded media ' . $response['files'][0]['name'] . ' Media ID ' . $response['files'][0]['mediaId'] . ' Stored as ' . $response['files'][0]['storedas']);
// Response will have the format:
/*{
"files":[{
"name": "Name",
"size": 52770969,
"type": "video/mp4",
"mediaId": 2344,
"storedas": "2344.mp4",
"error": ""
}]
}*/
if (!isset($response['files']) || count($response['files']) != 1)
throw new XiboApiException('Invalid return from library add');
if (!empty($response['files'][0]['error']))
throw new XiboApiException($response['files'][0]['error']);
// Modify some of the return
unset($response['files'][0]['url']);
$response['files'][0]['storedAs'] = $response['files'][0]['storedas'];
$media = new XiboLibrary($this->getEntityProvider());
return $media->hydrate($response['files'][0]);
} | php | public function create($name, $fileLocation, $oldMediaId = null, $updateInLayouts = null, $deleteOldRevisions = null)
{
$this->getLogger()->debug('Preparing media payload ');
$payload = [
[
'name' => 'name',
'contents' => $name
],
[
'name' => 'files',
'contents' => fopen($fileLocation, 'r')
]
];
$this->getLogger()->info('Uploading new media file ' . $name);
if ($oldMediaId != null) {
$this->getLogger()->debug('Replacing old media ID ' .$oldMediaId);
$payload[] = [
'name' => 'oldMediaId',
'contents' => $oldMediaId
];
$this->getLogger()->debug('Updating Media in all layouts it is assigned to');
$payload[] = [
'name' => 'updateInLayouts',
'contents' => $updateInLayouts
];
$this->getLogger()->debug('Deleting Old Revisions');
$payload[] = [
'name' => 'deleteOldRevisions',
'contents' => $deleteOldRevisions
];
}
$response = $this->doPost('/library', ['multipart' => $payload]);
if (isset($response['files'][0]['mediaId']))
$this->getLogger()->debug('Uploaded media ' . $response['files'][0]['name'] . ' Media ID ' . $response['files'][0]['mediaId'] . ' Stored as ' . $response['files'][0]['storedas']);
// Response will have the format:
/*{
"files":[{
"name": "Name",
"size": 52770969,
"type": "video/mp4",
"mediaId": 2344,
"storedas": "2344.mp4",
"error": ""
}]
}*/
if (!isset($response['files']) || count($response['files']) != 1)
throw new XiboApiException('Invalid return from library add');
if (!empty($response['files'][0]['error']))
throw new XiboApiException($response['files'][0]['error']);
// Modify some of the return
unset($response['files'][0]['url']);
$response['files'][0]['storedAs'] = $response['files'][0]['storedas'];
$media = new XiboLibrary($this->getEntityProvider());
return $media->hydrate($response['files'][0]);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"fileLocation",
",",
"$",
"oldMediaId",
"=",
"null",
",",
"$",
"updateInLayouts",
"=",
"null",
",",
"$",
"deleteOldRevisions",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
... | Upload new media.
Upload new media file to the CMS library.
@param string $name optional media name
@param string $fileLocation location of the file
@param int $oldMediaId Id of an existing media file which should be replaced with the new upload
@param int $updateInLayouts Flag set to 1 to update this media in all layouts (use with oldMediaId)
@param int $deleteOldRevisions Flag to either remove or leave the old file revisions (use with oldMediaId)
@return XiboLibrary
@throws XiboApiException | [
"Upload",
"new",
"media",
".",
"Upload",
"new",
"media",
"file",
"to",
"the",
"CMS",
"library",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L137-L193 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.revise | public function revise($fileLocation)
{
$this->getLogger()->info('Revising file');
return $this->create($this->name, $fileLocation, $this->mediaId, $this->updateInLayouts, $this->deleteOldRevisions);
} | php | public function revise($fileLocation)
{
$this->getLogger()->info('Revising file');
return $this->create($this->name, $fileLocation, $this->mediaId, $this->updateInLayouts, $this->deleteOldRevisions);
} | [
"public",
"function",
"revise",
"(",
"$",
"fileLocation",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Revising file'",
")",
";",
"return",
"$",
"this",
"->",
"create",
"(",
"$",
"this",
"->",
"name",
",",
"$",
"fileLocation... | Revise specified file.
@param string $fileLocation location of the file
@return XiboLibrary
@throws XiboApiException | [
"Revise",
"specified",
"file",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L203-L207 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.edit | public function edit($name, $duration, $retired, $tags, $updateInLayouts)
{
$this->name = $name;
$this->duration = $duration;
$this->retired = $retired;
$this->tags = $tags;
$this->updateInLayouts = $updateInLayouts;
$this->getLogger()->info('Editing Media ID ' . $this->mediaId);
$response = $this->doPut('/library/' . $this->mediaId, $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $duration, $retired, $tags, $updateInLayouts)
{
$this->name = $name;
$this->duration = $duration;
$this->retired = $retired;
$this->tags = $tags;
$this->updateInLayouts = $updateInLayouts;
$this->getLogger()->info('Editing Media ID ' . $this->mediaId);
$response = $this->doPut('/library/' . $this->mediaId, $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"duration",
",",
"$",
"retired",
",",
"$",
"tags",
",",
"$",
"updateInLayouts",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"duration",
"=",
"$",
"duration... | Edit existing media file.
@param string $name optional media name
@param int $duration Media duration
@param int $retired Flag indicating if this media is retired
@param string $tags Comma separated list of Tags
@param int $updateInLayouts Flag indicating whether to update the duration in all Layouts the Media is assigned to
@return XiboLibrary | [
"Edit",
"existing",
"media",
"file",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L219-L230 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.delete | public function delete()
{
$this->getLogger()->info('Deleting media ID ' . $this->mediaId);
$this->doDelete('/library/' . $this->mediaId);
return true;
} | php | public function delete()
{
$this->getLogger()->info('Deleting media ID ' . $this->mediaId);
$this->doDelete('/library/' . $this->mediaId);
return true;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Deleting media ID '",
".",
"$",
"this",
"->",
"mediaId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"'/library/'",
".",
"$",
"this",
"->",
... | Delete the media.
@return bool | [
"Delete",
"the",
"media",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L237-L243 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.deleteAssigned | public function deleteAssigned()
{
$this->getLogger()->info('Force deleting assigned media ID ' . $this->mediaId);
$this->doDelete('/library/' . $this->mediaId, [
'forceDelete' => 1
]);
return true;
} | php | public function deleteAssigned()
{
$this->getLogger()->info('Force deleting assigned media ID ' . $this->mediaId);
$this->doDelete('/library/' . $this->mediaId, [
'forceDelete' => 1
]);
return true;
} | [
"public",
"function",
"deleteAssigned",
"(",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Force deleting assigned media ID '",
".",
"$",
"this",
"->",
"mediaId",
")",
";",
"$",
"this",
"->",
"doDelete",
"(",
"'/library/'",
".",
... | Delete assigned media.
@return bool | [
"Delete",
"assigned",
"media",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L250-L258 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.AddTag | public function AddTag($tag)
{
$this->tag = $tag;
$response = $this->doPost('/library/' . $this->mediaId . '/tag', [
'tag' => [$tag]
]);
$tags = $this->hydrate($response);
foreach ($response['tags'] as $item) {
$tag = new XiboLibrary($this->getEntityProvider());
$tag->hydrate($item);
$tags->tags[] = $tag;
}
return $this;
} | php | public function AddTag($tag)
{
$this->tag = $tag;
$response = $this->doPost('/library/' . $this->mediaId . '/tag', [
'tag' => [$tag]
]);
$tags = $this->hydrate($response);
foreach ($response['tags'] as $item) {
$tag = new XiboLibrary($this->getEntityProvider());
$tag->hydrate($item);
$tags->tags[] = $tag;
}
return $this;
} | [
"public",
"function",
"AddTag",
"(",
"$",
"tag",
")",
"{",
"$",
"this",
"->",
"tag",
"=",
"$",
"tag",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"doPost",
"(",
"'/library/'",
".",
"$",
"this",
"->",
"mediaId",
".",
"'/tag'",
",",
"[",
"'tag'",
... | Add tag.
Adds specified tag to the specified media
@param string $tag name of the tag to add
@return XiboLibrary | [
"Add",
"tag",
".",
"Adds",
"specified",
"tag",
"to",
"the",
"specified",
"media"
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L267-L281 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.removeTag | public function removeTag($tag)
{
$this->tag = $tag;
$this->getLogger()->info('Removing tag: ' . $tag . ' from layout ID ' . $this->mediaId);
$this->doPost('/library/' . $this->mediaId . '/untag', [
'tag' => [$tag]
]);
return $this;
} | php | public function removeTag($tag)
{
$this->tag = $tag;
$this->getLogger()->info('Removing tag: ' . $tag . ' from layout ID ' . $this->mediaId);
$this->doPost('/library/' . $this->mediaId . '/untag', [
'tag' => [$tag]
]);
return $this;
} | [
"public",
"function",
"removeTag",
"(",
"$",
"tag",
")",
"{",
"$",
"this",
"->",
"tag",
"=",
"$",
"tag",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Removing tag: '",
".",
"$",
"tag",
".",
"' from layout ID '",
".",
"$",
"this... | Remove tag.
Removes specified tag from the specified media
@param string $tag name of the taf to remove
@return XiboLibrary | [
"Remove",
"tag",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L290-L299 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.download | public function download($mediaId, $type, $filePath, $fileName)
{
$this->mediaId = $mediaId;
$this->mediaType = $type;
$this->getLogger()->info('Downloading media ID ' . $mediaId . ' and saving it in ' . $filePath . ' as ' . $fileName);
$response = $this->doGet('/library/download/' . $this->mediaId . '/' . $this->mediaType);
// Check if the directory exists, if not create it
$this->getLogger()->debug('Checking if the directory exists');
if (!file_exists($filePath)) {
$this->getLogger()->debug('Creating directory to save files to ' . $filePath);
mkdir($filePath, 0777, true);
}
// Save file to the directory with the provided name
$file = fopen($filePath . $fileName, 'w');
fwrite($file, $response);
fclose($file);
return true;
} | php | public function download($mediaId, $type, $filePath, $fileName)
{
$this->mediaId = $mediaId;
$this->mediaType = $type;
$this->getLogger()->info('Downloading media ID ' . $mediaId . ' and saving it in ' . $filePath . ' as ' . $fileName);
$response = $this->doGet('/library/download/' . $this->mediaId . '/' . $this->mediaType);
// Check if the directory exists, if not create it
$this->getLogger()->debug('Checking if the directory exists');
if (!file_exists($filePath)) {
$this->getLogger()->debug('Creating directory to save files to ' . $filePath);
mkdir($filePath, 0777, true);
}
// Save file to the directory with the provided name
$file = fopen($filePath . $fileName, 'w');
fwrite($file, $response);
fclose($file);
return true;
} | [
"public",
"function",
"download",
"(",
"$",
"mediaId",
",",
"$",
"type",
",",
"$",
"filePath",
",",
"$",
"fileName",
")",
"{",
"$",
"this",
"->",
"mediaId",
"=",
"$",
"mediaId",
";",
"$",
"this",
"->",
"mediaType",
"=",
"$",
"type",
";",
"$",
"this... | Download Media from CMS library.
@param int $mediaId The media ID to download
@param string $type The module type to download
@param string $filePath Path to the directory where files should be saved
@param string $fileName Name of the saved media file
@return boolean | [
"Download",
"Media",
"from",
"CMS",
"library",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L327-L348 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboLibrary.php | XiboLibrary.getUsage | public function getUsage($mediaId)
{
$this->mediaId = $mediaId;
$this->getLogger()->info('Getting media usage report ' . $mediaId . ' for Displays');
$response = $this->doGet('/library/usage/' . $mediaId );
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | php | public function getUsage($mediaId)
{
$this->mediaId = $mediaId;
$this->getLogger()->info('Getting media usage report ' . $mediaId . ' for Displays');
$response = $this->doGet('/library/usage/' . $mediaId );
$this->getLogger()->debug('Passing the response to Hydrate');
return $this->hydrate($response);
} | [
"public",
"function",
"getUsage",
"(",
"$",
"mediaId",
")",
"{",
"$",
"this",
"->",
"mediaId",
"=",
"$",
"mediaId",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Getting media usage report '",
".",
"$",
"mediaId",
".",
"' for Displays... | Get Media Usage for Displays
@param int $mediaId Media ID
@return XiboLibrary | [
"Get",
"Media",
"Usage",
"for",
"Displays"
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboLibrary.php#L356-L365 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboPermissions.php | XiboPermissions.getPermissions | public function getPermissions($entity, $objectId)
{
$this->getLogger()->info('Getting Permissions arrays for Entity ' . $entity . ' with ID ' . $objectId);
$response = $this->doGet('/user/permissions/' . $entity . '/' . $objectId);
$entries = [];
foreach ($response as $item) {
$entries[] = clone $this->hydrate($item);
}
return $entries;
} | php | public function getPermissions($entity, $objectId)
{
$this->getLogger()->info('Getting Permissions arrays for Entity ' . $entity . ' with ID ' . $objectId);
$response = $this->doGet('/user/permissions/' . $entity . '/' . $objectId);
$entries = [];
foreach ($response as $item) {
$entries[] = clone $this->hydrate($item);
}
return $entries;
} | [
"public",
"function",
"getPermissions",
"(",
"$",
"entity",
",",
"$",
"objectId",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Getting Permissions arrays for Entity '",
".",
"$",
"entity",
".",
"' with ID '",
".",
"$",
"objectId",
... | Get permissions to specific entity.
@param string $entity The Name of the entity Campaign, DataSet, DayPart, DisplayGroup, Media, Notification, Page, Playlist, Region, Widget
@param int $objectId the ID of the object to return permissions for
@return XiboPermissions|array | [
"Get",
"permissions",
"to",
"specific",
"entity",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboPermissions.php#L72-L83 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboPermissions.php | XiboPermissions.setPermissions | public function setPermissions($entity, $objectId, $groupId, $view, $edit, $delete, $ownerId = null)
{
$this->getLogger()->info('Setting Permissions view ' . $view . ' edit ' . $edit . ' delete ' . $delete . ' for user group ID ' . $groupId . ' to Entity ' . $entity . ' with ID ' . $objectId);
$this->entity = $entity;
$this->objectId = $objectId;
$this->groupId = $groupId;
$this->view = $view;
$this->edit = $edit;
$this->delete = $delete;
$this->ownerId = $ownerId;
$response = $this->doPost('/user/permissions/' . $entity . '/' . $objectId, [
'groupIds' => [
$groupId => [
'view' => $view,
'edit' => $edit,
'delete' => $delete
]
],
'ownerId' => $ownerId
]);
return $this->hydrate($response);
} | php | public function setPermissions($entity, $objectId, $groupId, $view, $edit, $delete, $ownerId = null)
{
$this->getLogger()->info('Setting Permissions view ' . $view . ' edit ' . $edit . ' delete ' . $delete . ' for user group ID ' . $groupId . ' to Entity ' . $entity . ' with ID ' . $objectId);
$this->entity = $entity;
$this->objectId = $objectId;
$this->groupId = $groupId;
$this->view = $view;
$this->edit = $edit;
$this->delete = $delete;
$this->ownerId = $ownerId;
$response = $this->doPost('/user/permissions/' . $entity . '/' . $objectId, [
'groupIds' => [
$groupId => [
'view' => $view,
'edit' => $edit,
'delete' => $delete
]
],
'ownerId' => $ownerId
]);
return $this->hydrate($response);
} | [
"public",
"function",
"setPermissions",
"(",
"$",
"entity",
",",
"$",
"objectId",
",",
"$",
"groupId",
",",
"$",
"view",
",",
"$",
"edit",
",",
"$",
"delete",
",",
"$",
"ownerId",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->... | Set permissions to specific entity.
@param string $entity The Name of the entity Campaign, DataSet, DayPart, DisplayGroup, Media, Notification, Page, Playlist, Region, Widget
@param int $objectId the ID of the object to return permissions for
@param int $groupId The group ID to which the permissions should be set for
@param int $view A flag indicating whether view permission should be granted
@param int $edit A flag indicating whether edit permission should be granted
@param int $delete A flag indicating whether delete permission should be granted
@param int $ownerId Change the owner of this item. Leave empty to keep the current owner
@return XiboPermissions | [
"Set",
"permissions",
"to",
"specific",
"entity",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboPermissions.php#L98-L122 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboHls.php | XiboHls.create | public function create($name, $useDuration, $duration, $uri, $mute, $transparency, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->useDuration = $useDuration;
$this->duration = $duration;
$this->uri = $uri;
$this->mute = $mute;
$this->transparency = $transparency;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating HLS widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/hls/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | php | public function create($name, $useDuration, $duration, $uri, $mute, $transparency, $playlistId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->useDuration = $useDuration;
$this->duration = $duration;
$this->uri = $uri;
$this->mute = $mute;
$this->transparency = $transparency;
$this->playlistId = $playlistId;
$this->getLogger()->info('Creating HLS widget in playlist ID ' . $playlistId);
$response = $this->doPost('/playlist/widget/hls/' . $playlistId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"useDuration",
",",
"$",
"duration",
",",
"$",
"uri",
",",
"$",
"mute",
",",
"$",
"transparency",
",",
"$",
"playlistId",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"ge... | Create The HLS widget.
@param string $name Optional widget name
@param int $useDuration Flag indicating whether to use custom duration
@param int $duration Widget Duration
@param string $uri URL to HLS video stream
@param int $mute Flag Should the video be muted?
@param int $transparency Flag This causes some android devices to switch to a hardware accelerated web view
@param int $playlistId The playlist ID
@return XiboHls | [
"Create",
"The",
"HLS",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboHls.php#L76-L90 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboHls.php | XiboHls.edit | public function edit($name, $useDuration, $duration, $uri, $mute, $transparency, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->useDuration = $useDuration;
$this->duration = $duration;
$this->uri = $uri;
$this->mute = $mute;
$this->transparency = $transparency;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing HLS widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | php | public function edit($name, $useDuration, $duration, $uri, $mute, $transparency, $widgetId)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->name = $name;
$this->useDuration = $useDuration;
$this->duration = $duration;
$this->uri = $uri;
$this->mute = $mute;
$this->transparency = $transparency;
$this->widgetId = $widgetId;
$this->getLogger()->info('Editing HLS widget ID ' . $widgetId);
$response = $this->doPut('/playlist/widget/' . $widgetId , $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"edit",
"(",
"$",
"name",
",",
"$",
"useDuration",
",",
"$",
"duration",
",",
"$",
"uri",
",",
"$",
"mute",
",",
"$",
"transparency",
",",
"$",
"widgetId",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEnt... | Edit the HLS widget.
@param string $name Optional widget name
@param int $useDuration Flag indicating whether to use custom duration
@param int $duration Widget Duration
@param string $uri URL to HLS video stream
@param int $mute Flag Should the video be muted?
@param int $transparency Flag This causes some android devices to switch to a hardware accelerated web view
@param int $widgetId the Widget ID
@return XiboHls | [
"Edit",
"the",
"HLS",
"widget",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboHls.php#L104-L118 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboPlaylist.php | XiboPlaylist.get | public function get(array $params = [])
{
$this->getLogger()->info('Getting list of Playlists');
if (isset($params['embed']))
$embed = ($params['embed'] != null) ? explode(',', $params['embed']) : [];
$hydratedWidgets = [];
$entries = [];
$response = $this->doGet('/playlist', $params);
foreach ($response as $item) {
/** @var XiboPlaylist $playlist */
$playlist = new XiboPlaylist($this->getEntityProvider());
$playlist->hydrate($item);
if (in_array('widgets', $embed) === true) {
foreach ($playlist->widgets as $widget) {
/** @var XiboWidget $widgetObject */
$widgetObject = new XiboWidget($this->getEntityProvider());
$widgetObject->hydrate($widget);
$hydratedWidgets[] = $widgetObject;
}
$playlist->widgets = $hydratedWidgets;
}
$entries[] = clone $playlist;
}
return $entries;
} | php | public function get(array $params = [])
{
$this->getLogger()->info('Getting list of Playlists');
if (isset($params['embed']))
$embed = ($params['embed'] != null) ? explode(',', $params['embed']) : [];
$hydratedWidgets = [];
$entries = [];
$response = $this->doGet('/playlist', $params);
foreach ($response as $item) {
/** @var XiboPlaylist $playlist */
$playlist = new XiboPlaylist($this->getEntityProvider());
$playlist->hydrate($item);
if (in_array('widgets', $embed) === true) {
foreach ($playlist->widgets as $widget) {
/** @var XiboWidget $widgetObject */
$widgetObject = new XiboWidget($this->getEntityProvider());
$widgetObject->hydrate($widget);
$hydratedWidgets[] = $widgetObject;
}
$playlist->widgets = $hydratedWidgets;
}
$entries[] = clone $playlist;
}
return $entries;
} | [
"public",
"function",
"get",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"info",
"(",
"'Getting list of Playlists'",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"params",
"[",
"'embed'",
"]",
")",... | Return a list of playlists.
@param array $params can be filtered by: playlistId, name, userId, tags, mediaLike, embeddable parameter embed=widgets
@return array|XiboPlaylist | [
"Return",
"a",
"list",
"of",
"playlists",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboPlaylist.php#L85-L112 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboPlaylist.php | XiboPlaylist.assign | public function assign($media, $duration, $playlistId)
{
$this->playlistId = $playlistId;
$this->media = $media;
$this->getLogger()->info('Assigning Media To Playlist ' . $this->playlistId);
$response = $this->doPost('/playlist/library/assign/' . $playlistId, [
'media' => $media,
'duration' => $duration
]);
// Parse response
// set properties
$this->playlistId = $response['playlistId'];
$this->getLogger()->debug('Creating child object Widgets and linking it to parent Playlist');
// Set widgets property (with XiboWidget objects)
foreach ($response['widgets'] as $widget) {
$this->widgets[] = (new XiboWidget($this->getEntityProvider()))->hydrate($widget);
}
return $this;
} | php | public function assign($media, $duration, $playlistId)
{
$this->playlistId = $playlistId;
$this->media = $media;
$this->getLogger()->info('Assigning Media To Playlist ' . $this->playlistId);
$response = $this->doPost('/playlist/library/assign/' . $playlistId, [
'media' => $media,
'duration' => $duration
]);
// Parse response
// set properties
$this->playlistId = $response['playlistId'];
$this->getLogger()->debug('Creating child object Widgets and linking it to parent Playlist');
// Set widgets property (with XiboWidget objects)
foreach ($response['widgets'] as $widget) {
$this->widgets[] = (new XiboWidget($this->getEntityProvider()))->hydrate($widget);
}
return $this;
} | [
"public",
"function",
"assign",
"(",
"$",
"media",
",",
"$",
"duration",
",",
"$",
"playlistId",
")",
"{",
"$",
"this",
"->",
"playlistId",
"=",
"$",
"playlistId",
";",
"$",
"this",
"->",
"media",
"=",
"$",
"media",
";",
"$",
"this",
"->",
"getLogger... | Assign media to playlist.
@param array[int] $media Array of Media IDs to assign
@param int $duration Optional duration for all Media in this assignment to use on the widget
@param int $playlistId The Playlist ID to assign to
@return XiboPlaylist | [
"Assign",
"media",
"to",
"playlist",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboPlaylist.php#L122-L143 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboPlaylist.php | XiboPlaylist.add | public function add($name, $tags= '', $isDynamic = 0, $filterMediaName = '', $filterMediaTags = '')
{
$hydratedWidgets = [];
$this->name = $name;
$this->tags = $tags;
$this->isDynamic = $isDynamic;
$this->filterMediaName = $filterMediaName;
$this->filterMediaTags = $filterMediaTags;
$this->getLogger()->info('Creating Playlist ' . $this->name);
$response = $this->doPost('/playlist', $this->toArray());
/** @var XiboPlaylist $playlist */
$playlist = new XiboPlaylist($this->getEntityProvider());
$playlist->hydrate($response);
if (isset($playlist->widgets)) {
foreach ($playlist->widgets as $widget) {
/** @var XiboWidget $widgetObject */
$widgetObject = new XiboWidget($this->getEntityProvider());
$widgetObject->hydrate($widget);
$hydratedWidgets[] = $widgetObject;
}
$playlist->widgets = $hydratedWidgets;
}
return $playlist;
} | php | public function add($name, $tags= '', $isDynamic = 0, $filterMediaName = '', $filterMediaTags = '')
{
$hydratedWidgets = [];
$this->name = $name;
$this->tags = $tags;
$this->isDynamic = $isDynamic;
$this->filterMediaName = $filterMediaName;
$this->filterMediaTags = $filterMediaTags;
$this->getLogger()->info('Creating Playlist ' . $this->name);
$response = $this->doPost('/playlist', $this->toArray());
/** @var XiboPlaylist $playlist */
$playlist = new XiboPlaylist($this->getEntityProvider());
$playlist->hydrate($response);
if (isset($playlist->widgets)) {
foreach ($playlist->widgets as $widget) {
/** @var XiboWidget $widgetObject */
$widgetObject = new XiboWidget($this->getEntityProvider());
$widgetObject->hydrate($widget);
$hydratedWidgets[] = $widgetObject;
}
$playlist->widgets = $hydratedWidgets;
}
return $playlist;
} | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"tags",
"=",
"''",
",",
"$",
"isDynamic",
"=",
"0",
",",
"$",
"filterMediaName",
"=",
"''",
",",
"$",
"filterMediaTags",
"=",
"''",
")",
"{",
"$",
"hydratedWidgets",
"=",
"[",
"]",
";",
"$",
... | Create a new Playlist
@param string $name Name of the playlist
@param string $tags A Comma separated list of tags
@param int $isDynamic Flag indicating whether the playlist is dynamic
@param string $filterMediaName For dynamic playlist the filter by media Name
@param string $filterMediaTags For dynamic playlist the filter by media Tag
@return XiboPlaylist | [
"Create",
"a",
"new",
"Playlist"
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboPlaylist.php#L155-L181 | train |
xibosignage/oauth2-xibo-cms | src/Entity/XiboDisplayGroup.php | XiboDisplayGroup.create | public function create($displayGroup, $description, $isDynamic, $dynamicCriteria)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->displayGroup = $displayGroup;
$this->description = $description;
$this->isDynamic = $isDynamic;
$this->dynamicCriteria = $dynamicCriteria;
$this->getLogger()->info('Creating a new display Group ' . $displayGroup);
$response = $this->doPost('/displaygroup', $this->toArray());
return $this->hydrate($response);
} | php | public function create($displayGroup, $description, $isDynamic, $dynamicCriteria)
{
$this->userId = $this->getEntityProvider()->getMe()->getId();
$this->displayGroup = $displayGroup;
$this->description = $description;
$this->isDynamic = $isDynamic;
$this->dynamicCriteria = $dynamicCriteria;
$this->getLogger()->info('Creating a new display Group ' . $displayGroup);
$response = $this->doPost('/displaygroup', $this->toArray());
return $this->hydrate($response);
} | [
"public",
"function",
"create",
"(",
"$",
"displayGroup",
",",
"$",
"description",
",",
"$",
"isDynamic",
",",
"$",
"dynamicCriteria",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
"->",
"getMe",
"(",
")",
... | Create Display Group.
@param string $displayGroup The display group name
@param string $description The display group description
@param int $isDynamic Flag indicating whether this Display Group is dynamic
@param string $dynamicCriteria The filter criteria for this dynamic group. A comma separated set of regular expressions to apply
@return XiboDisplayGroup | [
"Create",
"Display",
"Group",
"."
] | 8e6ddb4be070257233c225f8829b8117f9d978c3 | https://github.com/xibosignage/oauth2-xibo-cms/blob/8e6ddb4be070257233c225f8829b8117f9d978c3/src/Entity/XiboDisplayGroup.php#L108-L120 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.