query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Setear validacion [ 'rule' => 'required|max:12', 'messages' => [ 'required' => 'This :attribute field is a must.', 'max' => 'This :attribute field maximum :max.' ] ]
public function setValidation(array $param): self { return $this->setExtra('validation', $param); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $producto = Producto::find($this->input('producto_id'));\n $cantMaxima = $producto->stock;\n return [\n 'producto_id' => 'required|numeric',\n 'cantidad' => 'required|numeric|max:'.$cantMaxima,\n 'descripcion' => 'string|max:255',\n ];\n ...
[ "0.7283509", "0.71827763", "0.70133954", "0.69930005", "0.6991932", "0.6979023", "0.6923422", "0.68843275", "0.6874212", "0.68617904", "0.68615276", "0.6858788", "0.6851456", "0.6835415", "0.6820481", "0.6818368", "0.68061644", "0.6785753", "0.67790896", "0.67665", "0.6736721...
0.0
-1
This will then load my_view from resources/views instead of the formfield. $action can be browse, read, edit, add or order $content the content for this field $dataType the DataType $dataTypeContent the whole modelinstance $row the DataRow
public function setView($view): self { $this->extras['view'] = $view; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load() {\n\t\t$this->init();\n\t\t$action = $this->action;\n\t\t$view = $this->$action();\n\n\t\tif ($view instanceof View && !$this->app->isErrorPage()):\n\t\t\t$this->app->view = $view;\n\t\tendif;\n\n\t\t$this->app->view->mergeData($this->data);\n\t\t$this->app->view->validate();\n\t}", "priva...
[ "0.6178999", "0.61031765", "0.5741985", "0.569072", "0.5645308", "0.5645308", "0.5644432", "0.55643666", "0.5563875", "0.55632114", "0.5533033", "0.547266", "0.54551667", "0.54400086", "0.5438061", "0.54230976", "0.5422262", "0.5421088", "0.5400479", "0.5325607", "0.53215325"...
0.0
-1
This method will be execute before run the main process
public function hook_before(&$postdata) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function beforeProcess() {\n }", "public function preExec()\n {\n }", "protected function _preExec()\n {\n }", "protected function preProcess() {}", "public function preExecute(){\n\n\t\n\t}", "public function before_run(){}", "public function preExecute() {\n }", "private...
[ "0.77645326", "0.7729242", "0.76580065", "0.765735", "0.7388166", "0.7385603", "0.7313168", "0.7306214", "0.7297037", "0.71217746", "0.71217746", "0.6886962", "0.67884594", "0.6767631", "0.67318076", "0.6722169", "0.67113966", "0.67084646", "0.66010505", "0.65970695", "0.6597...
0.0
-1
This method is to customize the sql query
public function hook_query(&$query) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSql()\n {\n $operators['='] = '=';\n $operators['like'] = 'like';\n $operators['>='] = '>=';\n $operators['<='] = '<=';\n\n $select = 'SELECT ';\n foreach ($this->columns as $key => $value)\n {\n $alias = '';\n //bairros::...
[ "0.7006227", "0.6897946", "0.6893941", "0.6873814", "0.6869947", "0.6842704", "0.6829786", "0.6769616", "0.67670196", "0.6760689", "0.67492837", "0.67421883", "0.6740243", "0.6723818", "0.6664229", "0.6628498", "0.66265285", "0.66145337", "0.6605062", "0.659942", "0.659942", ...
0.0
-1
This method will be execute after run the main process
public function hook_after($postdata,&$result) { $email = $postdata['email']; $password = $postdata['password']; $user = DB::table(config('crudbooster.USER_TABLE'))->where("email", $email)->first(); $token = Request::header('X-Authorization-Token'); $result['api_message'] = "ok"; $result['password'] = ''; // $result['sessions'] = $user->sessions(); // $result['user_id'] = $users->id; // $result['token'] = $token; $result['userData']['user_id'] = $user->id; $result['userData']['token'] = $token; $res = response()->json($result, 200); $res->send(); exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function after_run() {}", "public function after_run(){}", "protected function afterProcess() {\n }", "protected function _postExec()\n {\n }", "public function run()\n\t{\n\t\t//\n\t}", "public function postExec()\n {\n }", "public function run()\n {\n }", "protec...
[ "0.7691825", "0.76911443", "0.73500884", "0.71664333", "0.704315", "0.69860375", "0.69421095", "0.6937926", "0.6895388", "0.6863637", "0.6802592", "0.6790873", "0.6781017", "0.67638224", "0.6736275", "0.67171925", "0.66478384", "0.66478384", "0.66478384", "0.66478384", "0.660...
0.0
-1
Database Tests Phalcon\DataMapper\Pdo\ConnectionLocator :: __construct()
public function dMPdoConnectionLocatorConstruct(DatabaseTester $I) { $I->wantToTest('DataMapper\Pdo\ConnectionLocator - __construct()'); $connection = $I->getDataMapperConnection(); $locator = new ConnectionLocator($connection); $I->assertInstanceOf(ConnectionLocatorInterface::class, $locator); $I->assertInstanceOf(ConnectionLocator::class, $locator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() {\n $connector = new DbConnection();\n $conn = $connector->connect(); \n }", "protected function setUpDatabaseConnectionMock() {}", "function __construct() {\n\t\t$this->dsn = \"mysql:host=\". DB_SERVER . \";dbname=\" . DB_NAME . \";charset=\" . DB_CHAR;\n\t\n\t $thi...
[ "0.7387204", "0.72705716", "0.7182583", "0.7166514", "0.7118039", "0.71118724", "0.7095707", "0.70922506", "0.70547396", "0.70525753", "0.7027727", "0.70155275", "0.69955564", "0.6989077", "0.6980356", "0.69657296", "0.69657296", "0.69351125", "0.69342697", "0.6933796", "0.69...
0.7043216
10
put your code here
public function admin_login_check_info($email,$password){ $this->db->select('*'); $this->db->from('tbl_admin'); $this->db->where('email',$email); $this->db->where('password',$password); $query_result= $this->db->get(); $result=$query_result->row(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n //\n \n }", "public function run()\n\t{\n\t\t//\n\t}", "public function preExecute(){\n\n\t\n\t}", "function script()\n {\n }", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "public...
[ "0.60586566", "0.59289104", "0.5919654", "0.5899511", "0.5838488", "0.5838488", "0.58356965", "0.5814271", "0.5814271", "0.57796824", "0.5701954", "0.5700516", "0.5685669", "0.5684617", "0.5684617", "0.5684617", "0.5639208", "0.563027", "0.56278986", "0.56231225", "0.5620407"...
0.0
-1
Returns the "shortName" of this article
function getshortName() { return $this->shortName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShortName()\n {\n return $this->shortName;\n }", "public function getShortName()\n {\n return $this->shortName;\n }", "public function getShortName() {\n return $this->shortName;\n }", "function getShortName() \n {\n return $this->_shortName;\n...
[ "0.8082753", "0.8082753", "0.80470115", "0.80320585", "0.78876513", "0.787322", "0.7831776", "0.77869105", "0.77632815", "0.77409244", "0.7717981", "0.76782036", "0.7669078", "0.74990964", "0.7475929", "0.744115", "0.74065894", "0.7308346", "0.7182908", "0.7117368", "0.709656...
0.8277329
0
Sets the shortname for this article Since a shortname can not contain certain characters the new shortname is validated and possibly changed.
function setShortName($newShortName) { // we keep it simple, // a shortname can contain a-z 0-9 _ , . /* 48-57 number 65-90 a-z 97-122 A-Z 46 . 45 - 95 _ */ // a shortname must not be one of these $arrReservedWords = pb_shortname_reserved_words(); $convertTable = array( " " => "-", "å" => "a", "ä" => "a", "ö" => "o", "Å" => "a", "Ä" => "ä", "Ö" => "o" ); $validatedShortName = ''; // empty shortnames or only numbers is not ok $newShortName = trim($newShortName); if (empty($newShortName)) { $newShortName = trim($this->getTitleArticle()); if (empty($newShortName) || is_numeric($newShortName)) { $newShortName = "article"; } } // todo: this code should probably use the utf8-functions instead of this homebuilt utf-convert-thingie for ($i=0; $i<=strlen($newShortName); $i++) { #$char = $newShortName[$i]; // probs with chars like å, ä and ö $char = utf8_encode(substr(utf8_decode($newShortName), $i, 1)); if (array_key_exists($char, $convertTable)) { $char = $convertTable[$char]; } $code = ord($char); if ( ($code>=48 && $code <= 57) // number || ($code>=65 && $code <= 90) // a-z || ($code>=97 && $code <= 122) // A-Z || ($code == 45 || $code == 95) // - ) { // ok $validatedShortName .= $char; } } $validatedShortName = strtolower($validatedShortName); // we got a name, make sure its unique and not a reserved word if (in_array($validatedShortName, $arrReservedWords)) { $validatedShortName .= rand(1,9); } // no other article may have this name, mkay? // article that has isRevisionTo = this id is ok // or article that global $polarbear_db; $isUnique = false; while (!$isUnique) { $sql = " SELECT count(id) FROM " . POLARBEAR_DB_PREFIX . "_articles WHERE shortName = '$validatedShortName' AND id != $this->id AND (isRevisionTo IS NULL OR isRevisionTo IS NOT NULL AND isRevisionTo <> $this->id) AND status <> 'deleted' AND status <> 'preview' "; $isUnique = ! (int) $polarbear_db->get_var($sql); if (!$isUnique ) { $validatedShortName = $validatedShortName . rand(1,9999); } } $this->shortName = $validatedShortName; return $this->shortName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setShortName($shortName)\n {\n if (strlen($shortName) > 16) {\n throw new InvalidArgumentException(\"Input must be 16 characters or less\n in length!\");\n }\n $this->_shortName = $shortName;\n }", "public function set_Short_Title($str_Short_Title) {\n ...
[ "0.7796682", "0.73806196", "0.69870585", "0.68049914", "0.6706634", "0.6396947", "0.6278543", "0.61932653", "0.614404", "0.6088412", "0.6042589", "0.60007316", "0.60005105", "0.59791195", "0.5974426", "0.5969552", "0.5910076", "0.5898393", "0.58786386", "0.58748", "0.58625597...
0.8073771
0
gets the previous published article
function prevArticle() { $parent = $this->parent(); if (!$parent) { return false; } $parentChildren = $parent->children(); $aCount = sizeof($parentChildren); $foundAtPos=null; for ($i=0;$i<$aCount;$i++) { if ($parentChildren[$i]->getId() == $this->getId()) { $foundAtPos=($i-1); break; } } if ($foundAtPos>=0) { return $parentChildren[$foundAtPos]; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPreviousArticle() {\n return ArticleLanguageVersion::join('article', 'translated_article.article_id', '=', 'article.id')\n ->where('article.created', '<', $this->article->created)\n ->where('translated_article.language', $this->articleLanguageVersion->language)\n ->where('translated_...
[ "0.80965644", "0.7494172", "0.72369367", "0.70843303", "0.70685524", "0.7001448", "0.69961494", "0.69523007", "0.6924606", "0.6908015", "0.68887955", "0.68739927", "0.68441105", "0.6774995", "0.67562634", "0.67459005", "0.67010295", "0.6700513", "0.6700513", "0.6683991", "0.6...
0.6872631
12
gets the next published article
function nextArticle() { $parent = $this->parent(); if (!$parent) { return false; } $parentChildren = $parent->children(); $aCount = sizeof($parentChildren); $foundAtPos=null; for ($i=0;$i<$aCount;$i++) { if ($parentChildren[$i]->getId() == $this->getId()) { $foundAtPos=($i+1); break; } } if ($foundAtPos>=0 && $foundAtPos<$aCount) { return $parentChildren[$foundAtPos]; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNextArticle() {\n return ArticleLanguageVersion::join('article', 'translated_article.article_id', '=', 'article.id')\n ->where('article.created', '>', $this->article->created)\n ->where('translated_article.language', $this->articleLanguageVersion->language)\n ->where('translated_arti...
[ "0.7924571", "0.77064264", "0.66519886", "0.66099244", "0.6566093", "0.64965445", "0.6445507", "0.631449", "0.63142806", "0.6305385", "0.6305385", "0.62224925", "0.61876047", "0.6186175", "0.6176919", "0.6176919", "0.61366636", "0.61313057", "0.60822815", "0.60089296", "0.600...
0.6384105
7
/ setTitlePage finns redan... den vs. setCustom??
function getTitleArticle() { return $this->titleArticle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPageTitle($page_name);", "public function setPageTitle($page_name);", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\...
[ "0.7394576", "0.7394576", "0.72500193", "0.7077241", "0.68990153", "0.6873838", "0.68593746", "0.6793337", "0.67239213", "0.6676422", "0.6657411", "0.6588385", "0.65776384", "0.6549001", "0.6530939", "0.6483105", "0.6483105", "0.6483105", "0.6483105", "0.6483105", "0.6483105"...
0.0
-1
ger publiceringsdatum i unixtid
function getDatePublish($format = null) { if ($format == 'human') { return polarbear_time2str($this->datePublish); } else if ($format) { return strftime($format, $this->datePublish); } else { return $this->datePublish; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dbdatetime2unix ($tanggal = '') {\r\n list($year,$month,$day,$hour,$minute,$second) = sscanf($tanggal,'%4d-%2d-%2d %2d:%2d:%2d');\r\n return mktime($hour,$minute,$second,$month,$day,$year);\r\n}", "function get_unix_time()\n {\n return $this->timestamp;\n }", "function fechaDesdeUni...
[ "0.57875705", "0.5741585", "0.56347865", "0.56317663", "0.5621009", "0.56154054", "0.5391334", "0.537474", "0.5371553", "0.5366268", "0.53577566", "0.5357647", "0.5347889", "0.53263617", "0.5311228", "0.53014696", "0.53011626", "0.528255", "0.5272937", "0.52619064", "0.524717...
0.0
-1
Date article was modified/changed
function getDateChanged($format = null) { if ($format == 'human') { return polarbear_time2str($this->dateChanged); } else if ($format) { return strftime($format, $this->dateChanged); } else { return $this->dateChanged; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDateModified();", "public function get_date_modified();", "function getDateModified() {\n\t\treturn $this->_DateModified;\n\t}", "public function getDateModified()\n {\n return $this->dateModified;\n }", "public function getDateModified()\n {\n return $this->_DateM...
[ "0.8045748", "0.8037266", "0.764196", "0.75204504", "0.74823046", "0.746156", "0.7353333", "0.72069407", "0.71242857", "0.71056944", "0.703271", "0.70080864", "0.699248", "0.6934534", "0.6931676", "0.6920655", "0.69182736", "0.6907028", "0.69003034", "0.68908405", "0.6876842"...
0.0
-1
Returns when this article is to be unpublished
function getDateUnpublish($unix = false) { return $this->dateUnpublish; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUnpublish() {\n return $this->changeFilter('unpublish');\n }", "protected function getUnpublishDescription(): string {\n $date = $this->getScheduledDate('unpublish');\n\n if ($date) {\n return $this->t('Scheduled unpublish date: <span>@date</span>', [\n '@date' => $...
[ "0.7436658", "0.7308806", "0.6983075", "0.6827626", "0.6384254", "0.6352843", "0.6175079", "0.61296237", "0.61020553", "0.60126823", "0.59500027", "0.59387046", "0.5932939", "0.5919629", "0.5919065", "0.58961034", "0.5890423", "0.5868171", "0.58538485", "0.58226836", "0.58159...
0.704906
2
Type of template to use If articles for any reason don't have a template, "inherit" will be used as a default
function getTemplateType() { if (!$this->templateType) { return 'inherit'; } else { return $this->templateType; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function templateToUse() {\n\t\t// loop until templateType = name | custom\n\t\t$templateType = $this->getTemplateType();\n\t\t$templateCustom = $this->getTemplateCustom();\n\t\t$templateName = $this->getTemplateName();\n\t\t$articleName = $this->getTitleArticle();\n\t\t$articleId = $this->getId();\n\t\t$parent = ...
[ "0.68173414", "0.6627138", "0.65420103", "0.65420103", "0.64612937", "0.64459676", "0.64409584", "0.6440243", "0.6392396", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6360422", "0.6346921", "0.6335937...
0.6854448
0
Get name of template used for this article todo: if a template has been removed, check for that and.. do what? default to inherit?
function getTemplateName() { return $this->templateName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function intendedTemplate() {\n if(isset($this->cache['intendedTemplate'])) return $this->cache['intendedTemplate'];\n return $this->cache['intendedTemplate'] = $this->content()->exists() ? $this->content()->name() : 'default';\n }", "function get_current_template_name() {\n\tglobal $wp_query;\n \...
[ "0.82025933", "0.7506931", "0.74785143", "0.74384886", "0.7422751", "0.7369426", "0.73517907", "0.7330679", "0.72766703", "0.72704417", "0.7245323", "0.72442466", "0.7175602", "0.71671987", "0.71671987", "0.71671987", "0.71671987", "0.714398", "0.714398", "0.714398", "0.71439...
0.74349576
4
get the template we actually are gonna use taking inherit in consideration
function templateToUse() { // loop until templateType = name | custom $templateType = $this->getTemplateType(); $templateCustom = $this->getTemplateCustom(); $templateName = $this->getTemplateName(); $articleName = $this->getTitleArticle(); $articleId = $this->getId(); $parent = $this->parent(); $i = 0; while ($templateType != 'name' && $templateType != 'custom' && $parent !== null) { $templateType = $parent->getTemplateType(); $templateCustom = $parent->getTemplateCustom(); $templateName = $parent->getTemplateName(); $articleName = $parent->getTitleArticle(); $articleId = $parent->getId(); $parent = $parent->parent(); } /* echo "<br><br>templateType: " . $templateType; echo "<br>templateCustom: " . $templateCustom; echo "<br>templateName: " . $templateName; echo "<br>articleName: " . $articleName; echo "<br>articleID: $articleId"; // */ $templates = polarbear_getTemplates(); pb_pqp_log_speed("article templateToUse"); if ($templateType == 'custom') { return $templateCustom; } else if (isset($templates[$templateName])) { return $templates[$templateName]['file']; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate() {}", "function getTemp...
[ "0.83265114", "0.7874619", "0.7874619", "0.7874619", "0.7874619", "0.7874619", "0.7874619", "0.7782503", "0.760529", "0.7594811", "0.7537962", "0.7536522", "0.7499788", "0.7439588", "0.74201876", "0.7405425", "0.73901165", "0.7387207", "0.73592657", "0.72687465", "0.72687465"...
0.7335747
19
Does this article has a parent article If not it is at the root
function hasParent() { return (bool) ($this->parentID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function is_parent()\n\t{\n\t\treturn is_null($this->category_id);\n\t}", "public function hasParent() {}", "public function hasParent();", "public function hasParent();", "public function hasParent();", "public function hasParent()\n\t{\n\t\treturn !empty($this->parent);\n\t}", "public functio...
[ "0.7358635", "0.7341622", "0.73391825", "0.73391825", "0.73391825", "0.7266606", "0.7242384", "0.7201033", "0.71857864", "0.7149637", "0.71470565", "0.697956", "0.6933541", "0.6899916", "0.68857074", "0.67768085", "0.6744927", "0.6726278", "0.66935897", "0.6680812", "0.664539...
0.7207983
7
Does article have child nodes?
function hasChildren($options = null) { return (bool) $this->numChildren($options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasChildNodes() {}", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren();", "public function hasChildren() {}", "public function hasChildren() {}", "public function hasChildren() {}", "public function h...
[ "0.7510717", "0.7395093", "0.7395093", "0.7395093", "0.7395093", "0.72784597", "0.72779894", "0.72779894", "0.72779894", "0.72779894", "0.71846014", "0.71190166", "0.69492006", "0.69492006", "0.68695533", "0.6866107", "0.6863684", "0.68415356", "0.68367183", "0.68110967", "0....
0.0
-1
get number of children
function numChildren($options = null) { # if (!isset($this->numChildren)) { $children = $this->children($options); return sizeof($children); # $this->numChildren = sizeof($children); # } # return $this->numChildren; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumberChildren();", "public function countChildren();", "#[Pure] public function get_children_number(): int\n {\n return $this -> children -> size();\n }", "public function count() {\n\t\treturn count($this->children);\n\t}", "public function count(): int\n {\n ret...
[ "0.92674404", "0.9071308", "0.8799655", "0.87061006", "0.8634643", "0.8350916", "0.80838126", "0.80648506", "0.79034513", "0.7739844", "0.77191114", "0.7711546", "0.76818836", "0.7580745", "0.75685936", "0.7427926", "0.741482", "0.7402939", "0.73371494", "0.73342663", "0.7333...
0.8135758
6
Get child articles as array Array $options sort, direction, how many to get etc. See $defaults for details.
function children($options = null) { $defaults = array( 'sort' => 'prio', 'sortDirection' => 'desc', 'limitStart' => 0, 'limitCount' => null, 'includeUnpublished' => false, 'tagsMustInclude' => null, // comma seperated? 'tagsMustNotInclude' => null ); $options = polarbear_extend($defaults, $options); if ($options['limitCount'] === null) { // To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. $limitCount = 2147483647; } else { $limitCount = $options['limitCount']; } // done with options, check cache $optionsQuery = http_build_query($options); if (isset($this->childrenCache[$optionsQuery])) { return $this->childrenCache[$optionsQuery]; } // not in cache, go on and query $sql = "SELECT id FROM " . POLARBEAR_DB_PREFIX . "_articles "; $sql .= "WHERE (parentID = '$this->id' AND status <> 'deleted' AND status <> 'revision' ) "; if ($options["includeUnpublished"]) { // include unpublished articles } else { // don't include unpublished, remove'em $sql .= " AND status = 'published' AND datePublish < now() AND (dateUnpublish > now() OR dateUnpublish IS NULL) "; } // tags if ($options["tagsMustInclude"]) { $tagsMustInclude = explode(",", $options["tagsMustInclude"]); $strTagArticleIds = ""; foreach($tagsMustInclude as $oneTagID) { $oneTag = polarbear_tag::getInstance($oneTagID); // fetch articles for this tag $tagArticles = $oneTag->articles(); foreach ($tagArticles as $oneA) { $strTagArticleIds .= $oneA->getId() . ","; } } $strTagArticleIds = preg_replace("/,$/", "", $strTagArticleIds); if (!empty($strTagArticleIds)) { $strTagArticleIds = " AND id IN ($strTagArticleIds) "; } $sql .= $strTagArticleIds; } $sql .= "ORDER BY $options[sort] $options[sortDirection] "; $sql .= "LIMIT $options[limitStart], $limitCount"; // children = all articles that have current article as parentID global $polarbear_db; $childrenArr = array(); if ($r = $polarbear_db->get_results($sql)) { $preloader = pb_query_preloader::getInstance(); $strArticleIDs = ""; foreach ($r as $row) { // in med hittade id:n i preloadern $strArticleIDs .= ",".$row->id; } $preloader->addArticle($strArticleIDs); $preloader->update(); foreach ($r as $row) { $childrenArr[] = PolarBear_Article::getInstance($row->id); } } pb_pqp_log_speed("article children()"); $this->childrenCache[$optionsQuery] = $childrenArr; return $this->childrenCache[$optionsQuery]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArticles()\n {\n return NewsArticle::get()->filter('ParentID', $this->AllChildren()->column('ID') ?: null);\n }", "public function getChapters() \n\t{\n\n\t\t$req = $this->db->query('SELECT id, article_number, title FROM articles ORDER BY date_creation');\n\n\t\t$req->execute();\n...
[ "0.6124535", "0.6091557", "0.5915418", "0.5813516", "0.57794935", "0.57306206", "0.57271534", "0.5723596", "0.5715251", "0.56637853", "0.5648137", "0.5644236", "0.55979985", "0.5588315", "0.5571242", "0.55471987", "0.5525465", "0.550688", "0.55002904", "0.5482068", "0.5481170...
0.74796915
0
Returns all descendant childs Does not care about the order, just returns what it finds.
function descendants() { /* get all children of this article for each child, run the same query.. */ $childs = $this->children(); $subChilds = array(); foreach ($childs as $oneChild) { $subChilds = array_merge($subChilds, $oneChild->descendants()); } $childs = array_merge($childs, $subChilds); pb_pqp_log_speed("article descendants()"); return $childs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function children() {\n return $this->descendants(1);\n }", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "function descendants() {\n\t\t$out = array();\n\t\t$this->get_descendants($out);\n\t\treturn $out;\n\t}", "public function getDescendants();", "public fun...
[ "0.77575153", "0.7755607", "0.767318", "0.7447568", "0.70213604", "0.7012333", "0.69341666", "0.69209504", "0.68890715", "0.682943", "0.6777655", "0.6777655", "0.67191947", "0.67118716", "0.6710817", "0.67061085", "0.668678", "0.6682959", "0.66527086", "0.6641762", "0.6640711...
0.7932123
0
return the first child
function firstChild() { $children = $this->children(); if (sizeof($children>0)) { return $children[0]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function &firstChild()\n {\n $ret = null;\n if (! count($this->_children)) {\n return $ret;\n }\n return $this->_children[0];\n }", "function &firstChild () {\r\n $ret = null;\r\n if (!count ($this->_children)) {\r\n return $ret;\r\n ...
[ "0.8024498", "0.8019949", "0.7682782", "0.76804227", "0.7392652", "0.723037", "0.7191516", "0.7118963", "0.69916147", "0.6914467", "0.687017", "0.68197674", "0.68197674", "0.68197674", "0.68197674", "0.68197674", "0.68197674", "0.68197674", "0.68197674", "0.68197674", "0.6819...
0.8780974
0
returns the url for this article
function href() { $usemodrewrite = polarbear_setting('usemodrewrite'); if ($usemodrewrite) { return $this->fullpath(); } else { return $this->templateToUse() . '?polarbear-page=' . $this->getId(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function url(): string\n {\n return '/user/article/' . $this->slug . '/view';\n }", "public function get_url() {\r\n\t\treturn $this->feed->get_url().\"/\".$this->id.\"/\".urlencode(strtolower($this->title));\r\n\t}", "public function get_url();", "public function getUrl()\n {\n ...
[ "0.7915857", "0.78833735", "0.7612419", "0.7610853", "0.7561944", "0.754959", "0.754959", "0.75382996", "0.75382996", "0.7508947", "0.74917877", "0.74623054", "0.7462088", "0.74386436", "0.7437639", "0.7424443", "0.7409391", "0.73935175", "0.73935175", "0.73896044", "0.738956...
0.0
-1
get all existing field values for this article
function fieldValues() { if (isset($this->fieldValues)) { return $this->fieldValues; } // fieldvalues fanns inte. // kolla preload först och om inte där så ladda in $preloader = pb_query_preloader::getInstance(); $preloadRows = $preloader->getPreloadFieldsRows($this->id); if ($preloadRows === false) { #echo "<br>nah, no preload row for field, article: $this->id "; // no preload for this articles field, fetch them from db global $polarbear_db; $sql = " SELECT fv.fieldID, fv.articleID, fv.value, fv.numInSet, f.name as fieldName, f.type as fieldType FROM " . POLARBEAR_DB_PREFIX . "_fields_values as fv INNER JOIN " . POLARBEAR_DB_PREFIX . "_fields as f ON f.id = fv.fieldID WHERE articleID = '$this->id' ORDER BY fieldID ASC, numInSet ASC"; $rows = $polarbear_db->get_results($sql); } else { #echo "<br>got preload row for field, article: $this->id"; // horay! we got the field values preloaded $rows = $preloadRows; } $arrFieldValues = array(); $arrFieldCount = array(); if (is_array($rows)) { foreach ($rows as $oneRow) { if (!isset($arrFieldValues[$oneRow->fieldID])) { $arrFieldValues[$oneRow->fieldID] = array(); } /* todo: om det är en fil/bild ska det kanske finnas link, downloadLink, imageSrc osv. */ $arrFieldValues[$oneRow->fieldID][] = array( "fieldID" => $oneRow->fieldID, "articleID" => $oneRow->articleID, "value" => $oneRow->value, "numInSet" => $oneRow->numInSet, // and some useful "extras" too "valueEscaped" => htmlspecialchars ($oneRow->value, ENT_COMPAT, "UTF-8"), "valueNoTags" => strip_tags($oneRow->value), "fieldName" => $oneRow->fieldName, "fieldType" => $oneRow->fieldType ); if (!isset($arrFieldCount[$oneRow->fieldID])) { $arrFieldCount[$oneRow->fieldID]=0; } $arrFieldCount[$oneRow->fieldID]++; } } // update count foreach ($arrFieldCount as $fieldID => $fieldCount) { for ($i=0; $i<sizeof($arrFieldValues[$fieldID]); $i++) { $arrFieldValues[$fieldID][$i]["fieldSetCount"] = $fieldCount; } } #pb_pqp_log_speed("article fieldValues()"); $this->fieldValues = $arrFieldValues; return $this->fieldValues; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFieldValues()\n {\n if($this->isNewRecord){\n return []; //TODO: LOAD DEFAULT FIELDS OF TYPE\n }\n\n //pull meta values from DB\n $table = self::tablePrefix().'cms_post_field';\n $strSql = \"SELECT id, field_id, value \n\t\t\t\t\tFROM {$table}\n\...
[ "0.7314031", "0.7274868", "0.7121122", "0.7076908", "0.69505864", "0.69505864", "0.69505864", "0.69505864", "0.69505864", "0.69505864", "0.6904826", "0.68770826", "0.68770826", "0.68770826", "0.68547803", "0.6823459", "0.68009424", "0.68009424", "0.6774086", "0.6738962", "0.6...
0.76210403
0
Gets all fields that are connected to this article, and their values
function fieldsAndValues($forceReload = false) { if (isset($this->fieldsAndValues) && $forceReload==false) { return $this->fieldsAndValues; } $fieldValues = $this->fieldValues(); $fieldConnectorToUse = $this->fieldConnectorToUse(); $arrFields = polarbear_getFieldStructureForFieldConnector($fieldConnectorToUse); if (is_array($arrFields)) { foreach ($arrFields as $oneFieldConnector) { // i en connector har vi collections foreach ($oneFieldConnector['fieldCollections'] as $oneFieldCollection) { // i en collection har vi en eller flera fältsamlingar // fältsamlingen kan vara repeatable, så lagra värden i array $isRepeatable = $oneFieldCollection['repeatable']; foreach ($oneFieldCollection['fields'] as $oneField) { // find out max numInSet // xxx this...does not work.. i even dont know how i was thinking.. $maxNumInSet = null; if (isset($fieldValues[$oneField['id']]) && is_array($fieldValues[$oneField['id']])) { $maxNumInSet = sizeof($fieldValues[$oneField['id']]); /*foreach ($fieldValues[$oneField['id']] as $oneFieldValue) { if ($oneFieldValue['numInSet'] > $maxNumInSet) { $maxNumInSet = $oneFieldValue['numInSet']; } } $maxNumInSet++; */ } $arrFields[$oneFieldConnector['id']]['fieldCollections'][$oneFieldCollection['id']]['fields'][$oneField['id']]['totalNumInSet'] = (int) $maxNumInSet; if (isset($fieldValues[$oneField['id']])) { $arrFields[$oneFieldConnector['id']]['fieldCollections'][$oneFieldCollection['id']]['fields'][$oneField['id']]['values'] = $fieldValues[$oneField['id']]; } } } } } #pb_pqp_log_speed("article fieldsAndValues()"); $this->fieldsAndValues = $arrFields; return $this->fieldsAndValues; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function getFields();", "public function fields()\n {\n $fullResult = $this->client->call...
[ "0.6912236", "0.689491", "0.689491", "0.689491", "0.689491", "0.689491", "0.689491", "0.6760395", "0.6759824", "0.6759008", "0.6749362", "0.674724", "0.6723529", "0.6711657", "0.6689871", "0.6647899", "0.6647899", "0.6644933", "0.6644933", "0.6644933", "0.6621822", "0.66097...
0.0
-1
Prepare an article for copy unsets the id (so a the article will get a new id when saved) Does NOT change things like name or shortname for the article
function prepareForCopy() { $this->id = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCopyOfArticle() {\n\t\t$newArticle = new PolarBear_Article($this->id);\n\t\t$newArticle->prepareForCopy();\n\t\t$newArticle->save();\n\t\treturn $newArticle;\n\t}", "private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_...
[ "0.6764416", "0.6296818", "0.62753564", "0.61698526", "0.61326146", "0.60261834", "0.59995013", "0.5937513", "0.5842961", "0.56870526", "0.5680319", "0.56412464", "0.5603456", "0.55781996", "0.55536", "0.5490646", "0.54789793", "0.54771256", "0.53824323", "0.52903867", "0.528...
0.706167
0
return a copy of this article stuff that will get changed: id, shortname
function getCopyOfArticle() { $newArticle = new PolarBear_Article($this->id); $newArticle->prepareForCopy(); $newArticle->save(); return $newArticle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_copy()\r\n\t{\r\n\t\t$copy = clone($this);\r\n\r\n\t\t$copy->id = NULL;\r\n\r\n\t\treturn $copy;\r\n\t}", "public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }", "public funct...
[ "0.58104867", "0.56496257", "0.55739325", "0.54533535", "0.5445642", "0.54164535", "0.5380791", "0.5330271", "0.5280382", "0.5274447", "0.52600867", "0.52521074", "0.52153575", "0.5213415", "0.5211331", "0.5211261", "0.5202135", "0.5174316", "0.51621985", "0.5107293", "0.5107...
0.6114413
0
Delete article Deletion is done immediately
function delete() { $this->status = "deleted"; $sql = "UPDATE " . POLARBEAR_DB_PREFIX . "_articles SET status = '$this->status' WHERE id = '$this->id'"; global $polarbear_db; $polarbear_db->query($sql); $args = array( "article" => $this, "objectName" => $this->getTitleArticle() ); pb_event_fire("pb_article_deleted", $args); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleted(Article $article)\n {\n //\n }", "public function deleteArticle(): void\n {\n $this->articleId = $_GET['deleteId'];\n\n $this->articleModel->deleteArticle($this->articleId);\n // Redirect to the articles list page\n Router::redirectTo('listArtic...
[ "0.7929366", "0.784173", "0.7653868", "0.75799847", "0.7364501", "0.7364501", "0.7364501", "0.7364501", "0.7364501", "0.7364501", "0.7364501", "0.72992045", "0.72479427", "0.7243703", "0.723947", "0.7214925", "0.7195531", "0.718397", "0.7131863", "0.71252745", "0.7087437", ...
0.746753
4
get icon for article based on status
function statusIcon() { // published, draft // page_white_clock.png // page_white_edit.png switch ($this->status) { case 'published': // varit, eller ska bli, publicerad? // $datePublish $dateUnpublish if ($this->isPublished()) { return POLARBEAR_WEBPATH . 'images/silkicons/page_white_text.png'; } else { return POLARBEAR_WEBPATH . 'images/silkicons/page_white_text_clock.png'; } break; case 'draft': return POLARBEAR_WEBPATH . 'images/silkicons/page_white_text_edit.png'; break; default: return POLARBEAR_WEBPATH . 'images/silkicons/page_white_text.png'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArticleListIcon();", "public function icon ( )\n\t{\n\t\treturn Array( 'id' => $this->id,\t// shoud be consistent with what is passed to _uicmp_stuff_fold class\n\t\t\t\t\t 'title' => $this->messages['icon'] );\n\t}", "function emc_get_content_icon() {\r\n\r\n\t$format = get_the_terms( get_...
[ "0.7374917", "0.67964995", "0.66391575", "0.65576637", "0.6516822", "0.6516822", "0.65031403", "0.6498261", "0.6487382", "0.64755684", "0.6431907", "0.64089066", "0.64089066", "0.6342391", "0.6330536", "0.6273505", "0.61845374", "0.6167147", "0.6146151", "0.6144702", "0.61358...
0.69422144
1
Check if article is published published = status = published and datePublish >= now and dateUnpublish == null or now < dateUnpublish
function isPublished() { if ($this->status == 'published') { $now = time(); if ($this->datePublish <= $now) { if ($this->dateUnpublish > $now || $this->dateUnpublish == null) { return true; } else { return false; } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isPublished()\n {\n # code...\n return !is_null($this->published_at) && $this->published_at < today();\n }", "public function isPublished()\n {\n return $this->published_at->lte(Carbon::now());\n }", "public function publishedStatus()\n {\n if ( !$this...
[ "0.72871494", "0.6852336", "0.68515754", "0.67675704", "0.67496514", "0.6695189", "0.6644615", "0.66375685", "0.6616027", "0.6586621", "0.657681", "0.6572092", "0.65583825", "0.65570426", "0.6537006", "0.6526984", "0.65138197", "0.64944124", "0.6441735", "0.6437291", "0.64034...
0.76929957
0
returns a full page title path i.e. the titles of this article + all parent articles (except the top level one)
function fullPageTitle() { $title = htmlspecialchars($this->getTitlePage(), ENT_COMPAT, "UTF-8"); $separator = ' | '; $parents = $this->parents(); for ($i=0; $i<sizeof($parents)-1; $i++) { $oneParent = $parents[$i]; $title .= $separator; $title .= htmlspecialchars($oneParent->getTitlePage(), ENT_COMPAT, "UTF-8"); } return $title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tutv_get_parent_title( $page = null ) {\n global $post;\n\n if ( ! $page ) {\n $page = $post->ID;\n }\n\n\n if ( empty( $post->post_parent ) ) { // if there is no parent...\n return get_the_title( $post->ID ); // return the current page's title\n } else { // if there is a parent...\n return ...
[ "0.6721224", "0.65438515", "0.6430834", "0.63664746", "0.6299323", "0.6295497", "0.6161307", "0.61497414", "0.61475784", "0.6107044", "0.609558", "0.60802835", "0.60536236", "0.6053193", "0.6049531", "0.60419965", "0.5995228", "0.5940695", "0.59007347", "0.5899143", "0.588444...
0.7655751
0
Does this article have a teaser? Somthing must be written i the teaser for it to be considered as not empyu So for example a teaser with only an empty paragraph is considered empty
function hasTeaser() { $teaser = strip_tags($this->teaser, "<img><a>"); $teaser = trim($teaser); if (empty($teaser)) { return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_article();", "protected function content_handle_no_teaser_block( $content ) {\n\t\tif ( (strpos($content, 'noTeaser:true') !== false || strpos($content, '\"noTeaser\":true') !== false) && strpos($content, '<!-- /wp:more -->') !== false) {\n\t\t\t$arr = explode('<!-- /wp:more -->', $content);\n...
[ "0.6659093", "0.62476754", "0.60756284", "0.6055573", "0.5985787", "0.5923568", "0.5847395", "0.57268655", "0.5688894", "0.5685316", "0.5622512", "0.56215763", "0.5612918", "0.55845845", "0.5546626", "0.5534685", "0.5532762", "0.5517347", "0.5474935", "0.54425466", "0.5441382...
0.8046954
0
Does this article have a body? Somthing must be written i the teaser for it to be considered as not empty So for example a teaser with only an empty paragraph is considered empty
function hasBody() { $body = strip_tags($this->body, "<img><a>"); $body = trim($body); if (empty($body)) { return false; } else { return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasTeaser() {\n\t\t$teaser = strip_tags($this->teaser, \"<img><a>\");\n\t\t$teaser = trim($teaser);\n\t\tif (empty($teaser)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function hasContent(){ return !empty($this->content); }", "public function contentNotGiven()\n ...
[ "0.69119656", "0.6849419", "0.6744094", "0.65199625", "0.6468172", "0.64234823", "0.6380174", "0.63600844", "0.63541216", "0.63541216", "0.6353376", "0.6344033", "0.62879217", "0.6286339", "0.6269117", "0.6261149", "0.6260428", "0.6260428", "0.6248781", "0.6110059", "0.610786...
0.7467016
0
check if this article is a direct child or a subchild of the article $refArticle
function isChildOrSubChildOf($refArticle) { if (is_numeric($refArticle)) { $refArticle = polarbear_article::getInstance($refArticle); } $isChild = false; // loop our way up until we reach the top article or refArticle // $refArticle $doLoop = true; $tmpA = $this; while ($doLoop) { // get parent article $tmpA = $tmpA->parent(); if ($tmpA == null) { return false; } #echo "<br><br>tmpA:".$tmpA->getTitleArticle(); #echo "<br> refArticle->getId():" . $refArticle->getId(); #echo "<br> tmpA->getId():" . $tmpA->getId(); #echo "<br> tmpA->getParentId():"; var_dump($tmpA->getParentId()); // check if the parent article is the refArticle. if it is, that means that $this is a child of $refArticle if ($tmpA->getId() == $refArticle->getId()) { return true; } // if parent is null = is at top level if ($tmpA->getParentId()==null) { return false; } } pb_pqp_log_speed("article isChildOrSubChildOf()"); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isChild()\n {\n return $this->parentId != null;\n }", "public function isChild() {\n\t\treturn $this->_parent !== null;\n\t}", "public function isChild()\n {\n if (false === $this->parent_category) {\n return false;\n }\n\n return true;\n\n }",...
[ "0.6815142", "0.6668545", "0.6608818", "0.659937", "0.65369827", "0.64985424", "0.64686435", "0.6459183", "0.635483", "0.62968016", "0.6184997", "0.6153859", "0.61355823", "0.61238194", "0.6113297", "0.61029553", "0.6039569", "0.6037054", "0.6002086", "0.5970923", "0.5962534"...
0.861463
0
returns output this article according to the templateformat in $template if the article is not published, an empty string will be returned
function output($template) { global $polarbear_u, $polarbear_a; $isOk = false; if ($this->isPublished()) { $isOk = true; } else if ($this->getStatus()=="preview" && is_object($polarbear_u) && $polarbear_u->isAdmin()) { $isOk = true; } if ($isOk == false) { return ''; } $dwoo = new Dwoo(); $dwoo->setCompileDir(POLARBEAR_STORAGEPATH . 'dwoo'); $data = new Dwoo_Data(); $tpl = new Dwoo_Template_String($template); // add variables $data->assign('id', $this->getId()); $data->assign('titleArticle', htmlspecialchars($this->getTitleArticle(), ENT_COMPAT, "UTF-8")); $data->assign('titleArticleRaw', $this->getTitleArticle()); $data->assign('titlePage', htmlspecialchars($this->getTitlePage(), ENT_COMPAT, "UTF-8")); $data->assign('titleNav', htmlspecialchars($this->getTitleNav(), ENT_COMPAT, "UTF-8")); $data->assign('href', $this->href()); $data->assign('hrefFull', $this->hrefFull()); $data->assign('fullPageTitle', $this->fullPageTitle()); $data->assign('teaser', $this->getTeaser()); $data->assign('teaserNoTags', strip_tags($this->getTeaser())); $data->assign('hasTeaser', $this->hasTeaser()); $data->assign('body', $this->getBody()); $data->assign('bodyNoTags', strip_tags($this->getBody())); $data->assign('hasBody', $this->hasBody()); $data->assign('datePublish', $this->getDatePublish()); $data->assign('dateChanged', $this->getDateChanged()); $data->assign('metaDescription', trim($this->getMetaDescription())); $data->assign('metaKeywords', trim($this->getMetaKeywords())); if ($this->getStatus()=="preview") { // no edit icons in preview mode } else { $data->assign('edit', $this->getEditString()); $data->assign('editPrio', $this->getEditPrioString()); $data->assign('editAdd', $this->getEditAddString()); $data->assign('editAddChild', $this->getEditAddChildString()); } $SEOMetaTags = ""; if (trim($this->getMetaDescription())) { $SEOMetaTags .= '<meta name="description" content="' . htmlspecialchars(trim($this->getMetaDescription()), ENT_COMPAT, "UTF-8") . '" />'; } if (trim($this->getMetaKeywords())) { $SEOMetaTags .= '<meta name="keywords" content="' . htmlspecialchars(trim($this->getMetaKeywords()), ENT_COMPAT, "UTF-8") . '" />'; } $data->assign('SEOMetaTags', $SEOMetaTags); // $isCurrentArticle, good for using i lists $isCurrentArticle = false; if ($polarbear_a && $polarbear_a->getId() == $this->getId()) { $isCurrentArticle = true; } $data->assign('isCurrentArticle', $isCurrentArticle); // fetch parent so vi easily can check if current article is child of some article // todo: since these are the same as for the current article maybe we could make a wrapper for it.. somehow $parentA = PolarBear_Article::getInstance($this->parentID); $data->assign('parentId', $parentA->getId()); $data->assign('parentTitleArticle', htmlspecialchars($parentA->getTitleArticle(), ENT_COMPAT, "UTF-8")); $data->assign('parentTitlePage', htmlspecialchars($parentA->getTitlePage(), ENT_COMPAT, "UTF-8")); $data->assign('parentTitleNav', htmlspecialchars($parentA->getTitleNav(), ENT_COMPAT, "UTF-8")); $data->assign('parentHref', $parentA->href()); $data->assign('parentHrefFull', $parentA->href()); $data->assign('parentFullPageTitle', $parentA->fullPageTitle()); $data->assign('parentTeaser', $parentA->getTeaser()); $data->assign('parentHasTeaser', $parentA->hasTeaser()); $data->assign('parentBody', $parentA->getBody()); $data->assign('parentHasBody', $parentA->hasBody()); $data->assign('parentDatePublish', $parentA->getDatePublish()); $data->assign('parentDateChanged', $parentA->getDateChanged()); $data->assign('parentMetaDescription', $parentA->getMetaDescription()); $data->assign('parentMetaKeywords', $parentA->getMetaKeywords()); $fieldValues = $this->fieldValues(); $data->assign('fields', $fieldValues); $out = $dwoo->get($tpl, $data); $out = pb_event_fire("article_output", array("article" => $this, "output" => $out)); $out = $out["output"]; #pb_pqp_log_speed("article output()"); return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function templateToUse() {\n\t\t// loop until templateType = name | custom\n\t\t$templateType = $this->getTemplateType();\n\t\t$templateCustom = $this->getTemplateCustom();\n\t\t$templateName = $this->getTemplateName();\n\t\t$articleName = $this->getTitleArticle();\n\t\t$articleId = $this->getId();\n\t\t$parent = ...
[ "0.67228913", "0.65464205", "0.6375591", "0.63364995", "0.63085055", "0.6292047", "0.6279865", "0.62637776", "0.62637776", "0.62637776", "0.62637776", "0.62585753", "0.6203743", "0.6203743", "0.6203743", "0.6203743", "0.6203743", "0.6203743", "0.61924964", "0.61860967", "0.61...
0.6668079
1
not sure this one is in use. idea that never went anywhere
function fieldValuesSimplified() { $arrFieldValuesSimplified = array(); $fieldValues = $this->fieldValues(); foreach ($fieldValues as $fieldID => $fieldVal) { if (!isset($arrFieldValuesSimplified[$fieldID])) { $arrFieldValuesSimplified[$fieldID] = array(); } foreach ($fieldVal as $fieldSubVal) { $arrFieldValuesSimplified[$fieldID][] = $fieldSubVal['value']; } } return $arrFieldValuesSimplified; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixSelf() {}", "protected function fixSelf() {}", "private function __() {\n }", "private function __construct()\t{}", "private function _i() {\n }", "protected function __init__() { }", "final private function __construct(){\r\r\n\t}", "private function init()\n\t{\n\t...
[ "0.6103791", "0.6103791", "0.59956455", "0.5953056", "0.59226346", "0.58344084", "0.5787308", "0.5776321", "0.5769375", "0.5753654", "0.570444", "0.570444", "0.5653907", "0.56375355", "0.56098443", "0.56067383", "0.56067383", "0.56067383", "0.55705833", "0.55588156", "0.55561...
0.0
-1
Get all tags this article is tagged with
function tags() { $preloader = pb_query_preloader::getInstance(); $preloadRow = $preloader->getPreloadArticleTag($this->id); if ($preloadRow) { $rows = $preloadRow; } else { global $polarbear_db; $sql = "SELECT tagID FROM " . POLARBEAR_DB_PREFIX . "_article_tag_relation WHERE articleID = '$this->id'"; $rows = $polarbear_db->get_results($sql); } $arrTags = array(); if ($rows) { foreach ($rows as $row) { $arrTags[] = polarbear_tag::getInstance($row->tagID); } } pb_pqp_log_speed("article tags()"); return $arrTags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags() {}", "public function tags() {\n\t\treturn $this->get_tags();\n\t}", "public function tags()\n {\n $new = $this->po...
[ "0.79333645", "0.79333645", "0.79333645", "0.79333645", "0.79333645", "0.77106255", "0.75645006", "0.749101", "0.74824804", "0.74465036", "0.74197316", "0.74194056", "0.74194056", "0.7393746", "0.7388916", "0.7387862", "0.73850256", "0.73035234", "0.73035234", "0.73035234", "...
0.76261646
6
Get all tags that are child of tag with ID parentID and selected for the article
function tagsSelectedChildren($parentID) { $arr = array(); $arrTags = $this->tags(); foreach ($arrTags as $oneTag) { if ($oneTag->parentID==$parentID) { $arr[] = $oneTag; } } return $arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findAllWithParent() { \n return $this->createQueryBuilder('a')\n ->leftJoin('a.parent', 'p')\n ->getQuery()\n ->getResult();\n }", "public function getChildren($idParent) {\r\n\t\t$entities = $this->find('all', array(\r\n\t...
[ "0.6014812", "0.59737283", "0.5889965", "0.58226585", "0.57431567", "0.5719665", "0.5713641", "0.5642811", "0.56135005", "0.5585254", "0.55792195", "0.55677885", "0.5526267", "0.5504596", "0.5497928", "0.54804814", "0.5473635", "0.5462841", "0.5442516", "0.54241216", "0.54151...
0.7950513
0
Set the content to json $content
public function json(array $content): Content { $this->content = json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDataContent($content)\n {\n if (is_array($content)) {\n $this->headers->set('Content-Type', 'application/json');\n $content = json_encode($content);\n }\n\n $this->setContent($content);\n }", "function json($content = null){\n $this->_JSO...
[ "0.78884196", "0.75955975", "0.75914484", "0.71827155", "0.71258885", "0.70481664", "0.6854559", "0.66435784", "0.6586468", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65794635", "0.65747446", ...
0.67016137
7
Merge the current json content with $additional It's a recursive merge and if the current content can not be decoded it is getting replaced.
public function mergeJson(array $additional): Content { $this->content = json_encode(ArrayMerger::doMerge( json_decode($this->content, true) ?? [], $additional ), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getAdditionalJsonData(): array;", "private function mergeExtra()\n {\n if (method_exists($this, 'extra')) {\n $this->extra = $this->extra();\n }\n }", "public function getExtraJson()\n {\n return $this->extra;\n }", "public function setE...
[ "0.5705459", "0.5674741", "0.5347232", "0.53268456", "0.52907085", "0.5189178", "0.5084554", "0.5040155", "0.50257856", "0.50155675", "0.4973082", "0.4886909", "0.4882617", "0.48722002", "0.48604196", "0.4833405", "0.47595862", "0.47458008", "0.47219855", "0.47028667", "0.469...
0.77434695
0
Prepend $line with $content $line is a regular expression so keep in mind for proper masking of special characters. You can also refer to sub patterns keep in mind that the whole line is a subpattern added after $content.
public function prepend(string $line, string $content): Content { $this->content = preg_replace('~^(' . $line . ')$~sm', $content . PHP_EOL . '\1', $this->content); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prependContent ($content) {\r\n\t\t$this->content = (string)$content.$this->content;\r\n\t}", "public function append(string $line, string $content): Content\n {\n $this->content = preg_replace('~^(' . $line . ')$~sm', '\\1' . PHP_EOL . $content, $this->content);\n return $this;\...
[ "0.73560673", "0.72558165", "0.7217798", "0.70127034", "0.70068544", "0.6985556", "0.66676086", "0.60524374", "0.60358363", "0.602302", "0.5942655", "0.5942294", "0.5928109", "0.5828813", "0.5816379", "0.5794007", "0.5695521", "0.56891173", "0.5642749", "0.5635985", "0.559225...
0.81915766
0
Prepend $line with $content $line is a regular expression so keep in mind for proper masking of special characters. You can also refer to sub patterns keep in mind that the whole line is a subpattern.
public function replace(string $line, string $content): Content { $this->content = preg_replace('~^(' . $line . ')$~sm', $content, $this->content); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepend(string $line, string $content): Content\n {\n $this->content = preg_replace('~^(' . $line . ')$~sm', $content . PHP_EOL . '\\1', $this->content);\n return $this;\n }", "public function prependContent ($content) {\r\n\t\t$this->content = (string)$content.$this->content;...
[ "0.82024735", "0.72799104", "0.7233281", "0.7129444", "0.6980303", "0.6972923", "0.66116375", "0.6026539", "0.5989391", "0.5978756", "0.5945223", "0.594215", "0.5882257", "0.57594126", "0.5728624", "0.5727434", "0.56732446", "0.56648135", "0.5647239", "0.5564192", "0.5493114"...
0.69433933
6
Prepend $line with $content $line is a regular expression so keep in mind for proper masking of special characters. You can also refer to sub patterns keep in mind that the whole line is a subpattern.
public function append(string $line, string $content): Content { $this->content = preg_replace('~^(' . $line . ')$~sm', '\1' . PHP_EOL . $content, $this->content); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepend(string $line, string $content): Content\n {\n $this->content = preg_replace('~^(' . $line . ')$~sm', $content . PHP_EOL . '\\1', $this->content);\n return $this;\n }", "public function prependContent ($content) {\r\n\t\t$this->content = (string)$content.$this->content;...
[ "0.82019734", "0.7280032", "0.71302056", "0.69813806", "0.69727147", "0.69410735", "0.6612531", "0.6026453", "0.5989103", "0.59780234", "0.59448737", "0.5942994", "0.588412", "0.5759845", "0.5728072", "0.57278395", "0.5672914", "0.56635535", "0.5646495", "0.5562488", "0.54927...
0.72313964
2
Add method after method named $after
public function addMethod(string $methodDeclaration, string $after = null): Content { if (!preg_match('~(class|interface|trait)[a-z \n\\\\]+\{~ism', $this->content)) { throw new \Exception('Not a class, trait or interface'); } $pos = strrpos($this->content, '}'); $regex = '~^ [a-z ]*?' . // a method has to start with indentation of 4 and may have keywords in front 'function ' . $after . // the function keyword plus the method name '\s*\([^)]*\)' . // parameter definitions (note: no closing parenthesis inside strings allowed) '\s*(:\s*[a-z\\\n]+)?' . // maybe with return type declaration '\s*(\{.*?\n \}$|;$)' . // with a body or a semicolon at a end of line '~ism'; if ($after && preg_match($regex, $this->content, $match, PREG_OFFSET_CAPTURE)) { $pos = $match[0][1] + strlen($match[0][0]) + 1; } $this->content = substr_replace($this->content, $methodDeclaration, $pos, 0); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function after(\\Closure $after);", "public static function _after() : void {\n\t}", "abstract function after();", "protected function after(){}", "protected function after(){}", "protected function after(){}", "protected function _after()\n {\n }", "protected function _after()\n\t{\n\t\...
[ "0.8131647", "0.7950567", "0.77985257", "0.7711803", "0.7711803", "0.7711803", "0.77065855", "0.7621594", "0.7621594", "0.7570001", "0.75496113", "0.75267786", "0.7520458", "0.7478968", "0.7464653", "0.7428816", "0.7285258", "0.7141182", "0.7140441", "0.7140265", "0.7139118",...
0.56655526
92
last tail of first array
public function shiftRole($arr){ $first_tail = $arr["head"][0]["tail"]; //first head of last array $last_head = $arr["tail"][0]["head"]; //result first value array $res_first_head = []; //result last value array $res_last_tail = []; //result array $res_arr = []; foreach($arr as $key => $val){ switch ($key) { case "head" : $res_arr = $this->headRole($val[0],$res_arr); break; case "body" : $res = $this->bodyRole($val,$res_arr,$first_tail,$last_head); $res_arr = $res['res_arr']; $res_first_head = $res['res_first_head']; $res_last_tail = $res['res_last_tail']; break; case "tail" : $res_arr = $this->tailRole($val[0],$res_arr); break; } } $res_arr = array_merge($res_first_head,$res_arr); $res_arr = array_merge($res_arr,$res_last_tail); return $res_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_last($array)\n {\n return arr::last($array);\n }", "static function last(array $array) {\n return end($array);\n }", "function tail(array $list)\n{\n return array_slice($list, 1);\n}", "function asdb_last($array)\n\t{\n\t\treturn end($array);\n\t}", "public function...
[ "0.7111093", "0.6940916", "0.69408154", "0.6937575", "0.68588424", "0.6845268", "0.68448305", "0.68429536", "0.6834951", "0.67404515", "0.672879", "0.6697093", "0.6610664", "0.6454563", "0.64343375", "0.64343375", "0.64109355", "0.6387493", "0.63742244", "0.6287923", "0.62848...
0.0
-1
Run the database seeds.
public function run() { // Themes Table Seeder DB::table('themes')->insert([ ['fileName' => "0", 'themeName' => "Flatty"], ['fileName' => "1", 'themeName' => "Cerulean"], ['fileName' => "2", 'themeName' => "Cosmo"], ['fileName' => "3", 'themeName' => "Cyborg"], ['fileName' => "4", 'themeName' => "Darkly"], ['fileName' => "5", 'themeName' => "Journal"], ['fileName' => "6", 'themeName' => "Lumen"], ['fileName' => "7", 'themeName' => "Paper"], ['fileName' => "8", 'themeName' => "Readable"], ['fileName' => "9", 'themeName' => "Sandstone"], ['fileName' => "10", 'themeName' => "Simplex"], ['fileName' => "11", 'themeName' => "Slate"], ['fileName' => "12", 'themeName' => "Solar"], ['fileName' => "13", 'themeName' => "Spacelab"], ['fileName' => "14", 'themeName' => "Superhero"], ['fileName' => "15", 'themeName' => "United"], ['fileName' => "16", 'themeName' => "Yeti"] ]); DB::table('users')->insert([ 'name' => 'saman', 'email' => 'ahmadianrad.saman@gmail.com', 'password' => bcrypt('0019421664'), ]); DB::table('apartments')->insert([ 'code' =>'test', 'manager_name' => 'saman', 'manager_phone' => '09379084098', 'address' => 'lsadkfasudflkajsdf', 'description' => 'asjkdhfkjashdfklhaslkhfd' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Display a listing of showings
public function index(Cinema $cinema) { $startingAfter = $this->getStartingAfter($cinema); $endOfDay = $startingAfter->copy()->endOfDay(); $movieIds = Showing::where('start_time', '>=', $startingAfter->toDateTimeString()) ->where('start_time', '<=', $endOfDay->toDateTimeString()) ->where('cinema_id', $cinema->id)->distinct()->lists('movie_id')->unique(); // There are no movies left for today, try tomorrow (this should be moved to the app in the future) if(!count($movieIds)) { $startingAfter = Carbon::tomorrow(); $endOfDay = $startingAfter->copy()->endOfDay(); $movieIds = Showing::where('start_time', '>=', $startingAfter->toDateTimeString()) ->where('start_time', '<=', $endOfDay->toDateTimeString()) ->where('cinema_id', $cinema->id)->distinct()->lists('movie_id')->unique(); } $movies = Movie::whereIn('id', $movieIds)->with(array('details', 'showings' => function($q) use ($startingAfter, $endOfDay, $cinema) { $q->where('start_time', '>=', $startingAfter->toDateTimeString()); $q->where('start_time', '<=', $endOfDay->toDateTimeString()); $q->where('cinema_id', $cinema->id); }))->orderBy('tomato_meter', 'desc')->get(); foreach($movies as $movie) { // set if they are new // did they have a session 1 week ago? $movie->new = Showing::where('movie_id', $movie->id) ->where('cinema_id', $cinema->id) ->where('start_time', '>', Carbon::today($cinema->timezone)->subDays(7)) ->where('start_time', '<', Carbon::today($cinema->timezone)->subDays(6))->count() == 0; } return Fractal::collection($movies, new MovieTransformer)->responseJson(200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Listing $listing)\n {\n //\n }", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sid...
[ "0.7427381", "0.7295781", "0.7233856", "0.70804", "0.70496756", "0.6984542", "0.69112945", "0.68775874", "0.6847938", "0.68263924", "0.6690762", "0.6681035", "0.66565746", "0.66407114", "0.6623656", "0.6612671", "0.6611816", "0.6561395", "0.65363634", "0.6479455", "0.646418",...
0.0
-1
Returns the field name for the type of work.
public static function workType(): string { return 'type'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_field_name();", "public function getFieldName()\r\n\t{\r\n\t\treturn $this->name;\r\n\t}", "public function getFieldName() {}", "public function getFieldName()\n {\n return $this->fieldName;\n }", "public function getFieldName()\n {\n return $this->fieldName;\n ...
[ "0.7989957", "0.75793093", "0.74331254", "0.7429479", "0.7429479", "0.7429479", "0.73942125", "0.72984844", "0.72907996", "0.7278204", "0.7229615", "0.71899027", "0.7125336", "0.7095347", "0.70200104", "0.6999807", "0.6966098", "0.6945453", "0.6898232", "0.6863563", "0.684242...
0.65729266
40
Adds the type of work.
public function addWorkType(WorkType $workType): Term { return $this->addTerm($workType, self::workType()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addType($type);", "public static function workType(): string\n {\n return 'type';\n }", "public function AddType($type) {\n $this->Types[] = $type;\n }", "public function onTickettypesAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "static public function objectToAdd($ty...
[ "0.6574077", "0.6183576", "0.6173784", "0.59997857", "0.59317607", "0.5731618", "0.5722681", "0.569007", "0.56357265", "0.5601423", "0.5544256", "0.55344784", "0.55344784", "0.552291", "0.552291", "0.54903704", "0.5484543", "0.54658854", "0.54612595", "0.54545116", "0.5428739...
0.62523764
1
Upgrades data for a module
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); if (version_compare($context->getVersion(), '1.1.0', '<')) { $options = ['km', 'qm', 'cbm', 'pc']; // holds the conversion rates $dataTemplate = [ 'km' => [ [ 'reference_unit' => 'm', 'conversion_rate' => '0.001', ], [ 'reference_unit' => 'cm', 'conversion_rate' => '0.00001', ], [ 'reference_unit' => 'mm', 'conversion_rate' => '0.000001', ], ], 'm' => [ [ 'reference_unit' => 'km', 'conversion_rate' => '1000', ], ], 'cm' => [ [ 'reference_unit' => 'km', 'conversion_rate' => '100000', ], ], 'mm' => [ [ 'reference_unit' => 'km', 'conversion_rate' => '1000000', ], ], ]; $this->addOption($eavSetup, $options); $this->eavConfig->clear(); $this->addToSystemConfiguration($dataTemplate); $this->sortOptions($setup); } $setup->endSetup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function updateData();", "function upgrade_module_1_1_0($module)\n{\n /*\n * Do everything you want right there,\n * You could add a column in one of your module's tables\n */\n\n return true;\n}", "function processData() \n {\n \n // store values in table man...
[ "0.6612304", "0.64889705", "0.64011186", "0.6351384", "0.6349843", "0.62532115", "0.61109763", "0.60980785", "0.6042899", "0.59778166", "0.5975903", "0.59604204", "0.59535545", "0.5898077", "0.5875901", "0.58236986", "0.57752895", "0.57316774", "0.57241946", "0.5715318", "0.5...
0.0
-1
Sets conversations for added default units
protected function addToSystemConfiguration(array $dataTemplate) { // get all attribute options for product unit $productUnitOptions = []; foreach ($this->productAttributeOptionManagementInterface->getItems('baseprice_product_unit') as $option) { $productUnitOptions[$option->getLabel()] = $option->getValue(); } // get all attribute options for reference unit $referenceUnitOptions = []; foreach ($this->productAttributeOptionManagementInterface->getItems('baseprice_reference_unit') as $option) { $referenceUnitOptions[$option->getLabel()] = $option->getValue(); } //Config value is not available during first installation -> maybe config cache if (is_null($this->scopeConfig->getValue(Data::CONVERSION_CONFIG_PATH))) { $data = []; $dataTemplate = array_merge_recursive(self::DEFAULT_DATA_TEMPLATE, $dataTemplate); } else { $data = $this->serializer->unserialize($this->scopeConfig->getValue(Data::CONVERSION_CONFIG_PATH)); } // iterate over attribute options in order to replace labels with option ids foreach ($dataTemplate as $unit => $unitData) { foreach ($unitData as $key => $unitDataEntry) { $data[] = [ 'product_unit' => $productUnitOptions[$unit], 'reference_unit' => $referenceUnitOptions[$unitDataEntry['reference_unit']], 'conversion_rate' => $unitDataEntry['conversion_rate'], ]; } } //save system configuration $this->configResource->saveConfig( Data::CONVERSION_CONFIG_PATH, $this->serializer->serialize($data), ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSetMessagesConfidentiels() {\n\n $obj = new Collaborateurs();\n\n $obj->setMessagesConfidentiels(\"messagesConfidentiels\");\n $this->assertEquals(\"messagesConfidentiels\", $obj->getMessagesConfidentiels());\n }", "private function setMessageToPlayer()\n {\n ...
[ "0.5138219", "0.5132209", "0.50547963", "0.50118566", "0.5008269", "0.49841768", "0.49701706", "0.48281908", "0.48183528", "0.48172984", "0.4772161", "0.47620618", "0.47489032", "0.47418034", "0.47215116", "0.47091803", "0.4700095", "0.46969905", "0.46892437", "0.46880978", "...
0.0
-1
Sort options of the attribute(s) based on self::OPTIONS_SORT_ORDER
public function sortOptions(ModuleDataSetupInterface $setup, array $attributes = []) { if (empty($attributes)) { $attributes = self::UNIT_ATTRIBUTE_CODES; } //iterate through given attribute_codes foreach ($attributes as $attributeCode) { $attribute = $this->attributeRepository->get(Product::ENTITY, $attributeCode); //iterate through options foreach ($attribute->getOptions() as $option) { //get sort order based on options label $sortOrder = array_search($option->getLabel(), self::OPTIONS_SORT_ORDER); $table = $setup->getTable('eav_attribute_option'); $optionId = $attribute->getSource()->getOptionId($option->getValue()); if ($optionId != '' && ! is_null($optionId)) { $setup->getConnection()->update($table, ['sort_order' => $sortOrder], 'option_id=' . $optionId); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sortOptions() {\n $options = array();\n\n foreach($this->options as $key => $option) {\n $optionTitle = $option['optionTitle'];\n $options[$optionTitle] = $option;\n }\n\n ksort($options);\n reset($options);\n\n $this->options = $optio...
[ "0.76776123", "0.71275425", "0.68757313", "0.6867762", "0.6743747", "0.67381907", "0.6723236", "0.66895103", "0.654879", "0.6361041", "0.6355159", "0.63350993", "0.62891144", "0.6225007", "0.6208161", "0.6181618", "0.6172408", "0.6109331", "0.604209", "0.6031998", "0.6005601"...
0.71040255
2
Generates a menu bar for a user.
public function user($user) { //pr($user); $this->template = 'display'; $menu = []; $menu[] = [ 'title' => $user['name'], 'url' => ['controller' => 'profiles', 'action' => 'show', $user['id']], 'options' => [] ]; $menu[] = [ 'title' => 'Sign Out', 'url' => ['controller' => 'users', 'action' => 'logout'], 'options' => [] ]; $this->set('menu', $menu); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function usermin_createmenuitems()\n{\n $menubar['user'] = a...
[ "0.74969244", "0.74969244", "0.74969244", "0.74969244", "0.74969244", "0.74969244", "0.72681683", "0.6962246", "0.6826908", "0.67375594", "0.66924936", "0.669186", "0.669186", "0.6691475", "0.6654989", "0.66179216", "0.6614304", "0.6546831", "0.6546616", "0.652338", "0.652018...
0.0
-1
Generates a menu bar for a visitor.
public function visitor() { $this->template = 'display'; $menu = []; $this->set('menu', $menu); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public function makeMenu() {}", "public function writeMenu() ...
[ "0.77258295", "0.77258295", "0.77258295", "0.77258295", "0.77258295", "0.77258295", "0.7027807", "0.7024289", "0.7023488", "0.7023488", "0.7023199", "0.6821798", "0.67724943", "0.6675809", "0.66277003", "0.65984225", "0.6596611", "0.65319145", "0.65227485", "0.65160555", "0.6...
0.68105584
12
Returns the static model of the specified AR class.
public static function model($className = __CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($cl...
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0....
0.0
-1
Busco pago y envio de la fecha
public function getPea($inicio, $fin) { $criteria = new CDbCriteria(); $p = -1; $e = -1; if ($this->GCCP_Id == 11) { $p = 30; //credito parley-king $e = 31; //debito parley-king if (isset($this->gCCA)) { if ($this->gCCA->GCCA_Tv == 'pos') { $p = '30,0'; $e = '31,1'; } } else { $p = '30,0'; $e = '31,1'; } } else if ($this->GCCP_Id == 12) { $p = 32; //credito recargas-king $e = 33; //debito recargas-king } else if ($this->GCCP_Id == 1) { $p = 0; $e = 1; } $criteria->select = "SUM( CASE WHEN (GCUA_Id in (" . $p . ") ) THEN GCCS_Monto ELSE 0 END) as Pagos, SUM( CASE WHEN (GCUA_Id in (" . $e . ") ) THEN GCCS_Monto ELSE 0 END) as Envios"; if (isset($this->GCCA_Id)) $criteria->condition = 'GCCA_Id = ' . $this->GCCA_Id . ' and GCCD_Id = ' . $this->GCCD_Id . ' and GCCS_Status =1 and GCCS_Currency = "' . $this->GCCE_Currency . '" and GCCS_Fecha BETWEEN "' . $inicio . '" AND "' . $fin . '"'; else if ($this->gCCD->GCCU_Id == 2 ) $criteria->condition = 'GCCD_Id = ' . $this->GCCD_Id . ' and GCCS_Status =1 and GCCS_Currency = "' . $this->GCCE_Currency . '" and GCCS_Fecha BETWEEN "' . $inicio . '" AND "' . $fin . '"'; else $criteria->condition = 'GCCA_Id is null and GCCD_Id = ' . $this->GCCD_Id . ' and GCCS_Status =1 and GCCS_Currency = "' . $this->GCCE_Currency . '" and GCCS_Fecha BETWEEN "' . $inicio . '" AND "' . $fin . '"'; return Gccs::model()->find($criteria); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "public function get_facturas(Request $request){\n $currentPage = $request->input('pagina_actual');\n $limit = $request->input('...
[ "0.67588687", "0.66265446", "0.6438808", "0.6382975", "0.637913", "0.6363689", "0.6333858", "0.63239175", "0.6271153", "0.6243587", "0.62340915", "0.6223537", "0.61878556", "0.6163207", "0.61508185", "0.61053795", "0.60768306", "0.60753787", "0.6065901", "0.60429776", "0.6036...
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria = new CDbCriteria; $criteria->compare('GCCE_Id', $this->GCCE_Id); $criteria->compare('GCCA_Id', $this->GCCA_Id); $criteria->compare('GCCD_Id', $this->GCCD_Id); $criteria->compare('GCCP_Id', $this->GCCP_Id); $criteria->compare('GCCE_PorcentajeVentasD', $this->GCCE_PorcentajeVentasD); $criteria->compare('GCCE_PorcentajeVentasP', $this->GCCE_PorcentajeVentasP); $criteria->compare('GCCE_ControlEsquema', $this->GCCE_ControlEsquema, true); $criteria->compare('GCCE_PorcentajeUtilidad', $this->GCCE_PorcentajeUtilidad); $criteria->compare('GCCE_PorcentajePerdida', $this->GCCE_PorcentajePerdida); $criteria->compare('GCCE_Fecha', $this->GCCE_Fecha, true); $criteria->compare('GCCE_ApMinDirecta', $this->GCCE_ApMinDirecta); $criteria->compare('GCCE_ApMinParley', $this->GCCE_ApMinParley); $criteria->compare('GCCE_ApMaxDirecta', $this->GCCE_ApMaxDirecta); $criteria->compare('GCCE_ApMaxParley', $this->GCCE_ApMaxParley); $criteria->compare('GCCE_PreMaxDirecta', $this->GCCE_PreMaxDirecta); $criteria->compare('GCCE_PreMaxParley', $this->GCCE_PreMaxParley); $criteria->compare('GCCE_MaxMulti', $this->GCCE_MaxMulti); $criteria->compare('GCCE_MaxJugada', $this->GCCE_MaxJugada); $criteria->compare('GCCE_MinJugada', $this->GCCE_MinJugada); $criteria->compare('GCCE_Enabled', $this->GCCE_Enabled); // $criteria->compare('GCCE_MachoMin',$this->GCCE_MachoMin); // $criteria->compare('GCCE_HembraMax',$this->GCCE_HembraMax); // $criteria->compare('GCCE_HembraMin',$this->GCCE_HembraMin); // $criteria->compare('GCCE_EmpateMax',$this->GCCE_EmpateMax); $criteria->compare('GCCE_RepetidosMonto', $this->GCCE_RepetidosMonto); $criteria->compare('GCCE_CupoDeuda', $this->GCCE_CupoDeuda); $criteria->compare('GCCE_Repetidos', $this->GCCE_Repetidos, true); $criteria->compare('GCCE_Label', $this->GCCE_Label, true); $criteria->compare('GCCE_Currency', $this->GCCE_Currency, true); if (!Yii::app()->user->isSuperAdmin) $criteria->addInCondition('GCCD_Id', Gccd::model()->arrayHijos(Yii::app()->user->getState('grupo'))); return new CActiveDataProvider($this, array( 'criteria' => $criteria, 'sort' => array( 'defaultOrder' => 'GCCE_Fecha desc, GCCP_Id desc', 'attributes' => array( 'gcca_search' => array( 'asc' => 'gcca.GCCA_Nombre', 'desc' => 'gcca.GCCA_Nombre DESC', ), '*', ), ), 'pagination' => array( 'pageSize' => 500 ) )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w...
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.597930...
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $nacionalidades_vuelos = NacionalidadVuelo::lists('nombre','id'); $tipos_matriculas = TipoMatricula::lists('nombre','id'); if($request->ajax()){ $sortName = $request->get('sortName','nombre_cargo'); $sortName =($sortName=="")?"nombre_cargo":$sortName; $sortType = $request->get('sortType','ASC'); $sortType =($sortType=="")?"ASC":$sortType; $nombre_cargo = $request->get('nombre_cargo', '%'); $nombre_cargo =($nombre_cargo=="")?"%":$nombre_cargo; \Input::merge([ 'sortName'=>$sortName, 'sortType'=>$sortType]); $otros_cargos = OtrosCargo::with("conceptos") ->where('nombre_cargo', 'like', $nombre_cargo) ->orderBy($sortName, $sortType) ->paginate(20); return view('configuracionPrecios.confOtrosCargos.partials.table', compact('otros_cargos','tipos_matriculas', 'nacionalidades_vuelos')); } else { return view('configuracionPrecios.confOtrosCargos.index', compact('otros_cargos', 'tipos_matriculas', 'nacionalidades_vuelos')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $cantidad_unidades = $request->unidades; $aeropuerto_id = $request->aeropuerto_id; $precio_cargo = 0; $peso_desde = $request->peso_desde; $peso_hasta = $request->peso_hasta; foreach ($request->conceptos_id as $key => $concepto_id) { $concepto = Concepto::find($concepto_id); $nombre_cargo = $concepto->nompre; foreach ($request->tipos_matriculas_id as $key => $tipo_matricula_id) { foreach ($request->procedencias_id as $key => $procedencia_id) { foreach($request->nacionalidad_matriculas as $key => $nacionalidad_matricula) { $whereIn['concepto_id'] = $concepto_id; $whereIn['tipo_matricula'] = $tipo_matricula_id; $whereIn['aeropuerto_id'] = $aeropuerto_id; $whereIn['procedencia'] = $procedencia_id; $whereIn['nacionalidad_matricula'] = $nacionalidad_matricula; $whereIn['peso_desde'] = $peso_desde; $whereIn['peso_hasta'] = $peso_hasta; $otros_cargos = OtrosCargo::updateOrCreate($whereIn,array_filter([ 'nombre_cargo' => $nombre_cargo, 'precio_cargo' => $precio_cargo, 'aeropuerto_id' => $aeropuerto_id, 'cantidad_unidades' => $cantidad_unidades, 'concepto_id' => $concepto_id, 'conceptoCredito_id' => $concepto_id, 'conceptoContado_id' => $concepto_id, 'peso_desde' => $peso_desde, 'peso_hasta' => $peso_hasta, 'tipo_matricula' => $tipo_matricula_id, 'nacionalidad_matricula' => $nacionalidad_matricula, 'procedencia' => $procedencia_id, 'tipo_pago_id' => $request->tipo_pago_id ])); } } } } if ($otros_cargos){ return response()->json(array("text"=>'Registro realizado exitósamente', "otros_cargos"=>$otros_cargos, "success"=>1)); }else{ response()->json(array("text"=>'Error registrando el cargo',"success"=>0)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.634...
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $otrosCargo = OtrosCargo::find($id); $nacionalidades_vuelos = NacionalidadVuelo::lists('nombre','id'); $tipos_matriculas = TipoMatricula::lists('nombre','id'); $tipo_pagos = TipoPago::lists('name','id'); return view('configuracionPrecios.confOtrosCargos.partials.edit', compact('otrosCargo', 'tipos_matriculas', 'nacionalidades_vuelos','tipo_pagos')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update($id, Request $request) { $oc = OtrosCargo::find($id); $otrosCargo = $oc->update($request->all()); if($otrosCargo){ return ["success"=>1, "text" => "Registro modificado con éxito."]; }else{ return ["success"=>0, "text" => "Error modificando el registro."]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { if(\App\OtrosCargo::destroy($id)){ return ["success"=>1, "text" => "Registro eliminado con éxito."]; }else{ return ["success"=>0, "text" => "Error eliminando el registro."]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
checks if the current stack includes the given type
private function within($type, $stop = []) { $wild = !empty($stop) && $stop[0] === '*'; for ($i = count($this->stack) -1; $i >= 0; --$i) { $c = $this->stack[$i]; if ($c === $type) return true; if ($wild || in_array($c, $stop)) break; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasType(){\n return $this->_has(9);\n }", "public function hasType(){\r\n return $this->_has(7);\r\n }", "public function hasType(){\n return $this->_has(5);\n }", "public function hasType(){\n return $this->_has(5);\n }", "public function hasType(){\n r...
[ "0.66251063", "0.65623266", "0.6503499", "0.6503499", "0.64942384", "0.642284", "0.642284", "0.642284", "0.64030236", "0.6358008", "0.6354337", "0.6323765", "0.6166012", "0.60577357", "0.60429424", "0.60297215", "0.60248476", "0.60134256", "0.6005678", "0.5984078", "0.5933386...
0.6244216
12
checks if the given mods can be used without collision
private function check_nested_mods($mods) { foreach ($this->nmods as $nmo) { foreach ($mods as $mod) { if (isset ($nmo[$mod->type])) { Logger::warn_at($mod->loc, 'duplicate modifier `%s`', $mod->value); Logger::info_at($nmo[$mod->type], 'previous modifier was here'); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cs_coins_mod($mod)\n{\n\t$options = cs_sql_option(__FILE__, 'coins');\n\t$mods = array_map('trim', explode(',', strtolower($options['coin_mods'])));\n\tif (in_array(strtolower($mod), $mods))\n\t\treturn true;\n\treturn false;\n}", "protected function checkUsage(){\n $modId = $this->getModId();\n ...
[ "0.6743246", "0.64233416", "0.6368236", "0.6352324", "0.63375574", "0.6190638", "0.59760326", "0.58932674", "0.58820647", "0.5827975", "0.5827064", "0.580294", "0.5791601", "0.5779671", "0.5771295", "0.573058", "0.56890476", "0.56875503", "0.56768745", "0.5649325", "0.5622476...
0.6100875
6
checks if given modifiers + modifers from a nestedmods decl can be merged
private function push_mods($mods) { if (!$mods) return; $skip = []; foreach ($this->nmods as $nmo) { foreach ($mods as $mod) { if (in_array($mod, $skip)) continue; if (isset ($nmo[$mod->type])) { $skip[] = $mod; continue; } } } $marr = []; foreach ($mods as $mod) if (!in_array($mod, $skip)) $marr[$mod->type] = $mod->loc; array_push($this->nmods, $marr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function check_nested_mods($mods)\n {\n foreach ($this->nmods as $nmo) {\n foreach ($mods as $mod) {\n if (isset ($nmo[$mod->type])) {\n Logger::warn_at($mod->loc, 'duplicate modifier `%s`', $mod->value);\n Logger::info_at($nmo[$mod->type], 'previous modifier was here');\n...
[ "0.6935619", "0.5366825", "0.5365497", "0.5359097", "0.51166934", "0.5115001", "0.505053", "0.4888271", "0.48372728", "0.48295137", "0.4708239", "0.461563", "0.45601478", "0.45381725", "0.45031318", "0.44679478", "0.44479215", "0.4422452", "0.43839535", "0.43794093", "0.43533...
0.0
-1
pops off nested mods
private function pop_mods() { array_pop($this->nmods); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function check_nested_mods($mods)\n {\n foreach ($this->nmods as $nmo) {\n foreach ($mods as $mod) {\n if (isset ($nmo[$mod->type])) {\n Logger::warn_at($mod->loc, 'duplicate modifier `%s`', $mod->value);\n Logger::info_at($nmo[$mod->type], 'previous modifier was here');\n...
[ "0.54058236", "0.5280488", "0.50870544", "0.5004442", "0.48704857", "0.48507556", "0.48277876", "0.47754657", "0.4772254", "0.4744985", "0.4714142", "0.47010183", "0.4693923", "0.46936768", "0.46694234", "0.46484742", "0.46434817", "0.463465", "0.46233124", "0.46045268", "0.4...
0.6652544
0
checks if modifier is set
private function has_extern_mod($mods) { if (!$mods) return false; foreach ($mods as $mod) if ($mod->type === T_EXTERN || $mod->type === T_NATIVE) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsModifier() {\n return $this->isModifier;\n }", "function isTrustedModifier($modifier_name, $compiler)\r\n {\r\n if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {\r\n return true;\r\n ...
[ "0.6808254", "0.6620051", "0.64306134", "0.6209378", "0.602689", "0.59699136", "0.59650046", "0.59650046", "0.59650046", "0.59650046", "0.58731395", "0.5726979", "0.5694137", "0.55240077", "0.5494135", "0.5475493", "0.5427277", "0.5381709", "0.53693116", "0.5353525", "0.53461...
0.0
-1
checks if modifier is set
private function has_const_mod($mods) { if (!$mods) return false; foreach ($mods as $mod) if ($mod->type === T_CONST) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsModifier() {\n return $this->isModifier;\n }", "function isTrustedModifier($modifier_name, $compiler)\r\n {\r\n if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {\r\n return true;\r\n ...
[ "0.6808254", "0.6620051", "0.64306134", "0.6209378", "0.602689", "0.59699136", "0.59650046", "0.59650046", "0.59650046", "0.59650046", "0.58731395", "0.5726979", "0.5694137", "0.55240077", "0.5494135", "0.5475493", "0.5427277", "0.5381709", "0.53693116", "0.5353525", "0.53461...
0.0
-1
checks if modifier is set
private function has_static_mod($mods) { if (!$mods) return false; foreach ($mods as $mod) if ($mod->type === T_STATIC) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsModifier() {\n return $this->isModifier;\n }", "function isTrustedModifier($modifier_name, $compiler)\r\n {\r\n if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {\r\n return true;\r\n ...
[ "0.6808254", "0.6620051", "0.64306134", "0.6209378", "0.602689", "0.59699136", "0.59650046", "0.59650046", "0.59650046", "0.59650046", "0.58731395", "0.5726979", "0.5694137", "0.55240077", "0.5494135", "0.5475493", "0.5427277", "0.5381709", "0.53693116", "0.5353525", "0.53461...
0.0
-1
checks if modifier is set
private function has_final_mod($mods) { if (!$mods) return false; foreach ($mods as $mod) if ($mod->type === T_FINAL) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsModifier() {\n return $this->isModifier;\n }", "function isTrustedModifier($modifier_name, $compiler)\r\n {\r\n if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {\r\n return true;\r\n ...
[ "0.6806211", "0.6619349", "0.6429502", "0.6208909", "0.6026118", "0.5967336", "0.5960598", "0.5960598", "0.5960598", "0.5960598", "0.5876116", "0.5725192", "0.5695354", "0.55231917", "0.54922205", "0.5476657", "0.54311085", "0.53812736", "0.5368902", "0.5351525", "0.5346897",...
0.0
-1
checks if modifier is set
private function has_private_mod($mods) { // private by default if (!$mods) return true; $other = false; foreach ($mods as $mod) { if ($mod->type === T_PRIVATE) return true; if ($mod->type === T_PUBLIC || $mod->type === T_PROTECTED) { $other = true; break; } } return !$other; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsModifier() {\n return $this->isModifier;\n }", "function isTrustedModifier($modifier_name, $compiler)\r\n {\r\n if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {\r\n return true;\r\n ...
[ "0.6808254", "0.6620051", "0.64306134", "0.6209378", "0.602689", "0.59699136", "0.59650046", "0.59650046", "0.59650046", "0.59650046", "0.58731395", "0.5726979", "0.5694137", "0.55240077", "0.5494135", "0.5475493", "0.5427277", "0.5381709", "0.53693116", "0.5353525", "0.53461...
0.0
-1
checks if modifier is set
private function has_protected_mod($mods) { if (!$mods) return false; foreach ($mods as $mod) if ($mod->type === T_PROTECTED) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsModifier() {\n return $this->isModifier;\n }", "function isTrustedModifier($modifier_name, $compiler)\r\n {\r\n if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {\r\n return true;\r\n ...
[ "0.6808254", "0.6620051", "0.64306134", "0.6209378", "0.602689", "0.59699136", "0.59650046", "0.59650046", "0.59650046", "0.59650046", "0.58731395", "0.5726979", "0.5694137", "0.55240077", "0.5494135", "0.5475493", "0.5427277", "0.5381709", "0.53693116", "0.5353525", "0.53461...
0.5258372
26
checks members of a class/trait or iface declaration
private function check_extern_members($decl) { if (($decl instanceof ClassDecl || $decl instanceof TraitDecl) && $decl->traits !== null) { $peek = $decl->traits[0]; Logger::error_at($peek->loc, 'extern class/trait must not have traits'); } if ($decl->members !== null) { // all members must be 'abstract' $stack = [ $decl->members ]; while (null !== $members = array_pop($stack)) { foreach ($members as $member) { if ($member instanceof NestedMods) { array_push($stack, $member->members); continue; } if (!($member instanceof FnDecl || $member instanceof CtorDecl || $member instanceof DtorDecl)) { Logger::error_at($member->loc, 'invalid symbol in extern class'); continue; } if ($this->has_extern_mod($member->mods)) { Logger::info_at($member->loc, '`extern` modifier inside \\'); Logger::info('extern classes/traits/ifaces is optional'); } if ($member->body !== null) Logger::error_at($member->loc, 'extern function must not have a body'); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _parseClass()\n {\n // check which interfaces are implemented\n $interfaces = $this->_reflectionClass->getInterfaceNames();\n foreach ($interfaces as $i) {\n if ($i == 'Webiny\\Component\\Rest\\Interfaces\\AccessInterface') {\n $this->_parsedClass-...
[ "0.58498263", "0.5686526", "0.5643352", "0.55730605", "0.5551772", "0.5394808", "0.5390989", "0.5330083", "0.532341", "0.5291463", "0.5287305", "0.5254403", "0.5251495", "0.51687783", "0.5167336", "0.5166519", "0.5147239", "0.51312774", "0.5123417", "0.51204133", "0.5089501",...
0.6437542
0
checks if there a unreachable/undefined jumps (gotos)
private function check_jumps() { static $seen_loop_info = false; assert(is_array($this->gotos)); foreach ($this->gotos as $lid => $gotos) { foreach ($gotos as $goto) { if ($goto->resolved === true) continue; if (!isset ($this->labels[$lid])) Logger::error_at($goto->loc, 'goto to undefined label `%s`', $goto->id); else { Logger::error_at($goto->loc, 'goto to unreachable label `%s`', $goto->id); Logger::info_at($this->labels[$lid]->loc, 'label was defined here'); if (!$seen_loop_info) { $seen_loop_info = true; Logger::info_at($goto->loc, 'it is not possible to jump into a loop or switch statement'); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stepOutOfScope();", "private function isUnreachable(array $ping): bool\n {\n $needles = 'perdidos|lost';\n\n $result = $ping[count($ping) - 1];\n\n $unreachable = false;\n\n foreach (explode('|', $needles) as $needle) {\n $search = strpos($result, '100% '...
[ "0.5846149", "0.554881", "0.5212148", "0.52089965", "0.51529634", "0.50676537", "0.5060161", "0.50325316", "0.49669325", "0.4953693", "0.4910436", "0.4910436", "0.4902167", "0.49018475", "0.48875627", "0.48811358", "0.4879892", "0.48684302", "0.48649892", "0.48227948", "0.482...
0.7406535
0
checks if a label can be break/continue'ed
private function check_label_break($node) { $lid = ident_to_str($node->id); if (!isset ($this->labels[$lid])) Logger::error_at($node->loc, 'can not break/continue undefined label `%s`', $lid); else { $label = $this->labels[$lid]; if (!$label->breakable) { Logger::error_at($node->loc, 'can not break/continue label `%s` from this position', $lid); Logger::info_at($label->loc, 'label was defined here'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function breakLoop( $label = null )\n {\n throw new \\FutoIn\\Error( \\FutoIn\\Error::InternalError );\n }", "private function check_jumps()\n {\n static $seen_loop_info = false;\n \n assert(is_array($this->gotos));\n \n foreach ($this->gotos as $lid => $gotos) { \n ...
[ "0.7005193", "0.65601", "0.65024096", "0.607465", "0.5874888", "0.5827079", "0.5648772", "0.5470186", "0.53847295", "0.5367501", "0.53097904", "0.5302873", "0.52961314", "0.5277466", "0.5272234", "0.5272234", "0.5272234", "0.5272234", "0.5272234", "0.5272234", "0.5272234", ...
0.7716269
0
configration form for calculator data fetch from database.
protected function specific_definition($mform) { $arr = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16); $mform->addElement('header', 'configheader', get_string('blocksettings', 'block_caldata')); $mform->addElement('select','config_select', get_string('blocktxt', 'block_caldata'),$arr); $mform->setDefault('config_select',10); $mform->setType('config_select', PARAM_RAW); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getConfigForm()\n {\n $config_form = array(\n 'form' => array(\n 'legend' => array(\n 'title' => $this->l('Settings'),\n 'icon' => 'icon-cogs',\n ),\n 'input' => array(\n ar...
[ "0.5836843", "0.5739236", "0.56538063", "0.5642074", "0.56391007", "0.56011355", "0.55889744", "0.5574878", "0.55608547", "0.55520326", "0.5539804", "0.54964095", "0.5424134", "0.54030466", "0.5389703", "0.5365562", "0.53473526", "0.53434336", "0.5340556", "0.5339118", "0.531...
0.0
-1
OrderedFixtureInterface method Specifies in what order fixtures should be loaded
public function getOrder() { return 5; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrder()\n {\n return 1; //the order in which fixtures will be loaded\n }", "public function getOrder()\n {\n return 100; //the order in which fixtures will be loaded\n }", "public function getOrder()\n {\n return 10; // the order in which fixtures will be ...
[ "0.83041817", "0.8266725", "0.81529915", "0.72548497", "0.7095297", "0.7081169", "0.7081169", "0.7081169", "0.7081169", "0.70628375", "0.70437634", "0.70437634", "0.70232695", "0.70232695", "0.70050603", "0.70006716", "0.68659383", "0.68503946", "0.68473136", "0.68441784", "0...
0.0
-1
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/
public function index(){ $data['url'] = "/agent/joinAgent1"; $this->load->view("alert", $data); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome...
[ "0.7656208", "0.7415378", "0.739705", "0.73165625", "0.722926", "0.722926", "0.71883744", "0.7164455", "0.71509767", "0.71431154", "0.71066415", "0.707623", "0.70758826", "0.7040675", "0.7028172", "0.7028172", "0.7028172", "0.7028172", "0.7028172", "0.697183", "0.696945", "...
0.0
-1
Update position of rubric presration
public function updatePosition($iNewOrder) { if (!is_int($iNewOrder)) { throw new \InvalidArgumentException('Argument "$iNewOrder" expects an integer, "' . (is_object($iNewOrder) ? get_class($iNewOrder) : gettype($iNewOrder)) . '" given'); } $iOldOrder = $this->getOstTplPrestationOrder(); if ($iOldOrder !== $iNewOrder) { $oConnection = $this->getConnection(); $oConnection->beginTransaction(); try { $this->setOstTplPrestationOrder(-1); $this->save(); if ($iOldOrder < $iNewOrder) { $sOperator = '-'; $sConditionBetween = $iOldOrder . ' AND ' . $iNewOrder; $sOrder = 'ASC'; } else { $sOperator = '+'; $sConditionBetween = $iNewOrder . ' AND ' . $iOldOrder; $sOrder = 'DESC'; } $sQuery = 'UPDATE r_operation_type_sub_tpl_prestation SET ost_tpl_prestation_order = ost_tpl_prestation_order ' . $sOperator . ' 1 WHERE ost_tpl_prestation_order BETWEEN ' . $sConditionBetween . ' AND ost_tpl_rubrique_id = ' . $this->getOstTplRubriqueId() . ' ORDER BY ost_tpl_prestation_order ' . $sOrder; $oConnection->exec($sQuery); $this->setOstTplPrestationOrder($iNewOrder); $this->save(); $oConnection->commit(); } catch (\Exception $oException) { $oConnection->rollBack(); $this->addValidationFailed($oException->getMessage()); \CSErrorHandler::getInstance()->handleException($oException); return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateEditotPosition()\n {\n $this->format->shiftCurrentXposition($this->shape->getWidth() + ($this->shape->getBorderWidth() / 2));\n }", "public function setPosition()\n {\n // get the current position\n $currentX = $this->_pdf->getX();\n $currentY = $this->_...
[ "0.62926847", "0.58130276", "0.56078446", "0.55862963", "0.55846477", "0.541678", "0.5359156", "0.53160566", "0.5260406", "0.5256234", "0.5177793", "0.50816256", "0.50270927", "0.50015223", "0.49897853", "0.49728364", "0.494742", "0.49437383", "0.49351212", "0.4916311", "0.49...
0.0
-1
Display a listing of the resource.
public function index() { $estados = Estado::orderBy('id','DESC')->paginate(15); return view('admin.estados.index')->with('estados',$estados); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { return view('admin.estados.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $estados = new Estado($request->all()); $estados->save(); Flash::success("Se ha registrado el estado " .$estados->estado. " de manera Exitosa."); return redirect()->route('admin.estados.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.728708", "0.7144915", "0.7132209", "0.66401577", "0.66205436", "0.65682197", "0.6526531", "0.65085673", "0.6449452", "0.63749766", "0.63726056", "0.6364582", "0.6364582", "0.6364582", "0.6341498", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.63412726", "0.634...
0.0
-1
Display the specified resource.
public function show($id) { $estado = Estado::find($id); return view('admin.estados.edit')->with('estado',$estado); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $estado = Estado::find($id); return view('admin.estados.edit')->with('estado',$estado); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $estado = Estado::find($id); $estado->estado = $request->estado; $estado->save(); Flash::warning('El estado '.$estado->estado.' se ha modificado con exito.'); return redirect()->route('admin.estados.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $estado = Estado::find($id); $estado->delete(); Flash::error('Se eliminó '.$estado->estado.' de forma exitosa.'); return redirect()->route('admin.estados.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Determine if application locale is the given locale.
public function isLocale($locale) { return $this->getLocale() == $locale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSupportedLocale($locale);", "protected function requestHasLocale()\n {\n try {\n if ($this->locale($this->request)) {\n return true;\n }\n\n return false;\n } catch (Exception $ex) {\n return false;\n }\n }", ...
[ "0.7204146", "0.6755258", "0.645721", "0.64476013", "0.64059967", "0.639299", "0.62304527", "0.61285305", "0.6008709", "0.59053516", "0.58972627", "0.5883156", "0.58702004", "0.58702004", "0.5861629", "0.58537626", "0.58362716", "0.58220536", "0.57815665", "0.5753695", "0.571...
0.63441133
8
ensure 'mysite' doesn't exist before creating it...
public function testCreate() { app(SiteRepository::class)->remove('my-site'); $data = [ 'type' => 'sites', 'id' => 'my-site', 'attributes' => [ 'name' => 'My Blog', 'domain' => 'http://blog.example.com', ], ]; $id = $this->doCreate($data)->assertCreatedWithId($data); $this->assertEquals('my-site', $id); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_empty_blog($domain, $path, $weblog_title, $site_id = 1)\n {\n }", "private function create_site_db_entry() {\n\t\t$data = array(\n\t\t\t'sitename' => $this->site_name,\n\t\t\t'site_type' => $this->site_type,\n\t\t\t'site_title' => $this->site_title,\n\t\t\t'proxy_type' ...
[ "0.5888145", "0.5819147", "0.57722384", "0.56811035", "0.56370306", "0.56355697", "0.5617623", "0.5611238", "0.5505102", "0.55010116", "0.5472607", "0.5338334", "0.532136", "0.53017634", "0.52961844", "0.52343833", "0.5201341", "0.5196786", "0.518514", "0.5178497", "0.5154750...
0.4715283
80
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'name' => 'required|string|max:191', 'email' => 'required|email|max:191|unique:admins,id,' . $this->admin, 'password' => 'nullable|required_without:_method|string|max:191|confirmed', 'phone' => '|required_without:_method|required|numeric|unique:admins,phone,' . $this->admin, 'image' => 'nullable|image', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342797", "0.8013068", "0.79357624", "0.79257727", "0.7922943", "0.7903906", "0.7859204", "0.7789624", "0.7783409", "0.77624106", "0.773673", "0.7732383", "0.77094924", "0.7691624", "0.7684878", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", ...
0.0
-1
Reset instagram access token.
function reset_instagram_access_token ( $params = array() ) { ob_end_clean(); $success = $this->model->set_instagram_access_token(); if ( $success ) { wp_redirect( add_query_arg( array( 'page' => $this->page . '&instagram_token=' . time() ), admin_url( 'admin.php' ) ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeAccessToken();", "function RevokeAccessToken()\r\n {\r\n $this->Rest->RevokeAccessToken();\r\n }", "protected function unsetAccessTokenCookie()\n {\n setcookie('accessToken', '', time() - 3600, \"/\"); \n }", "public function logout() {\n\t\t$this->removeAccessToke...
[ "0.64313895", "0.6429764", "0.6188019", "0.59707016", "0.5963501", "0.59036446", "0.58976984", "0.588495", "0.5854429", "0.5835461", "0.5833806", "0.5816112", "0.58063775", "0.5785386", "0.57298464", "0.5699851", "0.5684128", "0.5662317", "0.5661533", "0.5653401", "0.56306547...
0.8210493
0
checked if the cookie used is the same with the encrypted cookie
function isCookieValid($db){ $isValid = false; if(isset($_COOKIE['rememberUserCookie'])){ /** * Decode cookies and extract user ID */ $decryptCookieData = base64_decode($_COOKIE['rememberUserCookie']); $user_id = explode("abcdefABCDEF1234567890", $decryptCookieData); $userID = $user_id[1]; /** * check if id retrieved from the cookie exists in the database */ $sqlQuery = "SELECT * FROM users WHERE id = :id"; $statement = $db->prepare($sqlQuery); $statement->exectue(array(':id' => $userID)); if($row = $statement->fetch()){ $id = $row['id']; $username = $row['username']; //create the user session variable $_SESSION['id']=$id; $_SESSION['username']=$username; $isValid = true; }else{ $isValid = false; signout(); } } return $isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isCookieSet() {}", "private function verifyCookie()\n {\n if (isset($this->cookie['auth'])\n && isset($this->cookie['userid'])\n && !empty($this->cookie['auth'])\n && !empty($this->cookie['userid'])\n && ($this->cookie['userid'] > 0)\n ...
[ "0.6714111", "0.67138165", "0.66813517", "0.6663355", "0.66002077", "0.65192115", "0.6462233", "0.64327425", "0.6417164", "0.6415013", "0.63827664", "0.635519", "0.635519", "0.63541013", "0.63356435", "0.6334229", "0.6322053", "0.63122267", "0.62944686", "0.62944686", "0.6279...
0.58298075
61
Get the batch history
public function getHistory() { return $this->history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHistory()\n {\n return $this->history;\n }", "function get_history() {\n\t\treturn $this->history;\n\t}", "public function fetchHistory(): array;", "public function getHistory()\n {\n return $this->_history;\n }", "public function getHistory(): array\n {\n ...
[ "0.74262446", "0.74169755", "0.7376191", "0.73581314", "0.73498124", "0.73498124", "0.7290355", "0.72162133", "0.7142417", "0.69719785", "0.68925184", "0.68900967", "0.6832276", "0.68256617", "0.679343", "0.67659026", "0.67343724", "0.6709853", "0.6642699", "0.6619283", "0.66...
0.7440319
0
Clear the batch history
public function clearHistory() { $this->history = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearHistory() {}", "public function erase_history()\n {\n $this->_event_history = [];\n }", "public function clear()\n {\n $this->batch = [];\n }", "public function clearHistorys()\n\t{\n\t\t$this->collHistorys = null; // important to set this to NULL since that mea...
[ "0.78067863", "0.7727706", "0.7478689", "0.73747796", "0.6943168", "0.6910923", "0.6788837", "0.6619707", "0.6585738", "0.6566311", "0.64597607", "0.64114946", "0.64042985", "0.63591176", "0.6358566", "0.6307073", "0.629841", "0.6264602", "0.62280047", "0.62280047", "0.622800...
0.7937457
0
Define static to avoid connecting more than once
function db_connect() { static $connection; //Check the connection if (!isset($connection)){ $config = parse_ini_file('./db/config.ini'); $connection = mysqli_connect($config['localhost'],$config['username'],$config['password'],$config['dbname']); } //for everything else that goes wrong if ($connection == false){ return mysqli_connect_error(); } return $connection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect() {\r\n static $conn;\r\n if ($conn === NULL){ \r\n $conn = mysqli_connect('localhost','root','','socialnetwork');\r\n }\r\n return $conn;\r\n}", "protected static function setConnection(){\n static::$conn = connection\\DBconnect::makeInstance();\n }", "private st...
[ "0.71635103", "0.6987068", "0.69010854", "0.6814388", "0.6813643", "0.6626743", "0.6538886", "0.646851", "0.6437422", "0.6396151", "0.63728756", "0.63723934", "0.636151", "0.6359343", "0.6336624", "0.6259939", "0.6242334", "0.621289", "0.6210461", "0.6210461", "0.6210461", ...
0.6149256
28
Determines the current asset version.
public function version(Request $request) { return parent::version($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_asset_version_string() {\n return Wordless::preference('assets.version', NULL);\n }", "public function getAssetsVersion(): string\n\t{\n\t\treturn Config::getProjectVersion();\n\t}", "public function getCurrentVersion();", "public static function get_current_version() {\n\t\t...
[ "0.7693832", "0.7364559", "0.7172281", "0.69250774", "0.6907489", "0.68270165", "0.6762231", "0.6759932", "0.67484266", "0.67248553", "0.66621083", "0.65719867", "0.65532917", "0.65320975", "0.6502384", "0.6486281", "0.6456022", "0.6456022", "0.6456022", "0.6456022", "0.64560...
0.0
-1