query stringlengths 7 5.25k | document stringlengths 15 1.06M | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Handles the OnLoad event | function ControlOnLoad() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onLoad() {\n \n }",
"protected function postLoad(){\n\t\t\t\n\t\t}",
"public function onLoad() {\n\t}",
"function onLoad($param)\n\t{\n\t\tparent::onLoad($param);\n\n\t\t$this->dataBind();\n\n\t\t//on loading the page for the first time, \n\t\t//initialize the drop down lists\n\t\ti... | [
"0.7480679",
"0.7480635",
"0.7355958",
"0.70718193",
"0.7004879",
"0.68789864",
"0.67819697",
"0.6769828",
"0.6663785",
"0.66549116",
"0.6595607",
"0.65771514",
"0.6550338",
"0.65244263",
"0.6482263",
"0.6475982",
"0.6474661",
"0.643189",
"0.64298004",
"0.6409701",
"0.6409701... | 0.65649915 | 12 |
Handles the OnUnload event | function ControlOnUnload() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onUnload($param) {\r\n\t\tPrado::trace(\"OnUnload\",'System.Web.Services.TPageService');\r\n\t\t$this->raiseEvent('OnUnload',$this,$param);\r\n\t}",
"public function unload()\n {\n // cannot unload started sessions\n if ($this->isStarted()) {\n return;\n }\n ... | [
"0.7558383",
"0.6633253",
"0.6398019",
"0.63769275",
"0.60731906",
"0.60731906",
"0.59652287",
"0.5948548",
"0.5940119",
"0.5842744",
"0.5822535",
"0.5793563",
"0.5744869",
"0.5725611",
"0.5725611",
"0.56765044",
"0.5647521",
"0.5647521",
"0.56395996",
"0.56166637",
"0.561666... | 0.8091386 | 0 |
Sends server control content, which will be rendered on the client. | function RenderChildren() {
if ($this->HasControls()) {
foreach($this->Controls as $control) {
$control->Render();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function send() {\n\t\theader ( 'Content-Type: ' . $this->getContentType () );\n\t\t\n\t\techo $this->getContent ();\n\t}",
"public function send()\n {\n $this->sendHeader(); // Insure headers are sent before sending content\n\n echo $this->content;\n }",
"public function send()\n ... | [
"0.682915",
"0.67147326",
"0.6664969",
"0.65778685",
"0.6476918",
"0.6355857",
"0.62551826",
"0.6047255",
"0.6012327",
"0.59674084",
"0.5961471",
"0.5943968",
"0.5921423",
"0.58756787",
"0.5856559",
"0.5851578",
"0.5843487",
"0.58425605",
"0.57889545",
"0.5787611",
"0.5748426... | 0.0 | -1 |
Sends server control content, which will be rendered on the client. | function Render() {
$this->RenderChildren();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function send() {\n\t\theader ( 'Content-Type: ' . $this->getContentType () );\n\t\t\n\t\techo $this->getContent ();\n\t}",
"public function send()\n {\n $this->sendHeader(); // Insure headers are sent before sending content\n\n echo $this->content;\n }",
"public function send()\n ... | [
"0.6828984",
"0.6714026",
"0.666529",
"0.6577088",
"0.6476717",
"0.6355295",
"0.6255282",
"0.60472834",
"0.60124063",
"0.59668964",
"0.59614193",
"0.5944149",
"0.5920824",
"0.5875371",
"0.5857338",
"0.5850816",
"0.584317",
"0.58421683",
"0.5788322",
"0.5787968",
"0.57486266",... | 0.0 | -1 |
Run the database seeds. | public function run()
{
echo "\n";
echo "/*---------------------------------------------- \n";
echo "| @Reset Data! \n";
echo "|----------------------------------------------*/ \n";
$this->reset();
echo "\n";
echo "/*---------------------------------------------- \n";
echo "| @Populating Data! \n";
echo "|----------------------------------------------*/ \n";
/*
|-----------------------------------------------
| @Roles
|----------------------------------------------*/
$this->call(RolesTableSeeder::class);
/*
|-----------------------------------------------
| @Groups
|----------------------------------------------*/
$this->call(GroupsTableSeeder::class);
/*
|-----------------------------------------------
| @Locations
|----------------------------------------------*/
$this->call(LocationsTableSeeder::class);
/*
|-----------------------------------------------
| @Organization
|----------------------------------------------*/
$this->call(OrganizationTableSeeder::class);
/*
|-----------------------------------------------
| @Employee Categories
|----------------------------------------------*/
$this->call(EmployeeCategoriesTableSeeder::class);
/*
|-----------------------------------------------
| @Form Template Categories
|----------------------------------------------*/
$this->call(FormTemplateCategoriesTableSeeder::class);
/*
|-----------------------------------------------
| @Event Categories
|----------------------------------------------*/
$this->call(EventCategoriesTableSeeder::class);
/*
|-----------------------------------------------
| @IDP Competency
|----------------------------------------------*/
$this->call(IDPCompetencyTableSeeder::class);
/*
|-----------------------------------------------
| @Default Forms
|----------------------------------------------*/
// $this->call(FormsSeeder::class);
/*
|-----------------------------------------------
| @Default Settings
|----------------------------------------------*/
// $this->call(SettingsSeeder::class);
echo "\n" . "Uncomment me to proceed to the sample data seeders" . "\n"; exit();
echo "\n";
echo "/*---------------------------------------------- \n";
echo "| @Populating Sample Data! \n";
echo "|----------------------------------------------*/ \n";
/*
|-----------------------------------------------
| @Default Users
|----------------------------------------------*/
// $this->call(UATUsersSeeder::class);
/*
| @Organization
|----------------------------------------------*/
// $this->call(SampleOrganizationTableSeeder::class);
/*
| @Employees
|----------------------------------------------*/
// $this->call(SampleUserTableSeeder::class);
/*
|-----------------------------------------------
| @Settings
|----------------------------------------------*/
// $this->call(SampleSettingsTableSeeder::class);
/*
| @Form Templates
|----------------------------------------------*/
// $this->call(SampleFormTemplateTableSeeder::class);
/*
| @Events
|----------------------------------------------*/
// $this->call(SampleEventsTableSeeder::class);
/*
| @IDP
|----------------------------------------------*/
// $this->call(SampleIDPsTableSeeder::class);
/*
| @Requests
|----------------------------------------------*/
// $this->call(SampleRequestsTableSeeder::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact... | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.78414... | 0.0 | -1 |
Gets the status code that corresponds to this exception. This is usually an HTTP status code. | public function getAssociatedStatusCode()
{
return AbstractResponse::RESPONSE_UNAUTHORIZED;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStatusCode() {\n\t\treturn $this->status['code'];\n\t}",
"public function status() :int\n {\n return (int) $this->exception->getStatusCode();\n }",
"public function get_status_code(): int {\n if (empty($this->status_code)) {\n throw new RuntimeException(\"HTTP ... | [
"0.84035456",
"0.84027636",
"0.8305358",
"0.8273803",
"0.8260128",
"0.82591057",
"0.82517266",
"0.8251708",
"0.8246169",
"0.8232071",
"0.82084626",
"0.8172489",
"0.8172489",
"0.8169037",
"0.81626153",
"0.8155708",
"0.81375736",
"0.8135647",
"0.80889076",
"0.8085555",
"0.80779... | 0.0 | -1 |
Construtor do Controlador Basico_OPController_FormularioAssocclElementoAssocclEventoOPController. | protected function __construct()
{
// chamando construtor da classe pai
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function conf__pantallas_evt(toba_ei_formulario $form)\n\t{\n\t\t$datos = array();\n\t\t//Meto los eventos asociados actuales por si agregaron alguno.\n\t\tforeach ($this->s__pantalla_evt_asoc as $dep) {\n\t\t\t$datos[$dep] = array('evento' => $dep, 'asociar' => 0);\n\t\t}\n\t\t//Busco la asociacion hecha\n\t\t$bu... | [
"0.5152678",
"0.5120071",
"0.5088142",
"0.50752866",
"0.47845143",
"0.45727366",
"0.45681238",
"0.45629045",
"0.45456752",
"0.45378312",
"0.44816238",
"0.44474918",
"0.44294387",
"0.4412847",
"0.4394826",
"0.43625692",
"0.43269375",
"0.43192586",
"0.43000907",
"0.42959833",
"... | 0.0 | -1 |
Inicializa o controlador Basico_OPController_FormularioAssocclElementoAssocclEventoOPController | protected function _init()
{
// chamando inicializacao da classe pai
parent::_init();
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newAssocForm()\n {\n $assocs = $this->assocManager->getAssocs();\n require_once 'vue/new.assoc.view.php';\n }",
"public function init()\n {\n \t\n \t$this->setAttrib('enctype', 'multipart/form-data');\n \t \t\n \t$this->setName('FormularioOcorrencia');\n ... | [
"0.61406106",
"0.60513276",
"0.59761506",
"0.57787544",
"0.57582146",
"0.57295805",
"0.57013893",
"0.5510478",
"0.5491748",
"0.5490587",
"0.54772645",
"0.54466814",
"0.5382834",
"0.53792",
"0.53725076",
"0.53625643",
"0.53622353",
"0.5359263",
"0.53490335",
"0.534296",
"0.534... | 0.0 | -1 |
Creates data provider instance with search query applied | public function search($params)
{
$query = WeekdayReading::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id' => $this->id,
'weekday_daynum' => $this->weekday_daynum,
'weekday_cycle_num' => $this->weekday_cycle_num,
'weekday_weeknum' => $this->weekday_weeknum,
]);
$query->andFilterWhere(['like', 'weekday_name', $this->weekday_name])
->andFilterWhere(['like', 'weekday_day', $this->weekday_day])
->andFilterWhere(['like', 'weekday_first_reading', $this->weekday_first_reading])
->andFilterWhere(['like', 'weekday_first_audio', $this->weekday_first_audio])
->andFilterWhere(['like', 'weekday_alleluia_verse', $this->weekday_alleluia_verse])
->andFilterWhere(['like', 'weekday_alleluia_audio', $this->weekday_alleluia_audio])
->andFilterWhere(['like', 'weekday_responsorial_psalm', $this->weekday_responsorial_psalm])
->andFilterWhere(['like', 'weekday_responsorial_audio', $this->weekday_responsorial_audio])
->andFilterWhere(['like', 'weekday_gospel', $this->weekday_gospel])
->andFilterWhere(['like', 'weekday_gospel_audio', $this->weekday_gospel_audio])
->andFilterWhere(['like', 'weekday_reading_type', $this->weekday_reading_type])
->andFilterWhere(['like', 'weekday_first_optional', $this->weekday_first_optional])
->andFilterWhere(['like', 'weekday_responsorial_optional', $this->weekday_responsorial_optional])
->andFilterWhere(['like', 'weekday_alleluia_optional', $this->weekday_alleluia_optional])
->andFilterWhere(['like', 'weekday_gospel_optional', $this->weekday_gospel_optional]);
return $dataProvider;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchQueryDataProvider() {}",
"public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }",
"public function getQueryDataProvider() {}",
"public function s... | [
"0.7773856",
"0.674291",
"0.65721744",
"0.6503215",
"0.6472826",
"0.6389071",
"0.63745373",
"0.6287255",
"0.62671757",
"0.62457365",
"0.62425256",
"0.62123144",
"0.61969537",
"0.6172912",
"0.61250603",
"0.6123412",
"0.6116283",
"0.61031115",
"0.6101092",
"0.608637",
"0.608177... | 0.0 | -1 |
Static instant patch function | public static function patch($xml, array $patch) {
$p = XMLPatcher::create($patch);
return $p->apply_patch($xml);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function resetPatch() {\n\n // TODO:\n \n }",
"function patch(Request &$request, Response &$response);",
"public function isPatch();",
"public function testJobPatch()\n {\n\n }",
"public static function isPatch(): bool {\r\n return static :: isMethod('patch');\r\n }",
"publi... | [
"0.64708567",
"0.611548",
"0.6110251",
"0.59530455",
"0.5863524",
"0.5819903",
"0.57037914",
"0.5570252",
"0.55487585",
"0.54917645",
"0.542843",
"0.5388357",
"0.53574467",
"0.53566617",
"0.5355179",
"0.5344666",
"0.52645814",
"0.5242443",
"0.5242443",
"0.5239338",
"0.5235829... | 0.0 | -1 |
Replace one or more nodes from the document, with a new element. | private function replace($old_xpath, $new_xml, $insert_ns = FALSE) {
$hits = $this->xpath->query($old_xpath, null, false);
if ($hits && count($hits) > 0) {
if ($insert_ns) {
$new_xml = XMLPatcher::insert_namespaces($new_xml, $this->namespaces);
}
foreach ($hits as $hit) {
$parent = $hit->parentNode;
//error_log('new_xml is ' . $new_xml);
$replace = dom_import_simplexml(simplexml_load_string($new_xml));
if ($replace !== FALSE) {
$replace = $this->dom->importNode($replace, TRUE);
$parent->replaceChild($replace, $hit);
$this->changed = TRUE;
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function replaceDomElement(\\DOMElement &$element, string $new_xml): void\n {\n // create a blank document fragment\n $fragment = $this->dom->createDocumentFragment();\n $fragment->appendXML($new_xml);\n\n // replace parent nodes child element with new fragment\n $eleme... | [
"0.6479389",
"0.61649334",
"0.60330516",
"0.5986537",
"0.59789294",
"0.5768618",
"0.5758014",
"0.57560825",
"0.5727133",
"0.5595905",
"0.55881244",
"0.5581427",
"0.5540645",
"0.5527353",
"0.5436673",
"0.53428674",
"0.5264431",
"0.5257504",
"0.52039105",
"0.51962835",
"0.51051... | 0.59050566 | 5 |
Remove one or more nodes from the document. | private function remove($old_xpath) {
$hits = $this->xpath->query($old_xpath);
$dom_to_remove = array();
foreach ($hits as $hit) {
$dom_to_remove[] = $hit;
}
foreach ($dom_to_remove as $hit) {
$hit->parentNode->removeChild($hit);
$this->changed = TRUE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove () {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t $node->parentNode->removeChild($node);\r\n\t}",
"public function removeChildNodes() {}",
"public static function removeNode()\n {\n }",
"public function clear(): void\n {\n unset($this->root);\n uns... | [
"0.7337993",
"0.7081535",
"0.6392106",
"0.62779856",
"0.6179613",
"0.61547625",
"0.59911853",
"0.5943876",
"0.5903179",
"0.5902701",
"0.58569896",
"0.5840626",
"0.57483983",
"0.5729424",
"0.57074845",
"0.57011503",
"0.56562954",
"0.5648564",
"0.56301224",
"0.5584295",
"0.5551... | 0.5211648 | 57 |
Add a node to the document. | private function add($parent_xpath, $new_xml, $insert_ns = FALSE) {
if ($insert_ns) {
$new_xml = XMLPatcher::insert_namespaces($new_xml, $this->namespaces);
}
$hits = $this->xpath->query($parent_xpath);
foreach ($hits as $hit) {
$new_node = dom_import_simplexml(simplexml_load_string($new_xml));
if ($new_node !== FALSE) {
$new_node = $this->dom->importNode($new_node, TRUE);
$hit->appendChild($new_node);
$this->changed = TRUE;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pushNode( $node );",
"public function addNode($node, $action = self::NODE_ADD);",
"public function insert(Node $node)\n {\n $this->root->insert($node);\n }",
"public function addChild(Node $child);",
"private function pushNode(\\DOMElement $node)\r\n {\r\n $this->curr... | [
"0.706289",
"0.6945849",
"0.6696333",
"0.6371246",
"0.631106",
"0.62089795",
"0.60931015",
"0.6071698",
"0.6061207",
"0.60587245",
"0.60512984",
"0.60226697",
"0.6017472",
"0.59265924",
"0.59107363",
"0.5863472",
"0.5794405",
"0.5729038",
"0.5665903",
"0.5661694",
"0.5640544"... | 0.0 | -1 |
Insert the namespaces to the element to allow us to parse an entire element. | protected static function insert_namespaces($element, array $namespaces) {
$pos = strpos($element, '>');
if (strpos(substr($element, 0, $pos), '/') !== FALSE) {
// We may have an empty element, parse to see if the
// backslash is inside an attribute.
for ($x = $pos; $x > 0; $x -= 1) {
if (substr($element, $x, 1) == "/") {
$pos = $x;
break;
}
elseif (substr($element, $x, 1) == "\"" || substr($element, $x, 1) == "'") {
break;
}
}
}
$add_string = "";
foreach ($namespaces as $prefix => $uri) {
if (strpos($element, "xmlns:$prefix") === FALSE) {
$add_string .= " xmlns:$prefix=\"$uri\"";
}
}
return substr($element, 0, $pos) . $add_string . substr($element, $pos);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addNamespaces(array $namespaces);",
"function addNamespace($namespace);",
"private function appendNamespaces(array $namespaces): void\n {\n $normalized = [];\n foreach ($namespaces as $key => $value) {\n $namespace = self::serializeNamespace($key);\n $normalized[... | [
"0.66407657",
"0.65517014",
"0.6223382",
"0.62108576",
"0.61992115",
"0.6158079",
"0.6137923",
"0.6093903",
"0.59161717",
"0.58535856",
"0.58509105",
"0.5779897",
"0.576871",
"0.5742723",
"0.57398623",
"0.57291967",
"0.5670539",
"0.56684786",
"0.56622654",
"0.5642368",
"0.561... | 0.6944918 | 0 |
Validate that the patch has been constructed correctly and populates the $this>operations array. | private function validate_patch(array $patch) {
$namespaces = array();
if (isset($patch['ns'])) {
if (!is_array($patch['ns'])) {
throw new XMLPatcherException('Namespaces section of patch must contain an array', 904);
}
else {
foreach ($patch['ns'] as $prefix => $uri) {
if (is_int($prefix)) {
throw new XMLPatcherException('Namespaces in patch must be an associative array of prefix => URI.', 904);
}
if (isset($namespaces[$prefix]) && $namespaces[$prefix] != $uri) {
throw new XMLPatcherException(sprintf('More than one namespace has the prefix (%s) but has different URIs.', $prefix), 904);
}
$namespaces[$prefix] = $uri;
}
}
}
if (isset($patch['changes'])) {
if (is_array($patch['changes'])) {
foreach ($patch['changes'] as $change) {
if (!isset($change['type'])){
throw new XMLPatcherException('Patch has a change without a "type": ' . implode(' - ', $change));
}
if ($change['type'] == 'replace' && !(isset($change['old']) && isset($change['new']))) {
throw new XMLPatcherException('Replace patch is missing a required element (old|new)', 903);
}
else if ($change['type'] == 'add' && !(isset($change['parent']) && isset($change['new']))) {
throw new XMLPatcherException('Add patch is missing a required element (parent|new)', 903);
}
else if ($change['type'] == 'remove' && !(isset($change['old']))) {
throw new XMLPatcherException('Remove patch is missing a required element (old)', 903);
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testAddOperation()\n {\n $patch = new Patch();\n $op = new Resources\\MockAtomic();\n $patch->addOperation($op);\n\n $this->assertNotEmpty(json_decode($patch));\n }",
"public function __invoke(string $name, $_): ValidationResult\n {\n // used as anythin... | [
"0.57915217",
"0.5273299",
"0.5249006",
"0.51984304",
"0.5171587",
"0.50771284",
"0.50766027",
"0.5073468",
"0.50732696",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.50133616",
"0.49863797",
... | 0.51520157 | 5 |
Validate the input XML. | private function validate_xml($xml) {
// Validate the inserted XML
libxml_use_internal_errors(true);
$doc = simplexml_load_string($xml);
$xml_lines = explode("\n", $xml);
if ($doc === FALSE) {
$errors = libxml_get_errors();
$exception = "";
foreach ($errors as $error) {
$exception .= XMLPatcher::display_xml_error($error, $xml_lines);
}
libxml_clear_errors();
throw new XMLPatcherException("Invalid XML provided: \n$exception", 905);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validate()\n {\n $this->validateNode($this->tree);\n }",
"public function validate($input) {\r\n $xml = parent::validate($input);\r\n \r\n if ($xml) {\r\n\r\n // very simple validation - just search for customers inside\r\n if (!count($xml->... | [
"0.7008044",
"0.68345875",
"0.67447317",
"0.66803414",
"0.65806305",
"0.6577348",
"0.64889973",
"0.64641654",
"0.6355312",
"0.6295257",
"0.62886715",
"0.6226436",
"0.6196032",
"0.6191542",
"0.6052681",
"0.60203004",
"0.60157335",
"0.6010046",
"0.5995027",
"0.5990739",
"0.5960... | 0.7067662 | 0 |
Format XML errors and match to lines in XML. | private function display_xml_error($error, $xml) {
$return = $xml[$error->line - 1] . "\n";
$return .= str_repeat('-', $error->column) . "^\n";
switch ($error->level) {
case \LIBXML_ERR_WARNING:
$return .= "Warning $error->code: ";
break;
case \LIBXML_ERR_ERROR:
$return .= "Error $error->code: ";
break;
case \LIBXML_ERR_FATAL:
$return .= "Fatal Error $error->code: ";
break;
}
$return .= trim($error->message) .
"\n Line: $error->line" .
"\n Column: $error->column";
if ($error->file) {
$return .= "\n File: $error->file";
}
return "$return\n\n--------------------------------------------\n\n";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayXMLValidationErrors($errors, $xml) {\n\t\techo '<h2>' . __('plugins.importexport.common.validationErrors') .'</h2>';\n\n\t\tforeach ($errors as $error) {\n\t\t\tswitch ($error->level) {\n\t\t\t\tcase LIBXML_ERR_ERROR:\n\t\t\t\tcase LIBXML_ERR_FATAL:\n\t\t\t\t\techo '<p>' .trim($error->message) .'</... | [
"0.702662",
"0.6902437",
"0.6713872",
"0.6713872",
"0.6486765",
"0.63808376",
"0.61858463",
"0.6029961",
"0.58217764",
"0.56908494",
"0.56432015",
"0.5569628",
"0.55458885",
"0.5536127",
"0.5533259",
"0.5527144",
"0.5525503",
"0.5487141",
"0.54767513",
"0.5466897",
"0.5458011... | 0.6400994 | 5 |
Display a listing of the resource. | public function __construct()
{
$this->middleware('can:admin.usuarios.index')->only('index');
$this->middleware('can:admin.usuarios.edit')->only('edit');
$this->middleware('can:admin.usuarios.create')->only('create');
$this->middleware('can:admin.usuarios.destroy')->only('destroy');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
//
$roles= Role::all();
return view('dash.usuarios.createUsuarios',compact('roles'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.717428... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
$validated = $request->validate([
'name' => 'required',
'email'=>'required',
'password'=>'required',
]);
$usuario= User::create([
'name' => $request['name'],
'email'=>$request['email'],
'password'=>bcrypt($request['password']),]
);
$usuario->roles()->sync($request->roles);
return redirect()->route('admin.usuarios.index')->with('info','El usuario se agrego correctamente');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit(User $usuario)
{
//
$roles= Role::all();
return view('dash.usuarios.editUsuarios',compact('usuario','roles'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, User $usuario)
{
$usuario->roles()->sync($request->roles);
return redirect()->route('admin.usuarios.edit',$usuario)->with('info','Se asigno un rol correctamente');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(User $usuario)
{
$usuario->delete();
return redirect()->route('admin.usuarios.index')->with('info','El usuario se elimino correctamente');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897... | 0.0 | -1 |
update deadline jika hari ini sudah melebihi deadline | public function index()
{
DB::statement("UPDATE m_kpix SET kpix_deadline = NULL WHERE kpix_deadline < DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d')");
return view('master/datakpi/index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _updateDeadline()\n {\n global $zdb;\n\n try {\n $due_date = self::getDueDate($this->_member);\n\n if ( $due_date != '' ) {\n $date_fin_update = $due_date;\n } else {\n $date_fin_update = new Expression('NULL');\n ... | [
"0.75438094",
"0.6839023",
"0.65811425",
"0.6499962",
"0.64726937",
"0.6326507",
"0.6272524",
"0.6130955",
"0.6130955",
"0.6119048",
"0.6082056",
"0.6061628",
"0.60455734",
"0.59000087",
"0.5878815",
"0.58178854",
"0.5796808",
"0.5690283",
"0.56462574",
"0.56130266",
"0.55989... | 0.0 | -1 |
Instantiates a new artifact and sets the default values. | public function __construct() {
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->applyDefaultValues();\n }",
"public function __construct()\n {\n $this->a... | [
"0.5547299",
"0.5547299",
"0.5547299",
"0.5547299",
"0.5547299",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5337604",
"0.5319317",
"0.5319317",
"0.5319317",
"0.5319317",
"0.5319317",
"0.5319317",
"... | 0.0 | -1 |
Creates a new instance of the appropriate class based on discriminator value | public static function createFromDiscriminatorValue(ParseNode $parseNode): Artifact {
$mappingValueNode = $parseNode->getChildNode("@odata.type");
if ($mappingValueNode !== null) {
$mappingValue = $mappingValueNode->getStringValue();
switch ($mappingValue) {
case '#microsoft.graph.security.host': return new Host();
case '#microsoft.graph.security.hostComponent': return new HostComponent();
case '#microsoft.graph.security.hostCookie': return new HostCookie();
case '#microsoft.graph.security.hostname': return new Hostname();
case '#microsoft.graph.security.hostSslCertificate': return new HostSslCertificate();
case '#microsoft.graph.security.hostTracker': return new HostTracker();
case '#microsoft.graph.security.ipAddress': return new IpAddress();
case '#microsoft.graph.security.passiveDnsRecord': return new PassiveDnsRecord();
case '#microsoft.graph.security.sslCertificate': return new SslCertificate();
case '#microsoft.graph.security.unclassifiedArtifact': return new UnclassifiedArtifact();
}
}
return new Artifact();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function createFromDiscriminatorValue(ParseNode $parseNode): DeviceManagementConfigurationSettingInstance {\n $mappingValueNode = $parseNode->getChildNode(\"@odata.type\");\n if ($mappingValueNode !== null) {\n $mappingValue = $mappingValueNode->getStringValue();\n ... | [
"0.5663202",
"0.56524795",
"0.55938476",
"0.5582519",
"0.5502307",
"0.54198116",
"0.5367442",
"0.5345139",
"0.5340543",
"0.5317889",
"0.53125316",
"0.5274097",
"0.52523774",
"0.52451587",
"0.5238258",
"0.5223514",
"0.52152604",
"0.5212037",
"0.51939124",
"0.5174952",
"0.51528... | 0.55732256 | 4 |
The deserialization information for the current model | public function getFieldDeserializers(): array {
$o = $this;
return array_merge(parent::getFieldDeserializers(), [
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOriginalModelInfo()\n {\n return $this->original_model_info;\n }",
"public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'detectionStatus' => fn(ParseNode $n) => $o->setDetectionStatus($n-... | [
"0.6067922",
"0.5759543",
"0.5708227",
"0.5663973",
"0.5626403",
"0.5607489",
"0.5597127",
"0.5582992",
"0.55805206",
"0.55749476",
"0.55737877",
"0.5545505",
"0.5529162",
"0.5523548",
"0.5518858",
"0.55104053",
"0.5507383",
"0.5482898",
"0.54758966",
"0.5475867",
"0.54485196... | 0.57719976 | 1 |
Serializes information the current object | public function serialize(SerializationWriter $writer): void {
parent::serialize($writer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function SerializeObject () {\n return serialize ($this);\n }",
"public function serialize()\n {\n // TODO: Implement serialize() method.\n }",
"public function serialize()\n {\n return serialize(get_object_vars($this));\n }",
"public function serialize()\n {\n ... | [
"0.7756909",
"0.7567479",
"0.7460804",
"0.7460804",
"0.7460804",
"0.74483377",
"0.74483377",
"0.7395633",
"0.7395633",
"0.7395633",
"0.7395633",
"0.7395633",
"0.7395633",
"0.739549",
"0.739549",
"0.7389668",
"0.73007923",
"0.7277297",
"0.7277297",
"0.7209685",
"0.719259",
"... | 0.0 | -1 |
Return the default value of the given value. | function value($value)
{
return $value instanceof Closure ? $value() : $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultValue() {}",
"public function getDefaultValue() {}",
"public function getDefaultValue()\n {\n\treturn $this->default;\n }",
"public function getDefaultValue()\n {\n return $this->default_value;\n }",
"public function getDefaultValue() \n\t\t{\n\t\t\treturn $thi... | [
"0.80408",
"0.804026",
"0.80091625",
"0.79798394",
"0.79289234",
"0.79138875",
"0.79138875",
"0.7909732",
"0.7881974",
"0.7881974",
"0.7848414",
"0.7823993",
"0.7820418",
"0.776555",
"0.7728266",
"0.77212256",
"0.76933616",
"0.76096064",
"0.7536002",
"0.7527292",
"0.7493406",... | 0.0 | -1 |
Escape HTML entities in a string. | function e($value)
{
if ($value instanceof Htmlable) {
return $value->toHtml();
}
return htmlentities($value, ENT_QUOTES, 'UTF-8', false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, \"UTF-8\"); }",
"public static function html_escape(string $str, string $encoding = 'UTF-8'): string\n {\n return self::htmlspecialchars(\n $str,\n \\ENT_QUOTES | \\ENT_SUBSTITUTE,\n $e... | [
"0.7398256",
"0.73252624",
"0.7279042",
"0.71967745",
"0.7172629",
"0.7108799",
"0.7092033",
"0.7061027",
"0.7047301",
"0.7039438",
"0.70331246",
"0.7000682",
"0.6996479",
"0.6989928",
"0.69414914",
"0.69414914",
"0.6927437",
"0.6924094",
"0.6896654",
"0.68397653",
"0.6826673... | 0.0 | -1 |
get a first value in an array | function first($target)
{
// target must be an array
if (!is_array($target)) {
$target = (array)$target;
}
// target is required to have a value.
if (count($target)) {
return array_values($target)[0];
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function first($array) {\n\t\treturn $array[0];\n\t}",
"public static function firstValue($array){\n\t\tforeach($array as $elt) return $elt;\n\t\treturn false;\n\t}",
"function _first($ar){\n\treturn array_shift(array_values($ar));\t\n}",
"function array_first($array)\n {\n return arr... | [
"0.81598693",
"0.8003739",
"0.7990094",
"0.7891045",
"0.7811379",
"0.77909565",
"0.77603984",
"0.7744126",
"0.77000874",
"0.7563306",
"0.7431629",
"0.74117345",
"0.73975104",
"0.7320833",
"0.73013973",
"0.7205051",
"0.71997315",
"0.7186234",
"0.7171078",
"0.7142157",
"0.71311... | 0.7061974 | 23 |
create and return a new view object | function view($file = '', $parameters = [], $mergeParameters = [])
{
return $file !== '' ? View::make($file, $parameters, $mergeParameters) : app('view');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createView();",
"public function makeNew()\n\t{\n\t\treturn new static($this->view);\n\t}",
"function view($name_view){\n return new View($name_view);\n}",
"public function createView(){\n\t\t$vue = new View(\"Create\");\n\t\t$vue->generer();\n\t}",
"public function create(): View\n {... | [
"0.8312718",
"0.78242815",
"0.7594237",
"0.7483111",
"0.7407571",
"0.73987806",
"0.7166859",
"0.7142819",
"0.71399647",
"0.7131695",
"0.70666873",
"0.6991523",
"0.69908655",
"0.695502",
"0.6945335",
"0.69352496",
"0.69260645",
"0.687377",
"0.6855885",
"0.68550223",
"0.6792455... | 0.0 | -1 |
add a parameter to view bag | function assign($name = '', $value = '')
{
return View::with($name, $value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setParamToView($key, $value);",
"public function setParamToView($key, $value){\n\t\tView::setViewParam($key, $value);\n\t}",
"function addExtraParameter($name) {\n\t\t$this->addParameter($name, Request::getParameter($name));\n\t}",
"function addParameter($name, $value) {\n\t\t$this->link->add... | [
"0.6673741",
"0.6226563",
"0.61348355",
"0.6077619",
"0.60666555",
"0.602137",
"0.6005444",
"0.59983975",
"0.594663",
"0.58954656",
"0.5856598",
"0.5808698",
"0.5673977",
"0.5644863",
"0.55754507",
"0.55315346",
"0.5496296",
"0.5477798",
"0.54398763",
"0.5436183",
"0.5412803"... | 0.0 | -1 |
work with config files | function config($name = '', $set = null)
{
if ('' === $name) {
return App::make('config');
}
return null === $set ? Config::get($name) : Config::set($name, $set);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function loadConfig();",
"public abstract function loadConfig($fileName);",
"function processConfiguration() ;",
"function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but e... | [
"0.7683705",
"0.752549",
"0.7277249",
"0.7263684",
"0.72213644",
"0.7190471",
"0.7177392",
"0.7115437",
"0.7092817",
"0.7064185",
"0.6902569",
"0.6893135",
"0.6862062",
"0.6839351",
"0.6825777",
"0.68184644",
"0.68082887",
"0.6784786",
"0.677997",
"0.67794913",
"0.6756413",
... | 0.0 | -1 |
Works with route collector. this function add a new get route | function get($uri, $action)
{
return Route::get($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getRoute(){\n\t}",
"public function testRouterAddByGet($method)\n {\n $router = new Router();\n\n $router->get(\"\", function () {\n return \"get\";\n });\n\n $router->always(function () {\n return \"not get\";\n });\n\n $res = $... | [
"0.6714278",
"0.6553148",
"0.6549881",
"0.6540084",
"0.65345263",
"0.6497026",
"0.6372589",
"0.6309439",
"0.6292032",
"0.6231883",
"0.6198055",
"0.6109596",
"0.60425746",
"0.60425746",
"0.60425746",
"0.60425746",
"0.60425746",
"0.60425746",
"0.60425746",
"0.60425746",
"0.6042... | 0.0 | -1 |
Works with route collector. this function add a new post route | function post($uri, $action)
{
return Route::post($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addRoute()\n {\n if (! $this->postType->rewrite) {\n return;\n }\n $postTypeSlug = $this->postType->rewrite['slug'];\n $this->cortexRoutes->addRoute(new QueryRoute(\n \"{$postTypeSlug}/{postName}/{singleChildName}\",\n function (arra... | [
"0.726868",
"0.68862665",
"0.65846616",
"0.6566753",
"0.6511439",
"0.64986575",
"0.64541626",
"0.64365137",
"0.6344932",
"0.6253549",
"0.62514323",
"0.6178018",
"0.61715704",
"0.6161502",
"0.6158321",
"0.6098704",
"0.6093677",
"0.6064975",
"0.60499334",
"0.604593",
"0.6029083... | 0.582581 | 68 |
Works with route collector. this function add a new put route | function put($uri, $action)
{
return Route::put($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testAddRouteShorthandMethodPut()\n {\n $this->collection->put('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('PUT', $rout... | [
"0.67217463",
"0.6618385",
"0.65387166",
"0.64000005",
"0.6391151",
"0.638829",
"0.63361806",
"0.63169885",
"0.6311415",
"0.6302552",
"0.62723124",
"0.62329066",
"0.62202924",
"0.61679924",
"0.61438483",
"0.6140045",
"0.6117754",
"0.6109016",
"0.6106314",
"0.61010337",
"0.610... | 0.61482465 | 14 |
Works with route collector. this function add a new any route | function any($uri, $action)
{
return Route::any($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add( Route $route ): Collection;",
"function\taddRoute($routeData){\n\t\t//$this->routes[] = $route;\n\t\t$this->routes[] = $routeData;\n\t}",
"private static function registerRoute($route) {\n global $Routes;\n $Routes[] = $route;\n }",
"public function addRoutes($routes);",... | [
"0.7078193",
"0.69250166",
"0.6891621",
"0.68513596",
"0.6730084",
"0.6728578",
"0.66840494",
"0.66520035",
"0.66515195",
"0.6633905",
"0.6591515",
"0.6557699",
"0.6555863",
"0.64848274",
"0.6436372",
"0.6436372",
"0.6436372",
"0.6436372",
"0.6436372",
"0.6436372",
"0.6436372... | 0.0 | -1 |
Works with route collector. this function add a new options route | function options($uri, $action)
{
return Route::options($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function routeOptions();",
"public function setRouteOptions($options);",
"static function add($route, $options=null) {\n if (is_array($route)) {\n foreach ($route as $route => $options) {\n self::add($route, $options);\n }\n } elseif (!is_null($route))... | [
"0.72336286",
"0.70398086",
"0.69697714",
"0.65069073",
"0.63734156",
"0.63640034",
"0.6301081",
"0.62393355",
"0.623774",
"0.617137",
"0.6059875",
"0.60594463",
"0.602469",
"0.6019009",
"0.60165566",
"0.59977657",
"0.5980398",
"0.59726006",
"0.59037274",
"0.58809954",
"0.587... | 0.0 | -1 |
Works with route collector. this function add a new options route | function delete($uri, $action)
{
return Route::delete($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function routeOptions();",
"public function setRouteOptions($options);",
"static function add($route, $options=null) {\n if (is_array($route)) {\n foreach ($route as $route => $options) {\n self::add($route, $options);\n }\n } elseif (!is_null($route))... | [
"0.7232585",
"0.70393795",
"0.69705176",
"0.6507999",
"0.63729274",
"0.6362656",
"0.6300883",
"0.6239619",
"0.62374705",
"0.6170748",
"0.60637635",
"0.6057919",
"0.60234547",
"0.6018345",
"0.6014452",
"0.5996",
"0.5978756",
"0.59703165",
"0.5904163",
"0.5879843",
"0.58786577"... | 0.0 | -1 |
Register a new route with the given verbs. | function match($methods, $uri, $action)
{
Route::match($methods, $uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function registerRouteBindings()\n {\n //\n }",
"private function register_routes() {\n\t\t$routes = $this->get_routes();\n\t\tforeach ( $routes as $route ) {\n\t\t\t$route->register();\n\t\t}\n\t}",
"public function register_routes()\n {\n }",
"public function register_r... | [
"0.67853874",
"0.6733141",
"0.67081445",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
"0.6707896",
... | 0.56949514 | 97 |
Works with route collector. this function add a new patch route | function patch($uri, $action)
{
return Route::patch($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testAddRouteShorthandMethodPatch()\n {\n $this->collection->patch('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('PATCH',... | [
"0.67541885",
"0.65879726",
"0.61451083",
"0.60961753",
"0.60028946",
"0.59598166",
"0.59275836",
"0.591393",
"0.58977073",
"0.58725154",
"0.5867379",
"0.58169484",
"0.5792245",
"0.5788836",
"0.5780938",
"0.5763275",
"0.5759909",
"0.5732895",
"0.5722049",
"0.57047486",
"0.567... | 0.56717163 | 22 |
works with session facade, does session get or set process | function session($get = null, $set = null)
{
if ($get !== null && $set === null) {
return Session::get($get);
} elseif ($get !== null && $set !== null) {
return Session::set($get, $set);
} else {
return App::make('session');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function startSession();",
"private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{... | [
"0.65633863",
"0.6530721",
"0.6525817",
"0.65093565",
"0.6486664",
"0.6415865",
"0.6360849",
"0.63312334",
"0.63012874",
"0.6277104",
"0.6265626",
"0.62583756",
"0.6233166",
"0.62226695",
"0.6197803",
"0.6175033",
"0.6147",
"0.6140555",
"0.61269414",
"0.61107385",
"0.60928255... | 0.0 | -1 |
works with session facade, does session get or set process | function cookie($get = null, $set = null)
{
if ($get !== null && $set === null) {
return Cookie::get($get);
} elseif ($get !== null && $set !== null) {
return Cookie::set($get, $set);
} else {
return App::make('cookie');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function startSession();",
"private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{... | [
"0.6563487",
"0.6530481",
"0.65254045",
"0.65091413",
"0.648616",
"0.64146715",
"0.63607347",
"0.633062",
"0.63021106",
"0.6276573",
"0.62652636",
"0.6256974",
"0.62318385",
"0.6222444",
"0.61978626",
"0.6174132",
"0.6146214",
"0.6139807",
"0.6126271",
"0.6109727",
"0.6092467... | 0.0 | -1 |
set cookie with very long time value | function forever($name, $value = '')
{
if (is_string($name) && is_string($value)) {
return cookie()->forever($name, $value);
} else {
throw new InvalidArgumentException('Cookie name or value must be a string');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_cookie($name,$value,$time_litmit){\n setcookie($name,$value,time() + ($time_litmit * 86400));\n }",
"function set_cookie($name, $value = 'Aceito', $time = null)\n{\n $time = $time != null ? $time : time() + apply_filters('cookie_expiration', 60 * 60 * 24 * 30);\n $value = base64_enco... | [
"0.7487933",
"0.7402098",
"0.714444",
"0.71275336",
"0.70555353",
"0.7035756",
"0.70099014",
"0.69214326",
"0.6909103",
"0.6841098",
"0.6824177",
"0.6813019",
"0.67778385",
"0.675458",
"0.6636457",
"0.6628806",
"0.66099954",
"0.65626055",
"0.6554724",
"0.64924496",
"0.6468853... | 0.0 | -1 |
add a new event | function listen($name, Closure $callback = null)
{
return Event::listen($name, $callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addEvent($event){\n $this->events[]=$event;\n }",
"function addEvent($event) {\n Event::addEvent($event);\n }",
"public function postEventadd();",
"public function add_event($_data){\r\n\t\t$args=$this->create_args($_data);\r\n\t\treturn($this->execute('add_event',$args));\r\... | [
"0.82585233",
"0.7873366",
"0.75119734",
"0.7287034",
"0.70022786",
"0.67712986",
"0.6633644",
"0.6628333",
"0.6569099",
"0.65601563",
"0.6539575",
"0.64775264",
"0.6474296",
"0.646055",
"0.6453761",
"0.64454186",
"0.6436427",
"0.6385804",
"0.6361531",
"0.63033867",
"0.623803... | 0.0 | -1 |
fetch all http headers | function getallheaders()
{
$headers = [];
if (isset($_SERVER)) {
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(
' ',
'-',
ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))
)] = $value;
}
}
}
return $headers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getHeaders();",
"public function getHeaders() {}",
"public function getHeaders ();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHead... | [
"0.81107736",
"0.8105792",
"0.80952203",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8077436",
"0.8053047",
"0.7752408",
"0.7752408",
"0.7751078",
"0.77038574",
"0.77038574",
"0.7689406",
"0.765387",
... | 0.76246667 | 22 |
return the a response object | function response($content = '', $statusCode = 200)
{
return new \Anonym\Http\Response($content, $statusCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_response_object()\n {\n }",
"function response() {\n return new Response;\n }",
"protected function _getResponse() {\n\t\treturn new Response;\n\t}",
"public function & GetResponse ();",
"function get_response() {\n return $this->response;\n }",
"pu... | [
"0.8195948",
"0.7935032",
"0.7910246",
"0.77957284",
"0.7773186",
"0.7695542",
"0.7660081",
"0.7543628",
"0.7541058",
"0.7494006",
"0.7489575",
"0.7488944",
"0.7488944",
"0.74828273",
"0.74828273",
"0.74703586",
"0.74703586",
"0.74703586",
"0.74703586",
"0.74703586",
"0.74703... | 0.0 | -1 |
get the registered csrf token | function csrf_active()
{
return Csrf::getToken();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function csrf_token()\n\t{\n\t\tif(isset($_SESSION['csrf_token'])) return $_SESSION['csrf_token'];\n\t\telse return NULL;\n\t}",
"public static function get_token() {\n\t\t\t\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Check if there is a csrf_token in the $_SESSION\n\t\t\ti... | [
"0.81229323",
"0.8105226",
"0.8049665",
"0.7947411",
"0.7923958",
"0.7922367",
"0.78320444",
"0.7819995",
"0.7723846",
"0.76975983",
"0.7653622",
"0.7641402",
"0.7606729",
"0.75858647",
"0.7577079",
"0.75184095",
"0.74754775",
"0.7471479",
"0.7433906",
"0.7387769",
"0.7364670... | 0.78851616 | 6 |
get the registered csrf token | function app($name = null)
{
return null === $name ? App::make('app') : App::make($name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function csrf_token()\n\t{\n\t\tif(isset($_SESSION['csrf_token'])) return $_SESSION['csrf_token'];\n\t\telse return NULL;\n\t}",
"public static function get_token() {\n\t\t\t\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Check if there is a csrf_token in the $_SESSION\n\t\t\ti... | [
"0.81229323",
"0.8105226",
"0.8049665",
"0.7947411",
"0.7923958",
"0.7922367",
"0.78851616",
"0.78320444",
"0.7819995",
"0.7723846",
"0.76975983",
"0.7653622",
"0.7641402",
"0.7606729",
"0.75858647",
"0.7577079",
"0.75184095",
"0.74754775",
"0.7471479",
"0.7433906",
"0.738776... | 0.0 | -1 |
get the registered csrf token | function asset($name = null)
{
$document = explode('/', rtrim(app('http.request')->uri, "/"));
$document = end($document);
$defaultPath = $document === 'public' ? 'assets/' : 'public/assets/';
$packpage = new \Anonym\Assets\VersionPackpage('', '%f', $defaultPath);
return $name !== null ? $packpage->getUrl($name) : $defaultPath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function csrf_token()\n\t{\n\t\tif(isset($_SESSION['csrf_token'])) return $_SESSION['csrf_token'];\n\t\telse return NULL;\n\t}",
"public static function get_token() {\n\t\t\t\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Check if there is a csrf_token in the $_SESSION\n\t\t\ti... | [
"0.81229323",
"0.8105226",
"0.8049665",
"0.7947411",
"0.7923958",
"0.7922367",
"0.78851616",
"0.78320444",
"0.7819995",
"0.7723846",
"0.76975983",
"0.7653622",
"0.7641402",
"0.7606729",
"0.75858647",
"0.7577079",
"0.75184095",
"0.74754775",
"0.7471479",
"0.7433906",
"0.738776... | 0.0 | -1 |
get the registered error bag | function filter($name = null, $regex = '')
{
return Route::filter($name, $regex);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrorBag(): array\n {\n return $this->_error_bag;\n }",
"public function getErrors() {\n\t\treturn $this->errorBag;\n\t}",
"protected function getErrors()\n {\n return $this->errors ?: $this->errors = app()->make(MessageBag::class);\n }",
"public function getError... | [
"0.78928035",
"0.71004206",
"0.673847",
"0.66217244",
"0.65805495",
"0.6554067",
"0.6527485",
"0.6475294",
"0.64623696",
"0.64165795",
"0.63427836",
"0.63427836",
"0.63427836",
"0.63427836",
"0.6306349",
"0.6303321",
"0.6276584",
"0.62655234",
"0.625274",
"0.6211366",
"0.6207... | 0.0 | -1 |
throw an http exception with given datas | function abort($code = 503, $message = '', array $headers = [])
{
App::abort($code, $message, $headers);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function http(HttpResponseException $ex);",
"public static function send_http_error( $data )\n {\n \\HttpResponse::status( 400 );\n \\HttpResponse::setContentType( 'application/json' ); \n \\HttpResponse::setData( $data );\n \\HttpResponse::send();\n }",
"private function fail() {\n\t\thea... | [
"0.68838024",
"0.671749",
"0.6573866",
"0.63624644",
"0.63155794",
"0.63108957",
"0.6291802",
"0.62610275",
"0.6172622",
"0.6172622",
"0.61451316",
"0.60719484",
"0.604301",
"0.6022391",
"0.59747386",
"0.5940825",
"0.5937676",
"0.5933105",
"0.5902159",
"0.5896398",
"0.5892045... | 0.0 | -1 |
Works with route collector. this function add a new when collection | function when($uri, $action)
{
return Route::when($uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add( Route $route ): Collection;",
"public function configureRoutes(RouteCollection $collection) {\n parent::configureRoutes($collection);\n $collection\n ->remove('create')\n ->add('take','{objectId}/take');\n }",
"public function addRoutes($routes);",
... | [
"0.60678804",
"0.5951952",
"0.55835485",
"0.5565826",
"0.5545252",
"0.55266935",
"0.5517881",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
"0.54823977",
... | 0.0 | -1 |
add a new group collection to router | function group($name, $action, Closure $callback)
{
return Route::group($name, $action, $callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCreateGroup()\n {\n $this->collection->get('name', '/path', 'action');\n\n $this->collection->group('blog.', '/blog', function($collection) {\n $collection->get('name', '/path', 'action');\n });\n\n\n $routes = $this->collection->all();\n\n $this... | [
"0.6859102",
"0.6658393",
"0.65349716",
"0.6495271",
"0.64398456",
"0.636195",
"0.6345462",
"0.62960064",
"0.62688154",
"0.6229365",
"0.6227446",
"0.6221714",
"0.61965877",
"0.6137509",
"0.6042298",
"0.6038201",
"0.6001782",
"0.5995303",
"0.5981521",
"0.59621376",
"0.59602463... | 0.0 | -1 |
Gets the value of an environment variable. Supports boolean, empty and null. | function env($key, $default = null)
{
$value = getenv($key);
if ($value === false) {
return value($default);
}
switch (strtolower($value)) {
case 'true':
case '(true)':
return true;
case 'false':
case '(false)':
return false;
case 'empty':
case '(empty)':
return '';
case 'null':
case '(null)':
return;
}
if (Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
return substr($value, 1, -1);
}
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function env($key, $default = null)\n {\n $value = getenv($key);\n\n if ($value === false) {\n return value($default);\n }\n\n switch (strtolower($value)) {\n case 'true':\n case '(true)':\n return true;\n case 'false':\n ... | [
"0.73584306",
"0.7350863",
"0.73503494",
"0.7341796",
"0.73397934",
"0.73324037",
"0.73305756",
"0.7320075",
"0.7305387",
"0.7292094",
"0.7255595",
"0.70721316",
"0.70536894",
"0.7020108",
"0.68737966",
"0.6759906",
"0.6669979",
"0.6668818",
"0.6656916",
"0.6641413",
"0.66144... | 0.73069066 | 8 |
Retrieve scope values for form, compatible with form dropdown options | public function getScopeSelectOptions($empty = false, $all = false)
{
if (!$this->_options)
{
$options = [];
if ($empty)
{
$options[] = [
'label' => __('-- Please Select --'),
'value' => '',
];
}
if ($all)
{
$options[] = [
'label' => __('Default Config'),
'value' => self::SCOPE_DEFAULT . self::SCOPE_DELIMITER . '0', 'style' => 'color:#1EB5F0;',
];
}
$nonEscapableNbspChar = html_entity_decode(' ', ENT_NOQUOTES, 'UTF-8');
$storeModel = $this->_systemStore;
/* @var $storeModel Store */
foreach ($storeModel->getWebsiteCollection() as $website)
{
$websiteShow = false;
foreach ($storeModel->getGroupCollection() as $group)
{
if ($group->getWebsiteId() != $website->getId())
{
continue;
}
$groupShow = false;
foreach ($storeModel->getStoreCollection() as $store)
{
if ($store->getGroupId() != $group->getId())
{
continue;
}
if (!$websiteShow)
{
$options[] = [
'label' => $website->getName(),
'value' => self::SCOPE_WEBSITES . self::SCOPE_DELIMITER . $website->getId(),
];
$websiteShow = true;
}
if (!$groupShow)
{
$groupShow = true;
$values = [];
}
$values[] = [
'label' => str_repeat($nonEscapableNbspChar, 4) . $store->getName(),
'value' => self::SCOPE_STORES . self::SCOPE_DELIMITER . $store->getId(),
];
} //end: foreach store
if ($groupShow)
{
$options[] = [
'label' => str_repeat($nonEscapableNbspChar, 4) . $group->getName(),
'value' => $values,
];
}
} //end: foreach group
} //end: foreach website
$this->_options = $options;
}
return $this->_options;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFormValues()\n {\n return $this->form->getValues();\n }",
"private function getSelectFormValues()\n {\n $program_id = User::getLoggedInUser()->getCurrentProgram()->id;\n $selection_by = $this->_getParam('selection_by');\n $all_students = true;\n\n if... | [
"0.6459313",
"0.63188183",
"0.62420714",
"0.62084776",
"0.6062908",
"0.60003024",
"0.59367627",
"0.5931068",
"0.5906787",
"0.585394",
"0.58473307",
"0.58300245",
"0.5745401",
"0.57208085",
"0.5718462",
"0.5707472",
"0.5702158",
"0.5675933",
"0.5631872",
"0.5630961",
"0.559417... | 0.54367906 | 36 |
echo "$request>email.$request>password "; die; | public function sign(Request $request)
{
if(Auth::attempt($request->only('username','password'))){
$akun = DB::table('users')->where('username', $request->username)->first();
if($akun->role =='admin'){
return redirect('/home')->with('status'," Anda Berhasil Login | SELAMAT DATANG {{auth::users()->name}} ");
} else if($akun->role =='user'){
return redirect('/dashboard')->with('status','Anda Berhasil Login | SELAMAT DATANG');
// }elseif ($akun->role =='Dosen') {
// Auth::guard('dosen')->LoginUsingId($akun->id);
// return redirect('/berandadosen')->with('sukses','Anda Berhasil Login');
// }elseif ($akun->role =='Asisten Laboratorium') {
// Auth::guard('aslab')->LoginUsingId($akun->id);
// return redirect('/berandaaslab')->with('sukses','Anda Berhasil Login');
// }elseif ($akun->role =='Asisten Praktikum') {
// Auth::guard('asprak')->LoginUsingId($akun->id);
// return redirect('/berandasprak')->with('sukses','Anda Berhasil Login');
// }elseif ($akun->role =='Praktikan') {
// Auth::guard('praktikan')->LoginUsingId($akun->id);
// return redirect('/berandapraktikan')->with('sukses','Anda Berhasil Login');
}
}
return redirect('/login')->with('status',' Email & Password Salah :( | <b>Coba Lagi</b>');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function login_obscure()\n {\n return '<strong>Whoops</strong>: Your username or password are incorrect, please try again.';\n }",
"function getRequestPassword()\n {\n return $this->_props['RequestPassword'];\n }",
"function displayForm($email, $accessToken) {\n echo <<<END\n<form method=\"P... | [
"0.571755",
"0.54884374",
"0.54863274",
"0.54440665",
"0.5377205",
"0.528191",
"0.52682495",
"0.52571726",
"0.5238768",
"0.5223813",
"0.5194928",
"0.5174715",
"0.51661646",
"0.51638794",
"0.51378536",
"0.51078206",
"0.510197",
"0.5094736",
"0.5092531",
"0.50918686",
"0.508402... | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
if(!request()->ajax()) {
return view('posts.index');
}
return resolve(PostIndexService::class)->handle(request()->all());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
return view('posts.create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.717428... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(PostStoreRequest $request)
{
$post = $this->storeService
->handle($request->validated(), auth()->user());
return response([
'redirectUrl' => route('posts.show', $post->slug)
], 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
You should only call this if you already have an element in the iterator, so we just patch it through. | public function key() {
return $this->iterator->key();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rewind()\n {\n $this->iteratorIndex = 0;\n reset($this->elements);\n }",
"private function lazyAppend()\n {\n if (!parent::valid() and $this->iterators->valid()) {\n $this->append($this->iterators->current());\n $this->iterators->next();\n ... | [
"0.56791574",
"0.5660254",
"0.5655548",
"0.56313014",
"0.557116",
"0.54617417",
"0.5457116",
"0.5447414",
"0.5408333",
"0.5408069",
"0.53935176",
"0.5364577",
"0.5348864",
"0.53291285",
"0.5284291",
"0.5227483",
"0.51924926",
"0.5177519",
"0.5148371",
"0.51374483",
"0.5122076... | 0.0 | -1 |
You should only call this if you already have an element in the iterator, so we just patch it through. | public function current() {
return $this->iterator->current();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rewind()\n {\n $this->iteratorIndex = 0;\n reset($this->elements);\n }",
"private function lazyAppend()\n {\n if (!parent::valid() and $this->iterators->valid()) {\n $this->append($this->iterators->current());\n $this->iterators->next();\n ... | [
"0.56790227",
"0.56590396",
"0.5655071",
"0.56322384",
"0.55715626",
"0.54614717",
"0.5456969",
"0.5447641",
"0.54082644",
"0.54076433",
"0.53936195",
"0.5364188",
"0.53485453",
"0.5329203",
"0.528491",
"0.52272505",
"0.5191785",
"0.517702",
"0.5148206",
"0.51368463",
"0.5121... | 0.0 | -1 |
We assume that sort is NOT empty and contains a uniqueness index. | private function queryAfterElement($baseQuery, $lastElement, $sort) {
$ors = [];
$equals = [];
$keys = array_keys($sort);
while (count($keys) > 0) {
$key = array_shift($keys);
$direction = $sort[$key];
$directionalConstraint = array();
$directionalConstraint[$key] = array();
$directionalConstraint[$key][$direction > 0 ? '$gt' : '$lt'] = $lastElement[$key];
$ors[] = array_merge($equals, $directionalConstraint);
$equals[$key] = $lastElement[$key];
}
if ($baseQuery === NULL)
$baseQuery = array();
$query = $baseQuery;
if (isset($query['$or'])) {
if (!isset($query['$and']))
$query['$and'] = array();
$query['$and'][] = array('$or' => $query['$or']);
unset($query['$or']);
$query['$and'][] = array('$or' => $ors);
} else
$query['$or'] = $ors;
//var_dump($query);
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function unique($sortFlags = null);",
"abstract public function prepareSort();",
"public function hasSort() {\n return $this->_has(3);\n }",
"public function getSortIndex();",
"public function isUnique();",
"public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}",... | [
"0.67440104",
"0.5855169",
"0.5811032",
"0.56944007",
"0.5690678",
"0.5668176",
"0.55067295",
"0.54869694",
"0.54760885",
"0.5397672",
"0.5365833",
"0.5363977",
"0.5350865",
"0.5275425",
"0.5272461",
"0.5272461",
"0.5262264",
"0.52622247",
"0.52534",
"0.5224273",
"0.52133876"... | 0.0 | -1 |
This should only be called if valid, so we can assume there is a current element. | public function next() {
$this->elementsObtained++;
$lastElement = $this->current();
try {
// DEBUG: Comment In
//if ($this->elementsObtained > 5 && $this->first)
// throw new MongoDB\Driver\Exception\RuntimeException("cursor id exception simulation");
// DEBUG: Comment In
// We just try to get the next element
$this->iterator->next();
} catch (MongoDB\Driver\Exception\RuntimeException $e) {
if (strpos($e->getMessage(), "cursor id") !== FALSE) {
// cursor id not found exception, let's mitigate
$options = array();
// no skip; we already skipped everything in the first iterator
// limit if we have a limit; we adjust it with the elements obtained
if ($this->originalLimit !== NULL)
$options["limit"] = $this->originalLimit - $this->elementsObtained;
// sort we keep
if ($this->originalSort !== NULL)
$options["sort"] = $this->originalSort;
// Adjust the query so we start after the last obtained element
$query = $this->queryAfterElement($this->query, $lastElement, $this->originalSort);
// DEBUG: Comment In
//var_dump($query);
// DEBUG: Comment In
$this->iterator = new IteratorIterator($this->collection->find($query, $options));
$this->iterator->rewind();
// We don't call next on the new iterator because it already "has" the first element
// not first anymore
$this->first = FALSE;
} else {
// something else; let's throw this right back at the caller
throw $e;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function currentElement()\n {\n return $this->current ? $this->current->parentNode : NULL;\n }",
"public function current() {\n return $this->currentElem;\n }",
"public function valid()\n {\n return ($this->currentElement !== NULL);\n }",
"public function hasCurElementId()... | [
"0.6778425",
"0.6259352",
"0.6253849",
"0.62427837",
"0.62004304",
"0.6198294",
"0.6146866",
"0.61361384",
"0.6069787",
"0.6066588",
"0.6064123",
"0.60242957",
"0.6023218",
"0.5955001",
"0.5954559",
"0.59478784",
"0.59338117",
"0.59203774",
"0.5907677",
"0.5905347",
"0.589907... | 0.0 | -1 |
Calculates count of characters in string. | public static function length($string)
{
if (function_exists('mb_strlen')) {
return mb_strlen($string, static::getEncoding());
}
if (function_exists('iconv_strlen')) {
return iconv_strlen($string, static::getEncoding());
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function countChars($string)\n {\n // Get the length for the string we need.\n if (function_exists('mb_strlen')) {\n return mb_strlen($string, 'utf-8');\n }\n\n if (function_exists('iconv_strlen')) {\n return iconv_strlen($string, 'utf-8');\n ... | [
"0.77118397",
"0.7366129",
"0.7349283",
"0.7327655",
"0.7169423",
"0.7118719",
"0.71045756",
"0.70663476",
"0.70502204",
"0.7037784",
"0.7028235",
"0.6968039",
"0.6925982",
"0.68644637",
"0.6788817",
"0.67493945",
"0.6704958",
"0.6658022",
"0.6592667",
"0.6591739",
"0.6583980... | 0.59988064 | 46 |
Returns encoding used for all operations | public static function getEncoding()
{
return static::$encoding ?: 'utf-8';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEncoding();",
"public function getEncoding(): string;",
"public function encoding()\n {\n return $this->getEncoding();\n }",
"public function get_encoding()\n {\n }",
"protected static function encoding()\n {\n return static::$encoding;\n }",
"pu... | [
"0.79944247",
"0.79384786",
"0.786824",
"0.7823397",
"0.76029164",
"0.75511575",
"0.7536249",
"0.752952",
"0.752952",
"0.74988914",
"0.74988914",
"0.7470256",
"0.74104",
"0.73959696",
"0.7390851",
"0.7390851",
"0.7390851",
"0.7390851",
"0.73743224",
"0.72644585",
"0.72644585"... | 0.7038029 | 30 |
Sets encoding for all operations | public static function setEncoding($encoding)
{
static::$encoding = $encoding;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setEncoding($encode){\n\t\t$this->encodetext=$encode;\n\t}",
"public static function setCharsetEncoding () {\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::getInstance ();\r\n\t\t}\r\n\t\tself::$instance->exec (\r\n\t\t\t\"SET NAMES 'utf8';\r\n\t\t\tSET character_set_connection=utf8;\r\n\t\t\tSE... | [
"0.73998123",
"0.70162874",
"0.6853176",
"0.6838934",
"0.6763614",
"0.6650767",
"0.65684295",
"0.6558256",
"0.65187585",
"0.6515188",
"0.6478027",
"0.6474988",
"0.6413016",
"0.63858485",
"0.6331285",
"0.6324695",
"0.62920266",
"0.6288779",
"0.62768316",
"0.6274752",
"0.626361... | 0.5940819 | 47 |
Name case. (ex: Thomas, Lewis). Works properly with separated by '' words | public static function name($string)
{
if (strpos($string, '-') !== false) {
return implode('-', array_map([__CLASS__, __FUNCTION__], explode('-', $string)));
}
return static::upper(static::slice($string, 0, 1)) . static::lower(static::slice($string, 1));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatName(array $name)\r\n {\r\n return $name['last_name'] . ' ' . preg_replace('/\\b([A-Z]).*?(?:\\s|$)+/','$1',$name['first_name']);\r\n }",
"function accronym($string) {\n $out = '';\n foreach (explode(' ', $string) as $value) {\n if ($value) {\n $out .= strtoupper... | [
"0.7060522",
"0.6970395",
"0.68820673",
"0.6874002",
"0.6818582",
"0.68102926",
"0.6798277",
"0.6765081",
"0.67549217",
"0.6654978",
"0.66251963",
"0.6586632",
"0.65746003",
"0.6515771",
"0.65150625",
"0.65042514",
"0.64891225",
"0.6484637",
"0.6476503",
"0.64726955",
"0.6464... | 0.0 | -1 |
Slices string like python. | public static function slice($string, $start, $end = null)
{
if ($end !== null) {
$end -= $start;
}
if (function_exists('mb_substr')) {
return mb_substr($string, $start, $end, static::getEncoding());
}
if (function_exists('iconv_substr')) {
return iconv_substr($string, $start, $end ?: iconv_strlen($string), static::getEncoding());
}
throw new RuntimeException('Unreachable');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function slice($string, $start, $length = null)\n {\n return mb_substr($string, $start, $length, '8bit');\n }",
"public function slice($start, $end = null)\n {\n if ($end === null) {\n $length = $this->length();\n } elseif ($end >= 0 && $end <= $start) {\n return stati... | [
"0.651862",
"0.6339322",
"0.6238182",
"0.61369294",
"0.608373",
"0.59860986",
"0.59843695",
"0.5947018",
"0.58893776",
"0.58860546",
"0.58248353",
"0.5765659",
"0.5724889",
"0.56798184",
"0.56346923",
"0.5599828",
"0.55781144",
"0.55702823",
"0.555053",
"0.5493331",
"0.546843... | 0.61575466 | 3 |
Check that string has one of passed substrings | public static function stringContains($string, array $variants)
{
foreach ($variants as $variant) {
if (static::findFirstPosition($string, $variant) !== false) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function str_istarts_with_any(string $str, array $substrings): bool\n {\n if ($str === '') {\n return false;\n }\n\n if ($substrings === []) {\n return false;\n }\n\n foreach ($substrings as &$substring) {\n if (self::str_istarts_... | [
"0.7009283",
"0.70012707",
"0.6965653",
"0.69632995",
"0.6947512",
"0.6916798",
"0.68115985",
"0.6811339",
"0.6777383",
"0.66523534",
"0.6642791",
"0.6636761",
"0.66121846",
"0.65797126",
"0.6548112",
"0.6540831",
"0.65159124",
"0.6475113",
"0.645381",
"0.6421629",
"0.64184",... | 0.6206204 | 41 |
/ formdagi dropdown orqali kelgan ID ni API dan topib, malumotlarini uzatadi | public function GetStatisticsDateStart($date)
{
$date = explode(' - ',$date);
return $date[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dropdown_ijin() {\n $result = $this->db->get('tbl_ijin');\n\n // bikin array\n // please select berikut ini merupakan tambahan saja agar saat pertama\n // diload akan ditampilkan text please select.\n $dd[''] = 'Please Select';\n if ($result->num_rows() > 0) {\n ... | [
"0.6731925",
"0.6730893",
"0.66908574",
"0.6618406",
"0.6613717",
"0.6612627",
"0.6609346",
"0.6604749",
"0.65953106",
"0.6553289",
"0.65200204",
"0.6518845",
"0.6518775",
"0.64848566",
"0.6478122",
"0.64732665",
"0.64685404",
"0.6460909",
"0.64439857",
"0.6414969",
"0.641174... | 0.0 | -1 |
/remont qilingan mashinani minutga asosida narxini xisoblash | public function CalculatePrice($sector_id,$model,$case,$starting_time,$finishing_time)
{
if($model=='1CR48' or $model=='1CP48' or $model=='1MW48') {
$model='1CQ48';
} else if ($model=='1TH69') {
$model='1TF69';
}
if($case==1)
{
$case='is_little';
} else if($case==2)
{
$case='is_medium';
} else if($case==3)
{
$case='is_large';
}
/* finding time interval*/
$datetime1 = date_create($starting_time);
$datetime2 = date_create($finishing_time);
$interval = date_diff($datetime1, $datetime2);
/*get time*/
$minutes = $interval->format('%i');
$hours = $interval->format('%h');
($hours>0)?$hours = $hours*60:null;
$overallTime = $minutes+$hours;
$priceList = ServicePrice::find()
->where(['sector_id'=>$sector_id])
->andWhere(['model'=>$model])
->one();
$prise = $priceList->$case*$overallTime;
return $prise;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mois_suivant($mois,$annee){\n\t$mois++;\t//mois suivant, donc on incrémente de 1\n\tif($mois==13){\t\n\t\t$annee++;\n\t\t$mois=1;\n\t}\n\treturn $_SERVER['PHP_SELF'].\"?m=$mois&a=$annee\";\n}",
"function cariPosisi($batas){\nif(empty($_GET['halpengumuman'])){\n\t$posisi=0;\n\t$_GET['halpengumuman']=1;\n... | [
"0.57983017",
"0.57624364",
"0.5697816",
"0.56925696",
"0.56836087",
"0.5676264",
"0.5673752",
"0.5640158",
"0.56301445",
"0.56244516",
"0.5623838",
"0.562325",
"0.5614771",
"0.5614771",
"0.55796665",
"0.5548645",
"0.5521051",
"0.55155885",
"0.5510515",
"0.5486088",
"0.545823... | 0.0 | -1 |
Checks that response body contains specific text. | public function theResponseShouldBeEqual($text)
{
assertEquals($text, $this->browser->getLastResponse()->getContent());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function theResponseShouldContain($text)\n {\n $expectedRegexp = '/' . preg_quote($text) . '/i';\n $actual = (string) $this->response->getBody();\n Assertions::assertRegExp($expectedRegexp, $actual);\n }",
"public function theResponseShouldContain($text)\n {\n $expecte... | [
"0.74811125",
"0.73613584",
"0.6431327",
"0.634694",
"0.614299",
"0.6070325",
"0.6069794",
"0.6002103",
"0.6002103",
"0.5862571",
"0.5849959",
"0.58426076",
"0.5829357",
"0.5777618",
"0.5728604",
"0.5713777",
"0.5702664",
"0.56835735",
"0.5682098",
"0.5673549",
"0.5609396",
... | 0.5527051 | 27 |
Fields to be shown on create/edit forms | protected function configureFormFields(FormMapper $formMapper) {
$formMapper
->add('nombre', 'text', array('label' => 'Nombre del tipo'))
->add('estado', 'choice', array('choices' => array('1' => 'Activo', '0' => 'Inactivo')))
->add('imagen', 'sonata_media_type', array(
'provider' => 'sonata.media.provider.image',
'context' => 'tarjetas'
))
->add('imagenes', 'sonata_type_collection', array('by_reference' => false), array('edit' => 'inline'))
// ->add('imagenes', 'sonata_type_collection', array(
// 'cascade_validation' => true,
// ), array(
// 'edit' => 'inline',
// 'inline' => 'table',
// 'link_parameters' => array('context' => 'default')
// )
// )
//if no type is specified, SonataAdminBundle tries to guess it
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createFormFields() {\n\t}",
"function extraFields() {\n\t\n\t\t$file_id = JRequest::getVar('id');\n\t\t$filename = JRequest::getVar('filename');\n\t\t\n\t\tif (!$filename) {\n\t\t\texit();\n\t\t}\n\t\t\n\t\t$model = $this->getModel();\n\t\t$form = $model->getFieldForm($file_id, 'bulk');\n\t\t\... | [
"0.741264",
"0.7242255",
"0.7203603",
"0.7001965",
"0.6940099",
"0.6921341",
"0.6723752",
"0.6698826",
"0.66810036",
"0.66768795",
"0.6667922",
"0.66665",
"0.6602609",
"0.6595206",
"0.6575597",
"0.65719944",
"0.65646523",
"0.6563076",
"0.6535553",
"0.6532271",
"0.65213907",
... | 0.0 | -1 |
Fields to be shown on filter forms | protected function configureDatagridFilters(DatagridMapper $datagridMapper) {
//
$datagridMapper
->add('nombre')
->add('estado')
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function filterFields();",
"public static function getUiFilterFields()\n\t{\n\t\treturn array();\n\t}",
"protected function getFieldsFromShowItem() {}",
"function get_filter_form(Table $table) {\n return $table->renderFilter();\n}",
"private function filterFields() {\n\n // Initia... | [
"0.71406275",
"0.7038401",
"0.69285464",
"0.68665934",
"0.6833465",
"0.68259025",
"0.67834985",
"0.6749078",
"0.673389",
"0.66995",
"0.6689305",
"0.668148",
"0.666557",
"0.6627469",
"0.662126",
"0.6595873",
"0.6544579",
"0.65440506",
"0.65122986",
"0.64389765",
"0.6423477",
... | 0.0 | -1 |
Fields to be shown on lists | protected function configureListFields(ListMapper $listMapper) {
//
$listMapper
->addIdentifier('nombre')
->add('estado' , 'choice', array('choices' => array('1' => 'Activo', '0' => 'Inactivo')))
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function makeFieldList() {}",
"public function getListFields();",
"protected function getFieldsFromShowItem() {}",
"public function getFieldsList(){\n return $this->_get(1);\n }",
"function get_field_list()\r\n\t{\r\n\t\t$fields = array();\r\n\r\n\t\tif (Authority::can('edit', 'admin/item/def... | [
"0.7493804",
"0.74926674",
"0.73992157",
"0.73517346",
"0.72574997",
"0.712018",
"0.708437",
"0.7078778",
"0.7065264",
"0.7065264",
"0.7065264",
"0.7065264",
"0.7065264",
"0.7033627",
"0.6852073",
"0.67660683",
"0.6677723",
"0.6668185",
"0.66652226",
"0.6654396",
"0.6633424",... | 0.0 | -1 |
Site Control News Administration v2.0 | function show_recent_main_menu($db)
{
global $content,$action,$SID,$bluebdr,$greenbdr,$yellowbdr;
echo "<p>» <a href=\"main.php?SID=$SID&action=$action&do=sadd\">Add a news article</a></p>\n";
// check for empty database
if (!$db->Exists("SELECT * FROM news WHERE IsFeature != 0")) {
echo "<p>There are currently no news articles in the database.</p>\n";
return;
} else {
// output header, not to be included in for loop
// Search Box
echo "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\" bordercolor=\"$bluebdr\" align=\"center\">\n";
echo " <tr>\n";
echo " <td bgcolor=\"$bluebdr\" class=\"whitemain\" height=\"23\">Search The News Archives</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class=\"trrow1\" valign=\"top\" bordercolor=\"#FFFFFF\" class=\"main\">\n";
echo "<form action=\"main.php\">";
echo "<input type=\"hidden\" name=\"SID\" value=\"$SID\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"$action\">\n";
echo "<input type=\"hidden\" name=\"do\" value=\"search\">\n";
echo "<br><p>Enter keyword <input type=\"text\" name=\"search\" value=\"$search\" size=\"20\"> <input type=\"submit\" value=\"Search\"></form></p>\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table><br>\n";
echo "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"$greenbdr\" align=\"center\">\n";
echo "<tr>\n";
echo " <td bgcolor=\"$greenbdr\" class=\"whitemain\" height=\"23\"> 10 Most Recent News Article List</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td bgcolor=\"#FFFFFF\" valign=\"top\" bordercolor=\"#FFFFFF\" class=\"main\" colspan=\"2\">\n";
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">\n";
echo " <tr>\n";
echo " <td>\n";
// query database
$db->Query("SELECT * FROM news WHERE IsFeature != 1 ORDER BY id DESC LIMIT 10");
for ($x=0; $x<$db->rows; $x++) {
$db->GetRow($x);
// setup variables
$t = htmlentities(stripslashes($db->data['title']));
$id = htmlentities(stripslashes($db->data['id']));
$fe = $db->data['IsFeature'];
if($x % 2) {
echo "<tr bgcolor=\"#F5F6F6\">\n";
} else {
echo "<tr bgcolor=\"#EEEFEF\">\n";
}
// output
echo " <td align=\"left\">$id</td>\n";
if($fe != "1") {
echo " <td align=\"left\">$t</td>\n";
} else {
echo " <td align=\"left\"><b><font color=\"red\">$t</font></b></td>\n";
}
echo " <td align=\"right\"><a href=\"main.php?SID=$SID&action=$action&do=sedit&id=" . $db->data['id'] . "\"><img src=\"/images/icons/icon_edit.gif\" border=\"0\" alt=\"Edit\"></a><a href=\"main.php?SID=$SID&action=$action&do=sdel&id=" . $db->data['id'] . "\"><img src=\"/images/icons/icon_delete.gif\" border=\"0\" alt=\"Delete\"></a></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo " </td>\n";
echo "</tr>\n";
echo "</table><br>\n";
// News by Month Box
echo "<table width=\"100%\" border=\"1\" cellspacing=\"0\" cellpadding=\"3\" bordercolor=\"$yellowbdr\" align=\"center\">\n";
echo " <tr>\n";
echo " <td bgcolor=\"$yellowbdr\" class=\"whitemain\" height=\"23\">News Articles by Month</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td class=\"trrow1\" valign=\"top\" bordercolor=\"#FFFFFF\" class=\"main\">\n";
$yearrow = $db->QueryRow("SELECT year(`added`) AS theyear FROM news GROUP BY theyear");
for ($y=0; $y<$db->rows; $y++) {
$db->GetRow($y);
$ty = $db->data['theyear'];
$tm = $db->data['themonth'];
$mi = $db->data['monthid'];
echo "$ty ";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=1&monthname=January\">Jan</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=2&monthname=February&ccl_mode=5\">Feb</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=3&monthname=March&ccl_mode=5\">Mar</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=4&monthname=April&ccl_mode=5\">Apr</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=5&monthname=May&ccl_mode=5\">May</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=6&monthname=June&ccl_mode=5\">Jun</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=7&monthname=July&ccl_mode=5\">Jul</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=8&monthname=August&ccl_mode=5\">Aug</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=9&monthname=September&ccl_mode=5\">Sep</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=10&monthname=October&ccl_mode=5\">Oct</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=11&monthname=November&ccl_mode=5\">Nov</a>|";
echo "<a href=\"main.php?SID=$SID&action=$action&do=months&theyear=$ty&themonth=12&monthname=December&ccl_mode=5\">Dec</a>";
echo "<br>";
}
echo " </td>\n";
echo " </tr>\n";
echo "</table><br>\n";
echo "<p>» <a href=\"main.php?SID=$SID&action=$action&do=menu\">view all news articles</a></p>\n";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getSystemNews() {}",
"public function working_mom_news(){\r\n\t\t\r\n\t\t/* Get model */\r\n\t\t$itemsModel = $this->getModel('items');\r\n\t\t$itemsModel->set('category', $this->get('category'));\r\n\t\t\r\n\t\t/* Get data */\r\n\t\t$latestNews = $itemsModel->getLatest('news', 0, 4);\r\n\t\t\... | [
"0.7459822",
"0.73091364",
"0.7065309",
"0.6864271",
"0.6859785",
"0.67275065",
"0.6614624",
"0.6610831",
"0.660238",
"0.6589509",
"0.65859634",
"0.6584562",
"0.6551275",
"0.6534468",
"0.65261954",
"0.6493918",
"0.6487693",
"0.6477595",
"0.64645976",
"0.64360064",
"0.6405073"... | 0.0 | -1 |
====================== Query Scopes ====================== | public function scopePath($query, $path)
{
$slugs = collect(explode('/', $path));
$pages = self::whereIn($this->getTable().'.slug', $slugs)->get();
$target_slug = $slugs->pop();
$page = $pages->where('slug', $target_slug)->filter(function ($page) use ($slugs, $pages) {
$parent_id = $page->parent_id;
$parent_slugs = collect();
while (!is_null($parent_id)) {
if ($pages->whereIn('id', $parent_id)->isEmpty()) {
return false;
}
$parent = $pages->where($this->getKeyName(), $parent_id)->first();
$parent_slugs->prepend($parent->slug);
$parent_id = $parent->parent_id;
}
return $parent_slugs->toJson() == $slugs->toJson();
})->sortBy('order')->first();
if (!$page) {
throw (new ModelNotFoundException)->setModel(get_class($this->model));
}
return $query->where($this->getKeyName(), $page->getKey());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueryScope()\n {\n return $this->getQuery();\n }",
"public function getQueryScope()\n {\n return $this->query_scope;\n }",
"public function getScope();",
"public function getScope();",
"public function scopeSearch($query){\n if (request()->has('search_quer... | [
"0.7794624",
"0.7449051",
"0.6734174",
"0.6734174",
"0.67137265",
"0.670079",
"0.66816324",
"0.66428673",
"0.64159036",
"0.6387481",
"0.6367222",
"0.6367222",
"0.6367222",
"0.63250124",
"0.63200176",
"0.63183504",
"0.6297847",
"0.62931883",
"0.6274175",
"0.6274175",
"0.627352... | 0.0 | -1 |
Get the value of the indicator at a given interval number | public function get(int $intervalNum, OrderTime $orderTime): float; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIndicator() ;",
"abstract protected function get_interval();",
"public function getIntervalValue()\r\n {\r\n return $this->interval_value;\r\n }",
"public function getInterval() {}",
"protected function getInterval() {\n return new Interval($this->configuration['number'], $this-... | [
"0.6653696",
"0.6224163",
"0.6212928",
"0.5986658",
"0.57582295",
"0.5484392",
"0.5458628",
"0.54008573",
"0.5382212",
"0.5361484",
"0.5361484",
"0.53599954",
"0.5264917",
"0.52592784",
"0.525829",
"0.52316433",
"0.52116144",
"0.5200677",
"0.5187746",
"0.51394314",
"0.5139431... | 0.53646356 | 9 |
Record a message to the logger, if one exists. | public function record ($msg, $type = '', $channel = '', $has_html = false)
{
if (isset ($this->logs->logger))
{
if (! $channel)
{
$channel = $this->default_channel;
}
if (! $type)
{
$type = $this->default_type;
}
$this->logs->logger->record ($msg, $type, $channel);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function appendLog($message);",
"function log($message) {\n\t\tif (isset($this->logger)) {\n\t\t\tcall_user_func(array($this->logger, 'log'), $message);\n\t\t}\n\t}",
"private function record(int $level, ?string $message, $context = null): void\n\t{\n\t\tif(static::$context)\n\t\t{\n\t\t\t$context = $co... | [
"0.59936213",
"0.5981724",
"0.59504676",
"0.59161144",
"0.5884699",
"0.5725842",
"0.5704736",
"0.5685513",
"0.5667462",
"0.5650035",
"0.56418097",
"0.56056434",
"0.5573309",
"0.5560849",
"0.5560849",
"0.5560849",
"0.5552861",
"0.55510676",
"0.55105335",
"0.5505345",
"0.547781... | 0.6059651 | 0 |
Record additional information. Uses the last message's filter. | public function record_more ($msg, $has_html = false)
{
if (isset ($this->logs->logger))
{
$this->logs->logger->record_more ($msg, $has_html);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRecordLog() {\n \t$msg = '';\n \t$defaultFilterFields = array( 'id', 'modify_user_id' ,'modify_time', 'create_user_id', 'create_time','check_user_id','check_time');\n \t$addFilterFields = !empty($this->filterFields) ? $this->filterFields : array();\n \t$filterFields = array_merge($de... | [
"0.57129973",
"0.5501935",
"0.54812205",
"0.5173954",
"0.5129478",
"0.51133686",
"0.50712025",
"0.5030754",
"0.5009038",
"0.49852344",
"0.49771228",
"0.4919003",
"0.49178067",
"0.49093303",
"0.48895374",
"0.48845634",
"0.48815194",
"0.48763818",
"0.4864585",
"0.48245263",
"0.... | 0.5086193 | 6 |
/ get product category from the database | function uploadProductForm( $retire_id, $product_id, $action_id, $category_id ){
if($action_id == 1){
$get_product_category = $this->connection->prepare ("
SELECT product_id, category_name
FROM pro_category
WHERE product_id=?
" );
$get_product_category->bind_param("i",$category_id);
$send_id = 11;
}else{
$get_product_category = $this->connection->prepare ("
SELECT product_id, category_name
FROM pro_category
" );
$send_id = 7;
}
$get_product_category->execute();
$get_product_category->bind_result( $product_category_id, $category_name );
//create a form to be able to submit the product
if($action_id>0){
$heading = "<h3>Update the product</h3>";
}else{
$heading = "<h3>Upload the product</h3>";
}
echo
"<form id='upload_product_holder' action='object.php' method='post' enctype='multipart/form-data' class='upload_holder' style='display:block;'>".
$heading.
"<label class='label'> Choose Product Category </label>".
//create a select to select category name options
"<select name='product_category_id' class='text_inpu more_height'>";
//loop through each category
while ( $get_product_category->fetch() ){
//create product category names options to choose which category a product belongs to.
echo "<option value='".$product_category_id."'>".$category_name."<option/>";
}
//close select options created
echo
"</select>";
/*get product info if action is admin update*/
if($action_id==1){
$get_product = $this->connection->prepare ("
SELECT product_name, brand_id , product_description, product_color, weight, price
FROM product
WHERE product_id = ?
" );
$get_product->bind_param("i",$product_id);
$get_product->execute();
$get_product->bind_result( $product_name, $product_brand_id, $product_description, $product_color, $weight, $price );
while($get_product->fetch()){}
}else{
$product_name = "";
$product_brand_id = "";
$product_description = "";
$product_color = "";
$weight = "";
$price = "";
}
/*
* get the brand name created in the database
* To determine which brand a product belongs to
*/
if($action_id==1){
$get_product_brand = $this->connection->prepare("
SELECT brand_id, brand_name
FROM brand
WHERE brand_id=?
");
$get_product_brand->bind_param("i",$product_brand_id);
}else{
$get_product_brand = $this->connection->prepare("
SELECT brand_id, brand_name
FROM brand
");
}
$get_product_brand->execute();
$get_product_brand->bind_result( $brand_id, $brand_name );
//create a select input to create brand name options
echo
"<label class='label'> Choose Brand Name </label>".
"<select name='product_brand_name' class='text_inpu more_height'>";
while ( $get_product_brand->fetch() ){
$product_brand_name = $brand_id;
//create options to choose brand name
echo "<option value='".$product_brand_name."'>".$brand_name."<option/>";
}
//close the select input
echo
"</select>";
echo
"</select>".
"<label class='label'> Product Name </label>".
"<input type='text' name='product_name' value='".$product_name."' class='text_inpu' />".
"<label class='label'> Product description </label>".
"<textarea type='text' name='product_description' value='".$product_description."' class='text_inpu textarea' maxlength='240' >".$product_description."</textarea>".
"<label class='label'> Product color ( Separated by comma ) </label>".
"<input type='text' name='product_color' value='".$product_color."' class='text_inpu' />".
"<label class='label'> Product photo </label>".
"<input type='file' name='product_photo[]' multiple class='text_inpu' />".
"<label class='label'> Product size/weight available ( Separated by comma )</label>".
"<input type='text' name='product_weight' value='".$weight."' class='text_inpu' />".
"<label class='label'> Product Prices by size/weight above ( Separated by comma ) </label>".
"<input type='number' name='product_price' value='".$price."' class='text_inpu' />".
"<input type='hidden' name='product_match' value='0' />".
"<input type='hidden' name='update_product_id' value='".$product_id."' />";
/*
* get the product type from the database
*/
$get_product_type = $this->connection->prepare("
SELECT type_id, type_name
FROM pro_type " );
$get_product_type->execute();
$get_product_type->bind_result( $type_id, $type_name );
/*
*Create a type select input to create options to choose
*/
echo
"<label class='label'> Choose Product Type </label>".
"<select name='product_type_id' class='text_inpu more_height'>";
while ( $get_product_type->fetch() ){
$product_type_id = $type_id;
echo "<option value='".$product_type_id."'>".$type_name."<option/>";
}
echo "</select>";
echo
"<label class='label'>Gender</label>".
"<select name='gender' class='text_inpu more_height'>".
"<option value='1'>"."Unisex"."</option>".
"<option value='2'>"."Women"."</option>".
"<option value='3'>"."men"."</option>".
"</select>".
"<input type='hidden' name='send_id' value='".$send_id."' />".
"<input type='hidden' name='action_id' value='".$action_id."' />".
"<input type='submit' name='upload_product' value='submit' class='submit_btn ' />".
"</form>";
//close connection
$this->connection->close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }",
"public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $thi... | [
"0.8007528",
"0.79242253",
"0.785443",
"0.784101",
"0.78224367",
"0.76838833",
"0.76838833",
"0.763035",
"0.7558307",
"0.74781287",
"0.74624836",
"0.7396607",
"0.73837435",
"0.7315027",
"0.72926235",
"0.7265415",
"0.7235513",
"0.72241277",
"0.7203779",
"0.71912587",
"0.718955... | 0.0 | -1 |
/ Transport zwrotny zawiera dane jednej lokalizacji | public function location()
{
return $this->belongsTo('App\Location', 'locations_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&gt;po... | [
"0.58881027",
"0.5767705",
"0.57463026",
"0.5723991",
"0.55401945",
"0.55041087",
"0.5450933",
"0.5442134",
"0.54097146",
"0.5392099",
"0.5381406",
"0.5373449",
"0.53617686",
"0.5355803",
"0.5355335",
"0.5350063",
"0.5349428",
"0.53378177",
"0.53183466",
"0.53086555",
"0.5302... | 0.0 | -1 |
/ Transport zwrotny zawiera dane jednego pracownika | public function employee()
{
return $this->belongsTo('App\Employee', 'employee_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function transport() {\n return 'uregrem';\n }",
"function transaccion(){\n\t\t\t$this->conexion = new conexion();\n\t\t\t$this->conn = $this->conexion->enlace();\n\t\t}",
"Function DokumentZalozeniRequest($UdalostiPredchazejici, $ProfilDokumentu, $Autorizace) {\r\n //nastaveni parametru\r\n global... | [
"0.59352565",
"0.58047545",
"0.57636946",
"0.57522947",
"0.56787497",
"0.56667715",
"0.56466097",
"0.56046563",
"0.5603866",
"0.55985093",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",
"0.55806375",... | 0.0 | -1 |
Find all active news | public function findAllActiveWithLocale($locale)
{
$queryBuilder = $this->createQueryBuilder('n');
$queryBuilder
->where('n.active = :active')
->setParameter('active', true)
->orderBy('n.date_display', 'DESC')
;
$query = $queryBuilder->getQuery();
$query->setHint(
Query::HINT_CUSTOM_OUTPUT_WALKER,
'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker'
);
$query->setHint(TranslatableListener::HINT_TRANSLATABLE_LOCALE, $locale);
return $query->getResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getAllNews() {\n $model = new News();\n \n $result= $model->getAll();\n return $result;\n }",
"public static function retrieveAllNews() {\n return R::getAll('SELECT * FROM news');\n }",
"public function getAllLatestNews() {\n return $this->_lat... | [
"0.7518104",
"0.73903733",
"0.7366696",
"0.6982576",
"0.6933417",
"0.6922599",
"0.6922392",
"0.68945146",
"0.6867027",
"0.6812509",
"0.680573",
"0.6785688",
"0.6783361",
"0.67239946",
"0.66640234",
"0.6618863",
"0.65677136",
"0.6567114",
"0.65522915",
"0.6539534",
"0.6527947"... | 0.0 | -1 |
Find all active news | public function findAllWithLocale($locale)
{
$queryBuilder = $this->createQueryBuilder('n');
$queryBuilder
->orderBy('n.date_display', 'DESC')
;
$query = $queryBuilder->getQuery();
$query->setHint(
Query::HINT_CUSTOM_OUTPUT_WALKER,
'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker'
);
$query->setHint(TranslatableListener::HINT_TRANSLATABLE_LOCALE, $locale);
return $query->getResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getAllNews() {\n $model = new News();\n \n $result= $model->getAll();\n return $result;\n }",
"public static function retrieveAllNews() {\n return R::getAll('SELECT * FROM news');\n }",
"public function getAllLatestNews() {\n return $this->_lat... | [
"0.7518104",
"0.73903733",
"0.7366696",
"0.6982576",
"0.6933417",
"0.6922599",
"0.6922392",
"0.68945146",
"0.6867027",
"0.6812509",
"0.680573",
"0.6785688",
"0.6783361",
"0.67239946",
"0.66640234",
"0.6618863",
"0.65677136",
"0.6567114",
"0.65522915",
"0.6539534",
"0.6527947"... | 0.0 | -1 |
/ Get FieldTypes that aren't supported by DashCols | public function getUnsupportedFieldTypes()
{
return array( 'Rich Text', 'Table', 'Matrix' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_field_types()\n {\n }",
"public static function getFieldTypes() {\n\t\treturn self::$FIELD_TYPES;\n\t}",
"public static function getFieldTypes() {\n\t\treturn self::$FIELD_TYPES;\n\t}",
"public static function getFieldTypes() {\n\t\treturn self::$FIELD_TYPES;\n\t}",
"public function getC... | [
"0.7281465",
"0.6923287",
"0.6923287",
"0.6923287",
"0.6826621",
"0.6812844",
"0.67540234",
"0.6718503",
"0.668403",
"0.6551885",
"0.6538861",
"0.6472996",
"0.64675003",
"0.6444275",
"0.640267",
"0.6374321",
"0.6368725",
"0.63615316",
"0.6361297",
"0.6358128",
"0.63580394",
... | 0.74431455 | 0 |
/ Return map of default fields in Craft | public function getDefaultFields( $target = false )
{
$defaultFields = array(
'uri' => Craft::t( 'URI' ),
'postDate' => Craft::t( 'Post Date' ),
'expiryDate' => Craft::t( 'Expiry Date' ),
'section' => Craft::t( 'Section' ),
);
switch ( $target ) {
case 'singles' :
case 'categoryGroup' :
return array_intersect_key( $defaultFields, array_flip( array( 'uri' ) ) );
break;
case 'section' :
return array_intersect_key( $defaultFields, array_flip( array( 'uri', 'postDate', 'expiryDate' ) ) );
break;
default :
return $defaultFields;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function field_default() {\n\t\t\treturn array(\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'theme' => 'monolith',\n\t\t\t\t),\n\t\t\t\t'options' => array(),\n\t\t\t);\n\t\t}",
"protected function field_default() {\n\t\t\treturn array(\n\t\t\t\t'inputmask' => false,\n\t\t\t\t'placeholder' => false,\n\t... | [
"0.70895034",
"0.70774466",
"0.70706004",
"0.70337105",
"0.69641465",
"0.69617873",
"0.6959067",
"0.6901297",
"0.6890203",
"0.68520916",
"0.68091935",
"0.6791535",
"0.6618248",
"0.66087085",
"0.65760183",
"0.6568707",
"0.655304",
"0.6550862",
"0.6529052",
"0.6477395",
"0.6456... | 0.0 | -1 |
/ Return map of metadata fields in Craft | public function getMetaFields( $target = false )
{
$metaFields = array(
'id' => Craft::t( 'ID' ),
'dateUpdated' => Craft::t( 'Updated Date' ),
'authorId' => Craft::t( 'Author' ),
'typeId' => Craft::t( 'Entry Type' ),
);
switch ( $target ) {
case 'categoryGroup' :
return array_intersect_key( $metaFields, array_flip( array( 'id', 'dateUpdated' ) ) );
break;
default :
return $metaFields;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function metadataFields()\n {\n return [\n 'first_name',\n 'last_name',\n 'city',\n 'phone_number',\n 'state',\n 'postal_code',\n 'modified_by'\n ];\n }",
"public function get_metadata() {\n\t\t$metadata = ... | [
"0.74329007",
"0.706743",
"0.70280486",
"0.6939141",
"0.6922535",
"0.68534815",
"0.6751654",
"0.6704475",
"0.664099",
"0.66284835",
"0.66261744",
"0.6583168",
"0.6556382",
"0.65314096",
"0.6530841",
"0.65199614",
"0.65049535",
"0.6490468",
"0.6490468",
"0.6484237",
"0.6469912... | 0.0 | -1 |
/ Get all custom fields | public function getCustomFields()
{
return $this->_customFields ?: array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllCustomFields() : array\n {\n return $this->getAll();\n }",
"public function getCustomFields() {\n }",
"public function getCustomFields() {\n }",
"public function getFormCustomFields(){\n\t}",
"public function getCustomFields()\n {\n return $this->customFie... | [
"0.8274964",
"0.8160087",
"0.8160087",
"0.8038956",
"0.8032602",
"0.8032602",
"0.80239016",
"0.7943402",
"0.77329206",
"0.7657585",
"0.76319444",
"0.7559657",
"0.75156283",
"0.75138754",
"0.7499961",
"0.74336743",
"0.7430449",
"0.7195594",
"0.716986",
"0.7154281",
"0.7154281"... | 0.785412 | 8 |
/ Add custom fields to the cache | public function addCustomFields( $fields )
{
$customFields = $this->getCustomFields();
foreach ( $fields as $field ) {
if ( ! isset( $customFields[ $field->handle ] ) ) {
$customFields[ $field->handle ] = $field;
}
}
$this->_customFields = $customFields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function reCacheCustomFields() : void\n {\n foreach ($this->getAll() as $key => $value) {\n $this->setInRedis($key, $value);\n }\n }",
"protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n ... | [
"0.7196821",
"0.6219057",
"0.620348",
"0.615413",
"0.613446",
"0.60355854",
"0.60291815",
"0.59662825",
"0.59468186",
"0.59078306",
"0.58914393",
"0.58837587",
"0.58808345",
"0.5838609",
"0.5833239",
"0.58251417",
"0.58195424",
"0.5804406",
"0.5745877",
"0.57081306",
"0.56833... | 0.55707794 | 25 |
/ Get custom field by handle | public function getCustomFieldByHandle( $handle )
{
return isset( $this->_customFields[ $handle ] ) ? $this->_customFields[ $handle ] : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_field(/* .... */)\n {\n return $this->_field;\n }",
"function getFieldValue($field);",
"public function getField($field_name);",
"public function fetchField();",
"public abstract function FetchField();",
"public function getField();",
"public function getField();",
"p... | [
"0.6743048",
"0.66129315",
"0.658516",
"0.6584583",
"0.6552164",
"0.6547368",
"0.6547368",
"0.6547368",
"0.64589196",
"0.64382464",
"0.6419736",
"0.64177483",
"0.6411223",
"0.63991964",
"0.6340991",
"0.6310624",
"0.62988573",
"0.62436473",
"0.62436473",
"0.62366986",
"0.62221... | 0.7060629 | 0 |
/ Add a FieldLayoutModel's fields to the cache | public function getCustomFieldsFromFieldLayout( FieldLayoutModel $fieldLayout )
{
$fields = array();
$fieldLayoutFieldModels = $fieldLayout->getFields();
foreach ( $fieldLayoutFieldModels as $fieldLayoutFieldModel ) {
if ( ! in_array( $fieldLayoutFieldModel->field->getFieldType()->name, $this->getUnsupportedFieldTypes() ) ) {
$fields[ $fieldLayoutFieldModel->field->handle ] = $fieldLayoutFieldModel->field;
}
}
return $fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cacheFieldInfo() {}",
"protected function addFieldConfigs()\n {\n\n $this[\"flexibleLayoutProxy\"] = function ($c) {\n return new FlexibleLayoutProxy($c);\n };\n\n }",
"public function addConfigFields(\\MUtil_Model_ModelAbstract $orgModel);",
"private function l... | [
"0.5918488",
"0.57938385",
"0.5698413",
"0.55832916",
"0.5426157",
"0.54191285",
"0.53879297",
"0.5331738",
"0.5304208",
"0.5303813",
"0.52821356",
"0.5208681",
"0.5185324",
"0.51755005",
"0.5166491",
"0.5166137",
"0.5163312",
"0.5156969",
"0.5143783",
"0.51026195",
"0.509268... | 0.0 | -1 |
/ Get all sortable fields | public function getSortableFields()
{
$sortableAttributeTypes = array(
AttributeType::Number,
AttributeType::DateTime,
AttributeType::String,
AttributeType::Bool,
);
$sortableFields = $this->getMetaFields();
$customFields = $this->getCustomFields();
foreach ( $customFields as $handle => $field ) {
$fieldTypeContentAttribute = $field->fieldType->defineContentAttribute();
if ( is_array( $fieldTypeContentAttribute ) ) {
$fieldTypeContentAttribute = array_shift( $fieldTypeContentAttribute );
}
if ( in_array( $fieldTypeContentAttribute, $sortableAttributeTypes ) ) {
$sortableFields[ $handle ] = $field;
}
}
return $sortableFields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sortFields()\n {\n return property_exists($this, 'sortable') ? $this->sortable : [];\n }",
"protected function get_sortable_columns()\n {\n }",
"protected function get_sortable_columns()\n {\n }",
"protected function get_sortable_columns()\n {\n... | [
"0.795977",
"0.6703822",
"0.6703822",
"0.670277",
"0.65621424",
"0.65620124",
"0.6542344",
"0.6506944",
"0.6506915",
"0.65033907",
"0.6495714",
"0.6448686",
"0.6435488",
"0.64239335",
"0.64187163",
"0.6380019",
"0.6378172",
"0.6358737",
"0.63552016",
"0.63318133",
"0.63232094... | 0.75853676 | 1 |
Get the stub file for the generator. | protected function getStub()
{
return __DIR__ . '/Stubs/ServiceProvider.stub';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStubFile(): string\n {\n return $this->getStubFileFromPresetStorage($this->preset, 'seeder.stub');\n }",
"protected function getStub()\n {\n return $this->files->get($this->getStubPath().'/default.stub');\n }",
"public function getStubFile(): string\n {\n ... | [
"0.83574617",
"0.81961524",
"0.81649333",
"0.8128994",
"0.8034211",
"0.8003086",
"0.7956773",
"0.794045",
"0.7909817",
"0.7873063",
"0.7869168",
"0.78583384",
"0.7853997",
"0.7848993",
"0.78454924",
"0.78430194",
"0.78287834",
"0.78240514",
"0.7816454",
"0.78106594",
"0.77890... | 0.71593654 | 98 |
Get the default namespace for the class. | protected function getDefaultNamespace($rootNamespace)
{
return $rootNamespace . '\Modules\\' . $this->baseModule . '\Providers';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultNamespace()\n\t{\n\t\treturn $this->default_namespace;\n\t}",
"public function getDefaultNamespace();",
"abstract public function getDefaultNameSpace();",
"public function getNamespace()\n {\n return $this->getAttribute('metadata.namespace', 'default');\n }",
"public ... | [
"0.8448936",
"0.821764",
"0.7800281",
"0.74542356",
"0.74156207",
"0.7397914",
"0.7362119",
"0.7336174",
"0.72904134",
"0.7272925",
"0.723129",
"0.72085345",
"0.7196747",
"0.7127158",
"0.7018227",
"0.7012884",
"0.69916",
"0.6979542",
"0.69777244",
"0.6956813",
"0.6936764",
... | 0.0 | -1 |
Build the class with the given name. | protected function buildClass($name)
{
$stub = $this->files->get($this->getStub());
$this->replaceModel($stub);
return $this->replaceNamespace($stub, $name)->replaceClass($stub, $name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function buildClass($name)\n {\n return $this->replaceComponentName(parent::buildClass($name));\n }",
"protected function buildClass($name)\n {\n $stub = $this->files->get($this->getStub());\n\n return $this->replaceClass($stub, $name);\n }",
"public function buildCla... | [
"0.81533456",
"0.8070352",
"0.80405176",
"0.8011189",
"0.7959702",
"0.7931643",
"0.7889602",
"0.7861706",
"0.7851589",
"0.78447306",
"0.7825273",
"0.77749634",
"0.7750451",
"0.77387345",
"0.77089214",
"0.76841116",
"0.76594216",
"0.76244134",
"0.7611173",
"0.7603207",
"0.7594... | 0.7932265 | 5 |
Process received transactions data | protected function _processReceivedTransactionData($data = [], $result = [])
{
$key = '';
foreach ($data as $trans) {
if (!$key) {
$key = $trans['time'];
}
$result[$trans['time']] = [
'y' => $trans['time'],
'received' => $trans['credit'],
'spent' => 0,
];
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processTransaction($data){\n\n\t\t$bmtProducts = array( // todo add more products \n\t\t\t91390007 => '50',\n\t\t\t91390006 => '10',\n\t\t\t91390005 => '25',\n\t\t\t91390009 => '100',\n\t\t\t91390008 => '75',\n\t\t\t\n\t\t);\n\t \n\t $sessionId = $data['ccom'];\n\t $pid = $data['productid'];\n\t \... | [
"0.6781948",
"0.6701362",
"0.6361216",
"0.6347485",
"0.620456",
"0.6199414",
"0.61197317",
"0.60036254",
"0.60004485",
"0.59847015",
"0.5842665",
"0.5772446",
"0.57524115",
"0.5746092",
"0.57354873",
"0.57333404",
"0.568481",
"0.56506306",
"0.5636272",
"0.5615098",
"0.5572615... | 0.5544537 | 24 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.