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 |
|---|---|---|---|---|---|---|
Definicion de variables para ejecucion del procedimiento | function modificarAnalisisPorqueDet(){
$this->procedimiento='gem.ft_analisis_porque_det_ime';
$this->transaccion='GM_DET_MOD';
$this->tipo_procedimiento='IME';
//Define los parametros para la funcion
$this->setParametro('id_analisis_porque_det','id_analisis_porque_det','int4');
$this->setParametro('id_analisis_porque','id_analisis_porque','int4');
$this->setParametro('solucion','solucion','varchar');
$this->setParametro('estado_reg','estado_reg','varchar');
$this->setParametro('porque','porque','varchar');
$this->setParametro('respuesta','respuesta','varchar');
//Ejecuta la instruccion
$this->armarConsulta();
$this->ejecutarConsulta();
//Devuelve la respuesta
return $this->respuesta;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t... | [
"0.63404673",
"0.62689656",
"0.6236188",
"0.61963254",
"0.61485535",
"0.60632485",
"0.60158503",
"0.60088146",
"0.6008106",
"0.5993651",
"0.59636974",
"0.59630775",
"0.59587324",
"0.59502906",
"0.59502906",
"0.59502906",
"0.59502906",
"0.59410065",
"0.593854",
"0.5930859",
"0... | 0.0 | -1 |
Definicion de variables para ejecucion del procedimiento | function eliminarAnalisisPorqueDet(){
$this->procedimiento='gem.ft_analisis_porque_det_ime';
$this->transaccion='GM_DET_ELI';
$this->tipo_procedimiento='IME';
//Define los parametros para la funcion
$this->setParametro('id_analisis_porque_det','id_analisis_porque_det','int4');
//Ejecuta la instruccion
$this->armarConsulta();
$this->ejecutarConsulta();
//Devuelve la respuesta
return $this->respuesta;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVariablesEntrada()\r\n\t{\r\n\t\t$request = $this->requestStack->getCurrentRequest();\r\n\t\t\r\n\t\t$this->tipo = $request->get('tipo');\r\n\t\t$this->apoyoTapas = $request->get('apoyoTapas');\r\n\t\t$this->prof = $request->get('prof');\r\n\t\t$this->anchoPanel = $request->get('ancho');\r\n\t\t... | [
"0.63404673",
"0.62689656",
"0.6236188",
"0.61963254",
"0.61485535",
"0.60632485",
"0.60158503",
"0.60088146",
"0.6008106",
"0.5993651",
"0.59636974",
"0.59630775",
"0.59587324",
"0.59502906",
"0.59502906",
"0.59502906",
"0.59502906",
"0.59410065",
"0.593854",
"0.5930859",
"0... | 0.0 | -1 |
Create a new notification instance. | public function __construct()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function create($notification){\n }",
"public static function createNotification($type, $eventid){\n\t\t$notification = new Notification; \n\t\t$notification->type = $type;\n\t\t$notification->eventid = $eventid;\n\t\t$notification->time = date('Y-m-d H:i:s');\n\t\t$notification->save();\n\t\tretu... | [
"0.8276063",
"0.72309536",
"0.7192113",
"0.71250874",
"0.7123231",
"0.70414555",
"0.6982398",
"0.6982398",
"0.6982398",
"0.69165224",
"0.6844303",
"0.68205667",
"0.6801263",
"0.6776018",
"0.6589725",
"0.6531073",
"0.6507233",
"0.65047646",
"0.6503655",
"0.64437956",
"0.641349... | 0.0 | -1 |
Get the notification's delivery channels. | public function via($notifiable)
{
return ['mail'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNotificationChannels()\n {\n if (array_key_exists(\"notificationChannels\", $this->_propDict)) {\n return $this->_propDict[\"notificationChannels\"];\n } else {\n return null;\n }\n }",
"public function getDistributionChannels();",
"public func... | [
"0.78077316",
"0.7333707",
"0.7127785",
"0.7089724",
"0.7087921",
"0.70300424",
"0.69931364",
"0.6973003",
"0.6951073",
"0.6927183",
"0.68472975",
"0.67785895",
"0.6697527",
"0.6530563",
"0.65100604",
"0.6496754",
"0.6474866",
"0.6446399",
"0.643471",
"0.6423392",
"0.64229727... | 0.0 | -1 |
Get the mail representation of the notification. | public function toMail($notifiable)
{
$url = secure_url('/home');
$subject = sprintf('%s: Your Subscription was Successful!', $notifiable->firstname);
$greeting = sprintf('Hello %s!', $notifiable->firstname);
return (new MailMessage)
->subject($subject)
->greeting($greeting)
->salutation('Best regards')
->line('Your subscription to Afribary Scholarships was successful. You can now access information on thousands of international scholarships available to Nigerians.')
->action('Get Started', $url)
->line('We are looking forward giving you the best service!');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNotificationEmail() {}",
"public function toMail($notifiable)\n {\n $mailMessage = (new MailMessage())\n ->error()\n ->subject($this->getMessageText())\n ->line($this->getMessageText());\n\n foreach ($this->getMonitorProperties() as $name => $v... | [
"0.7329682",
"0.73008144",
"0.7279281",
"0.72447264",
"0.7150932",
"0.713269",
"0.71279645",
"0.7124905",
"0.70436907",
"0.70436907",
"0.70436907",
"0.70436907",
"0.70169747",
"0.6981995",
"0.6965215",
"0.69630843",
"0.6962014",
"0.69318545",
"0.692679",
"0.6913696",
"0.69016... | 0.0 | -1 |
Get the array representation of the notification. | public function toArray($notifiable)
{
return [
//
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toArray()\n {\n return [\n 'on' => $this->on,\n 'message' => $this->message,\n 'remaining' => $this->remaining\n ];\n }",
"public function toArray($notifiable)\n {\n return $this->message;\n }",
"public function getAsArray() {\n ... | [
"0.76758885",
"0.76516277",
"0.75636953",
"0.74597746",
"0.7458128",
"0.734528",
"0.73423344",
"0.72810096",
"0.72445726",
"0.7225404",
"0.7216026",
"0.72065705",
"0.71766704",
"0.71498305",
"0.70820516",
"0.70820177",
"0.70782363",
"0.70270497",
"0.70252293",
"0.702143",
"0.... | 0.0 | -1 |
Returns the default options. | public static function get_default_options() {
return array(
'mailgun' => array(
'region' => 'us',
'api_key' => '',
'domain'=> '',
),
'double_opt_in' => '0',
'use_honeypot' => '1',
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultOptions() {\n return static::defaultOptions();\n }",
"public static function getDefaultOptions()\n {\n return self::$defaults;\n }",
"public static function getDefaultOptions()\n {\n return self::$defaults;\n }",
"public function defaultOptions() {\n ... | [
"0.8984043",
"0.89472985",
"0.89472985",
"0.89255154",
"0.8815272",
"0.8815272",
"0.88134605",
"0.8715469",
"0.8533158",
"0.84160185",
"0.83681417",
"0.8311251",
"0.8020589",
"0.7977923",
"0.79202974",
"0.77666",
"0.77374285",
"0.77273804",
"0.7717638",
"0.7711843",
"0.771184... | 0.84350425 | 9 |
Returns the full set of options. | public static function get_options() {
return get_option( 'omnimailer' ) ?: self::get_default_options();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}",
"protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}",
"protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}",
"protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}",
"protected function get... | [
"0.82651615",
"0.8249841",
"0.8249841",
"0.8249841",
"0.8249841",
"0.8249841",
"0.8249841",
"0.8249841",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.82317203",
"0.... | 0.0 | -1 |
Returns a single option or a default value. | public static function get_option( $option, $provider = null, $options = null, $default = false ) {
if( is_null( $options ) )
$options = self::get_options();
if( ! is_null( $provider ) )
return $options[$provider][$option] ?: $default;
return $options[$option] ?: $default;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOption($option, $default = null);",
"public function getOption(string $name, mixed $default = null): mixed;",
"public function getOption($name, $default = NULL);",
"public function getOption($key, $default = NULL);",
"function get_option($option_name, $default_value = false)\n{\n if (... | [
"0.8090809",
"0.7992185",
"0.792235",
"0.7831958",
"0.7804693",
"0.775851",
"0.75745773",
"0.7558324",
"0.7472344",
"0.7433378",
"0.73978025",
"0.738285",
"0.73435485",
"0.72956705",
"0.72638816",
"0.726272",
"0.7249118",
"0.7226512",
"0.72240597",
"0.72008735",
"0.71685785",... | 0.0 | -1 |
Registers available settings with WordPress. Note that get_called_class() must be used to call a static method. | public static function register_settings() {
register_setting( 'omnimailer', 'omnimailer', array( get_called_class(), 'validate_options' ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register_settings(){\n\n\t\t// Register our option\n\t\tregister_setting( 'slack-post-types', 'slack-post-types', array( $this, 'sanitize' ) );\n\n\t\t// Add post post-type as default\n\t\tadd_option( 'slack-post-types', array( 'post' => 1 ) );\n\t}",
"public function register_settings()\n ... | [
"0.7193437",
"0.6992135",
"0.6991059",
"0.69773716",
"0.6961627",
"0.6960646",
"0.6937324",
"0.6858746",
"0.681216",
"0.6698226",
"0.6681473",
"0.66112727",
"0.66100556",
"0.6602855",
"0.65282536",
"0.6524228",
"0.6515486",
"0.6492001",
"0.6427416",
"0.64028984",
"0.640276",
... | 0.5963782 | 79 |
Returns an enableFields SQL statement for the specified table | protected function enableFields($tableName) {
if (TYPO3_MODE === 'FE') {
// Use enableFields in frontend mode
$enableFields = $GLOBALS['TSFE']->sys_page->enableFields($tableName);
} else {
// Use enableFields in backend mode
$enableFields = \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause($tableName);
$enableFields .= \TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields($tableName);
}
return $enableFields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableFields($table) {\n\t\t$ctrl = $GLOBALS['TCA'][$table]['ctrl'];\n\t\t$query = '';\n\t\tif (is_array($ctrl)) {\n\t\t\t\t// Delete field check:\n\t\t\tif ($ctrl['delete']) {\n\t\t\t\t$query .= ' AND ' . $table . '.' . $ctrl['delete'] . ' = 0';\n\t\t\t}\n\n\t\t\t\t// Filter out new place-holder records ... | [
"0.7298381",
"0.6938929",
"0.5947395",
"0.59226626",
"0.5811514",
"0.5807966",
"0.56912017",
"0.561809",
"0.54972714",
"0.5475507",
"0.54003054",
"0.5349946",
"0.52991337",
"0.5286421",
"0.5284635",
"0.5275244",
"0.5268001",
"0.5255614",
"0.5161692",
"0.5155005",
"0.51269406"... | 0.6434263 | 2 |
Escapes a string for use in a database query Note that this function does not add single quotes around the string (see fullQuoteStr()) | protected function quoteStr($string, $tableName = '') {
return $GLOBALS['TYPO3_DB']->quoteStr($string, $tableName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function escapeString($stringToEscape);",
"public function escape($string) {\n\t\t\treturn str_replace(\"'\", \"''\", $string);\n\t\t}",
"public function escape($string);",
"public function escape($string);",
"function escape($str) {\n $str = get_magic_quotes_gpc()?stripslashes($str):$str;\n ... | [
"0.81385463",
"0.8009989",
"0.7963388",
"0.7963388",
"0.79240566",
"0.7844677",
"0.7810136",
"0.7797099",
"0.7790993",
"0.7779611",
"0.7779245",
"0.7767277",
"0.7713929",
"0.77138746",
"0.7660083",
"0.7654411",
"0.7639411",
"0.7608654",
"0.7602519",
"0.759419",
"0.7577928",
... | 0.0 | -1 |
Returns an SQL statement that checks for one or multiple storage PIDs | protected function storagePidStatement(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query, $tableName = '') {
// Get allowed storage pids
$storagePids = $query->getQuerySettings()->getStoragePageIds();
// Sanitize them (just to be sure)
$storagePids = array_map('intval', $storagePids);
// Generate SQL
$tableField = ($tableName) ? $tableName . '.pid' : 'pid';
return " AND $tableField IN (" . implode(', ', $storagePids) . ') ';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getStoragePids();",
"function db_checkCSID($csid) {\n $conn = OpenCon();\n \n //$stmt->bind_param( \"ss\", $table_name, $csid );\n $tables = array( 'admin', 'aio', 'professor', 'student' );\n foreach( $tables as $table_name ) {\n\n $st = \"SELECT * FROM `$table_name` ... | [
"0.52852386",
"0.50307095",
"0.4760972",
"0.47188503",
"0.468266",
"0.46733648",
"0.46633515",
"0.46529123",
"0.46493667",
"0.4648606",
"0.46412587",
"0.4600992",
"0.4567939",
"0.45642945",
"0.4555683",
"0.45416847",
"0.45220962",
"0.45220962",
"0.45021865",
"0.44996247",
"0.... | 0.578123 | 0 |
Debug an extbase query result. Before debugging the query you must execute it. ($query>execute()) | public function debugQuery(\TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $queryResult) {
$GLOBALS['TYPO3_DB']->debugOuput = 2;
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;
$queryResult->toArray();
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($GLOBALS['TYPO3_DB']->debug_lastBuiltQuery);
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = false;
$GLOBALS['TYPO3_DB']->explainOutput = false;
$GLOBALS['TYPO3_DB']->debugOuput = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function queryDebug($resultVar){\n\tif (!$resultVar) {\n\t\t$message = 'Invalid query: ' . mysql_error() . \"\\n\";\n\t\t$message .= 'Whole query: ' . $query;\n\t\tdie($message);\n\t}\n}",
"public function debug(){\r\n $this->db->debugMode(function($args){\r\n echo ($args[\"query\"]);\r\n ... | [
"0.67332107",
"0.67195904",
"0.66700304",
"0.64472026",
"0.6435239",
"0.6428209",
"0.63536006",
"0.6341092",
"0.63402104",
"0.63164425",
"0.6301908",
"0.63003266",
"0.62771124",
"0.6272097",
"0.6268642",
"0.62641454",
"0.62490714",
"0.62346864",
"0.6230715",
"0.6230699",
"0.6... | 0.7498202 | 0 |
Find all foreign UIDs from a mm relation. The direction in extbase is not bidirectional. You can configure a bidirectional relation about tca configuration | protected function findUidByForeign($foreign, $table) {
$in = [];
$uid = [];
// we working only with a Traversable items
if($foreign instanceof \TYPO3\CMS\Extbase\DomainObject\AbstractEntity) {
$entity = clone $foreign;
$foreign = [$entity];
}
foreach($foreign as $key) {
if($key instanceof \TYPO3\CMS\Extbase\DomainObject\AbstractEntity) {
$in[] = (int) $key->getUid();
} else {
$in[] = (int) $key;
}
}
foreach($GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
$table . '.uid_foreign AS uid',
$table,
$table . '.uid_local IN (' . implode(',', $in) . ')'
) as $row) {
$uid[] = (int) $row['uid'];
}
return $uid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getResolveForeignIdFields();",
"public function getForeignReferList()\n\t{\n\t\treturn Yii::app()->db->createCommand()->select('code as key, printable_name as title')->from(self::tableName())->queryAll();\n\t}",
"public function findForeignIDs($model) \r\n {\r\n foreach($model-... | [
"0.64714414",
"0.5852523",
"0.54760313",
"0.52834326",
"0.51122665",
"0.5063405",
"0.5060649",
"0.5060649",
"0.5057215",
"0.5013246",
"0.49999055",
"0.49841198",
"0.4979048",
"0.496881",
"0.4931447",
"0.49160773",
"0.48714277",
"0.485828",
"0.4851337",
"0.48500666",
"0.484526... | 0.5653487 | 2 |
Create a in uid query part. $query>in(uid, $uid) not working | public function inUid(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query, $uid) {
$or = [];
foreach($uid as $single) {
$or[] = $query->equals('uid', $single);
}
return $query->logicalAnd($query->logicalOr($or));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_users_in($itemids) {}",
"public function in($column,$val);",
"public function where_emp_in($emp) {\n\t\t$this->db->where_in('ID', $emp);\n\t}",
"public function setUidListConstraint(Tx_Extbase_Persistence_QueryInterface $query) {\n\t\t$idList = (empty($this->uidList)) ? array('0') ... | [
"0.6495714",
"0.5879846",
"0.5753212",
"0.5721153",
"0.56351167",
"0.5502334",
"0.5445983",
"0.5370739",
"0.5366118",
"0.5342043",
"0.52690643",
"0.526707",
"0.52370226",
"0.52168655",
"0.5216827",
"0.5216827",
"0.5216826",
"0.5212076",
"0.5195517",
"0.5193435",
"0.51743174",... | 0.7238444 | 0 |
Get auth role id | public function can($permission_slug, $auth_id){
$role_id = $this->hasRole($auth_id);
if($role_id == 1){
return true;
}
$roles = $this->has_permission($role_id, $permission_slug);
if(count($roles) > 0) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getRoleID()\n {\n return self::getInstance()->_getRoleID();\n }",
"public function _getRoleID()\n {\n $this->selftest();\n return $this->objectUser->RoleID;\n }",
"function get_role_id(){\n return $this->role_id;\n }",
"public function getRole... | [
"0.82005644",
"0.80408925",
"0.8031758",
"0.7941389",
"0.7857301",
"0.78206444",
"0.78206444",
"0.780773",
"0.7767318",
"0.76720816",
"0.76720816",
"0.76720816",
"0.76661974",
"0.7645287",
"0.76444864",
"0.7622688",
"0.75823206",
"0.7536513",
"0.751394",
"0.7466578",
"0.74618... | 0.0 | -1 |
Run the database seeds. | public function run()
{
// $this->call(UsersTableSeeder::class);
DB::table('users')->insert([
'name' => 'Lumina',
'email' => 'lumina.lye@gmail.com',
'password' => Hash::make('Moon2202')
]);
} | {
"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 |
try to connect to Oracle student database | function display_existing_report_info_user($login, $password, $report)
{
$conn = hsu_conn_sess($login, $password);
$report_query = 'SELECT REPORT_ID, START_TIME, END_TIME, REPORT_DATE, BEACH_NAME, SURVEY_SUMMARY '.
'FROM REPORTS, BEACHES '.
'WHERE REPORTS.BEACH_ABBR = BEACHES.BEACH_ABBR '.
'AND REPORT_ID = :REPORT';
$query_stmt = oci_parse($conn, $report_query);
oci_bind_by_name($query_stmt, ":report", $report);
oci_execute($query_stmt, OCI_DEFAULT);
oci_fetch($query_stmt);
?>
<form class="form-inline" action="<?= htmlentities($_SERVER['PHP_SELF'],ENT_QUOTES) ?>" method="post">
<div class="form-group">
<fieldset>
<legend> Report Details </legend>
<p name="report_details">
Report ID : <?= oci_result($query_stmt, "REPORT_ID"); ?> <br>
Beach : <?= oci_result($query_stmt, "BEACH_NAME"); ?> <br>
Date : <?= oci_result($query_stmt, "REPORT_DATE"); ?> <br>
Start Time: <?= oci_result($query_stmt, "START_TIME"); ?> <br>
End Time: <?= oci_result($query_stmt, "END_TIME"); ?> <br>
Survey Summary: <?= oci_result($query_stmt, "SURVEY_SUMMARY"); ?> <br>
</p>
<?php
oci_free_statement($query_stmt);
$entries_query = 'SELECT PRN, HSU_USERNAME, SPEC_NAME, POST_SURVEY_TAG, '.
'EXISTING_TAGS, PHOTOS, COMMENTS '.
'FROM REPORT_ENTRIES, SPECIES '.
'WHERE REPORT_ENTRIES.SPECIES_ABBR = SPECIES.SPEC_ABBR '.
'AND REPORT_ID = :REPORT';
/* $entries_query = 'SELECT PRN, HSU_USERNAME, SPECIES_ABBR, COMMENTS '.
'FROM REPORT_ENTRIES '.
'WHERE REPORT_ID = :REPORT '; */
$entries_stmt = oci_parse($conn, $entries_query);
oci_bind_by_name($entries_stmt, ":report", $report);
oci_execute($entries_stmt, OCI_DEFAULT);
?>
<fieldset>
<legend> Entries </legend>
<?php
$entry_count = 0;
while(oci_fetch($entries_stmt))
{
$entry_count = $entry_count + 1;
$curr_prn = oci_result($entries_stmt, "PRN");
$curr_user = oci_result($entries_stmt, "HSU_USERNAME");
$curr_species = oci_result($entries_stmt, "SPEC_NAME");
//$curr_species = oci_result($entries_stmt, "SPEC_ABBR");
$curr_surv_tag = oci_result($entries_stmt, "POST_SURVEY_TAG");
$curr_exist_tag = oci_result($entries_stmt, "EXISTING_TAGS");
$curr_photos = oci_result($entries_stmt, "PHOTOS");
$curr_comments = oci_result($entries_stmt, "COMMENTS");
?>
<label for="entries"> Entry #<?=$entry_count?> </label>
<p name="entry_details">
PRN : <?= $curr_prn ?> <br>
Surveyor : <?= $curr_user ?> <br>
Species : <?= $curr_species ?> <br>
Existing Tags? : <?= $curr_exist_tag ?> <br>
Post Survey Tag? : <?= $curr_surv_tag ?> <br>
Photos? : <?= $curr_photos ?> <br>
Comments : <?= $curr_comments ?> <br>
</p>
<?php
}
oci_free_statement($entries_stmt);
?>
</fieldset>
<input type="submit" name="report_view_by_user" value="Go Back" />
<input type="submit" name="main_menu" value="Main Menu" />
</fieldset>
</div>
</form>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function connect() {\n\t \t\tif (!extension_loaded('oci8')) {\n\t throw new SQLException('OCI8 extension not loaded');\n\t }\t\t\n\t\t\t$dsn = $this->dsn;\n\n\t\t\t$user = $dsn['username'];\n\t\t\t$pass = $dsn['password'];\n\t\t\t$hostspec = $dsn['hostspec'];\n\t\t\t$db\t= $dsn['database']... | [
"0.6856202",
"0.67402124",
"0.6715765",
"0.63425374",
"0.6245188",
"0.6209207",
"0.61815095",
"0.61412513",
"0.6093673",
"0.6087111",
"0.6046567",
"0.60428005",
"0.6042266",
"0.601571",
"0.59979504",
"0.59731007",
"0.5924299",
"0.5902829",
"0.5896106",
"0.58872205",
"0.587706... | 0.0 | -1 |
/CLEAN UP A VAR BEFORE SENDING IT TO OUTPUT OR DATABASE | function IsValid_Variable($MyVar2Test,$DefaultValue='')
{
$MyVar = (trim(strip_tags(stripslashes($MyVar2Test)))!='') ? trim(strip_tags(stripslashes(($MyVar2Test)))) : $DefaultValue ;
return $MyVar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _clearAndOutput() {}",
"public function cleanUp()\n {\n $this->_value = null;\n }",
"public function cleanUp();",
"public function cleanUp();",
"public function cleanUp();",
"public function clean()\n\t{\n\t\t$this->buffer = '';\t\t\n\t}",
"protected function _flushVars(... | [
"0.6310301",
"0.62213916",
"0.61734754",
"0.61734754",
"0.61734754",
"0.60790753",
"0.59778893",
"0.5945205",
"0.5945205",
"0.5945205",
"0.5945205",
"0.5945205",
"0.5945205",
"0.5945205",
"0.5944071",
"0.5944071",
"0.5944071",
"0.5944071",
"0.5944071",
"0.5944071",
"0.5944071... | 0.0 | -1 |
Display a listing of the resource. | public function index(SponsorFilters $filters)
{
$sponsors = Sponsor::filter($filters);
return SponsorResource::collection($sponsors);
} | {
"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 |
Store a newly created resource in storage. | public function store(SponsorResourceRequest $request)
{
return new SponsorResource($request->persist());
} | {
"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(Sponsor $sponsor)
{
return new SponsorResource($sponsor);
} | {
"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 |
Update the specified resource in storage. | public function update(SponsorResourceRequest $request, Sponsor $sponsor)
{
return new SponsorResource($request->persist($sponsor));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"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 |
Display a listing of the resource. | public function index()
{
//
$cc=ColoniaCaserio::BarCan();
return view('ColoniaCaserio.index',compact('cc'));
} | {
"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('ColoniaCaserio.create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.717428... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
$file = Input::file('nombre_img');
//Creamos una instancia de la libreria instalada
$image = \Image::make(\Input::file('nombre_img'));
//Ruta donde queremos guardar las imagenes
$path = public_path().'/imagenesColoniasCaserios/';
// Guardar Original
$image->save($path.$file->getClientOriginalName());
ColoniaCaserio::create([
'nombre'=>$request['nombre'],
'idCC'=>$request['id'],
'nombre_img'=>$file->getClientOriginalName(),
]);
\Kairos\Bitacora::bitacora("Se registro : ".$request['nombre']);
return redirect('/coloniaCaserio')->with('message','create');
} | {
"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($id)
{
$cc=ColoniaCaserio::find($id);
return view('ColoniaCaserio.edit',compact('cc'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$aux=$request['hi2'];
$cc = ColoniaCaserio::find($id);
if($aux=='4'){
$file = Input::file('nombre_img');
//Creamos una instancia de la libreria instalada
$image = \Image::make(\Input::file('nombre_img'));
//Ruta donde queremos guardar las imagenes
$path = public_path().'/imagenesColoniasCaserios/';
// Guardar Original
$image->save($path.$file->getClientOriginalName());
$cc->nombre_img=$file->getClientOriginalName();
}
else{
$cc->nombre=$request['nombre'];
}
$cc->save();
\Kairos\Bitacora::bitacora("Se modifico : ".$request['nombre']);
Session::flash('mensaje','¡Registro Actualizado!');
return redirect::to('/coloniaCaserio')->with('message','update');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"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 |
default function (wrong parameters) | function def($param)
{
//a. a default function incase anything was called unexpectedly
return "\033[91m" .print_r($param). "InputError: \033[0m ".
"\033[31mI require atleast a single paramater. \033[0m ".
"add the correct parameter --action=help \n";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function func_default() {}",
"public function _default()\n {\n $_func_name = $this->_default_func;\n $this->$_func_name();\n }",
"function define_default($param, $value) {\n\t\t//\n\t}",
"public function getDefault();",
"public function applyDefaultValues()\n\t{\n\t}",
"publ... | [
"0.85506386",
"0.72398055",
"0.6918609",
"0.6867501",
"0.6800385",
"0.6800385",
"0.6800385",
"0.67468464",
"0.66977906",
"0.6640529",
"0.6619597",
"0.6611857",
"0.65598464",
"0.64451367",
"0.64451367",
"0.6417924",
"0.63643",
"0.63271976",
"0.6274695",
"0.62465084",
"0.623950... | 0.5809888 | 47 |
Remove a student record from the file | function help()
{
return
"\n -------------------------------------------------------------------------\n".
" ---- ~ BidVest Data : Assessment Commands ~ -------\n".
" -------------------------------------------------------------------------\n\n".
" All comamnds begin with '\e[1m\033[92mphp run.php\033[0m'\e[0m\n".
" Then append of the folling options: \n".
" -------------------------------------------------------------------------\n".
"\n\n".
" 1. \e[1m --action=\033[34madd \033[0m \e[0m : \e[3mThis allows you to add a record.\e[0m \n\n".
" 2. \e[1m --action=\033[33medit \033[0m \e[1m--id=<vaild_id>\e[0m \e[0m : \e[3mEdit a student record.\e[0m \n\n".
" (leave filed blank to keep previous value)\n\n".
" 3. \e[1m --action=\033[91mdelete\033[0m \e[1m--id=<vaild_id>\e[0m \e[0m : \e[3mDelete a student record (remove file only).\e[0m \n\n".
" 4. \e[1m --action=\033[36msearch \033[0m \e[0m : \e[3mSearch for a student record. \e[0m \n\n".
" -------------------------------------------------------------------------\n\n".
" Where \e[1m<valid_id>\e[0m must be an 8-digit number.\n\n".
" -------------------------------------------------------------------------\n";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function deleteFileRecord($fileName) {\n /** @var URLRequest $record */\n $record = URLRequest::where('fileName', $fileName)->first();\n shell_exec('cd /Stream && sudo rm ' . $record->fileName);//Remove the file from the /Stream directory.\n $record->delete(); //Delete $record f... | [
"0.64361817",
"0.60772014",
"0.6060365",
"0.60162276",
"0.60119575",
"0.6002251",
"0.5964741",
"0.5884228",
"0.5871385",
"0.5852393",
"0.58314866",
"0.5815117",
"0.5789033",
"0.57733095",
"0.57686245",
"0.5760568",
"0.57599443",
"0.5746159",
"0.5715588",
"0.57068044",
"0.5688... | 0.0 | -1 |
Remove a student record from the file | function add()
{
//-- 1. create a student record.(Number must be seven chars)
$student = new stdClass();
echo "\n Enter id:";
$student->student_id = trim(fgets(STDIN));
$exists = 0;
foreach ($students as $Student => $id) {
if($student->student_id == $id)
{
$exists = 1;
}
};
if( $exists == 0 && is_numeric($student->student_id) && strlen((string)$student->student_id)>7)
{
echo " Enter name:";
$student->name = trim(fgets(STDIN));
echo " Enter surname:";
$student->surname = trim(fgets(STDIN));
echo " Enter age:";
$student->age = trim(fgets(STDIN));
echo " Enter curriculum:";
$student->curriculum = trim(fgets(STDIN));
$content = json_encode($student);
$dir = "students/".substr($student->student_id,0,2);
mkdir($dir,0777,true);
$record = fopen($_SERVER['DOCUMENT_ROOT'] . $dir ."/". $student->student_id. ".json","wb");
if (!$record) {
err("file already exists");
}
fwrite($record,$content);
fclose($record);
echo "\n \033[32m A student(".$student->student_id.") was just created succesfully in!!\033[0m";
} else {
if($exists == 1)
err("A Student Id number\033[0m already exists.");
elseif (!is_numeric($student->student_id))
err("This Student Id number\033[0m isn't a number.");
else
err("A Student Id number\033[0m must have more than 7 numeric characters");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function deleteFileRecord($fileName) {\n /** @var URLRequest $record */\n $record = URLRequest::where('fileName', $fileName)->first();\n shell_exec('cd /Stream && sudo rm ' . $record->fileName);//Remove the file from the /Stream directory.\n $record->delete(); //Delete $record f... | [
"0.64361817",
"0.60772014",
"0.6060365",
"0.60162276",
"0.60119575",
"0.6002251",
"0.5964741",
"0.5884228",
"0.5871385",
"0.5852393",
"0.58314866",
"0.5815117",
"0.5789033",
"0.57733095",
"0.57686245",
"0.5760568",
"0.57599443",
"0.5746159",
"0.5715588",
"0.57068044",
"0.5688... | 0.0 | -1 |
Edit a student record in the file (green return text) | function edit($id)
{
// a. find the student record in question
$dir = "students/".substr($id,0,2);
$student_arr = file( $dir ."/". $id. ".json");
$previous_student_arr = $student_arr;
$previous_student_arr = json_decode($previous_student_arr[0]);
$student_arr = json_decode($student_arr[0]);
$keep = "";
echo " [".$student_arr->name."] Enter name:";
$keep = fgetc(STDIN);
if($keep!="\n") {
$student_arr->name = trim(fgets(STDIN));
}
echo " [".$student_arr->surname."] Enter surname:";
$keep = fgetc(STDIN);
if($keep!="\n") {
$student_arr->name = trim(fgets(STDIN));
}
echo " [".$student_arr->age."] Enter age:";
$keep = fgetc(STDIN);
if($keep!="\n") {
$student_arr->age = trim(fgets(STDIN));
}
echo " [".$student_arr->curriculum."] Enter curriculum:";
$keep = fgetc(STDIN);
if($keep!="\n") {
$student_arr->curriculum = trim(fgets(STDIN));
}
$dir = "students/".substr($student_arr->student_id,0,2);
print_r($student_arr);
$record = fopen($_SERVER['DOCUMENT_ROOT'] . $dir ."/". $student_arr->student_id . ".json","wb");
fwrite($record,json_encode($student_arr,true));
fclose($record);
print_r($previous_student_arr);
if($previous_student_arr==$student_arr){
echo "\33[34m Editing of student (" .$student_arr->student_id. ") succesful. \33[0m";
} else {
echo "This student didn't change anything.";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(ReadingRecord $readingRecord)\n {\n //\n }",
"public function edit(Student $student)\n {\n //\n }",
"public function edit(Student $student)\n {\n //\n }",
"public function edit(Student $student)\n {\n //\n }",
"public function edit(St... | [
"0.63576794",
"0.61951625",
"0.61951625",
"0.61951625",
"0.61951625",
"0.61951625",
"0.61951625",
"0.61951625",
"0.61951625",
"0.59537905",
"0.5950145",
"0.59412473",
"0.5887603",
"0.58696836",
"0.5851138",
"0.5836256",
"0.5819414",
"0.5807374",
"0.5786073",
"0.5781609",
"0.5... | 0.64862144 | 0 |
Remove a student record from the file (red return text) | function delete($id)
{
// a. first find the file in question.
$search_val = find_by_val("student_id",$id);
$dir = "students/".substr($id,0,2);
$delete_location = $_SERVER['DOCUMENT_ROOT'] . $dir ."/". $id. ".json";
// b. remove the file not the folder
if (!unlink($delete_location)) {
err("$delete_location \00[0m cannot be deleted due to an error");
}
else {
err("$delete_location \33[0m has been deleted");
}
// c. if a folder is empty then it must be removed
if (is_dir_empty($dir)) {
rmdir($_SERVER['DOCUMENT_ROOT'] . $dir ."/");
}
if(!empty($search_val))
echo "\33[34m Your Student \33[34m has been deleted \33[34m succesfully. \33[0m";
else
err("Value non-existent \33[34m Are you sure these are the correct search values? Please try again. ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remove_passwords($term) {\n\tglobal $samba_share;\n\t$file=$samba_share.$term.'_users_stu.csv';\n\tif (file_exists($file)) {\n\n\t\t$stu_file=file_get_contents($file);\n\t\t$student_users=explode(\"\\n\",$stu_file);\n\t\t$writeit=\"\";\n\t\tforeach ($student_users as $line) {\n\t\t\t$line=preg_replace('/\... | [
"0.63940316",
"0.6157597",
"0.609182",
"0.60761863",
"0.59994024",
"0.59141207",
"0.59031403",
"0.586917",
"0.58564085",
"0.5855205",
"0.5754017",
"0.5734922",
"0.5732191",
"0.56697124",
"0.56641114",
"0.56093967",
"0.5572034",
"0.55512226",
"0.5548376",
"0.55343753",
"0.5532... | 0.58972216 | 7 |
Search if a Student Record Exist output that it does if it does. If it doesn't exist let the user know (blue return text) | function search()
{
//-- a. seek the file ensure if it doesn't exist let the user know.
echo "Enter Search Criteria: ";
$search_info = trim(fgets(STDIN));
$search_data = explode("-",$search_info);
$field = $search_data[0];
$value = $search_data[1];
//
$search_val = find_by_val($field,$value);
if(!empty($search_val))
echo "\33[34m Your Student has been found succesful. \33[0m";
else
err("Value non-existent \33[34m Are you sure these are the correct search values? Please try again. ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isstudentsExisting ($student_number){\n $sqlQuery = \"SELECT count (*) as isExisting \";\n $sqlQuery .= \"FROM students \";\n $sqlQuery .= \"WHERE student_number= $student_number\";\n $result = $this -> getDbManager() -> executeSelectQuery ( $sqlQuery );\n if ( $result [0][ \" isExisting \"] == 1) ... | [
"0.6216964",
"0.62045556",
"0.6144942",
"0.6064677",
"0.5920059",
"0.590486",
"0.5877793",
"0.5803156",
"0.569305",
"0.5676236",
"0.56665653",
"0.5662382",
"0.5643325",
"0.5638065",
"0.5577599",
"0.55540854",
"0.5552079",
"0.55405957",
"0.5539774",
"0.5531627",
"0.5506155",
... | 0.5726374 | 8 |
Scan & store all students that exist in all the records. Basically get all student ids(filenames) in each folder. | function find_by_val($field,$value)
{
$arr1=[];
$found=[];
$seek = scan_students();
foreach ($seek as $student => $id) {
$dir = "students/".substr($id,0,2);
$arr1 = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . $dir ."/". $id. ".json"),true);
if($arr1[$field] == $value) { $found = $arr1;}
}
if(!empty($found))
echo print_r($found);
else
err("Student Not Found.\00[0m This student doesn't exist.");
return $found;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scan_students()\n {\n $current_students = [];\n $di = new RecursiveDirectoryIterator('students/');\n foreach (new RecursiveIteratorIterator($di) as $filename => $file) {\n $path_info = pathinfo($filename);\n if($path_info['extension']=='json'){\n array_push($current_student... | [
"0.6626312",
"0.5772552",
"0.5551689",
"0.5516066",
"0.54075825",
"0.5361266",
"0.53024673",
"0.5262366",
"0.52584785",
"0.5188217",
"0.51165456",
"0.51117533",
"0.50930315",
"0.50889266",
"0.5075992",
"0.507278",
"0.5050092",
"0.50408554",
"0.5021227",
"0.5010898",
"0.499748... | 0.5496636 | 4 |
Scan & store all students that exist in all the records. Basically get all student ids(filenames) in each folder. | function scan_students()
{
$current_students = [];
$di = new RecursiveDirectoryIterator('students/');
foreach (new RecursiveIteratorIterator($di) as $filename => $file) {
$path_info = pathinfo($filename);
if($path_info['extension']=='json'){
array_push($current_students,$path_info['filename']);
}
}
// echo print_r($current_students);
return $current_students;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function scanFolder()\n {\n return scandir($this->currentPath);\n }",
"function scan_files( ){\n\n // List of all the audio files found in the directory and sub-directories\n $audioFileArray = array();\n\n // List of filenames already handled during the scan. To detect d... | [
"0.57698435",
"0.5550492",
"0.55180883",
"0.5496296",
"0.5408772",
"0.5361843",
"0.5304064",
"0.52624863",
"0.526012",
"0.5188724",
"0.51179993",
"0.511087",
"0.5094498",
"0.50861484",
"0.5077359",
"0.50752896",
"0.50510573",
"0.50421214",
"0.5021373",
"0.50137556",
"0.499856... | 0.6625037 | 0 |
Sensure a directory is empty beore removing it. | function is_dir_empty($diectory)
{
if (!is_dir($diectory)) return false;
foreach (scandir($diectory) as $dir)
{
if (!in_array($dir, ['.','..','.json'])) return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear_directory($dir_path)\n{\n $dir = @opendir($dir_path);\n if(!$dir) return FALSE;\n\n while ($file = readdir($dir))\n if (strlen($file)>2)\n unlink(\"$dir_path/$file\");\n\n closedir($dir);\n return TRUE;\n}",
"function empty_dir($dir) {\n $iterator = new RecursiveIteratorIterato... | [
"0.69822717",
"0.68900925",
"0.6833278",
"0.68303496",
"0.67394084",
"0.6573315",
"0.65600204",
"0.6551564",
"0.65309227",
"0.653",
"0.6487482",
"0.643801",
"0.64371556",
"0.6404532",
"0.6403065",
"0.6378778",
"0.637524",
"0.63386786",
"0.6327002",
"0.6317663",
"0.6314302",
... | 0.0 | -1 |
Get Order by an OrderNumber | public function getById($orderlineId); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function fetchOrderModel(string $orderNumber): Order\n {\n /** @var Order $order */\n $order = Bootstrap::getObjectManager()->get(Order::class);\n $order->loadByIncrementId($orderNumber);\n return $order;\n }",
"public static function getOrderIdByOrderNumber($orderNumber... | [
"0.7427878",
"0.7353671",
"0.68314254",
"0.68314254",
"0.67587936",
"0.6755244",
"0.66848737",
"0.65451616",
"0.650618",
"0.6461843",
"0.6460398",
"0.6456172",
"0.64149725",
"0.6347064",
"0.6323347",
"0.6320527",
"0.6320527",
"0.6320527",
"0.6310595",
"0.6280282",
"0.6267892"... | 0.5580548 | 86 |
Delete a Order by an OrderNumber | public function deleteById($orderlineId); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteOrder($order_id);",
"function deleteOrder($orderId);",
"public function deleting(Order $Order)\n {\n //code...\n }",
"public function deleteOrderDetails($product_code,$order_id=NULL,$quantity,$token=NULL);",
"public function deleted(Order $Order)\n {\n //code...... | [
"0.76382196",
"0.7599958",
"0.72785854",
"0.6903683",
"0.67808634",
"0.674524",
"0.674524",
"0.6722107",
"0.671904",
"0.66062057",
"0.66048974",
"0.6599808",
"0.6599808",
"0.64452493",
"0.64338654",
"0.6430342",
"0.64131606",
"0.6408023",
"0.63942975",
"0.63826406",
"0.636837... | 0.6960964 | 3 |
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget. | public function search($const = false)
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria = new CDbCriteria;
$criteria->compare('title', $this->title, true);
$criteria->compare('status', $this->status);
$criteria->compare('const_query', $const?1:0);
return new CActiveDataProvider($this, array(
'criteria' => $criteria,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object... | [
"0.72127825",
"0.7136067",
"0.7093868",
"0.7092793",
"0.69851667",
"0.69601536",
"0.69477975",
"0.6940818",
"0.69330317",
"0.6923378",
"0.690978",
"0.69027317",
"0.68979496",
"0.68971545",
"0.6892498",
"0.688223",
"0.68793845",
"0.6873633",
"0.6848405",
"0.68481565",
"0.68344... | 0.0 | -1 |
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants! | public static function model($className = __CLASS__)
{
return parent::model($className);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function model() {\n return parent::model(get_called_class());\n }",
"public function model()\r\n {\r\n return static::class;\r\n }",
"public static function model($className=__CLASS__) { return parent::model($className); }",
"public static function model($className=__CLA... | [
"0.7574005",
"0.7528819",
"0.7270635",
"0.7269363",
"0.72611624",
"0.7211197",
"0.72105455",
"0.7130912",
"0.7127844",
"0.7127844",
"0.7101899",
"0.7101899",
"0.7101485",
"0.70736724",
"0.70631427",
"0.70631427",
"0.70631427",
"0.70631427",
"0.70631427",
"0.70631427",
"0.7063... | 0.0 | -1 |
Getting the last Id | public function submitAddPortfolio(Request $request) {
$lastid = Portfolio::select('id')->orderBy('id', 'desc')->first();
if (empty($lastid['id']))
$lastid = 1;
else {
$lastid = $lastid['id'] + 1;
}
// end
$rules = [
'filename' => 'required',
'title' => 'required',
'pdetails' => 'required',
'link' => 'required',
];
$messages = [
'required' => 'This field is required',
];
$validator = Validator:: make($request->all(), $rules, $messages);
if ($validator->fails()) {
return Redirect::to('addportfolio')->withErrors($validator)->withInput();
} else {
if ($request->isMethod('post')) {
$table = new Portfolio();
// upload the image
$image = $request->file('filename');
$portfolioextension = $request->file('filename')->getClientOriginalExtension();
$imageRealPath = $image->getRealPath();
$img = Image::make($imageRealPath);
$path = public_path('dist/portfolio/');
if (!File::exists($path))
File::makeDirectory($path, 0777, true);
$img->save(public_path('dist/portfolio') . '/' . $lastid . '.' . $portfolioextension);
chmod(public_path('dist/portfolio') . '/' . $lastid . '.' . $portfolioextension, 0777);
$table->image = '/dist/portfolio/' . $lastid . '.' . $portfolioextension;
$table->title = $request->input('title');
$table->link = $request->input('link');
$table->details = $request->input('pdetails');
$table->save();
return Redirect::back();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastId();",
"public function getLastId();",
"public function lastId();",
"public function lastId(){\n return $this->lastId;\n }",
"public function lastId()\r\n {\r\n return $this->getKey('last_id');\r\n }",
"function get_last_id()\n {\n // TODO: Impleme... | [
"0.9115486",
"0.9115486",
"0.91010386",
"0.88181263",
"0.8676524",
"0.86586565",
"0.8576924",
"0.8508489",
"0.84644306",
"0.8443903",
"0.84314585",
"0.84215254",
"0.8396023",
"0.8388422",
"0.834308",
"0.8329831",
"0.8299534",
"0.82903117",
"0.8264374",
"0.8206549",
"0.8189418... | 0.0 | -1 |
Constructs a new DibsPaytypesEvent. | public function __construct(array $paytypes) {
$this->paytypes = $paytypes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEventTypes()\n {\n return new EventTypes(array('order_name' => true));\n }",
"protected function _generateEventLabels()\n {\n if (!self::$_eventList) {\n self::$_eventList = array(\n 'T0000' => Mage::helper('paypal')->__('General: received payment o... | [
"0.50240695",
"0.4963597",
"0.49189267",
"0.47831592",
"0.47248018",
"0.46664563",
"0.46566236",
"0.4607767",
"0.4572097",
"0.4561144",
"0.4555454",
"0.45304328",
"0.4503911",
"0.44528607",
"0.44373566",
"0.4425131",
"0.44250995",
"0.44071388",
"0.44009224",
"0.44007167",
"0.... | 0.5629286 | 0 |
Display a listing of the resource. | public function index()
{
return Brand::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 |
Store a newly created resource in storage. | public function store(Request $request)
{
// return $request->all();
$this->validate($request, [
'name' => ['required']
]);
$name = $request->name;
$slug = Str::slug($name);
if($request->destaca){
$destaca = $request->destaca;
}else{
$destaca = 1;
};
$destaca = $request->destaca;
$description= $request->description;
$validateBrand = Brand::where('slug', $slug)->get();
if(count($validateBrand)>=1){
return response()->json(["message" => "Marca ".$name." ya existe!!!"], 400);
}else{
$brand = new Brand;
$brand->name = $name;
$brand->slug = $slug;
$brand->destaca = $destaca;
$brand->description = $description;
$brand->save();
if($request->file('image_url')){
$img = $request->file('image_url');
$path = Storage::disk('public')->put('images/logos-marcas', $img);
// $product->fill(['file' => asset($path)])->save();
// return $path;
$brand->fill(['image_url' => $path])->save();
return $brand;
}
return response()->json($brand, 200);
}
} | {
"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 |
Update the specified resource in storage. | public function update($id, Request $request)
{
$name = $request->name;
$slug = Str::slug($name);
$destaca = $request->destaca;
$description= $request->description;
$status = $request->status;
$validateBrand = Brand::where('slug', $slug)->where('id', '!=', $id)->get();
if(count($validateBrand)>=1){
return response()->json(["message" => "Marca ".$name." ya existe!!!"], 400);
}else{
$brand = Brand::find($id);
if($request->name) $brand->name = $name;
if($request->slug) $brand->slug = $slug;
// if($request->destaca or $request->destaca == 0 and $request->destaca != null) $brand->destaca = $destaca;
if($request->destaca or $request->destaca == 0 ) $brand->destaca = $destaca;
if($request->description) $brand->description = $description;
if($request->status){
$brand->status = $status;
/////AFECTAR ARTICULOS AL ACTIVAR O DESACTIVAR MARCA
$product= Product::where('brand_id', $brand->id)->get();
foreach ($product as $element) {
// return $element;
$element->status = $request->status;
$element->save();
}
}
$brand->save();
if($request->hasFile('image_url')){
$img = $request->file('image_url');
$path = Storage::disk('public')->put('images/logos-marcas', $img);
// $product->fill(['file' => asset($path)])->save();
$brand->fill(['image_url' => $path])->save();
$brand->save();
}
return response()->json($brand, 200);
} } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$brand = Brand::find($id);
$brand->delete();
return response()->json($brand, 200); } | {
"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 |
full path to subform classes | function action_index()
{
$subforms = array(
\Artefacts\Subform_Description::forge(),
\Artefacts\Subform_Owner::forge(),
\Artefacts\Subform_File::forge(),
\Quotes\Subform_Worksub::forge(),
\Quotes\Subform_Quote::forge(),
\Receipts\Subform_Receipt::forge(),
\Jobs\Subform_Jobs::forge(),
\Invoices\Subform_Invoices::forge(),
\Files\Subform_Files::forge()
);
$vsubforms = array();
foreach($subforms as $subform)
{
if(isset($vsubforms[$subform->get_prefix()]))
{
throw new \FuelException('Specified subform prefix already exists in subform test.');
}
$vsubforms[$subform->get_prefix()] = $subform->render();
}
//update
if(\Input::post('save'))
{
foreach ($subforms as $subform)
{
$subform->update(\Input::post($subform->get_prefix()));
}
}
if (\Input::post('save') )
{
if(\Input::param('lock'))
{
//return \Message::set('error', 'Form locked has been changed');
$tab = \Input::param('lock');
\Response::redirect(\Uri::create('mainform/index/?tab='.$tab.'"e_id='.$_GET['quote_id']));
}else{
return \Message::set('success', 'Successfully saved..!') . \Response::redirect(\Uri::create('mainform/index/?tab=0"e_id='.$_GET['quote_id']));
}
}
if ( \Input::post('cancel'))
{
return \Response::redirect(Helper_App::url_from_tab(\Input::get('active_tab')));
}
$view = \View::forge('mainform');
if(\Input::param('wind')){
$this->set_iframe_template();
}
$view->set('subforms', $vsubforms, false);
$this->template->body_classes = array('contact_un');
$this->template->content = $view;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final function getChildFormClass()\n {\n if ($class = $this->getOption('child_form_class') !== null)\n return $class;\n\n return $this->getRelation()->getClass().'Form';\n }",
"protected function getFormClass() : string\n {\n return 'XLite\\Module\\PureClarity\\Personalization\\View... | [
"0.62079877",
"0.5860808",
"0.5816864",
"0.5624751",
"0.56047815",
"0.5594288",
"0.5562095",
"0.5514982",
"0.54195565",
"0.54043114",
"0.5375375",
"0.5374392",
"0.5356819",
"0.53502023",
"0.5268945",
"0.5259698",
"0.525807",
"0.5250663",
"0.5250663",
"0.5238515",
"0.52246314"... | 0.49500585 | 57 |
create table excel pakai | private function makeMigrationXls(){
if(!Schema::hasTable('sap_')){
Schema::create('sap_', function (Blueprint $table) {
$table->increments('id');
foreach (array_keys($this->data[0]) as $key => $value) {
$table->string($value)->nullable();
}
});
}
foreach ($this->data as $value) {
DB::table('sap_')->insert($value);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }",
"abstract public function createTable();",
"private function createDummyTable() {}",
"function createTable($name, $rows);"... | [
"0.70440465",
"0.67297953",
"0.6537376",
"0.648276",
"0.64484566",
"0.63876796",
"0.63686043",
"0.6332067",
"0.6309053",
"0.6308547",
"0.6252669",
"0.62516093",
"0.62474275",
"0.6240335",
"0.6238694",
"0.61718243",
"0.61523706",
"0.6140888",
"0.61248845",
"0.61178154",
"0.610... | 0.0 | -1 |
gets instance conenctor manager | public function getConnectorManager()
{
if (empty($this->connectorManger)) {
$this->connectorManager = new ConnectorManager();
}
return $this->connectorManager;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function getInstance(){\n if(MethodologiesManager::$obj == null){\n MethodologiesManager::$obj = new MethodologiesManager(new EloquentConnection());\n }\n return MethodologiesManager::$obj;\n }",
"function analogue()\n {\n return Manager::getInstance();\n }"... | [
"0.68586224",
"0.6853848",
"0.6846559",
"0.683165",
"0.683165",
"0.6732868",
"0.6732868",
"0.6732868",
"0.6732868",
"0.67320615",
"0.6731514",
"0.66979706",
"0.66979706",
"0.66979706",
"0.66979706",
"0.6687231",
"0.6687231",
"0.6671062",
"0.66629267",
"0.6659249",
"0.66429025... | 0.0 | -1 |
handles if given connector hash is valid | public function validateHash(array $args)
{
if (!empty($args['connectorHash'])) {
$cm = $this->getConnectorManager();
$valid = $cm->isHashValid($args['connectorHash']);
if (!$valid) {
// hash is invalid throw api error for 412
throw new DotbApiExceptionInvalidHash(
'EXCEPTION_CONNECTORS_META_OUT_OF_DATE',
null,
null,
0,
'connectors_meta_out_of_date'
);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function valid_compte_hashValidation($hash){ \n\n\t\t$sql = \"UPDATE utilisateur SET ut_compte_valide = '1' WHERE ut_hash_validation = ?\";\n\t\t$res = $this->executerRequete($sql,array($hash));\n\t\t\treturn ($res->rowCount() == 1); // si 1 alors mise a jour ok\n\n\t\t}",
"public function validateHash($p... | [
"0.62204945",
"0.6210698",
"0.6137567",
"0.61097914",
"0.5977902",
"0.59247816",
"0.5880834",
"0.5870791",
"0.5834529",
"0.5796652",
"0.5700268",
"0.5693106",
"0.56841606",
"0.56671655",
"0.5655448",
"0.5638411",
"0.56305283",
"0.56303585",
"0.5620119",
"0.5605997",
"0.560478... | 0.6839638 | 0 |
Transform the \ContactGroup entity | public function transform(ContactGroup $model)
{
return [
'id' => $model->id,
'org_id' => $model->org_id,
'name' => $model->name,
'description' => $model->description
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function parseContacts($data, $contactGroup) {\n $contactGroup['contacts'] = [];\n if ($data) {\n $contacts = [];\n foreach($data as $contact) {\n $newContact = [];\n $newContact['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('C... | [
"0.60255605",
"0.57956856",
"0.55557865",
"0.55095255",
"0.5487097",
"0.54014796",
"0.5331914",
"0.5316126",
"0.5301569",
"0.52960724",
"0.5271924",
"0.527151",
"0.5235497",
"0.5210859",
"0.519019",
"0.5148069",
"0.5136212",
"0.5135771",
"0.51137406",
"0.5105334",
"0.5102308"... | 0.66498 | 0 |
Create a new filesystem wrapper | public function __construct($root = '')
{
$this->root = $root;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create(array $config): FilesystemInterface;",
"public function filesystem(): Filesystem;",
"protected function createFilesystemDriver(): StoreContract\n {\n return $this->createCacheBased('filesystem');\n }",
"public function createFilesystemDriver()\n {\n return new Fi... | [
"0.72791356",
"0.70920235",
"0.67926335",
"0.6628072",
"0.66063297",
"0.6478215",
"0.64568096",
"0.6434806",
"0.6368421",
"0.63450944",
"0.6334146",
"0.6295976",
"0.62945616",
"0.6215496",
"0.6212335",
"0.61978155",
"0.6165078",
"0.6120218",
"0.6057397",
"0.5900967",
"0.58850... | 0.0 | -1 |
Open a file and return the contents | public function get($file)
{
if (!$this->exists($this->path($file)))
{
throw new FileNotFoundException("File not found at $file");
}
return file_get_contents($this->path($file));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getFileContents() {\n $path = $this->getFilePath();\n return file_get_contents($path);\n }",
"public function getContents($file);",
"function fileGetContents($filename);",
"public function getFileContents($file)\n\t{\n\t\treturn file_get_contents($file);\n\t}",
"function... | [
"0.79625887",
"0.78986555",
"0.7595353",
"0.7501221",
"0.74787325",
"0.7386877",
"0.7269128",
"0.7239975",
"0.7192103",
"0.71920425",
"0.7181598",
"0.714959",
"0.713588",
"0.7122956",
"0.71011025",
"0.710067",
"0.7040828",
"0.7002866",
"0.69977957",
"0.6992191",
"0.6983698",
... | 0.6977324 | 21 |
Create this file for us and set content | public function put($filename, $content)
{
$directory = $this->directory($filename);
if (!$this->exists($directory))
{
$this->mkdir($directory);
}
return file_put_contents($this->path($filename), $content);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createFile() {}",
"abstract public function setContentFromFile($file);",
"protected function _writeFileBody() {}",
"public function write_file ( $content ) {\r\n\r\n\t}",
"private function setContent()\n {\n $this->setTag();\n $this->openRoot();\n $this->setParam(... | [
"0.68384475",
"0.6802304",
"0.6677871",
"0.6294031",
"0.62883687",
"0.62876844",
"0.6283592",
"0.6260655",
"0.61966467",
"0.6190149",
"0.61694306",
"0.61668736",
"0.6092504",
"0.6083858",
"0.60480934",
"0.60477996",
"0.6003446",
"0.59711623",
"0.5963684",
"0.594418",
"0.59119... | 0.0 | -1 |
Return the directory for this $file | public function directory($file)
{
return dirname($this->path($file));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDirectory()\n {\n return dirname($this->file);\n }",
"function getFileDirectory() {\n\t\treturn dirname($this->getFilename());\n\t}",
"public function directoryOf($file){\n $path_parts = pathinfo($file);\n return $path_parts['dirname'];\n }",
"public function ... | [
"0.85628796",
"0.82756287",
"0.7842453",
"0.7825812",
"0.7731061",
"0.7720469",
"0.75859004",
"0.7497771",
"0.7495889",
"0.7495889",
"0.7495889",
"0.7495889",
"0.7495889",
"0.7495889",
"0.745824",
"0.7438007",
"0.73969424",
"0.73377943",
"0.72780335",
"0.72780335",
"0.7278033... | 0.7876371 | 2 |
Returns an array of file content from given directory | public function getFileContentsFromDirectory($directory)
{
$directory = $this->path($directory);
$contents = array();
foreach (new RecursiveIteratorIterator (new RecursiveDirectoryIterator($directory)) as $filename)
{
if ($filename->isFile())
{
$relativePath = $this->makeRelativePath($filename, $directory);
$contents[$relativePath] = file_get_contents($filename);
}
}
return $contents;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_dir_contents($dir)\n\t{\n\t\t$contents = Array();\n\t\t\n\t\tif ($handle = opendir($dir))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle))) {\n\t\t\t\tif ($file != \".\" && $file != \"..\") {\n\t\t\t\t\t$contents[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\telse\n\t\t{... | [
"0.7942482",
"0.7749241",
"0.73846763",
"0.73031366",
"0.72935766",
"0.7269816",
"0.7178615",
"0.71235967",
"0.70016325",
"0.69821614",
"0.69749314",
"0.68951166",
"0.686314",
"0.6850891",
"0.6839022",
"0.68370837",
"0.68328863",
"0.68328863",
"0.68328863",
"0.6809155",
"0.67... | 0.73233104 | 3 |
Strip off the base directory | public function makeRelativePath($path, $base)
{
return str_replace($base . '/', '', $path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clean_path($path){ return str_replace(MMRPG_CONFIG_ROOTDIR, '/', $path); }",
"function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t... | [
"0.68108726",
"0.6735982",
"0.6509385",
"0.64558506",
"0.62983984",
"0.61849594",
"0.6182563",
"0.61692953",
"0.6165911",
"0.61442226",
"0.6121962",
"0.6117205",
"0.6113591",
"0.6106034",
"0.61008084",
"0.60910326",
"0.60876644",
"0.60421264",
"0.601965",
"0.60113966",
"0.599... | 0.0 | -1 |
Return the path wrapper (for testing purposes mainly) | protected function path($path)
{
return $this->root . $path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPath(): string;",
"abstract protected function getPath();",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
"public function getPath(): string;",
... | [
"0.7434491",
"0.7393222",
"0.7297917",
"0.7297917",
"0.7297917",
"0.7297917",
"0.7297917",
"0.7297917",
"0.7297917",
"0.7297917",
"0.7273592",
"0.7248919",
"0.7196188",
"0.7196188",
"0.71178836",
"0.71178836",
"0.71178836",
"0.71178836",
"0.7117539",
"0.711722",
"0.70903593",... | 0.0 | -1 |
Core::getCourier Online Booking delivered() | public function getCourier_list_booking_delivered()
{
$sql = "SELECT a.id, a.order_inv, a.r_name, a.c_driver, a.r_address, a.r_dest, a.r_city, a.r_curren, a.r_costtotal, a.r_description, a.total_insurance, a.total_tax, a.payment_status, a.pay_mode, a.created, a.r_hour, a.status_courier, a.act_status, a.con_status, s.mod_style, s.color FROM add_courier a, styles s WHERE a.status_courier=s.mod_style AND a.username = '".$this->username."' AND a.status_courier='Delivered' ORDER BY a.id ASC";
$row = self::$db->fetch_all($sql);
return ($row) ? $row : 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDeliveredCount()\n {\n return $this->deliveredCount;\n }",
"public function isReadyForIssuing()\n {\n return $this->isFeePaid();\n }",
"public function isRedelivered();",
"public function getDeliveries()\n {\n return $this->deliveries;\n }",
"public... | [
"0.631243",
"0.6241944",
"0.60767645",
"0.5952808",
"0.5925427",
"0.5905212",
"0.5860488",
"0.582135",
"0.5814719",
"0.57733107",
"0.5763579",
"0.5735767",
"0.57323754",
"0.5717282",
"0.57066816",
"0.56492406",
"0.560451",
"0.5557361",
"0.5552874",
"0.5543098",
"0.5499387",
... | 0.7154301 | 0 |
Core::getCourier Online Deliveries list() | public function getCourier_deliveries_list()
{
$sql = "SELECT a.id, a.order_inv, a.c_driver, a.r_address, a.created, a.r_hour, a.status_courier, a.act_status, s.mod_style, s.color FROM consolidate a, styles s WHERE a.status_courier=s.mod_style AND a.c_driver = '".$this->username."' AND a.act_status=1 ORDER BY a.id ASC";
$row = self::$db->fetch_all($sql);
return ($row) ? $row : 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDeliveries()\n {\n return $this->deliveries;\n }",
"function get_export_list(){\n\n\t\t$output = array();\n\n\t\t$query = \"SELECT lead_id FROM leads_pending\n\t\tWHERE sent_fes = 0\n\t\tLIMIT 60000; \";\n\n\t\tif ($result = mysql_query($query, $this->conn)){\n\t\t\twhile($row = m... | [
"0.64258206",
"0.61960334",
"0.6028114",
"0.60102975",
"0.6004807",
"0.5967586",
"0.5927006",
"0.58542305",
"0.579075",
"0.57717305",
"0.57650614",
"0.57650614",
"0.57650614",
"0.57487446",
"0.57463753",
"0.5743755",
"0.5728753",
"0.5728753",
"0.5716643",
"0.571424",
"0.56707... | 0.6507052 | 0 |
Core::cost total client dashboard() | public function getcosstotalcourier()
{
$courbudget = 0;
$sql = "SELECT r_costtotal,total_insurance,total_tax FROM " . self::cTable . " WHERE act_status = '1' AND con_status= '0' AND payment_status='0' AND username='" . $this->username . "'";
$row = self::$db->fetch_all($sql);
foreach ($row as $budget){
return $courbudget+= $budget->r_costtotal;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCost();",
"public function totalCost(): float;",
"public function cost(){\n\t\t\n\t\treturn 200;\n\t}",
"function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$c... | [
"0.6750209",
"0.66620797",
"0.6629128",
"0.65792435",
"0.65017426",
"0.6381126",
"0.6251645",
"0.6147378",
"0.61286557",
"0.6060393",
"0.60425127",
"0.60001826",
"0.60001826",
"0.60001826",
"0.5980366",
"0.59654415",
"0.59235674",
"0.591354",
"0.5884104",
"0.58354235",
"0.582... | 0.61315864 | 8 |
Script adding shipping type attribute for products | public function apply()
{
/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
if (!$eavSetup->getAttribute(Product::ENTITY, 'am_shipping_type')) {
$eavSetup->addAttribute(
Product::ENTITY,
'am_shipping_type',
[
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'label' => 'Shipping Type',
'input' => 'select',
'class' => '',
'source' => '',
'global' => ScopedAttributeInterface::SCOPE_STORE,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => ''
]
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hook_shipping_type() {\n $weight = variable_get('uc_quote_type_weight', array('small_package' => 0));\n\n $types = array();\n $types['small_package'] = array(\n 'id' => 'small_package',\n 'title' => t('Small Packages'),\n 'weight' => $weight['small_package'],\n );\n\n return $types;\n}",
"... | [
"0.6803826",
"0.6436384",
"0.63552606",
"0.6342926",
"0.6214153",
"0.6146409",
"0.5982885",
"0.5975315",
"0.59531474",
"0.59239525",
"0.5897245",
"0.588454",
"0.58802414",
"0.5836447",
"0.5820645",
"0.5786976",
"0.5760866",
"0.5731677",
"0.57273954",
"0.5708754",
"0.568646",
... | 0.7075091 | 0 |
Get a string including indispensable info: Use this function to add space into position str: | function addSpace($str){
$s = $str[0];
for($i=1;$i<strlen($str);$i++){
if(ctype_upper($str[$i]) == true){
$s.= ' '.$str[$i];
}
else{
$s.= $str[$i];
}
}
return $s;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function spaces() {\n return str_pad('', $this->currentIndention, ' ', STR_PAD_LEFT);\n }",
"public function indentStr($n = 0)\n\t{\n\t\treturn \"\";\n\t}",
"public function getCurrentPosition() {\n return implode(' ', array($this->x, $this->y, $this->facing));\n }",
"public function getStringO... | [
"0.7130491",
"0.61656785",
"0.61557573",
"0.5994228",
"0.59531844",
"0.5950041",
"0.5831983",
"0.5826125",
"0.58251405",
"0.5806674",
"0.5787674",
"0.5781184",
"0.57305133",
"0.57305133",
"0.5723752",
"0.56490624",
"0.5634406",
"0.56298673",
"0.56283295",
"0.56043226",
"0.559... | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('banners')->insert([
'bannerImage' => 'https://miro.medium.com/max/3840/1*EOCQfnhc84knJssqDlXLEA.jpeg'
]);
DB::table('banners')->insert([
'bannerImage' => 'https://royaldestinyblog.files.wordpress.com/2018/09/dnd-banner.jpg?w=700'
]);
DB::table('banners')->insert([
'bannerImage' => 'https://media.dnd.wizards.com/styles/news_banner_header/public/images/head-banner/bg-heroes_0.jpg'
]);
DB::table('banners')->insert([
'bannerImage' => 'https://www.lavanguardia.com/files/image_948_465/uploads/2018/12/06/5fa44ab997050.jpeg'
]);
DB::table('banners')->insert([
'bannerImage' => 'https://media.redadn.es/imagenes/super-smash-bros-ultimate-nintendo-switch_328266.jpg'
]);
} | {
"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 |
Getter of the field 'value'. | public function getValue() {
return $this->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_value()\n {\n return $this->value;\n }",
"public function get_value() {\n return $this->value;\n }",
"public function value() { return $this->_m_value; }",
"public function get_value()\n\t{\n\t\treturn $this->value;\n\t}",
"protected function getValue() {\r\n ... | [
"0.8622056",
"0.8615567",
"0.86029536",
"0.84996146",
"0.8456522",
"0.8451566",
"0.84010243",
"0.84010243",
"0.84010243",
"0.8381827",
"0.8375665",
"0.8374002",
"0.834534",
"0.834534",
"0.834534",
"0.834534",
"0.834534",
"0.834534",
"0.8337014",
"0.8337014",
"0.8337014",
"0... | 0.828375 | 76 |
Create PurchaseLabel from JSON string | public static function fromJson($json) {
$value = json_decode($json, true);
return PurchaseLabel::fromString($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Label_isni($jsonString='')\n {\n //--------------------------------------------------------------------\n // I'm basically OK with being quiet on missing JSON property names\n //--------------------------------------------------------------------\n error_reporting( error_rep... | [
"0.52658886",
"0.5149901",
"0.50144184",
"0.49271137",
"0.47502184",
"0.4749456",
"0.47452065",
"0.47268164",
"0.46878815",
"0.4677468",
"0.46685994",
"0.46589783",
"0.46467033",
"0.46402663",
"0.46071574",
"0.45938554",
"0.45135733",
"0.45074317",
"0.45042673",
"0.4457392",
... | 0.78822225 | 0 |
JSON representing this object | public function jsonSerialize() {
return json_encode($this->value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toJSON(){\n return json_encode($this);\n }",
"public function serialize() {\r\n return json_encode($this);\r\n }",
"public function get_json()\n {\n return json_encode($this);\n }",
"public function serialize()\n {\n return json_encode($this);\n ... | [
"0.8273287",
"0.8053849",
"0.8026659",
"0.80202705",
"0.79846925",
"0.79654515",
"0.7963293",
"0.79629296",
"0.79591405",
"0.7954452",
"0.79476494",
"0.7943521",
"0.79175496",
"0.79172707",
"0.79085547",
"0.79066193",
"0.7886816",
"0.7886816",
"0.78849727",
"0.78849727",
"0.7... | 0.0 | -1 |
JSON representing this object | public function toJson() {
return $this->jsonSerialize();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toJSON(){\n return json_encode($this);\n }",
"public function serialize() {\r\n return json_encode($this);\r\n }",
"public function get_json()\n {\n return json_encode($this);\n }",
"public function serialize()\n {\n return json_encode($this);\n ... | [
"0.8273287",
"0.8053849",
"0.8026659",
"0.80202705",
"0.79846925",
"0.79654515",
"0.7963293",
"0.79629296",
"0.79591405",
"0.7954452",
"0.79476494",
"0.7943521",
"0.79175496",
"0.79172707",
"0.79085547",
"0.79066193",
"0.7886816",
"0.7886816",
"0.78849727",
"0.78849727",
"0.7... | 0.0 | -1 |
This method will provide all the relevant index scopes for a given index | public function getAll(Index $index): iterable; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFromContext(Index $index): IndexScope;",
"public function getFromChannelAndLocaleAndCurrency(\n Index $index,\n string $channelCode = null,\n string $localeCode = null,\n string $currencyCode = null\n ): IndexScope;",
"protected function scopes()\n {\n ... | [
"0.7597148",
"0.5817061",
"0.5677836",
"0.5616579",
"0.5549429",
"0.5549429",
"0.5549429",
"0.55404556",
"0.5504399",
"0.5458559",
"0.544613",
"0.5403047",
"0.53921366",
"0.5390148",
"0.5387861",
"0.5372585",
"0.5365177",
"0.53591543",
"0.5348482",
"0.53473",
"0.52692485",
... | 0.6521152 | 1 |
Returns an index scope from the application context (channel, locale, currency) | public function getFromContext(Index $index): IndexScope; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFromChannelAndLocaleAndCurrency(\n Index $index,\n string $channelCode = null,\n string $localeCode = null,\n string $currencyCode = null\n ): IndexScope;",
"#[CustomOpenApi\\Operation(id: 'channelIndex', tags: [Tags::Channel, Tags::V1])]\n #[CustomOpenApi\\Pa... | [
"0.75075257",
"0.6033961",
"0.540871",
"0.5361528",
"0.52263415",
"0.50955284",
"0.508293",
"0.5064449",
"0.50310546",
"0.50261116",
"0.49943587",
"0.49943587",
"0.49889183",
"0.4978954",
"0.49274015",
"0.4917363",
"0.49060947",
"0.48657656",
"0.48547855",
"0.4851444",
"0.483... | 0.73292917 | 1 |
Returns an index scope based on the given arguments | public function getFromChannelAndLocaleAndCurrency(
Index $index,
string $channelCode = null,
string $localeCode = null,
string $currencyCode = null
): IndexScope; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFromContext(Index $index): IndexScope;",
"public function buildIndex();",
"abstract public function getScope();",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"... | [
"0.718105",
"0.5625875",
"0.54953057",
"0.5454769",
"0.5454769",
"0.5454769",
"0.5454424",
"0.5454424",
"0.5454424",
"0.54543394",
"0.54543394",
"0.5453691",
"0.5394627",
"0.5369575",
"0.530874",
"0.5304495",
"0.5304495",
"0.5284758",
"0.5260252",
"0.52202696",
"0.5208177",
... | 0.545216 | 12 |
/ This function is not allowed to actually change the attribute $method, it will render objects of this class unusable when trying to send a command to a bose speaker. Method exists only for consistency. | private function setMethod($method) {
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMethod($value) { $this->_method = $value; }",
"abstract protected function setMethod();",
"public function setMethod($method);",
"public function setMethod($method);",
"public function set_method($method)\n {\n }",
"public function setMethod($method)\n {\n $th... | [
"0.72696596",
"0.71478105",
"0.7129051",
"0.7129051",
"0.7054419",
"0.70030844",
"0.6945324",
"0.69099635",
"0.6857366",
"0.6797961",
"0.6664143",
"0.66458887",
"0.66458887",
"0.66458887",
"0.66458887",
"0.6604361",
"0.6603469",
"0.6594303",
"0.6544439",
"0.6544439",
"0.65444... | 0.71377045 | 2 |
/ This function is not allowed to actually change the attribute $path, it will render objects of this class unusable when trying to send a command to a bose speaker. Method exists only for consistency. | private function setPath($path) {
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setPath($path){ }",
"public function setPathAttribute($path){ //modificaremos el atributo path, estamos recibiendo path de la BD\n\n if(! empty($path)){ //El campo path no debe estar vacio para que ejecute toda esa accion\n $name = Carbon::now()->second.$path->getClientOriginalName();//... | [
"0.69205874",
"0.6797022",
"0.6795881",
"0.67047936",
"0.6603736",
"0.66008294",
"0.6491899",
"0.6491899",
"0.6491899",
"0.6491899",
"0.64860547",
"0.64691657",
"0.6464472",
"0.64613265",
"0.6444354",
"0.64167",
"0.6414064",
"0.6414064",
"0.6410894",
"0.63993835",
"0.6336694"... | 0.67820823 | 3 |
Autoloading a system library usin constructor method | public function __construct() {
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n // Init exception library object\n $this->utilityLibObj = new UtilityLib();\n\n // Init DateTime library object\n $this->dateTimeLibObj = new DateTimeLib... | [
"0.7429468",
"0.7292706",
"0.7292706",
"0.7292706",
"0.72368014",
"0.6937666",
"0.6919827",
"0.6915052",
"0.69046414",
"0.6863052",
"0.6856215",
"0.6847969",
"0.6847969",
"0.68470633",
"0.68226445",
"0.67772263",
"0.6751986",
"0.673813",
"0.673813",
"0.67188984",
"0.66930634"... | 0.0 | -1 |
Could not read argv | public function __construct($message = "", $code = 0, \Exception $previous = null)
{
if (!$code) {
$code = self::E_ANY;
}
parent::__construct($message, $code, $previous);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function parseArguments($argv) {\n\t\t$shortopts = \"h::i:o:p::d::s:c::\";\n\n\t\t$longopts = array(\n\t\t\t\"help::\", // --help\n\t\t\t\"input:\", // --input=file\n\t\t\t\"output:\", // --output=file\n\t\t\t\"pretty-xml::\", // --pretty-xml=k\n\t\t\t\"details::\", // --details=class_uses\n\t\t\t\"search:... | [
"0.6317212",
"0.61038584",
"0.59945977",
"0.5982054",
"0.594719",
"0.59366536",
"0.59118754",
"0.58754444",
"0.5802868",
"0.56958175",
"0.5599045",
"0.55985016",
"0.5549587",
"0.5458798",
"0.54408616",
"0.54400605",
"0.5426033",
"0.54172045",
"0.539569",
"0.5374136",
"0.53655... | 0.0 | -1 |
Overwrite method Compacts the ordering sequence of the selected records | function reorder( $parent_id = 0, $where='' )
{
$k = $this->_tbl_key;
if (!in_array( 'ordering', array_keys($this->getProperties() ) ))
{
vmError( get_class( $this ).' does not support ordering');
return false;
}
$query = 'SELECT c.'.$this->_tbl_key.', c.ordering'
. ' FROM '. $this->_tbl . ' c'
. ' LEFT JOIN #__virtuemart_category_categories cx'
. ' ON c.virtuemart_category_id = cx.category_child_id'
. ' WHERE c.ordering >= 0' . ( $where ? ' AND '. $where : '' )
. ' AND cx.category_parent_id = '. $parent_id
. ' ORDER BY c.ordering'.$order2;
$this->_db->setQuery( $query );
if (!($orders = $this->_db->loadObjectList()))
{
vmError($this->_db->getErrorMsg());
return false;
}
// compact the ordering numbers
for ($i=0, $n=count( $orders ); $i < $n; $i++)
{
if ($orders[$i]->ordering >= 0)
{
if ($orders[$i]->ordering != $i+1)
{
$orders[$i]->ordering = $i+1;
$query = 'UPDATE '.$this->_tbl
. ' SET ordering = '. (int) $orders[$i]->ordering
. ' WHERE '. $k .' = '. $this->_db->Quote($orders[$i]->$k)
;
$this->_db->setQuery( $query);
$this->_db->query();
}
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function order();",
"protected function prepareOrderByStatement() {}",
"public function generateOrder();",
"function SetUpSortOrder() {\r\n\t\tglobal $fs_multijoin_v;\r\n\r\n\t\t// Check for \"order\" parameter\r\n\t\tif (@$_GET[\"order\"] <> \"\") {\r\n\t\t\t$fs_multijoin_v->CurrentOrder = ew_StripSl... | [
"0.6949786",
"0.6596622",
"0.637659",
"0.63706857",
"0.6369452",
"0.63419497",
"0.63056016",
"0.6280431",
"0.6270463",
"0.6266637",
"0.6257193",
"0.6257193",
"0.6257193",
"0.62192076",
"0.6212788",
"0.6203942",
"0.615839",
"0.6156547",
"0.61521786",
"0.6151954",
"0.61400354",... | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
/**
* use the facade we created.
* LanguageHelper::getLang();
*/
$arabic_date = $this->ArabicDate();
return view('commonmodule::index', ['date' => $arabic_date]);
} | {
"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 |
use the facade we created. LanguageHelper::getLang(); | public function cat()
{
return view('commonmodule::index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLang();",
"public function getLanguage() {}",
"public function lang(): string;",
"static function get()\n\t{\n\t\treturn self::$lang;\n\t}",
"protected static function getLanguageService() {}",
"public function language();",
"public function language();",
"protected function getLan... | [
"0.79465425",
"0.7724416",
"0.7709876",
"0.7629389",
"0.76208526",
"0.7549183",
"0.7549183",
"0.7487414",
"0.7487414",
"0.7487414",
"0.7487414",
"0.7487414",
"0.7487414",
"0.7487414",
"0.74871606",
"0.74871606",
"0.74871606",
"0.74871606",
"0.74871606",
"0.74871606",
"0.74871... | 0.0 | -1 |
Set the Localization of the Content. | public function setLocal($lang)
{
Session::put('applocale', $lang);
return redirect()->back();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function set_locale()\n {\n\n $plugin_i18n = new myFOSSIL_Resources_i18n();\n $plugin_i18n->set_domain( $this->get_plugin_name() );\n\n $this->loader->add_action( 'plugins_loaded', $plugin_i18n,\n 'load_plugin_textdomain' );\n\n }",
"public function settingLangua... | [
"0.7048407",
"0.67991567",
"0.679656",
"0.665422",
"0.6651303",
"0.66423947",
"0.6556826",
"0.6412163",
"0.63545835",
"0.6337506",
"0.633181",
"0.6294659",
"0.6200269",
"0.6156301",
"0.6111117",
"0.61104214",
"0.610225",
"0.60851747",
"0.6078956",
"0.6067386",
"0.6006405",
... | 0.0 | -1 |
Activate Languages From DB. | public function activateLang(Request $request)
{
$ar_lang = $request->get('arActivate');
$en_lang = $request->get('enActivate');
LanguageHelper::activateLangs($ar_lang, $en_lang);
return redirect()->to('/admin-panel');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function loadLanguages()\n\t{\n\t\tself::$_LANGUAGES = array();\n\t\t$result = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'Language`');\n\t\tforeach ($result AS $row)\n\t\t\tself::$_LANGUAGES[(int)$row['LanguageId']] = $row;\n\t}",
"protected function setupLanguages()\n {\n ... | [
"0.6871785",
"0.656806",
"0.65488565",
"0.6195094",
"0.617388",
"0.6165846",
"0.6135659",
"0.6128798",
"0.612598",
"0.6101056",
"0.6074891",
"0.6053158",
"0.603088",
"0.6028652",
"0.59692013",
"0.5956118",
"0.59560937",
"0.59263116",
"0.58827335",
"0.5870374",
"0.5822563",
... | 0.5956642 | 15 |
Activate Apps From DB. | public function activateApp(Request $request)
{
Apps::where('title', 'service')->update( ['active' => $request->get("service_Activate")]);
Apps::where('title', 'project')->update( ['active' => $request->get("project_Activate")]);
Apps::where('title', 'product')->update( ['active' => $request->get("product_Activate")]);
Apps::where('title', 'blog')->update( ['active' => $request->get("blog_Activate")]);
Apps::where('title', 'video')->update( ['active' => $request->get("video_Activate")]);
Apps::where('title', 'photo')->update( ['active' => $request->get("photo_Activate")]);
Apps::where('title', 'slider')->update( ['active' => $request->get("slider_Activate")]);
Apps::where('title', 'team')->update( ['active' => $request->get("team_Activate")]);
Apps::where('title', 'testimonial')->update(['active' => $request->get("testimonial_Activate")]);
Apps::where('title', 'partner')->update( ['active' => $request->get("partner_Activate")]);
Apps::where('title', 'pages')->update( ['active' => $request->get("pages_Activate")]);
Apps::where('title', 'workhours')->update( ['active' => $request->get("workhours_Activate")]);
Apps::where('title', 'contactus')->update( ['active' => $request->get("contactus_Activate")]);
Apps::where('title', 'bookings')->update( ['active' => $request->get("bookings_Activate")]);
Apps::where('title', 'why_us')->update( ['active' => $request->get("why_us_Activate")]);
return redirect()->to('/admin-panel');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function AppActivate ( $app )\n\t {\n\t\t$this -> ShellInstance -> AppActivate ( $app ) ;\n\t }",
"public function activateApp($teamid, $appid)\n {\n $user = Auth::user(); \n $result = UserActiveApp::processUpdates($user->id, $appid);\n\n return redirect()->route('apps.show',... | [
"0.66192937",
"0.60342765",
"0.5970644",
"0.5957167",
"0.5907916",
"0.59026814",
"0.58523256",
"0.56782097",
"0.5605068",
"0.55934376",
"0.5564146",
"0.5544416",
"0.55189824",
"0.5514357",
"0.5472157",
"0.54548717",
"0.5451909",
"0.5445915",
"0.5413645",
"0.54125524",
"0.5411... | 0.7309194 | 0 |
Redirect user to the activation view. | public function activate()
{
$langs = LanguageHelper::getAllLangs();
return view('commonmodule::Language', ['langs' => $langs]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function activateAction()\r\n {\r\n\t\tUser::activate($this->route_params['token']);\r\n\t\t\r\n\t\t$this->user = Auth::getUser();\r\n\r\n $this->redirect('/signup/activated');\r\n }",
"public function activateAction()\n {\n $process = User::activate($this->route_params['token']);\n... | [
"0.78891397",
"0.7651143",
"0.7449781",
"0.74430853",
"0.73230547",
"0.71984476",
"0.7149087",
"0.71339226",
"0.71220887",
"0.71018136",
"0.7053563",
"0.6941354",
"0.68907446",
"0.6887436",
"0.6839503",
"0.68156403",
"0.67702985",
"0.6719226",
"0.67007583",
"0.6697606",
"0.66... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
return view('commonmodule::create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.717428... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
} | {
"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 |
Show the specified resource. | public function show()
{
return view('commonmodule::show');
} | {
"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 }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function show($id)\n {\n ... | [
"0.86625683",
"0.8656298",
"0.7061081",
"0.7016237",
"0.69712675",
"0.693585",
"0.6916958",
"0.68928856",
"0.6802355",
"0.66791755",
"0.6661057",
"0.6640048",
"0.66189003",
"0.66071963",
"0.6594754",
"0.65945184",
"0.65812767",
"0.65802205",
"0.6552344",
"0.65498114",
"0.6549... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit()
{
return view('commonmodule::edit');
} | {
"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.6768301 | 32 |
Update the specified resource in storage. | public function update(Request $request)
{
} | {
"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()
{
} | {
"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 |
Get a team by name | public function getTeam($name)
{
if (!is_string($name)) {
throw new InvalidTypeException('Name', 'string', gettype($name));
}
return $this->get(sprintf('teams/%s', $name));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTeam();",
"public function getTeam() {\n return $this->db->getTeamById($this->teamId);\n }",
"public static function getByID($id){\n\t\treturn DB::table('teams')->where('id', $id)->first();\n\t}",
"public function getTeam($id)\n {\n return $this->_getTeam($id);\n }",... | [
"0.778894",
"0.69826925",
"0.6979283",
"0.6946591",
"0.6900469",
"0.6855721",
"0.68554854",
"0.6837608",
"0.6782374",
"0.6681516",
"0.6655595",
"0.6634102",
"0.662447",
"0.66222507",
"0.66196036",
"0.6587913",
"0.65724945",
"0.6550653",
"0.65500575",
"0.65219235",
"0.6477591"... | 0.7587281 | 1 |
Get all active teams | public function getAllTeams($limit = 25, $offset = 0)
{
if (!$this->isValidLimit($limit)) {
throw new InvalidLimitException();
}
if (!$this->isValidOffset($offset)) {
throw new InvalidOffsetException();
}
$params = [
'limit' => intval($limit),
'offset' => intval($offset),
];
return $this->get('teams', $params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTeams();",
"public function getAll()\n {\n return Team::all();\n }",
"public function getAllActive()\n {\n return Team::enabled()->get();\n }",
"public function teams()\n {\n return $this->request('get', '/api/teams');\n }",
"public function getAll(... | [
"0.8126422",
"0.80921715",
"0.80690163",
"0.78078437",
"0.7777228",
"0.7580821",
"0.75313735",
"0.7504203",
"0.75040525",
"0.75033045",
"0.74476576",
"0.73166925",
"0.7269366",
"0.72227854",
"0.7219081",
"0.71843076",
"0.71345973",
"0.7093068",
"0.7080585",
"0.70080274",
"0.7... | 0.0 | -1 |
put your code here constructor | function __construct() {
require_once 'common.php';
try{
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
$this->_db = new PDO('mysql:host='.$host.';dbname='.$database, $user, $password, array(PDO::ATTR_PERSISTENT => true));
$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $ex) {
die("Failed to connect to the database: ");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}",
"function __construct(){\n\t\t// nowt much...\n\t}",
"public function __construct()\n\t\t{\n\t\t\t\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t//\n\t\t}",
"function __construct() {\n\t\t\n\t//TODO - Insert your code here\n\t}",
"pu... | [
"0.813941",
"0.79847896",
"0.79780304",
"0.7974748",
"0.79710597",
"0.79539406",
"0.7876008",
"0.7867498",
"0.78619045",
"0.7854988",
"0.7850288",
"0.7839539",
"0.78349173",
"0.7828115",
"0.7826647",
"0.7826647",
"0.7826647",
"0.7826647",
"0.7826647",
"0.7826647",
"0.7826647"... | 0.0 | -1 |
Adding new user to mysql database returns user details | public function storeUser($email, $password, $user_type, $first_name, $last_name, $address, $city, $state, $zip, $card_num) {
$hash = $this->hashSSHA($password);
$encrypted_password = $hash["encrypted"]; // encrypted password
$salt = $hash["salt"]; // salt
$hash = $this->hashSSHA($card_num);
$encrypted_card = $hash["encrypted"]; // encrypted password
$card_salt = $hash["salt"]; // salt
$query = "
INSERT INTO users (
email,
password,
salt,
user_type,
first_name,
last_name,
address,
city,
state,
zip,
encrypted_card,
card_salt
) VALUES (
:email,
:password,
:salt,
:user_type,
:first_name,
:last_name,
:address,
:city,
:state,
:zip,
:encrypted_card,
:card_salt
)
";
try
{
$stmt = $this->_db->prepare($query);
$stmt->bindValue(':email',$email);
$stmt->bindValue(':password',$encrypted_password);
$stmt->bindValue(':salt',$salt);
$stmt->bindValue(':user_type',$user_type);
$stmt->bindValue(':first_name',$first_name);
$stmt->bindValue(':last_name',$last_name);
$stmt->bindValue(':address',$address);
$stmt->bindValue(':city',$city);
$stmt->bindValue(':state',$state);
$stmt->bindValue(':zip',$zip);
$stmt->bindValue(':encrypted_card',$encrypted_card);
$stmt->bindValue(':card_salt',$card_salt);
$stmt->execute();
}
catch(PDOException $ex)
{
$h = $ex->getMessage ();
die($h);
}
$query = "
SELECT * from users WHERE email = :email;
";
try
{
$stmt = $this->_db->prepare($query);
$stmt->bindValue(':email',$email);
$stmt->execute();
$result = $stmt->fetch();
return $result;
}
catch(PDOException $ex)
{
$h = $ex->getMessage ();
die($h);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n ... | [
"0.7510196",
"0.7269391",
"0.72638273",
"0.7187511",
"0.7178913",
"0.7162",
"0.71190375",
"0.7094702",
"0.70945364",
"0.7086928",
"0.7043314",
"0.70315826",
"0.70292604",
"0.70147496",
"0.70080346",
"0.69805396",
"0.6930872",
"0.6910384",
"0.6900169",
"0.6897729",
"0.68830323... | 0.0 | -1 |
Check user is existed or not | public function isUserExisted($email) {
$query = "
SELECT * from users WHERE email = :email;
";
try
{
$stmt = $this->_db->prepare($query);
$stmt->bindValue(':email',$email);
$stmt->execute();
$result = $stmt->fetch();
}
catch(PDOException $ex)
{
$h = $ex->getMessage ();
die($h);
}
if (!(empty($result))) {
// user existed
return true;
} else {
// user not existed
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function userExists( $user_name ) { return true;}",
"private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['co... | [
"0.80854905",
"0.803215",
"0.7927345",
"0.77850366",
"0.77830017",
"0.7682984",
"0.7667868",
"0.7657921",
"0.76283",
"0.7572905",
"0.75677484",
"0.75569826",
"0.74755573",
"0.74418736",
"0.74362034",
"0.74211556",
"0.74114007",
"0.74001193",
"0.73748577",
"0.7370407",
"0.7361... | 0.0 | -1 |
Verifies user by email and password | public function getUserByEmailAndPassword($email, $password) {
$query = "
SELECT * from users WHERE email = :email;
";
try
{
$stmt = $this->_db->prepare($query);
$stmt->bindValue(':email',$email);
$stmt->execute();
$result = $stmt->fetch();
}
catch(PDOException $ex)
{
$h = $ex->getMessage ();
die($h);
}
if(!(empty($result))){
$salt = $result['salt'];
$encrypted_password = $result['password'];
$hash = $this->checkhashSSHA($salt, $password);
if ($encrypted_password == $hash) {
// user authentication details are correct
return $result;
}
} else {
// user not found
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $... | [
"0.7814631",
"0.76163906",
"0.735944",
"0.7170459",
"0.7162064",
"0.7014756",
"0.70012903",
"0.69483626",
"0.6899576",
"0.68399197",
"0.6817929",
"0.67955005",
"0.6782092",
"0.67759854",
"0.67719537",
"0.6723582",
"0.6704876",
"0.66968316",
"0.6692527",
"0.66865396",
"0.66845... | 0.61944145 | 85 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.