query stringlengths 9 43.3k | document stringlengths 17 1.17M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2 values |
|---|---|---|---|---|---|---|
Job Apply mail template | function job_apply_templates_callback() {
?>
<div class="wrap">
<p><h3>Job Apply Mail Template</h3></p>
<?php
if(isset($_GET['settings-updated'])){
?>
<div class="updated settings-error notice is-dismissible" id="setting-error-settings_updated">
<p>
<strong>Settings saved.</strong>
</p>
<button class="notice-dismiss" type="button">
<span class="screen-reader-text">Dismiss this notice.</span>
</button>
</div>
<?php
}
?>
<form method="post" action="options.php">
<?php
settings_fields('job_apply');
$job_apply = get_option('job_apply');
$argss = array(
'textarea_name' => 'job_apply[job_apply_template]',
);
$contents = isset($job_apply['job_apply_template']) ? $job_apply['job_apply_template'] : '';
?>
<table class="form-table">
<tr>
<th><label for="subject">Subject</label></th>
<td><textarea style="width:100%" name="job_apply[job_apply_subject]" id="subject"><?php echo $job_apply['job_apply_subject']; ?></textarea></td>
</tr>
<tr>
<th><label>Mail Editor</label></th>
<td><?php wp_editor( $contents, 'job_apply_template', $argss); ?></td>
</tr>
</table><?php
submit_button();
?>
</form>
</div>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sendmailwithtemplateAction() {\r\n $Emaillist = $this->getEmailappTable()->searchBy($_REQUEST); \r\n $iddata = $_POST['maillist']; \r\n $idlist = explode(',', $iddata); \r\n foreach ($idlist as $id) {\r\n $iddatum = $this->getEmailappTable()... | [
"0.6376655",
"0.62890697",
"0.61130524",
"0.5922528",
"0.58498526",
"0.58463883",
"0.5811566",
"0.579281",
"0.57722867",
"0.57508135",
"0.572957",
"0.57036436",
"0.5688127",
"0.567594",
"0.5642034",
"0.5624832",
"0.56102777",
"0.56078196",
"0.55985886",
"0.5572888",
"0.557165... | 0.6317247 | 1 |
Cleansing translation cache The method is called after updating values in the model | public function afterUpdate()
{
$this->deleteTranslateCache();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cache_reset() {\n $this->translations = array();\n // Ensure a possible persistent cache of this object is cleared too.\n cache_clear_all($this->get_cid(), 'cache', TRUE);\n }",
"public function cache_reset() {\n $this->strings = array();\n $this->string_format = array();\n\n /... | [
"0.7752052",
"0.7095123",
"0.6790117",
"0.6760821",
"0.638263",
"0.6366748",
"0.6324414",
"0.63167",
"0.6297143",
"0.6200435",
"0.61686367",
"0.61659783",
"0.6107885",
"0.6092822",
"0.60913694",
"0.60883003",
"0.6075396",
"0.6075002",
"0.60610056",
"0.6033592",
"0.59819084",
... | 0.7270436 | 1 |
/ Returns an DB_DataObject Object containing document data. Checks if the file exists and the user has read perms. | function getDocument($assetId)
{
$document = DB_DataObject::factory($this->conf['table']['document']);
$document->get($assetId);
// check if user has rights for the category the file is in.
$category = new SGL_Category();
$category->load($document->category_id);
if (!$category->hasPerms()) {
return SGL::raiseError(
'You do not have read permissions for this file',
SGL_ERROR_INVALIDAUTH);
}
$fileName = SGL_UPLOAD_DIR . '/' . $document->name;
if (!@is_file($fileName)) {
return SGL::raiseError(
'The specified file does not appear to exist',
SGL_ERROR_NOFILE);
}
return $document;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function read(Document $document);",
"public function get_document($entry, $options = array()) {\n try {\n $cm = $this->get_cm('data', $entry->dataid, $entry->course);\n $context = \\context_module::instance($cm->id);\n } catch (\\dml_missing_record_exception $ex... | [
"0.60803366",
"0.602959",
"0.59181195",
"0.5901187",
"0.57868475",
"0.5694719",
"0.56872696",
"0.56698406",
"0.5564075",
"0.55410635",
"0.5536074",
"0.54878795",
"0.5465483",
"0.5450121",
"0.5448274",
"0.54229444",
"0.5419618",
"0.539394",
"0.53936756",
"0.5379856",
"0.537960... | 0.61572707 | 0 |
Builds the instance template from scratch | public function build(): void
{
// check if building is enabled
$url = $this->config()->templateUrl();
if (is_string($url) !== true) {
throw new Exception('The template URL that is required for building is not configured');
}
// prevent that new instances are created
// while the template is being rebuilt
$this->lock()->acquireExclusiveLock();
// recursively delete the whole old template directory
Dir::remove($this->config()->templateRoot());
// initialize the template from ZIP
$root = $this->config()->templateRoot();
$this->downloadZip(
Str::before($url, '#'),
Str::after($url, '#'),
$root
);
// run the post-build hook if defined
$this->runHook($root, 'build:after', $this);
// delete all prepared instances (they are now outdated)
foreach ($this->instances()->all('ipHash IS NULL') as $instance) {
$instance->delete();
}
// instances can now be created again
$this->lock()->releaseLock();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function buildTemplate()\n {\n $this->t_wrap->del('rows');\n $this->t_wrap->appendHtml('rows', '{rows}');\n\n for ($row = 1; $row <= $this->rows; ++$row) {\n $this->t_row->del('column');\n\n for ($col = 1; $col <= $this->columns; ++$col) {\n $t... | [
"0.6611248",
"0.6490492",
"0.6403197",
"0.6312011",
"0.627641",
"0.62599856",
"0.6118746",
"0.6087629",
"0.6075819",
"0.6042951",
"0.6015938",
"0.6015938",
"0.6013658",
"0.59882724",
"0.5986691",
"0.5946641",
"0.5939587",
"0.5936635",
"0.5922634",
"0.5922634",
"0.5922634",
... | 0.659462 | 1 |
Cleans up all expired instances and executes the cleanup hook of the template | public function cleanup(): void
{
$expired = $this->instances()->all()->filterBy('hasExpired', '==', true);
foreach ($expired as $instance) {
$instance->delete();
}
$this->runHook($this->config()->templateRoot(), 'cleanup', $this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cleanUpGarbage()\n\t{\n\t\t$phptalCacheFilesExpire = time() - $this->getCacheLifetime() * 3600 * 24;\n\t\t$upperLimit = $this->getPhpCodeDestination() . 'tpl_' . $phptalCacheFilesExpire . '_';\n\t\t$lowerLimit = $this->getPhpCodeDestination() . 'tpl_0_';\n\t\t$phptalCacheFiles = glob($this->getPhpC... | [
"0.6743329",
"0.66931474",
"0.66736114",
"0.6667251",
"0.6667251",
"0.6620647",
"0.6595874",
"0.65852135",
"0.6582892",
"0.65598816",
"0.65489644",
"0.65489644",
"0.65349096",
"0.65220195",
"0.6521177",
"0.6521177",
"0.6521177",
"0.6446087",
"0.6421119",
"0.64190364",
"0.6411... | 0.89211154 | 0 |
Checks if given HTML string is valid by running it trough callback function. | private function runValidityChecker(string $html): void
{
if (!$this->isFunction($this->htmlCheckerFunction)) {
return;
}
if (!$this->callFunction($this->htmlCheckerFunction, new Crawly($html))) {
throw new ScrapeException('Page html validation failed.', 400);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wponion_is_valid_html( $string ) {\n\t\treturn ( strip_tags( $string ) !== $string );\n\t}",
"static function validateHTML($html, $min_length = false) {\n if ($html) {\n // strip (excluding specified tags)\n $html = (string) strip_tags($html, '<div><img><a>');\n\n // remove non... | [
"0.66325694",
"0.6036852",
"0.59409195",
"0.59009016",
"0.5854424",
"0.5817811",
"0.5738442",
"0.57258177",
"0.5638474",
"0.56150675",
"0.5606015",
"0.55859786",
"0.55055034",
"0.5497091",
"0.5460106",
"0.5344196",
"0.53413576",
"0.5327814",
"0.53052133",
"0.5284241",
"0.5266... | 0.6623713 | 1 |
Passes given Crawly crawler trough available parsers. | private function runParsers(Crawly $crawly): array
{
$result = [];
foreach ($this->parsers as $parser) {
$crawly->reset();
$result = $parser->process($crawly, $result, $this->params);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract function parse(Crawler $crawler);",
"public function scrape()\n {\n $crawler = $this->client->request('GET', $this->config['endPoint']);\n $this->checkRequestStatus();\n $result = [];\n\n $result = $crawler->filter($this->config['domNodes']['itemNodes'])->each(fu... | [
"0.7506488",
"0.59899825",
"0.58805054",
"0.5851559",
"0.58234507",
"0.57359225",
"0.5571056",
"0.55332565",
"0.5532693",
"0.55285776",
"0.5525626",
"0.5524539",
"0.5523075",
"0.54967326",
"0.549531",
"0.54208875",
"0.53957707",
"0.5372889",
"0.53635734",
"0.53512704",
"0.530... | 0.6304405 | 1 |
Adds specified parser to available parsers array. | public function addParser(IParser $parser): void
{
$parser->setParams($this->params);
$this->parsers[] = $parser;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addParser(ParserInterface $parser)\n {\n $this->parsers[] = $parser;\n }",
"public function addParser(AbstractParser $parser) {\n\t\t$this->parsers[$parser->getType()] = $parser;\n\t\treturn $this;\n\t}",
"public function registerParser(ParserInterface $parser)\n {\n $thi... | [
"0.7650991",
"0.66852146",
"0.6421304",
"0.6208653",
"0.591666",
"0.57319665",
"0.5600127",
"0.5505011",
"0.5378241",
"0.5328386",
"0.5222153",
"0.5217923",
"0.51654357",
"0.5164897",
"0.50486577",
"0.4998307",
"0.49577615",
"0.49201748",
"0.4878488",
"0.48138732",
"0.479532"... | 0.77268356 | 0 |
Parses current template and inits template objects | public function parseTemplate()
{
// --- Parsing Template Until Ends --- //
$currPosition = 0;
while ($currPosition = $this->getNextElement($currPosition, $matches));
if (is_array($matches) && isset($matches[3]))
{
foreach ($matches[3] as $key => $match)
{
$blockName = $matches[2][$key];
$this->_matches[$blockName] = $match;
$this->{$blockName} = new PHP2_UI_RBTEngine($blockName, $this);
$this->{$blockName}->loadFromTemplate($match, true);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function parseTemplate()\n {\n $content = $this->fileLookup(file_get_contents($this->file));\n \n $this->recursiveParse($content, null, -1);\n $this->initializeVars($content);\n \n //reset the parent to the root node\n $this->parent = substr($this->parent, 0, strpos($this->parent, '... | [
"0.7610771",
"0.68399954",
"0.6826836",
"0.6800766",
"0.6513303",
"0.6474037",
"0.6384417",
"0.6328197",
"0.6319628",
"0.6308122",
"0.6271953",
"0.62281847",
"0.62119687",
"0.61864626",
"0.6121037",
"0.61143804",
"0.6072077",
"0.60020304",
"0.59963924",
"0.59757555",
"0.59163... | 0.6962432 | 1 |
Clears Render Result Output | public function clearOutput()
{
$this->_renderResult = '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function forceClearOutput()\n {\n $this->_renderResult = '';\n\n foreach ($this->_matches as $tValue => $rValue)\n {\n $this->{$tValue}->forceClearOutput();\n }\n }",
"public function clearOutput() {\n $this->output = [];\n }",
"protected static fu... | [
"0.80017483",
"0.75609136",
"0.7488372",
"0.7244295",
"0.71333903",
"0.7100096",
"0.70102626",
"0.698378",
"0.698378",
"0.698378",
"0.698378",
"0.693844",
"0.68974924",
"0.68851167",
"0.6877812",
"0.6852012",
"0.6847209",
"0.683324",
"0.6828547",
"0.6810032",
"0.6810032",
"... | 0.9008267 | 0 |
Force Clears Rendered Result Output | public function forceClearOutput()
{
$this->_renderResult = '';
foreach ($this->_matches as $tValue => $rValue)
{
$this->{$tValue}->forceClearOutput();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearOutput()\n {\n $this->_renderResult = '';\n }",
"public function clearStateIfDoneRendering();",
"protected static function clear(): void{\n ob_end_clean();\n }",
"public function & outputClear()\n\t{\n\t\t$this->m_output = '';\n\t\treturn $this;\n\t}",
"public fu... | [
"0.8629838",
"0.72660464",
"0.70937693",
"0.7030698",
"0.6989081",
"0.69884515",
"0.687777",
"0.6786212",
"0.6783311",
"0.6772234",
"0.6719763",
"0.6690036",
"0.6659976",
"0.66430235",
"0.6611089",
"0.6611089",
"0.6611089",
"0.6611089",
"0.6570787",
"0.65619415",
"0.655283",
... | 0.81568545 | 1 |
we're going to just return true or false if the player has liked the app :)~ | static function playerLikesApp($playerID)
{
$facebook = App::make('facebook');
$user = $facebook->getUser();
$likesApp = false;
$params = array(
'method' => 'fql.query',
'query' => 'SELECT uid FROM page_fan WHERE page_id = ' . Config::get('facebook.page_id') . ' AND uid = ' . $user
);
$userLikes = $facebook->api($params);
if($userLikes)
{
$likesApp = true;
$cb = CouchbaseHelper::connect();
$p = new PlayerHelper();
$p = $p->loadPlayer($playerID);
$p->liked_game = 1;
$p->savePlayer($cb);
//log_message('debug', 'Updated player couchbase liked_game = 1 for player ' . $playerID);
}
else
{
$likesApp = false;
}
return $likesApp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userLiked($id_post)\n {\n global $link;\n global $id_user;\n $sql = \"SELECT * FROM rating_info WHERE id_user=$id_user\n AND id_post=$id_post AND rating_action='like'\";\n $result = mysqli_query($link, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n ... | [
"0.66392744",
"0.6558003",
"0.65282696",
"0.6486656",
"0.6427369",
"0.6426339",
"0.6421352",
"0.64208746",
"0.64188844",
"0.6362694",
"0.6286086",
"0.626826",
"0.6265609",
"0.6264809",
"0.626031",
"0.6224794",
"0.61619014",
"0.61516684",
"0.613495",
"0.6134386",
"0.61084104",... | 0.71837485 | 0 |
Log::info("Creating couchbase player with id: " . $playerID); | private function createCouchbasePlayer($playerID)
{
if ($playerID <= 0)
{
//Log::error("Couchbase Error: Trying to create a player with an invalid ID: " . $playerID . " UA: " . $_SERVER['HTTP_USER_AGENT'] . " XFWD: " . $_SERVER['HTTP_X_FORWARDED_FOR']);
}
else
{
//log_message('debug', 'createCouchbasePlayer() :: Creating player with id: ' . $playerID);
// self::data->player_id = $playerID;
$cb = CouchbaseHelper::connect();
$this->data->player_id = $playerID;
$this->InitUnsetFields();
$this->bLoaded = true;
$this->savePlayer($cb);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lk_log_debug($message){\n $log = new DebugLog($message);\n $log ->save();\n}",
"function createNewPlayer($playerName) {\n $database = new Database();\n $db = $database->getConnection();\n\n // initialize object\n $player = new Player($db);\n\n // set product property values\n $pl... | [
"0.54105866",
"0.53091055",
"0.5300245",
"0.5206469",
"0.5151932",
"0.5107435",
"0.50646657",
"0.5063957",
"0.5027318",
"0.5025139",
"0.50188476",
"0.50163126",
"0.5008926",
"0.49961033",
"0.49794412",
"0.4977653",
"0.4957059",
"0.49483448",
"0.49359906",
"0.4929894",
"0.4924... | 0.6333096 | 0 |
Return the maximum number of arguments accepted | public function maximum_parameter_count() { return $this->maximumArgumentCount; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getMinNrOfRequiredArguments()\n {\n return 0;\n }",
"protected function getArgumentsCount(): int\n\t{\n\t\treturn 1;\n\t}",
"public static function argCount(): int {\n\t\t\treturn 2;\n\t\t}",
"public function numArguments() {\n return sizeof($this->arguments);\n }",
... | [
"0.77778643",
"0.7464168",
"0.7461929",
"0.7442837",
"0.7329899",
"0.73276305",
"0.7277918",
"0.7211907",
"0.7109376",
"0.7055657",
"0.6817092",
"0.66957337",
"0.6591069",
"0.6496574",
"0.6454205",
"0.63121027",
"0.6226833",
"0.62128884",
"0.61514485",
"0.6102352",
"0.6073745... | 0.81736094 | 0 |
Find and return an Organization's Orders with the given $filterParams | public function search(int $organizationId, array $filterParams = []); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOrdersQueryBuilder($customerId, $filter = null, $orderBy = null)\n {\n /** @var QueryBuilder $builder */\n $builder = $this->getEntityManager()->createQueryBuilder();\n // Select the different entities\n $builder->select([\n 'orders.id as id',\n ... | [
"0.59179115",
"0.57677126",
"0.5767572",
"0.5686694",
"0.55791754",
"0.55783534",
"0.557514",
"0.555598",
"0.55388427",
"0.55268955",
"0.5513347",
"0.54992884",
"0.54949415",
"0.5481089",
"0.5469869",
"0.5463293",
"0.5448088",
"0.53851163",
"0.5356152",
"0.5355119",
"0.534522... | 0.61093324 | 0 |
Varre o array, contando quantas receitas foram encontradas. | function contadorArrayPesquisa() {
global $resultado;
$quantidade = 0;
foreach ($resultado as $row):
$quantidade++;
endforeach;
return $quantidade;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function find_array() {\n\t\treturn $this->_run();\n\t}",
"public function getcount(Request $request){\n parse_str($request->data, $searcharray);\n $targets = ['country','device','brand','model','os','osversion','browser','browserversion','language','connection'];\n \n $subscri... | [
"0.5901661",
"0.56300557",
"0.551086",
"0.5501408",
"0.54828006",
"0.5443939",
"0.5374832",
"0.5373687",
"0.5362112",
"0.5337705",
"0.530197",
"0.52462053",
"0.5226821",
"0.5220905",
"0.5211936",
"0.51746464",
"0.5170973",
"0.5158512",
"0.5144068",
"0.51348156",
"0.513466",
... | 0.5867521 | 1 |
echo "func3" . $data; | function func3($data)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function out($data)\n { \n echo $data;\n }",
"function pe($data)\n{\n echo \"<pre>\";\n var_dump($data);\n}",
"function st_get_content_from_func($function,$data = array(),$settings = array()){\n if(!function_exists($function) || !is_string($function)){ \n return false;\... | [
"0.62203914",
"0.6109418",
"0.61009806",
"0.6073261",
"0.60508794",
"0.59782827",
"0.59654796",
"0.59606546",
"0.59209716",
"0.59097743",
"0.5886311",
"0.5877628",
"0.5787622",
"0.5737044",
"0.5714257",
"0.5686858",
"0.5677313",
"0.5671644",
"0.56343764",
"0.5625651",
"0.5613... | 0.75428283 | 0 |
FUNCION PARA VALIDAR PERFIL | public static function validarPerfil($datos){
$errores=[];
$trimeados=[];
foreach ($datos as $posicion => $valor) {
$trimeados[$posicion]=trim($valor);
}
// VALIDACION PARA NOMBRE
if (!strlen($trimeados["name"])) {
$errores["nombre"] = "Campo obligatorio";
} elseif (!Funciones::nombreYApellido($trimeados["name"])) {
$errores["nombre"] = "El campo contiene carateres invalidos";
} elseif (!Funciones::determinarNombreYApellido($trimeados["name"])){
$errores["nombre"] = "El campo puede tener primer y segundo nombre";
}
// VALIDACION PARA APELLIDO
if (!strlen($trimeados["last_name"])) {
$errores["apellido"] = "Campo obligatorio";
} elseif (!Funciones::nombreYApellido($trimeados["last_name"])) {
$errores["apellido"] = "El campo contiene carateres invalidos";
} elseif (!Funciones::determinarNombreYApellido($trimeados["last_name"])){
$errores["apellido"] = "El campo debe tener primer y segundo apellido";
}
//VALIDACION PARA CONTRASEÑAS
if (!strlen($trimeados["password"])) {
$errores["pass"] = "Campo obligatorio";
}elseif (!strlen($trimeados["confirmpass"])) {
$errores["pass"] = "Verifique la contraseña";
}elseif (Funciones::contraseñaMezcla($trimeados["password"]) !== 0) {
$errores["pass"] = "La contraseña debe incluir al menos una mayuscula, una minuscula y un numero";
}elseif (!Funciones::contraseñaPermitida($trimeados["password"])) {
$errores["pass"] = "La contraseña debe incluir al menos un numero";
}
//VALIDACION PARA OFERTAS
if (!isset($trimeados["sale"])) {
$errores["ofertas"] = "Elija una opcion";
}
return $errores;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function validation();",
"public function valid() {}",
"public function valid() {}",
"public static function validate() {}",
"function valid() {}",
"public function valid () {}",
"public function valid(){ }",
"public function valid();",
"public function valid();",
"public funct... | [
"0.68427",
"0.683908",
"0.683908",
"0.6816566",
"0.6809543",
"0.6803196",
"0.67373306",
"0.6736975",
"0.6736975",
"0.6736975",
"0.6736975",
"0.6736975",
"0.6736975",
"0.6696716",
"0.6696716",
"0.667429",
"0.667429",
"0.667429",
"0.666415",
"0.666415",
"0.666415",
"0.666415"... | 0.68898153 | 0 |
Have to override the AuditTrait's getConnectionName method to ensure that the system uses the Hyn MultiTenant method to point at the tenant database as opposed to the system DB | public function getConnectionName()
{
return app(Connection::class)->tenantName();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConnectionName(): string\n {\n return config('template.auth.database_connection');\n }",
"public function getConnectionName(): string\n {\n return config('haystack.db_connection');\n }",
"protected abstract function _getDbClassName();",
"public function getConnect... | [
"0.6690371",
"0.65314656",
"0.65301013",
"0.64596945",
"0.637745",
"0.6209899",
"0.6189204",
"0.61228555",
"0.6122753",
"0.6063887",
"0.6048777",
"0.59670043",
"0.59639466",
"0.5916257",
"0.5916257",
"0.5916257",
"0.5913605",
"0.5894475",
"0.58841205",
"0.5849926",
"0.5841294... | 0.71983314 | 0 |
Get all political parties | function getPoliticalParties () {
// sql query
$sql = "SELECT * FROM party";
// execution of query
$result = $this->db->con->query($sql);
if ($this->db->con->error) {
// logging of error into a file
$fetch_party_error = 'fetch_party_error.txt';
$error_msg = "Unable to get all political parties because ".$this->db->con->error."\n";
file_put_contents($fetch_party_error, $error_msg, FILE_APPEND);
return "<div class='alert alert-danger'>"."There is an error: ".$this->db->con->error."</div>";
} elseif ($result->num_rows > 0) {
while ( $row = $result->fetch_assoc()) {
$rows[] = $row;
}
return $rows;
} else {
return "<div class='alert alert-danger'>Polling Unit result unavailable, refresh.</div>";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listLocalParties() {\r\n\t\tif($this->localparties == null) {\r\n\t\t\t$pr = new LocalParty();\r\n\t\t\t$this->localparties = $pr->getList('', 'WHERE party = '.$this->party, 'ORDER BY p.name');\r\n\t\t}\r\n\t\treturn $this->localparties;\r\n\t}",
"public function getParties();",
"public functio... | [
"0.6527767",
"0.65258324",
"0.6463711",
"0.62137747",
"0.60381544",
"0.59960496",
"0.59647423",
"0.59432834",
"0.5919412",
"0.57519567",
"0.5717823",
"0.5717542",
"0.5693611",
"0.56619173",
"0.5659961",
"0.5655336",
"0.5644662",
"0.5622507",
"0.5612832",
"0.5592746",
"0.55906... | 0.67203575 | 0 |
Insert political parties results | function insertPoliticalPartiesScore (
$partyScore,
$registered_user,
$polling_unit_id,
$user_ip_address
) {
// looping the array of political party score to insert to database
foreach ($partyScore as $key => $value) {
if (empty($value)) {
continue;
}
// sql query
$sql = "INSERT INTO announced_pu_results SET polling_unit_uniqueid = (SELECT uniqueid FROM polling_unit WHERE uniqueid = '$polling_unit_id'), entered_by_user = '$registered_user', party_abbreviation = '$key', party_score = '$value', user_ip_address = '$user_ip_address'";
// execution of query
$result = $this->db->con->query($sql);
}
if ($this->db->con->error) {
// logging of error into a file
$upload_party_result_error = 'party_result_error.txt';
$error_msg = "Unable to upload new polling unit with id '".$polling_unit_id."' results because ".$this->db->con->error."\n";
file_put_contents($upload_party_result_error, $error_msg, FILE_APPEND);
return "<div class='alert alert-danger'>"."There is an error: ".$this->db->con->error."</div>";
} elseif ($this->db->con->affected_rows >= 1) {
$msg1 = "<div class='alert alert-success' id='msg1'>Result successfully uploaded</div>";
// redirect to create polls page
header("Location: create-polls.php?msg=$msg1");
exit;
} else {
return "<div class='alert alert-danger'>Result Insertion failed! Try again</div>";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addParty() {\n $req = $this->pdo->prepare('INSERT INTO `parties`(name, description, id_users, horraire) VALUES(:name, :description, :id_users, :horraire)');\n $req->bindValue(':name', $this->name, PDO::PARAM_STR);\n $req->bindValue(':description', $this->description, PDO::PARAM... | [
"0.6008451",
"0.57071483",
"0.5570855",
"0.55281305",
"0.5475917",
"0.54720783",
"0.528642",
"0.5279844",
"0.5275862",
"0.5261023",
"0.5256919",
"0.524961",
"0.517968",
"0.5149262",
"0.5147964",
"0.51186734",
"0.5104035",
"0.50866205",
"0.5080184",
"0.50785327",
"0.5044323",
... | 0.6103977 | 0 |
Test without set now. | public function testWithoutSetNow()
{
$humanDate = new HumanDate($this->timezone, $this->lang);
$formattedDate = $humanDate->format(new \DateTime('-6 seconds'));
$expectedDate = '6 seconds ago';
$this->assertEquals($expectedDate, $formattedDate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testTime()\n {\n $this->todo('stub');\n }",
"public function testNow()\n {\n Chronos::useTimezone(\"EUROPE/Berlin\");\n date_default_timezone_set(\"EUROPE/Berlin\");\n $chronos = Chronos::now();\n\n $this->assertSame((int)date(\"Y\"), $chronos->year());... | [
"0.7091602",
"0.65340173",
"0.6432608",
"0.63785714",
"0.62594205",
"0.6250979",
"0.62453055",
"0.62405217",
"0.62387866",
"0.62325335",
"0.61088693",
"0.61021453",
"0.6058878",
"0.6034138",
"0.60102415",
"0.60095537",
"0.6008211",
"0.600762",
"0.59946036",
"0.5993935",
"0.59... | 0.67971146 | 1 |
Data for test short months. | public function dataShortMonths()
{
return array(
array('2015-01-15 00:00:00', '2015-01-01 00:00:00', '15 Jan at 12:00 am'),
array('2015-02-15 00:00:00', '2015-01-01 00:00:00', '15 Feb at 12:00 am'),
array('2015-03-15 00:00:00', '2015-01-01 00:00:00', '15 Mar at 12:00 am'),
array('2015-04-15 00:00:00', '2015-01-01 00:00:00', '15 Apr at 12:00 am'),
array('2015-05-15 00:00:00', '2015-01-01 00:00:00', '15 May at 12:00 am'),
array('2015-06-15 00:00:00', '2015-01-01 00:00:00', '15 Jun at 12:00 am'),
array('2015-07-15 00:00:00', '2015-01-01 00:00:00', '15 Jul at 12:00 am'),
array('2015-08-15 00:00:00', '2015-01-01 00:00:00', '15 Aug at 12:00 am'),
array('2015-09-15 00:00:00', '2015-01-01 00:00:00', '15 Sep at 12:00 am'),
array('2015-10-15 00:00:00', '2015-01-01 00:00:00', '15 Oct at 12:00 am'),
array('2015-11-15 00:00:00', '2015-01-01 00:00:00', '15 Nov at 12:00 am'),
array('2015-12-15 00:00:00', '2015-01-01 00:00:00', '15 Dec at 12:00 am'),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_month(){\n // $start->modify('first day of this month');\n // $end = new DateTime('2019-06-20');\n // $end->modify('first day of next month');\n // $interval = DateInterval::createFromDateString('1 month');\n // $period = new DatePeriod($start, $interval, $en... | [
"0.7409365",
"0.638413",
"0.6366011",
"0.62775457",
"0.618878",
"0.6157663",
"0.6157483",
"0.61545575",
"0.61255026",
"0.5928678",
"0.592733",
"0.5908725",
"0.5870427",
"0.58665186",
"0.57719964",
"0.5739858",
"0.5711177",
"0.5693929",
"0.5693498",
"0.56888306",
"0.56789523",... | 0.6969891 | 1 |
Data for test dates in past time. | public function dataPastTime()
{
return array(
array('2015-01-15 00:00:00', '2015-01-15 00:00:01', 'just now'),
array('2015-01-15 00:00:00', '2015-01-15 00:00:06', '6 seconds ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:00:45', 'one minute ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:01:45', 'two minutes ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:02:45', 'three minutes ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:03:45', 'four minutes ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:04:45', '5 minutes ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:05:29', '5 minutes ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:05:30', '6 minutes ago'),
array('2015-01-15 00:00:00', '2015-01-15 00:45:45', 'one hour ago'),
array('2015-01-15 00:00:00', '2015-01-15 01:45:45', 'two hours ago'),
array('2015-01-15 00:00:00', '2015-01-15 02:45:45', 'three hours ago'),
array('2015-01-15 00:00:00', '2015-01-15 03:45:45', 'four hours ago'),
array('2015-01-15 00:00:00', '2015-01-15 04:45:46', 'today at 12:00 am'),
array('2015-01-15 00:00:00', '2015-01-16 04:45:46', 'yesterday at 12:00 am'),
array('2015-01-15 00:00:00', '2015-01-17 04:45:46', '15 Jan at 12:00 am'),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test()\n {\n // $today = date(\"Y-m-d\");\n // $result['date'] = $this->get_date_diff('2018-12-19 20:01:56');\n $result['date'] = $this->get_date_diff('2018-12-19');\n return $result;\n }",
"public function test_isPast()\n {\n $task = new Task();\n ... | [
"0.63963675",
"0.62102413",
"0.61099935",
"0.6013551",
"0.5993482",
"0.59428906",
"0.5882993",
"0.58559895",
"0.581672",
"0.57762796",
"0.576612",
"0.571162",
"0.570917",
"0.5706421",
"0.5699686",
"0.56772107",
"0.5657016",
"0.565436",
"0.5640259",
"0.56172216",
"0.55848646",... | 0.6342881 | 1 |
Data for test dates in future time. | public function dataFutureTime()
{
return array(
array('2015-01-15 00:00:01', '2015-01-15 00:00:00', 'right now'),
array('2015-01-15 00:00:06', '2015-01-15 00:00:00', 'in a 6 seconds'),
array('2015-01-15 00:00:45', '2015-01-15 00:00:00', 'in a one minute'),
array('2015-01-15 00:01:45', '2015-01-15 00:00:00', 'in a two minutes'),
array('2015-01-15 00:02:45', '2015-01-15 00:00:00', 'in a three minutes'),
array('2015-01-15 00:03:45', '2015-01-15 00:00:00', 'in a four minutes'),
array('2015-01-15 00:04:45', '2015-01-15 00:00:00', 'in a 5 minutes'),
array('2015-01-15 00:05:29', '2015-01-15 00:00:00', 'in a 5 minutes'),
array('2015-01-15 00:05:30', '2015-01-15 00:00:00', 'in a 6 minutes'),
array('2015-01-15 00:45:45', '2015-01-15 00:00:00', 'in a one hour'),
array('2015-01-15 01:45:45', '2015-01-15 00:00:00', 'in a two hours'),
array('2015-01-15 02:45:45', '2015-01-15 00:00:00', 'in a three hours'),
array('2015-01-15 03:45:45', '2015-01-15 00:00:00', 'in a four hours'),
array('2015-01-15 04:45:46', '2015-01-15 00:00:00', 'today at 4:45 am'),
array('2015-01-16 04:45:46', '2015-01-15 00:00:00', 'tomorrow at 4:45 am'),
array('2015-01-17 04:45:46', '2015-01-15 00:00:00', '17 Jan at 4:45 am'),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test()\n {\n // $today = date(\"Y-m-d\");\n // $result['date'] = $this->get_date_diff('2018-12-19 20:01:56');\n $result['date'] = $this->get_date_diff('2018-12-19');\n return $result;\n }",
"public function testDates() {\n $this->helpDt(\"en\",\"2001-03-30... | [
"0.6293063",
"0.6078858",
"0.6060155",
"0.6041839",
"0.6033525",
"0.60246336",
"0.6020988",
"0.59707123",
"0.58972347",
"0.58810836",
"0.58386904",
"0.58325493",
"0.5832377",
"0.5790173",
"0.57852405",
"0.5766085",
"0.57594067",
"0.57336825",
"0.5720529",
"0.5718063",
"0.5691... | 0.6328268 | 0 |
Returns the ID of the rule where this target belongs. | public function getRuleId()
{
return $this->ruleId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getId() {\r\n\t\treturn $this->get('ruleid');\r\n\t}",
"public function getRuleIdentifierHint(string $rule, Context $context): string;",
"public function getRuleNumber()\n {\n return isset($this->rule_number) ? $this->rule_number : 0;\n }",
"public function getTargetId()\r\n {... | [
"0.8073345",
"0.65463156",
"0.6523398",
"0.6506098",
"0.6473085",
"0.6473085",
"0.64575875",
"0.645325",
"0.64397484",
"0.64353377",
"0.6381305",
"0.6381305",
"0.63052034",
"0.61799645",
"0.60684675",
"0.6027147",
"0.59509385",
"0.5904191",
"0.588963",
"0.5800595",
"0.5791192... | 0.827419 | 0 |
Ok here we add a fee record in | public function addFee($fee_data) {
// all the fees can be added to the fees_charged table
// except auto-relist That will have to be added to a reoccuring list because that only happens at each relisting
$sql = "INSERT INTO " . DB_PREFIX . "fees_charged
SET
auction_id = '" . $this->db->escape($fee_data['auction_id']) . "',
customer_id = '" . $this->db->escape($fee_data['customer_id']) . "',
fee_code = '" . $this->db->escape($fee_data['fee_code']) . "',
amount = '" . $this->db->escape($fee_data['amount']) . "',
date_added = NOW()";
$this->db->query($sql);
return $this->db->getLastId(); // this will return the fee id for adding to the cart and to add a transaction in
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function insert_flex_so_fee()\r\n\t{\r\n\t\treturn TRUE;\r\n\t}",
"public function createTargetFee() {\n $feeType = Input::get('fee_type');\n $feeAmt = Input::get('fee_amt');\n $currentDate = date('Y-m-d',strtotime('now'));\n $insert = DB::table('il_target_fee... | [
"0.7012539",
"0.6846966",
"0.6767325",
"0.67195785",
"0.67013854",
"0.66418356",
"0.6535011",
"0.65115535",
"0.63957506",
"0.6383042",
"0.6214602",
"0.62142223",
"0.61429185",
"0.6072128",
"0.6058087",
"0.6056867",
"0.605597",
"0.6049563",
"0.6041227",
"0.6013876",
"0.6007511... | 0.71112156 | 0 |
display the an InventoryItem | public function showAction(InventoryItem $item) {
$this->view->assign('item', $item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(inventory $invent)\n {\n //\n }",
"public function show(Inventory $inventory)\n {\n //\n }",
"public function show(Inventory $inventory)\n {\n //\n }",
"public function show(Inventory $inventory)\n {\n //\n }",
"public function show(I... | [
"0.72847146",
"0.72771895",
"0.72771895",
"0.72771895",
"0.72771895",
"0.702587",
"0.68295354",
"0.67813486",
"0.6690194",
"0.6690194",
"0.6690194",
"0.6656255",
"0.6582112",
"0.65432864",
"0.65432864",
"0.65432864",
"0.65432864",
"0.65432864",
"0.65432864",
"0.65432864",
"0.... | 0.7804951 | 0 |
shows a mask to edit an InventoryItem | public function editAction(InventoryItem $item) {
$this->view->assign('item', $item);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Item $item)\n {\n //\n }",
"public function edit(Item $item)\n {\n //\n }",
"public function edit(Item $item)\n {\n //\n }",
"public function edit(Item $item)\n {\n //\n }",
"public function edit(Item $item)\n {\n $iconos = ... | [
"0.5916689",
"0.5916689",
"0.5916689",
"0.5916689",
"0.58208674",
"0.5745358",
"0.57449085",
"0.57449085",
"0.57449085",
"0.57449085",
"0.57167536",
"0.57167536",
"0.57167536",
"0.56378204",
"0.56136376",
"0.5545042",
"0.5505427",
"0.547509",
"0.5469815",
"0.5433103",
"0.5421... | 0.63195354 | 0 |
persists and shows an InventoryItem | public function createAction(InventoryItem $item) {
$this->inventoryItemRepository->add($item);
$this->persistenceManager->persistAll();
$this->redirect('show', NULL, NULL, array('item' => $item));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showAction(InventoryItem $item) {\n\t\t$this->view->assign('item', $item);\n\t}",
"public function inventoryAction()\n {\n $this->permissionsCheck(false, true);\n\n $this->view->pageTitle = \"Inventory\";\n $this->view->form = new Account_Form_Inventory();\n $this->... | [
"0.73254085",
"0.69467455",
"0.69341046",
"0.67268455",
"0.67268455",
"0.67268455",
"0.67268455",
"0.655888",
"0.6533072",
"0.64386106",
"0.63219607",
"0.63073516",
"0.62212884",
"0.61845684",
"0.6146738",
"0.61213475",
"0.61213475",
"0.61213475",
"0.61213475",
"0.61186856",
... | 0.7277362 | 1 |
Fetches the database id of the schedule to use | public function getScheduleId()
{
return $this->iScheduleDatabaseId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDatabaseId()\n {\n return $this->database_id;\n }",
"function getId () {\n return $this -> dbId;\n }",
"public function getUseDbId();",
"protected function getDatabase()\n {\n if (!$this->database)\n {\n // use same DB as article\n $t... | [
"0.6549801",
"0.64030564",
"0.6402206",
"0.6385614",
"0.63359797",
"0.629068",
"0.6243721",
"0.62290084",
"0.6228357",
"0.61484134",
"0.6137555",
"0.6133347",
"0.6111967",
"0.60168713",
"0.5979635",
"0.5966176",
"0.5952363",
"0.5912788",
"0.587439",
"0.5870033",
"0.58537173",... | 0.7912162 | 0 |
(A) SEND () : SEND EMAIL $to : recipients, string or array of emails. $subject : email subject $body : email message, HTML OK. $cc : optional cc, string or array of emails. $bcc : optional bcc, string or array of emails. | function send ($to, $subject, $body, $cc=null, $bcc=null) {
// (A1) BUILD PARTIAL HEADERS
$headers = [
"MIME-Version: 1.0",
"Content-type: text/html; charset=utf-8",
"From: " . EMAIL_FROM
];
// (A2) ADD CC + BCC
if ($cc != null) {
$headers[] = "Cc: " . (is_array($cc) ? implode(", ", $cc) : $cc);
}
if ($bcc != null) {
$headers[] = "Bcc: " . (is_array($bcc) ? implode(", ", $bcc) : $bcc);
}
// (A3) SEND!
return @mail(
is_array($to) ? implode(", ", $to) : $to,
$subject, $body, implode("\r\n", $headers)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function _send_email($sender_name, $sender_email, $recipient, $subject, $body, $bcc, $isHTML=false) {\n\n $config =& JFactory::getConfig();\n $sender = array(\n $config->getValue('config.mailfrom'),\n $config->getValue('config.fromname')\n );\n\n // ... | [
"0.73695725",
"0.73215795",
"0.72385436",
"0.72005504",
"0.7149104",
"0.71237445",
"0.7064576",
"0.69553065",
"0.6925623",
"0.686024",
"0.6847479",
"0.6843487",
"0.6817475",
"0.68124324",
"0.6809162",
"0.67824477",
"0.6780175",
"0.6778755",
"0.6742615",
"0.6734485",
"0.673293... | 0.8189408 | 0 |
Adds a new child to this filter. | public function addChild(FilterInterface $child): void
{
$this->child = $child;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addChild($child)\n {\n $this->children[] = $child;\n \n return $this;\n }",
"function &addChild ( &$child ) {\n\t\t$this->children[] =& $child;\n\t\t\n\t\treturn $child;\n\t}",
"function add_child(&$child)\r\n\t{\r\n\t\t$child->parent = &$this;\r\n\t\t$this->children[... | [
"0.7082697",
"0.68029225",
"0.6687722",
"0.66658854",
"0.66524863",
"0.66277707",
"0.658032",
"0.642188",
"0.64045966",
"0.6398077",
"0.63924927",
"0.6339856",
"0.628651",
"0.6234204",
"0.61970085",
"0.61073875",
"0.59649754",
"0.5959182",
"0.5944146",
"0.59408885",
"0.588699... | 0.76234776 | 0 |
Creates a form to delete a productMedia entity. | private function createDeleteForm(ProductMedia $productMedia)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('productmedia_delete', array('id' => $productMedia->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteAction($id)\n {\n $form = $this->createDeleteForm($id);\n $request = $this->getRequest();\n\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $entity = $em->getRepository('ACInst... | [
"0.67361265",
"0.65892524",
"0.6545893",
"0.6466156",
"0.63801414",
"0.6354919",
"0.6278801",
"0.621602",
"0.6197738",
"0.6170875",
"0.61641276",
"0.6128618",
"0.61237264",
"0.61237264",
"0.6079393",
"0.60772145",
"0.6072325",
"0.60660183",
"0.60125107",
"0.5990189",
"0.59758... | 0.80082184 | 0 |
Get a lifetime amount of all water drank | public static function getLifetimeAmount()
{
$waterLogs = WaterLog::all();
$amount = 0;
foreach ($waterLogs as $waterLog) {
$amount += $waterLog->amount;
}
return $amount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLifetimeAverageReturn() {\r\n return $this->lifetimeWons / $this->lifetimeSpins;\r\n }",
"public function getRemainingLifetime():int\n {\n }",
"function getMaxLifetime();",
"public static function lifetimeCommission()\n {\n return static::all()->sum('sale_commission');\n }"... | [
"0.6341493",
"0.6145971",
"0.6131273",
"0.60857207",
"0.6066788",
"0.57375145",
"0.5579213",
"0.55754554",
"0.5550819",
"0.55391985",
"0.55390906",
"0.55211073",
"0.54968363",
"0.5477754",
"0.5437362",
"0.5435108",
"0.5398232",
"0.5384625",
"0.5328155",
"0.53260267",
"0.53208... | 0.7223875 | 0 |
The order of current graph is the number of its vertices. | public function order()
{
return Operations::order($this->getVertices());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function vertices(){\n return $this->vertices;\n }",
"public function numVerts() { return $this->_m_numVerts; }",
"function getOrder()\n {\n return 0;\n }",
"function getOrder()\n {\n return 0;\n }",
"function order() {\n static $order = 0;\n $order++;\n ... | [
"0.63224256",
"0.62570286",
"0.5922781",
"0.5922781",
"0.5853863",
"0.5742863",
"0.571804",
"0.571804",
"0.571804",
"0.5681441",
"0.55802137",
"0.5571792",
"0.5570831",
"0.5562641",
"0.5557473",
"0.55571395",
"0.5551705",
"0.5551705",
"0.5551705",
"0.5551705",
"0.5551705",
... | 0.68410033 | 0 |
il metodo sottrae due numeri e stampa il risultato | function sottrazione(){
$sottrazione=$this->numero - $this->numero2."\n";
print "Sottrazione:".$sottrazione."<br />";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function redondea($sf,$numero){\n$redondeado = round ($numero, floor ($sf - log10($numero))); \nreturn ($redondeado);\n}",
"function rupiah($angka){\n\t\t\t$angka = number_format($angka,2);\n\t\t\t$angka1 = str_replace('.', '-', $angka); \n $angka2 = str_replace(',', '.', $angka1);\n $angk... | [
"0.695859",
"0.63678753",
"0.6315526",
"0.6185709",
"0.6175388",
"0.61456025",
"0.61379814",
"0.6130529",
"0.6109909",
"0.6050343",
"0.604866",
"0.6034924",
"0.60338885",
"0.60327256",
"0.60312706",
"0.60286015",
"0.59946924",
"0.5988923",
"0.59884775",
"0.59876364",
"0.59724... | 0.6506744 | 1 |
Recusively sets status for this and all subfolders. Saves object if status parameter given | public function set_status_recursive($value = null)
{
$this->require_state("saved");
$r = true;
// determine value to be set and whether to modify and save this object
if (null === $value)
{
$dont_save_this = true;
$value = $this->status();
}
else
{
$dont_save_this = false;
}
try
{
$subfolders = new object_tree(array(
"class_id" => CL_MENU,
"parent" => $this->id()
));
if ($dont_save_this)
{ // convert to list and remove this object
$subfolders = $subfolders->to_list();
$subfolders->remove($this->id());
}
// objtree and objlist have the same interface
$subfolders->foreach_o(array(
"func" => "set_status",
"params" => array($value),
"save" => true
));
}
catch (Exception $e)
{
$r = false;
}
return $r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setFolderDetails($id,$title,$complaintstatus) {\r\n\t\tglobal $session;\r\n\t\t$now = gmdate(\"Y-m-d H:i:s\");\r\n\t\t\r\n\t\t$q = \"UPDATE \" . CO_TBL_COMPLAINTS_FOLDERS . \" set title = '$title', status = '$complaintstatus', edited_user = '$session->uid', edited_date = '$now' where id='$id'\";\r\n\t\t$r... | [
"0.57229006",
"0.5688241",
"0.5520497",
"0.52925205",
"0.52903694",
"0.52162766",
"0.5212126",
"0.5049999",
"0.50262535",
"0.50108445",
"0.49480766",
"0.4944922",
"0.4898879",
"0.48953933",
"0.48862746",
"0.48793316",
"0.48719913",
"0.48551875",
"0.48515373",
"0.48446447",
"0... | 0.68772346 | 0 |
Filter the query by a related Tipocaratula object | public function filterByTipocaratula($tipocaratula, $comparison = null)
{
return $this
->addUsingAlias(ImpresionPeer::ID_TIPOCARATULA, $tipocaratula->getId(), $comparison);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filterByTipotripa($tipotripa, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $tipotripa->getId(), $comparison);\n\t}",
"public static function buscarProfesores($tipocriterio, $criterio, $idArea)\n {\n \n if($tipocriterio==1) {\n ... | [
"0.5712855",
"0.56585264",
"0.55988157",
"0.55471885",
"0.5523285",
"0.5508375",
"0.550325",
"0.54775023",
"0.5460994",
"0.5446345",
"0.54456514",
"0.53977793",
"0.5378875",
"0.53644454",
"0.53390115",
"0.53308094",
"0.5323419",
"0.5321179",
"0.53206456",
"0.5313778",
"0.5304... | 0.60968363 | 0 |
Adds a JOIN clause to the query using the Tipocaratula relation | public function joinTipocaratula($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Tipocaratula');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Tipocaratula');
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());",
"public function join($type, $table, $on)\n {\n $this->join .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $on;\n }",
"public function join($table)\n {\n /**\n * \n * rewrite data tab... | [
"0.61809236",
"0.61300164",
"0.60585606",
"0.600817",
"0.5979828",
"0.59778804",
"0.5942937",
"0.5926986",
"0.5898913",
"0.58904195",
"0.58840907",
"0.5817574",
"0.5813439",
"0.5798619",
"0.57589275",
"0.57586014",
"0.57585716",
"0.57346946",
"0.5728974",
"0.57003826",
"0.569... | 0.6459886 | 0 |
Filter the query by a related Tipoimpresion object | public function filterByTipoimpresion($tipoimpresion, $comparison = null)
{
return $this
->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $tipoimpresion->getId(), $comparison);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filterByIdTipoimpresion($idTipoimpresion = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipoimpresion)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipoimpresion['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOIMPRESION, $idTipoimpresion['min'], Criteria::GREATER_EQUAL);\... | [
"0.54378134",
"0.5373625",
"0.53113127",
"0.52820116",
"0.5229512",
"0.5211378",
"0.520739",
"0.5205728",
"0.51850915",
"0.5111583",
"0.51026356",
"0.5095927",
"0.50949144",
"0.5041111",
"0.50357056",
"0.5028131",
"0.5013891",
"0.5012487",
"0.49791658",
"0.49670705",
"0.49624... | 0.6046834 | 0 |
Adds a JOIN clause to the query using the Tipoimpresion relation | public function joinTipoimpresion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Tipoimpresion');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Tipoimpresion');
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());",
"public function join($type, $table, $on)\n {\n $this->join .= ' ' . $type . ' JOIN ' . $table . ' ON ' . $on;\n }",
"protected function join($joinTable,$connection,$type=\"inner\"){\n\t\tforeach($connection ... | [
"0.6282923",
"0.62218684",
"0.6107877",
"0.6089673",
"0.6024786",
"0.60223025",
"0.60090053",
"0.5991784",
"0.5962511",
"0.5910458",
"0.582967",
"0.5819908",
"0.58156157",
"0.57960224",
"0.5777474",
"0.57743376",
"0.5768051",
"0.5762859",
"0.5756841",
"0.5744526",
"0.5727589"... | 0.668714 | 0 |
Use the Tipoimpresion relation Tipoimpresion object | public function useTipoimpresionQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinTipoimpresion($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Tipoimpresion', 'TipoimpresionQuery');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getImpuesto()\n {\n return $this->hasOne(Impuestos::className(), ['Id' => 'impuesto_id']);\n }",
"public function getTipo0()\n {\n return $this->hasOne(Tipos::className(), ['id' => 'tipo']);\n }",
"public function impPotencial()\n {\n return $this->belongsTo(... | [
"0.6311264",
"0.5831701",
"0.57679963",
"0.5712776",
"0.5545974",
"0.55448246",
"0.55122954",
"0.5463949",
"0.5445576",
"0.543734",
"0.54299146",
"0.54155403",
"0.54019326",
"0.5375299",
"0.5370171",
"0.5334978",
"0.5320524",
"0.53170455",
"0.530595",
"0.5296394",
"0.5281306"... | 0.5949623 | 1 |
Filter the query by a related Tipoencuadernacion object | public function filterByTipoencuadernacion($tipoencuadernacion, $comparison = null)
{
return $this
->addUsingAlias(ImpresionPeer::ID_TIPOENCUADERNACION, $tipoencuadernacion->getId(), $comparison);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filter(){\n\t\t\t$this->filtroSQL = \"SELECT art.*, cat.categoria, fam.familia, sfam.subfamilia, autor\n\t\t\t\t,date_format(art.fmodificacion,'%d-%m-%Y %H:%i:%s') ffmodificacion\n\t\t\t\t,format(art.precio,2,'de_DE') fprecio\n\t\t\t\t,format(art.oferta,2,'de_DE') foferta\n\t\t\t\t,(select nombre f... | [
"0.57239634",
"0.5493088",
"0.5477086",
"0.5469171",
"0.5424602",
"0.5363672",
"0.53568166",
"0.53249925",
"0.5314889",
"0.53065884",
"0.5233135",
"0.5226777",
"0.51868844",
"0.51759034",
"0.51745325",
"0.51538134",
"0.51531047",
"0.5149649",
"0.5149635",
"0.51388496",
"0.513... | 0.58214134 | 0 |
Adds a JOIN clause to the query using the Tipoencuadernacion relation | public function joinTipoencuadernacion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Tipoencuadernacion');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Tipoencuadernacion');
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array());",
"public function join($clause);",
"function join($table, $condition, $direction = '') {\n $this->join[] = $direction . ' JOIN ' . $table . ' ON ' . $condition;\n return $this; \n }",
"public fun... | [
"0.6520899",
"0.6309563",
"0.62581265",
"0.6230454",
"0.61824286",
"0.61686915",
"0.61686116",
"0.6135458",
"0.6080655",
"0.60605115",
"0.60032934",
"0.5996926",
"0.5996567",
"0.5968078",
"0.5927892",
"0.59224594",
"0.5916415",
"0.59114224",
"0.59051",
"0.5896591",
"0.5890331... | 0.6634506 | 0 |
Filter the query by a related Tipotripa object | public function filterByTipotripa($tipotripa, $comparison = null)
{
return $this
->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $tipotripa->getId(), $comparison);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filterByIdTipotripa($idTipotripa = null, $comparison = null)\n\t{\n\t\tif (is_array($idTipotripa)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($idTipotripa['min'])) {\n\t\t\t\t$this->addUsingAlias(ImpresionPeer::ID_TIPOTRIPA, $idTipotripa['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = tr... | [
"0.5934542",
"0.57626915",
"0.57407165",
"0.57332116",
"0.565435",
"0.55667347",
"0.5497845",
"0.54127926",
"0.54047686",
"0.53817594",
"0.53721297",
"0.53562045",
"0.5341601",
"0.53327173",
"0.5324124",
"0.5315122",
"0.5292843",
"0.5290607",
"0.52571005",
"0.52565455",
"0.52... | 0.6589009 | 0 |
Adds a JOIN clause to the query using the Tipotripa relation | public function joinTipotripa($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Tipotripa');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Tipotripa');
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function joinTipocaratula($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Tipocaratula');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\... | [
"0.63275135",
"0.62256366",
"0.609808",
"0.59920824",
"0.59761053",
"0.59754264",
"0.5892894",
"0.58864063",
"0.5860517",
"0.5817329",
"0.57756233",
"0.577187",
"0.5769066",
"0.57459974",
"0.5718532",
"0.57165974",
"0.57142997",
"0.5710233",
"0.56994295",
"0.56753236",
"0.567... | 0.6464003 | 0 |
Filter the query by a related Historico object | public function filterByHistorico($historico, $comparison = null)
{
return $this
->addUsingAlias(ImpresionPeer::ID, $historico->getIdImpresion(), $comparison);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function filterByHistorico($historico, $comparison = null)\n\t{\n\t\treturn $this\n\t\t\t->addUsingAlias(EdicionPeer::ID, $historico->getIdEdicion(), $comparison);\n\t}",
"public function historicos()\n {\n\n //dd( $this->hasMany(Historico::class));\n return $this->hasMany(Historico::class... | [
"0.65922016",
"0.575697",
"0.55857503",
"0.5520858",
"0.5451684",
"0.54332757",
"0.54148984",
"0.5353746",
"0.53432745",
"0.52919966",
"0.5287284",
"0.5259011",
"0.5216163",
"0.5213876",
"0.5195034",
"0.51535136",
"0.5150865",
"0.51433134",
"0.5082473",
"0.50702506",
"0.50520... | 0.6164103 | 1 |
This function returns the approved feedbacks of the merchant to be displayed in the frontend. | public function getMerchantFeedbacks($merchant)
{
$query = $this->getEntityManager()
->createQuery('SELECT f FROM GD\AdminBundle\Entity\Feedback f WHERE f.merchant = :merchant AND f.isApproved = true AND f.isRejected = false ORDER BY f.createdAt DESC')
->setParameter('merchant', $merchant->getId());
return $query->getResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFeedbacksForViewAttribute()\n {\n if (empty($this->feedbacks)) {\n return [];\n }\n\n $resp = [];\n foreach ($this->feedbacks as $feedback) {\n $resp[] = [\n 'rating' => $feedback->rating,\n 'attendance' => $feedb... | [
"0.65447193",
"0.6512737",
"0.6374007",
"0.598913",
"0.59442955",
"0.5750445",
"0.5713516",
"0.56987125",
"0.5697182",
"0.56802803",
"0.56801677",
"0.5672079",
"0.5632202",
"0.5585252",
"0.55634946",
"0.5554053",
"0.55538124",
"0.55257636",
"0.55118895",
"0.5509334",
"0.55079... | 0.69441587 | 0 |
Validate Rule Class to be namespaced class name and instance of yii\rbac\Rule | public function validRuleClass($attribute, $params, $validator)
{
$class = $this->$attribute;
if (! class_exists($class)) {
$this->addError($attribute, 'Not valid class name.');
return false;
} else {
$reflect = new \ReflectionClass($class);
if (! $reflect->isSubclassOf(\yii\rbac\Rule::className())) {
$this->addError($attribute, 'Class have to be extended of \\yii\\rbac\\Rule class');
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRuleClassName()\n\t{\n\t\tif ($this->ruleName) {\n\t\t\t$rule = Yii::$app->authManager->getRule($this->ruleName);\n\t\t\treturn get_class($rule);\n\t\t}\n\t\treturn null;\n\t}",
"public function getRule($className)\n\t{\n\t\t$rules = Yii::$app->authManager->getRules();\n\t\tforeach ($rules as ... | [
"0.6422105",
"0.60576046",
"0.57861114",
"0.5662804",
"0.5579971",
"0.54918385",
"0.5455773",
"0.54185575",
"0.5412592",
"0.5389218",
"0.5382056",
"0.5333758",
"0.5302438",
"0.52912587",
"0.52880615",
"0.5285622",
"0.52674365",
"0.5220438",
"0.5207071",
"0.52008986",
"0.51828... | 0.68942297 | 0 |
Get RBAC Rule object create/register in case rule doesn't exists | public function getRule($className)
{
$rules = Yii::$app->authManager->getRules();
foreach ($rules as $rule) {
if (get_class($rule) === $className) {
return $rule;
}
}
// no rule found - creating rule
$rule = Yii::createObject("\\" . $className);
Yii::$app->authManager->add($rule);
return $rule;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRuleObject()\n {\n if (is_null($this->ruleObject)) {\n $this->ruleObject = new RuleObject();\n $this->ruleObject->setExpression($this->expression);\n $this->ruleObject->setJson($this->json);\n }\n return $this->ruleObject;\n }",
"prot... | [
"0.60164297",
"0.59061104",
"0.5702072",
"0.5663495",
"0.56472206",
"0.5623921",
"0.55903846",
"0.55326456",
"0.55169797",
"0.5487666",
"0.544133",
"0.54120326",
"0.53594273",
"0.53583103",
"0.53561693",
"0.53418094",
"0.5332909",
"0.5332026",
"0.5332026",
"0.5325373",
"0.530... | 0.6016982 | 0 |
Find rule namespaced class name by current ruleName | public function getRuleClassName()
{
if ($this->ruleName) {
$rule = Yii::$app->authManager->getRule($this->ruleName);
return get_class($rule);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRule($ruleName);",
"public static function getClassNameFromNamespace()\n {\n $classArray = explode(\"\\\\\", self::$namespace);\n return $classArray[count($classArray) - 1];\n }",
"public function getRule($name);",
"public static function resolverClassName();",
"publ... | [
"0.6304797",
"0.621237",
"0.60623187",
"0.59636974",
"0.59048337",
"0.58104664",
"0.57922953",
"0.57922953",
"0.57922953",
"0.57922953",
"0.579101",
"0.5779671",
"0.5768072",
"0.5726928",
"0.5704949",
"0.5681841",
"0.56685185",
"0.56570655",
"0.56418234",
"0.562319",
"0.55956... | 0.7125428 | 0 |
Retorna el identificador del Trabajo de Grado | public function getIdTrabajoGrado( ){
return $this->idTrabajoGrado;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGradoId()\n {\n return $this->grado_id;\n }",
"public function getNombreTrabajoGrado( ){\n\t\treturn $this->nombre;\n\t}",
"public function getIdDocumentoGrado( ){\n\t\treturn $this->idDocumentoGrado;\n\t}",
"public function getRegistroGrado( ){\n\t\treturn $this->registroGrad... | [
"0.76729536",
"0.7126759",
"0.6929561",
"0.6785122",
"0.6569205",
"0.64802235",
"0.6461657",
"0.6461289",
"0.63892996",
"0.63851064",
"0.6382263",
"0.6355873",
"0.63530093",
"0.6283525",
"0.6227389",
"0.62112725",
"0.6196732",
"0.6192694",
"0.6192694",
"0.6192694",
"0.6192694... | 0.8135599 | 0 |
Modifica el nombre del Trabajo de Grado | public function setNombreTrabajoGrado( $nombre ){
$this->nombre = $nombre;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNombreTrabajoGrado( ){\n\t\treturn $this->nombre;\n\t}",
"public function getGradoNombre()\n {\n return $this->grado_nombre;\n }",
"public function CercadaNomeGratis()\n {\n $view = new VRicerca();\n $nome = $view->getNomericerca();\n $controller = new CG... | [
"0.77896625",
"0.68447626",
"0.6351023",
"0.63266027",
"0.6125311",
"0.60934144",
"0.60626125",
"0.60626125",
"0.60526496",
"0.59873545",
"0.586134",
"0.5858869",
"0.5851527",
"0.5851427",
"0.5848988",
"0.5776541",
"0.57281184",
"0.5665559",
"0.56478626",
"0.5644181",
"0.5608... | 0.7241583 | 1 |
Retorna el nombre del Trabajo de Grado | public function getNombreTrabajoGrado( ){
return $this->nombre;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGradoNombre()\n {\n return $this->grado_nombre;\n }",
"public function getIdTrabajoGrado( ){\n\t\treturn $this->idTrabajoGrado;\n\t}",
"function nombrecampo($numcampo){\n\t\treturn mysql_field_name($this->consulta_ID, $numcampo);\n\t}",
"function nombrecampo($numcampo){\n\t\tr... | [
"0.7572951",
"0.7037197",
"0.6695505",
"0.6695505",
"0.661271",
"0.6528516",
"0.65044075",
"0.6502834",
"0.64598745",
"0.6400132",
"0.639314",
"0.6310599",
"0.62326837",
"0.6181268",
"0.6176602",
"0.61670524",
"0.61655843",
"0.615882",
"0.61517274",
"0.61207044",
"0.6116298",... | 0.8399416 | 0 |
Busca si existe Trabajo de Grado por Estudiante | public function buscar( ) {
$sql = "SELECT
COUNT( idtrabajodegrado ) as existe
FROM
trabajodegrado
WHERE
codigoestudiante = ?
AND codigoestado LIKE '1%'";
$this->persistencia->crearSentenciaSQL( $sql );
$this->persistencia->setParametro( 0 , $this->getEstudiante( )->getCodigoEstudiante( ) , false );
$this->persistencia->ejecutarConsulta( );
if( $this->persistencia->getNext( ) ){
return $this->persistencia->getParametro( "existe" );
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function buscarTGradoEstudiante( ) {\n\t\t$sql = \"SELECT\n\t\t\t\t\tidtrabajodegrado, nombretrabajodegrado\n\t\t\t\tFROM\n\t\t\t\t\ttrabajodegrado\n\t\t\t\tWHERE\n\t\t\t\t\tcodigoestudiante = ?\n\t\t\t\tAND codigoestado LIKE '1%'\";\n\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t$this->persisten... | [
"0.6993624",
"0.6506359",
"0.61965156",
"0.6073526",
"0.6073526",
"0.5953309",
"0.59403324",
"0.5940321",
"0.5937088",
"0.5925361",
"0.5917719",
"0.591563",
"0.59067905",
"0.5893661",
"0.58532774",
"0.5836181",
"0.581449",
"0.57524836",
"0.5751792",
"0.57467014",
"0.574635",
... | 0.6509205 | 1 |
Busca Trabajo de Grado por Estudiante | public function buscarTGradoEstudiante( ) {
$sql = "SELECT
idtrabajodegrado, nombretrabajodegrado
FROM
trabajodegrado
WHERE
codigoestudiante = ?
AND codigoestado LIKE '1%'";
$this->persistencia->crearSentenciaSQL( $sql );
$this->persistencia->setParametro( 0 , $this->getEstudiante( )->getCodigoEstudiante( ) , false );
$this->persistencia->ejecutarConsulta( );
if( $this->persistencia->getNext( ) ){
$this->setIdTrabajoGrado( $this->persistencia->getParametro( "idtrabajodegrado" ) );
$this->setNombreTrabajoGrado( $this->persistencia->getParametro( "nombretrabajodegrado" ) );
}
//echo $this->persistencia->getSQLListo( );
$this->persistencia->freeResult( );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNombreTrabajoGrado( ){\n\t\treturn $this->nombre;\n\t}",
"function getEdificioEstacionamientosGrandes(){\n\t\t$this->resultado = pg_query($this->con,\"SELECT edificios.nombre,ST_AsText(ST_CENTROID(edificios.geom)) as edificioPos,ST_AsText(estacionamientos.geom) as estacionamientoPos FROM estac... | [
"0.6450779",
"0.63011247",
"0.6247035",
"0.6161449",
"0.6150986",
"0.60623735",
"0.60613275",
"0.60420364",
"0.6031722",
"0.6026257",
"0.5998087",
"0.5959395",
"0.5945947",
"0.5928261",
"0.59217274",
"0.5895006",
"0.5885082",
"0.58802605",
"0.58749926",
"0.5872746",
"0.585163... | 0.7630718 | 0 |
set_view(v, time) Method: Set's the type (view) of calendar | function set_view($v, $time=NULL)
{
if($time == NULL)
$time = $this->time ;
switch($this->view[$v])
{
case 0:
$this->calendar = new DayCalendar($time) ;
break ;
case 1:
$this->calendar = new WeekCalendar($time) ;
break ;
case 3:
$this->calendar = new TermCalendar($time) ;
break ;
case 4:
$this->calendar = new UpcomingCalendar($time) ;
break ;
default:
$this->calendar = new MonthCalendar($time) ;
break;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function setViewType($type)\n {\n self::$instance->setViewType($type);\n }",
"protected function setCalendarDefaultView($view)\n {\n $allowed = ['day','week', 'month'];\n\n if(!in_array($view, $allowed)){\n $this->errors = ['tipo' => $this->typeError[6], 'bad' => $v... | [
"0.648586",
"0.6264322",
"0.6188865",
"0.616412",
"0.61379737",
"0.6131997",
"0.6124006",
"0.60896903",
"0.581863",
"0.58166456",
"0.5717766",
"0.5709594",
"0.57032186",
"0.5661767",
"0.5661767",
"0.56516254",
"0.55397886",
"0.5478657",
"0.5463993",
"0.5443723",
"0.5409059",
... | 0.84073395 | 0 |
/ Generating automated group names if project inserted successfully | private function generateGroups(int $groupsTotal, int $projectId): bool
{
for ($i = 1; $i <= $groupsTotal; $i++) {
$stmt = $this->pdo->prepare("INSERT INTO project_groups (name, project_id)
VALUES (:name, :project_id)");
$groupName = 'Group #' . $i;
$stmt->bindParam(':name', $groupName);
$stmt->bindParam(':project_id', $projectId);
$result = $stmt->execute();
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProjectGroup();",
"function add_group() {\r\n\r\n\t\tgreen::$watches['pageHeading'] = 'Create template group';\r\n\r\n\t\tgreen::$watches['toggleSidebar'] = TRUE;\r\n\r\n\t\t\r\n\r\n\t\t$this->display('templates/add_group');\r\n\r\n\t}",
"function testGroupRename()\r\n {\r\n // Ins... | [
"0.62314713",
"0.5972075",
"0.5901913",
"0.57937855",
"0.57929426",
"0.57843626",
"0.5746992",
"0.5738046",
"0.5734437",
"0.571573",
"0.5715605",
"0.5698844",
"0.5642549",
"0.5640564",
"0.56319344",
"0.56309354",
"0.5624124",
"0.5616909",
"0.5613589",
"0.56052625",
"0.5586889... | 0.6051442 | 1 |
Copy the value(ID) of LeadType | private function replaceLeadType(){
$leads = Lead::all();
foreach($leads as $lead){
if($lead->LeadType == "Flight"){
$lead->lead_type_id = 1;
}
else if($lead->LeadType == "Hotel"){
$lead->lead_type_id = 2;
}
else if($lead->LeadType == "Visa"){
$lead->lead_type_id = 3;
}
else if($lead->LeadType == "Insurance"){
$lead->lead_type_id = 4;
}
else if($lead->LeadType == "Tour"){
$lead->lead_type_id = 5;
}
else if($lead->LeadType == "Umrah"){
$lead->lead_type_id = 6;
}
else if($lead->LeadType == "Hajj"){
$lead->lead_type_id = 7;
}
$lead->save();
}
dump('Leads Done');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getID_Type(){\n return $this->ID_Type;\n }",
"public function setTypeId($value){\n\t\t$this->typeId = $value;\n\t}",
"public function id() {\n return $this->type;\n }",
"function setTypeId($typeId) {\n\t\treturn $this->setData('typeId', $typeId);\n\t}",
"public functio... | [
"0.55681926",
"0.5451286",
"0.54099447",
"0.53938514",
"0.5377225",
"0.52554613",
"0.52159697",
"0.52054536",
"0.5198669",
"0.5193992",
"0.5183067",
"0.5182844",
"0.5182844",
"0.5182844",
"0.51724184",
"0.5151393",
"0.5144384",
"0.5123139",
"0.51186633",
"0.5102795",
"0.50823... | 0.63295776 | 0 |
Copy and Replace BranchId | private function replaceBranches(){
$branches = Branch::all();
foreach($branches as $branch){
if($branch->BranchRestrict == "HDQ"){
$branch->branch_id = 1;
}
$branch->save();
}
dump('Leads Done');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function branch ( $id );",
"public function alter($branch_id,string $name): Branch\r\n {\r\n $branch = $this->findById($branch_id);\r\n $branch->branch_id = $branch_id;\r\n $branch->name = $name;\r\n $branch->save();\r\n\r\n echo \"<pre>\";\r\n var_dump($branch... | [
"0.623125",
"0.58103573",
"0.55475813",
"0.55400574",
"0.5491584",
"0.5406257",
"0.536469",
"0.5220051",
"0.5169354",
"0.51301646",
"0.5123887",
"0.51068825",
"0.50694174",
"0.50474536",
"0.5044209",
"0.50427103",
"0.49988383",
"0.4952105",
"0.4945788",
"0.49425325",
"0.49425... | 0.64016116 | 0 |
Update CreatedBy,TakenBy,ClosedBy in CRM_Leads | private function UpdatedallUsersInLeads(){
$leads = \App\Lead::all();
foreach ($leads as $lead) {
$createdBy = \App\User::where('user_name',$lead->CreatedBy)->first();
$takenOverBy = \App\User::where('user_name',$lead->TakenOverBy)->first();
$ClosedBy = \App\User::where('user_name',$lead->ClosedBy)->first();
$LastUpdatedBy = \App\User::where('user_name',$lead->LastUpdateBy)->first();
$branch = \App\Branch::where('name',$lead->BranchRestrict)->first();
if($createdBy)
$lead->user_id = $createdBy->id;
if($takenOverBy)
$lead->taken_over_by = $takenOverBy->id;
if($ClosedBy)
$lead->closed_by = $ClosedBy->id;
if($LastUpdatedBy)
$lead->last_updated_by = $LastUpdatedBy->id;
if($branch)
$lead->branch_id = $branch->id;
$lead->save();
}
dump('UpdatedallUsersInLeads');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updated(Lead $lead)\n {\n //\n }",
"public function updateOpportunities(){\n }",
"public function update() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $type = $ad->type;\n\n $ad->update([\n 'city' => $this->params['city'],\n 'descrip... | [
"0.5682421",
"0.5429461",
"0.52758163",
"0.52446055",
"0.51822895",
"0.51617074",
"0.5141699",
"0.5102746",
"0.5062273",
"0.5038503",
"0.500924",
"0.4993985",
"0.49864212",
"0.49739298",
"0.4969714",
"0.4968534",
"0.4966776",
"0.4958874",
"0.49544588",
"0.49328297",
"0.492046... | 0.6517807 | 0 |
Create stream context and set context options like certificate file | protected function _createContext() {
if (is_resource($this->_streamContext)) {
return $this;
}
$this->_streamContext = stream_context_create();
stream_context_set_option($this->_streamContext, 'ssl', 'local_cert', $this->_apnsCertificateFilePath);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stream_context_create (array $options = null, array $params = null) {}",
"public static function create_default_context(\n string $purpose,\n ?string $name = None,\n $context = [],\n ?string $capath = None,\n ?string $cafile = None,\n array $caSelfDetails = []\n ) {\n $options = ne... | [
"0.71480095",
"0.6689009",
"0.6592172",
"0.6507048",
"0.6415508",
"0.63939095",
"0.6367796",
"0.63641566",
"0.6324356",
"0.6194057",
"0.6153138",
"0.6110914",
"0.60739523",
"0.59864104",
"0.59592015",
"0.5950216",
"0.57579464",
"0.56772184",
"0.56723773",
"0.55849797",
"0.556... | 0.7193522 | 0 |
Renders bylines on a post. Checks post metadata for either contributors or authors. Prioritises contributors. Optionally can link the rendered bylines. Reverts to Novara Reporters if nothing found. | function render_bylines($post_id, $is_linked = false) {
$contributors_posts_array = get_contributors_array($post_id);
$author = get_post_meta($post_id, '_cmb_author', true);
$twitter = get_post_meta($post_id, '_cmb_author_twitter', true);
$twitter_url = false;
if ($twitter &&(!is_array($twitter) || count($twitter) === 1)) { // if twitter is set and it either isn't an array (old support) or it only has 1 value then we can display it
if (is_array($twitter)) {
$twitter_url = $twitter[0];
} else {
$twitter_url = $twitter;
}
}
if ($contributors_posts_array) {
$number_of_contributors = count($contributors_posts_array);
foreach($contributors_posts_array as $index => $contributor) {
if ($number_of_contributors > 1) {
if ($number_of_contributors === $index + 1) {
echo ' & ';
} else if ($index !== 0) {
echo ', ';
}
}
echo $is_linked ? '<a href="' . get_the_permalink($contributor->ID) . '">' . $contributor->post_title . '</a>' : $contributor->post_title;
}
} else if (!empty($author)) {
if ($twitter_url && $is_linked) {
echo '<a href="https://twitter.com/' . $twitter_url . '" target="_blank" rel="nofollow">' . $author . '</a>';
} else {
echo $author;
}
} else {
echo 'Novara Reporters';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tuu_authors_posts_links($between = null, $betweenLast = null, $before = null, $after = null, $echo = true) {\n if ( function_exists( 'coauthors' ) ) {\n coauthors_posts_links($between, $betweenLast, $before, $after, $echo);\n } else {\n the_author_posts_link();\n }\n}",
"function ... | [
"0.5755466",
"0.5468563",
"0.5427621",
"0.53969675",
"0.5327851",
"0.5321025",
"0.5290182",
"0.5266982",
"0.52433944",
"0.52203566",
"0.52043074",
"0.51918066",
"0.51512986",
"0.51404554",
"0.5139684",
"0.51313263",
"0.51138514",
"0.50972116",
"0.5093323",
"0.5085162",
"0.507... | 0.71767217 | 0 |
Renders a banner from template parts according to value from meta field select. Has ability to custom render for template parts that require arguements like email signup | function render_front_page_banner($key) {
switch ($key) {
case (false || '0'): // if empty or set none
break;
case (preg_match('/^newsletter-signup-/', $key) ? true : false) : // if key has newsletter signup prefix
$newsletter_id = str_replace('newsletter-signup-', '', $key);
$newsletter = get_post($newsletter_id);
if ($newsletter) {
$meta = get_post_meta($newsletter->ID);
$mailchimp_key = !empty($meta['_nm_mailchimp_key']) ? $meta['_nm_mailchimp_key'][0] : false;
$banner_text = !empty($meta['_nm_banner_text']) ? $meta['_nm_banner_text'][0] : false;
if ($mailchimp_key) {
get_template_part('partials/email-signup', null, array(
'newsletter' => $mailchimp_key,
'copy' => $banner_text,
));
}
}
break;
case 'email-the-cortado': // custom logic for email sign ups with variables depreciated 3.9.0
get_template_part('partials/email-signup', null, array(
'newsletter' => 'The Cortado',
'copy' => 'Sign up to The Cortado—your weekly shot of political analysis from Ash Sarkar, plus a round up of the week’s content. It’s brewed every Friday morning.'
));
break;
case 'email-the-pick': // depreciated 3.9.0
get_template_part('partials/email-signup', null, array(
'newsletter' => 'The Pick',
'copy' => 'Novara Media’s best articles, every week, straight to your inbox.'
));
break;
default: // default behavior to render the template part from path provided
get_template_part($key);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function render() {\n\t\twoodmart_elementor_banner_carousel_template( $this->get_settings_for_display() );\n\t}",
"public function forTemplate() {\n return $this->renderWith('Banner');\n }",
"function wpi_postform_banner(){\n\t\techo '<p id=\"banner-enabled\" style=\"padding-bottom:9px\">';... | [
"0.63348633",
"0.62470406",
"0.6196876",
"0.61658335",
"0.5893559",
"0.5867198",
"0.58337396",
"0.5823337",
"0.5735318",
"0.5734373",
"0.5642988",
"0.56090325",
"0.56054825",
"0.56017447",
"0.55840176",
"0.55721915",
"0.55422753",
"0.5527506",
"0.55238396",
"0.5522685",
"0.54... | 0.6783211 | 0 |
Handle the question "updated" event. | public function updated(Question $question)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function updateQuestion() {\n // text, answers, complexity, attributes.\n }",
"public function setUpdated()\n {\n if ($this->getQuestion() != null) {\n $this->getQuestion()->setUpdated();\n }\n }",
"public function updated(Answer $answer)\n {\n //\n ... | [
"0.7193711",
"0.70654875",
"0.689793",
"0.68471193",
"0.6833861",
"0.6324047",
"0.6226938",
"0.6224443",
"0.62059265",
"0.61791867",
"0.61791867",
"0.61791867",
"0.61791867",
"0.61791867",
"0.61791867",
"0.61791867",
"0.6173512",
"0.609314",
"0.5995821",
"0.5970454",
"0.59525... | 0.7811646 | 0 |
Handle the question "deleted" event. | public function deleted(Question $question)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onDelete($event);",
"public function on_delete() {}",
"public function afterDelete($event)\n {\n $this->emit(\"delete\");\n }",
"protected function _afterDelete()\r\n\t{}",
"protected function afterDelete()\n {\n }",
"public function forceDeleted(Question $question)\n ... | [
"0.7146802",
"0.70947933",
"0.69883865",
"0.6942093",
"0.6905838",
"0.6843886",
"0.6827451",
"0.6806368",
"0.67989135",
"0.67912686",
"0.6712693",
"0.6688467",
"0.6665794",
"0.659027",
"0.659027",
"0.6583675",
"0.65489084",
"0.65276396",
"0.64512074",
"0.6434504",
"0.64292884... | 0.76553774 | 0 |
Handle the question "restored" event. | public function restored(Question $question)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function restored(Answer $answer)\n {\n //\n }",
"public function restored(Event $event)\n {\n //\n }",
"public function restore(ThreadWasRestored $event)\n {\n if ($event->thread->firstPost ) {\n $event->thread->firstPost->restore();\n event(new... | [
"0.6809347",
"0.66438156",
"0.63976574",
"0.6055762",
"0.6005499",
"0.59462446",
"0.5812377",
"0.57426155",
"0.5739643",
"0.57377225",
"0.56605166",
"0.56376314",
"0.56273097",
"0.561104",
"0.5601115",
"0.55779785",
"0.5547564",
"0.5534997",
"0.5493013",
"0.54843974",
"0.5430... | 0.73197854 | 0 |
Handle the question "force deleted" event. | public function forceDeleted(Question $question)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _afterDelete()\r\n\t{}",
"protected function _beforeDelete()\r\n\t{}",
"protected function afterDelete()\n {\n }",
"public function on_delete() {}",
"protected function beforeDelete()\n {\n }",
"protected function _postDelete()\n\t{\n\t}",
"public function afterDelete()\n... | [
"0.73517686",
"0.7349866",
"0.7215015",
"0.71586686",
"0.7039872",
"0.6996682",
"0.69707745",
"0.68986756",
"0.6898538",
"0.6887923",
"0.68355095",
"0.6820845",
"0.67964756",
"0.6779395",
"0.6777817",
"0.6767128",
"0.6760551",
"0.67431605",
"0.67426103",
"0.66971725",
"0.6671... | 0.76610595 | 0 |
Initilaize routes fields options. | public function init_route_fields_options() {
//Setup Settings Page
$settings_page = Rest_Manager_Settings::getInstance( $this->plugin_name );
$route_fields = rest_manager_settings_route_fields();
foreach ( $route_fields as $route_field) {
$settings_page->add_field( 'rest_manager_routes', 'routes', $route_field );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restOptions() {\n\t\t$_page = $_option = $this->slug;\n\t\t$_section = $this->slug . '_section';\n\n\t\t$defaults = [];\n\n\t\tif ( false == call_user_func( $this->get_option, $this->slug ) ) {\n\t\t\tcall_user_func( $this->add_option, $this->slug, $defaults );\n\t\t}\n\n\t\t/**************************... | [
"0.64232737",
"0.64063275",
"0.63813245",
"0.63476104",
"0.62776226",
"0.62752205",
"0.62381923",
"0.6181901",
"0.61704814",
"0.6169944",
"0.6158237",
"0.6123333",
"0.60862964",
"0.6080409",
"0.60702884",
"0.60225534",
"0.6012907",
"0.5997594",
"0.5995663",
"0.59927297",
"0.5... | 0.8701607 | 0 |
Adds the breadcrumbs to the breadcrumbtrail | protected function add_breadcrumbs()
{
$trail = BreadcrumbTrail::getInstance();
$trail->add(
new Breadcrumb(
$this->get_url(
array(\Chamilo\Core\Reporting\Viewer\Manager::PARAM_BLOCK_ID => 4),
array(\Chamilo\Application\Weblcms\Manager::PARAM_TEMPLATE_ID)),
Translation::get('LastAccessToToolsBlock')));
$trail->add(
new Breadcrumb(
$this->get_url(),
Translation::get(
'TypeName',
null,
\Chamilo\Application\Weblcms\Tool\Manager::get_tool_type_namespace($this->tool))));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addBreadcrumb()\n\t{\n\t\tBackend::addPagesBreadcrumb();\n\t}",
"private function addBreadcrumb(): void\n {\n $breadcrumb = $this->container->get(BreadCrumbService::class)->get();\n $this->paramViews['breadcrumb'] = $breadcrumb;\n }",
"function hook_menu_... | [
"0.7733623",
"0.74189955",
"0.67983305",
"0.6764055",
"0.6689898",
"0.6663445",
"0.6636942",
"0.66366833",
"0.6627395",
"0.6607772",
"0.6589663",
"0.64961845",
"0.6426578",
"0.64196914",
"0.63904953",
"0.63591266",
"0.6334137",
"0.631094",
"0.63072014",
"0.62966454",
"0.62718... | 0.816269 | 0 |
/ Setup pager types | function qw_default_pager_types( $pagers ) {
$pagers['default'] = array(
'title' => 'Default',
'callback' => 'qw_theme_pager_default'
);
$pagers['numbers'] = array(
'title' => 'Page Numbers',
'callback' => 'qw_theme_pager_numbers'
);
// WP PageNavi Plugin
if ( function_exists( 'wp_pagenavi' ) ) {
$pagers['pagenavi'] = array(
'title' => 'PageNavi',
'callback' => 'wp_pagenavi'
);
}
return $pagers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function initPager() {\n\t\t// create and configure pager object and store reference to it into the registry\n\t\t$this->pager = new tx_ptlist_pager();\n\t\t$this->conf['itemsPerPage'] = $GLOBALS['TSFE']->cObj->stdWrap($this->conf['itemsPerPage'], $this->conf['itemsPerPage.']);\n\t\tif (!empty($this->con... | [
"0.7033818",
"0.6580467",
"0.63413316",
"0.62452275",
"0.61838454",
"0.6129177",
"0.61214983",
"0.60548043",
"0.60317117",
"0.5969194",
"0.5920001",
"0.58953846",
"0.5826228",
"0.5818835",
"0.5795788",
"0.5787103",
"0.57636166",
"0.5761484",
"0.5720014",
"0.5691589",
"0.56451... | 0.702185 | 1 |
TODO: Implement createProductPart() method. | function createProductPart($data)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createPart()\n {\n $entityClass = 'MU\\\\YourCityModule\\\\Entity\\\\PartEntity';\n\n $entity = new $entityClass();\n\n $this->entityInitialiser->initPart($entity);\n\n return $entity;\n }",
"private function create_product()\n\t{\n\t\t$this->product = new stdCla... | [
"0.7032147",
"0.68081367",
"0.6454833",
"0.64429647",
"0.638188",
"0.6262671",
"0.6194976",
"0.61356807",
"0.61329824",
"0.60400045",
"0.60184616",
"0.6008802",
"0.59693176",
"0.59633976",
"0.5932625",
"0.5881969",
"0.58734745",
"0.58617264",
"0.5806163",
"0.57930964",
"0.579... | 0.79969513 | 0 |
TODO: Implement updateProductPart() method. | function updateProductPart($data, $id)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateProduct() {\n\n $params = [\n 'name' => $this->product\n ];\n \n $response = getResponse(getConfigVar(\"api_url\"), \"products\", $params, [],'body');\n \n $this->qty = $response[\"results\"][0][\"qty\"];\n $this->price = $response[\"results\"][0][... | [
"0.687474",
"0.6567394",
"0.63455176",
"0.6316998",
"0.6313841",
"0.62349576",
"0.6068152",
"0.606392",
"0.6027608",
"0.5995744",
"0.5994314",
"0.59876174",
"0.5940095",
"0.5935544",
"0.58788043",
"0.5878333",
"0.58586127",
"0.5847473",
"0.5845087",
"0.5835788",
"0.5787668",
... | 0.76151586 | 0 |
TODO: Implement deleteProductPart() method. | function deleteProductPart($id)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function del($part){\n // PARAM $part : part number\n\n // MAIN ENTRY\n $this->start();\n $sql = \"DELETE FROM `inventory_stock` WHERE `part_no`=?;\";\n $cond = [$part];\n $pass = $this->exec($sql, $cond);\n\n // STOCK MOVEMENT - IF PART NUMBER IS CHANGED\n if ($pass) {\n $sql = \"DELETE... | [
"0.6637312",
"0.6513286",
"0.64892757",
"0.6361099",
"0.63530713",
"0.6342366",
"0.63202846",
"0.6314489",
"0.63136375",
"0.6313512",
"0.63038576",
"0.6292826",
"0.6285919",
"0.6269659",
"0.62076354",
"0.6197536",
"0.61604774",
"0.6155678",
"0.6147361",
"0.6144671",
"0.612704... | 0.82279295 | 0 |
TODO: Implement productPartRules() method. | function productPartRules()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createProductPart($data)\n {\n }",
"public static function getCatalogPriceRules($product)\n {\n // Used as first argument of the logEvent function.\n $codeLocation = 'helpers/pricerule.php';\n\n // Gets current date and time (UTC).\n $now = JFactory::getDate()->toSql();\n\n // Gets... | [
"0.6023938",
"0.55763644",
"0.55501527",
"0.55061185",
"0.5498793",
"0.5470961",
"0.54324645",
"0.5420485",
"0.5344725",
"0.532371",
"0.5298575",
"0.5262976",
"0.5261773",
"0.5232629",
"0.51971316",
"0.51729465",
"0.5142837",
"0.5135377",
"0.511159",
"0.5092171",
"0.50915444"... | 0.8970002 | 0 |
TODO: Implement updateRules() method. | function updateRules()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function updateRules();",
"abstract protected function rules();",
"abstract public function rules();",
"abstract public function rules();",
"abstract public function rules();",
"abstract public function rules();",
"public function rules();",
"abstract public function getRules();",
"... | [
"0.8421801",
"0.7288822",
"0.7269173",
"0.7269173",
"0.7269173",
"0.7269173",
"0.7203543",
"0.71275526",
"0.7065883",
"0.706036",
"0.7006159",
"0.7006159",
"0.69966245",
"0.6818394",
"0.6718046",
"0.66940594",
"0.66500086",
"0.66364306",
"0.6625779",
"0.6618406",
"0.6556435",... | 0.8385922 | 1 |
db_array() runs a database query and returns an array with the result usage: db_array() note: uses db_query() | function MY_dbArray($query)
{
$result = MY_dbQuery($query);
$result_array = array();
while ($row = mysql_fetch_assoc($result))
{
array_push($result_array, $row);
}
return $result_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dbArray($query, $parms = array()) {\n return \\App\\M\\Database::getArray($query, $parms);\n }",
"function db_fetch_array ($sql) {\n\tglobal $db_err, $db_sql, $db_args;\n\t$db = db_get_conn ();\n\t$args = func_get_args ();\n\tarray_shift ($args);\n\t$args = db_args ($args);\n\t$sql = db_normalize_sq... | [
"0.75648314",
"0.7557573",
"0.75508684",
"0.7397634",
"0.7394682",
"0.734828",
"0.73153114",
"0.7286159",
"0.7045256",
"0.7023018",
"0.7003746",
"0.6988848",
"0.69660175",
"0.6939584",
"0.69112134",
"0.6901115",
"0.6873792",
"0.6867521",
"0.68276906",
"0.68111634",
"0.6787500... | 0.7616252 | 0 |
db_simple_array() runs a database query and returns a simple array with the result usage: db_simple_array() note: uses db_query() | function MY_dbSimpleArray($query)
{
$result = MY_dbQuery($query);
$result_array = array();
while ($row = mysql_fetch_row($result))
{
$result_array[$row[0]] = $row[1];
}
return $result_array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MY_dbArray($query)\n{\n $result = MY_dbQuery($query);\n $result_array = array();\n while ($row = mysql_fetch_assoc($result))\n {\n array_push($result_array, $row);\n }\n return $result_array;\n}",
"static function execArray($sql, $one_row = false) {\n global $db;\n\n ... | [
"0.72220004",
"0.71870035",
"0.7104622",
"0.70905036",
"0.7082062",
"0.7070543",
"0.70359784",
"0.6896289",
"0.6858952",
"0.68543136",
"0.68285936",
"0.6824367",
"0.6804708",
"0.6804228",
"0.6801626",
"0.6765459",
"0.67540973",
"0.6749912",
"0.6736135",
"0.6722805",
"0.671883... | 0.76892596 | 0 |
/ ALL THE FUNCTIONS / find_matches() : This function will parse the "singles.txt" CSV file and create a 2D array that will make the data accessible to query It will then identify all of the queried client's attributes and use them to create a date array that holds all of the corresponding field quantities used to filter matches | function find_matches() {
# request from the server
$name = htmlspecialchars($_GET["name"]);
# $all_singles : stores the entire "singles.txt" file
$all_singles = file('singles.txt');
# $each_single : holds each line of the "singles.txt"
$each_single = [];
# $info_single : is an array of each single's information
$info_single = [];
/* $info : is a 2D array where the line number is the first index, the
second index is the information for each person
(i.e. $info[0][name] = Ada Lovelace
because she is listed on the first line of the file) */
$info = array();
for ($i = 0; $i < 7; $i++){
$info[$i] = array();
}
for ($i = 0; $i < count($all_singles); $i++) {
$each_single[$i] = $all_singles[$i];
$info_single = explode(",", $each_single[$i]);
$info[$i][name] = $info_single[0];
$info[$i][gender] = $info_single[1];
$info[$i][age] = $info_single[2];
$info[$i][type] = $info_single[3];
$info[$i][os] = $info_single[4];
$info[$i][minage] = $info_single[5];
$info[$i][maxage] = $info_single[6];
}
$attributes_for_client = [];
$line = 0;
# identify which line the client is on in the "singles.txt" CSV
while ($name != $info[$line][name]) {
$line++;
}
# use that line to store all of the attributes of the client
$attributes_for_client[gender] = $info[$line][gender];
$attributes_for_client[minage] = $info[$line][minage];
$attributes_for_client[maxage] = $info[$line][maxage];
$attributes_for_client[os] = $info[$line][os];
$attributes_for_client[type] = $info[$line][type];
$attributes_for_date = [];
/* Assign the appropriate value for the date's gender search parameter */
$attributes_for_client[gender] == "F" ?
$attributes_for_date[gender] = "M" : $attributes_for_date[gender] = "F";
/* Assign the client's preferred operating system to
the date's preferred operating system */
$attributes_for_date[os] = $attributes_for_client[os];
/* FILTER to find MATCHES */
for ($i = 0; $i < count($all_singles); $i++){
# gender check
if ($info[$i][gender] == $attributes_for_date[gender]){
# os check
if ($info[$i][os] == $attributes_for_date[os]){
# age check min
if ($info[$i][age] >= $attributes_for_client[minage]){
# age check max
if ($info[$i][age] <= $attributes_for_client[maxage]){
# type check
if (type_match($info[$i][type], $attributes_for_client[type]) > 0){
/* finally! Now that a match has been located, pass the
corresponding information of the match/date to the display
function */
display_matches($info[$i][name], $info[$i][gender],
$info[$i][age], $info[$i][type], $info[$i][os]);
}
}
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function read_list_from_file($directory) {\n $ret = array();\n// echo 'read_list_from_file<br>';\n\n $nr = 0;\n $myfile = fopen(\"$directory/gps.csv\", \"r\") or die(\"Unable to open file!\");\n while (!feof($myfile)) {\n\n //Get one line\n $line = fgets($myfile);\n\n // Ignore ... | [
"0.58056784",
"0.57898176",
"0.5619654",
"0.5455533",
"0.5447341",
"0.5444841",
"0.5412025",
"0.5385104",
"0.5328345",
"0.5301048",
"0.52809215",
"0.5273156",
"0.526488",
"0.5262859",
"0.5214906",
"0.5184854",
"0.5168099",
"0.5153197",
"0.51407677",
"0.5136825",
"0.5087471",
... | 0.7685221 | 0 |
/ Will brake down the personality types of the client and the potential date, this function will return whether or not this is a match when considering Personality Type | function type_match($type_date, $type_client) {
$brake_type_client = [];
$brake_type_date = [];
$compatibility = 0;
$brake_type_date = str_split($type_date);
$brake_type_client = str_split($type_client);
for ($i = 0; $i < 4; $i++){
switch ($brake_type_client[$i]) {
case $brake_type_date[0]:
$compatibility++;
break;
case $brake_type_date[1]:
$compatibility++;
break;
case $brake_type_date[2]:
$compatibility++;
break;
case $brake_type_date[3]:
$compatibility++;
break;
}
}
return $compatibility;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkPersonality($matchPersonality, $userPersonality) {\n\n for ($i = 0; $i < 4; $i++) {\n if ($matchPersonality[$i] == $userPersonality[$i]) {\n return true;\n }\n }\n}",
"public function hasDateType(){\n return $this->_has(5);\n }",
"private function is_allowed... | [
"0.549718",
"0.5467621",
"0.5376719",
"0.53680164",
"0.52505696",
"0.51880616",
"0.5184424",
"0.5114012",
"0.509361",
"0.5090989",
"0.5085323",
"0.50824887",
"0.5016544",
"0.49825305",
"0.49820545",
"0.4969406",
"0.4933538",
"0.4926214",
"0.48811877",
"0.48775768",
"0.4875554... | 0.647052 | 0 |
Given an email, return the list of sites owned by that user. | private function get_wpcom_users( $email ) {
$exclude_sites = array(
'https://woocommerce.com',
);
$this->output->writeln( '<comment>Fetching list of WordPress.com & Jetpack sites...</comment>' );
$all_sites = $this->api_helper->call_wpcom_api( 'rest/v1.1/me/sites/?fields=ID,URL', array() );
if ( ! empty( $all_sites->error ) ) {
$this->output->writeln( '<error>Failed. ' . $all_sites->message . '<error>' );
exit;
}
// Filter out sites from exclude list.
$filtered_sites = array_filter(
$all_sites->sites,
function( $site ) use ( $exclude_sites ) {
foreach ( $exclude_sites as $exclude ) {
if ( $exclude === $site->URL ) {
return false;
}
}
return true;
}
);
$this->output->writeln( "<comment>Searching for '$email' across " . count( $filtered_sites ) . ' WordPress.com & Jetpack sites...</comment>' );
$site_users_endpoints = array_map(
static function( $site ) use ( $email ) {
return "sites/$site->ID/users/?search=$email&search_columns=user_email&fields=ID,email,site_ID,URL";
},
$filtered_sites
);
// concurrent call for all endpoints.
$sites_users = WPCOM_API_Helper::call_api_concurrent( $site_users_endpoints );
// clean up data by removing entries were user was not found.
$sites_users = array_filter(
$sites_users,
static function( $user ) {
return ( isset( $user ) && ! isset( $user->error ) && $user->found > 0 );
}
);
$data = array();
foreach ( $filtered_sites as $site ) {
foreach ( $site_users_endpoints as $index => $endpoint ) {
if ( isset( $sites_users[ $index ] ) && str_contains( $endpoint, $site->ID ) ) {
$data[] = (object) array(
'userId' => $sites_users[ $index ]->users[0]->ID,
'email' => $sites_users[ $index ]->users[0]->email,
'siteId' => $site->ID,
'siteName' => $site->URL,
);
}
}
}
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function userWebsites(string $email) \n {\n return $this->select()->columns('twitter, vk, discordapp')\n ->where(\" user_email = '{$email}' \")\n ->get();\n }",
"public function getSites($email)\n {\n return $this->apiRequest('cu... | [
"0.72736907",
"0.7064785",
"0.6601885",
"0.6446355",
"0.63642246",
"0.60709727",
"0.6041106",
"0.6000236",
"0.5984534",
"0.59704816",
"0.5959282",
"0.59351003",
"0.58758867",
"0.5813116",
"0.5783808",
"0.5778781",
"0.5765861",
"0.5761114",
"0.57187486",
"0.5695142",
"0.565409... | 0.7097189 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.