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
Gets the list of Courses associated with a CourseCatalog.
public function getCoursesByCatalog(osid_id_Id $courseCatalogId) { $lookupSession = $this->manager->getCourseLookupSessionForCatalog($courseCatalogId); $lookupSession->useIsolatedView(); if ($this->usesPlenaryView()) $lookupSession->usePlenaryCourseView(); else $lookupSession->useComparativeCourseView(); return $lookupSession->getCourses(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetCourses()\n\t\t{\n $course_students = CourseStudent::GetAll(['student_id' => $this->GetAttribute(static::$primary_key)]);\n $courses = array();\n\n foreach ($course_students as $course_student) {\n $courses[] = Course::GetFromPrimaryKey($course_stu...
[ "0.71496224", "0.7125692", "0.70384246", "0.69054234", "0.68716055", "0.6822623", "0.67812306", "0.6755467", "0.66981727", "0.6686777", "0.66485065", "0.6596202", "0.65363705", "0.6517668", "0.650607", "0.64620215", "0.6339792", "0.6298999", "0.6254616", "0.6078578", "0.60613...
0.7477056
0
Gets the list of Course Ids corresponding to a list of CourseCatalog objects.
public function getCourseIdsByCatalogs(osid_id_IdList $courseCatalogIdList) { $idList = new phpkit_CombinedList('osid_id_IdList'); while ($courseCatalogIdList->hasNext()) { try { $idList->addList($this->getCourseIdsByCatalog($courseCatalogIdList->getNextId())); } catch (osid_NotFoundException $e) { if ($this->usesPlenaryView()) throw $e; } } return $idList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCourseIdsByCatalog(osid_id_Id $courseCatalogId) {\n \t$ids = array();\n \t$courses = $this->getCoursesByCatalog($courseCatalogId);\n \twhile ($courses->hasNext()) {\n \t\t$ids[] = $courses->getNextCourse()->getId();\n \t}\n \treturn new phpkit_id_ArrayIdList($ids);\n }", "...
[ "0.76753193", "0.71126395", "0.6887197", "0.6728595", "0.6565588", "0.6200786", "0.6114252", "0.611215", "0.6048621", "0.60457027", "0.6044892", "0.59037507", "0.5902864", "0.5879822", "0.5832614", "0.5832614", "0.5800741", "0.57538456", "0.5745121", "0.5712706", "0.57010573"...
0.7867208
0
Gets the list of Courses corresponding to a list of CourseCatalog objects.
public function getCoursesByCatalogs(osid_id_IdList $courseCatalogIdList) { $courseList = new phpkit_CombinedList('osid_course_CourseList'); while ($courseCatalogIdList->hasNext()) { try { $courseList->addList($this->getCoursesByCatalog($courseCatalogIdList->getNextId())); } catch (osid_NotFoundException $e) { if ($this->usesPlenaryView()) throw $e; } } return $courseList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetCourses()\n\t\t{\n $course_students = CourseStudent::GetAll(['student_id' => $this->GetAttribute(static::$primary_key)]);\n $courses = array();\n\n foreach ($course_students as $course_student) {\n $courses[] = Course::GetFromPrimaryKey($course_stu...
[ "0.73062104", "0.71245277", "0.7057654", "0.70350176", "0.6980809", "0.6867817", "0.67235196", "0.6720836", "0.662141", "0.65670955", "0.65172315", "0.64136034", "0.6380824", "0.6318145", "0.63082445", "0.6265644", "0.6240504", "0.62089175", "0.613569", "0.610299", "0.6020837...
0.7464477
0
Gets the CourseCatalog Ids mapped to a Course.
public function getCatalogIdsByCourse(osid_id_Id $courseId) { $parameters = array( ':subject_code' => $this->getSubjectFromCourseId($courseId), ':course_number' => $this->getNumberFromCourseId($courseId) ); $statement = $this->getGetCatalogsStatement(); $statement->execute($parameters); $ids = array(); while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $ids[] = $this->getOsidIdFromString($row['catalog_id'], 'catalog/'); } $statement->closeCursor(); return new phpkit_id_ArrayIdList($ids); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCourseIdsByCatalog(osid_id_Id $courseCatalogId) {\n \t$ids = array();\n \t$courses = $this->getCoursesByCatalog($courseCatalogId);\n \twhile ($courses->hasNext()) {\n \t\t$ids[] = $courses->getNextCourse()->getId();\n \t}\n \treturn new phpkit_id_ArrayIdList($ids);\n }", "...
[ "0.76474375", "0.68942463", "0.6645033", "0.6436734", "0.6417131", "0.62609273", "0.6161324", "0.61395127", "0.6127694", "0.6127694", "0.60481673", "0.6031365", "0.60047334", "0.58725065", "0.5861905", "0.5826808", "0.5821608", "0.5818245", "0.58150244", "0.57863843", "0.5781...
0.7548647
1
Gets the CourseCatalog objects mapped to a Course.
public function getCatalogsByCourse(osid_id_Id $courseId) { $parameters = array( ':subject_code' => $this->getSubjectFromCourseId($courseId), ':course_number' => $this->getNumberFromCourseId($courseId) ); $statement = $this->getGetCatalogsStatement(); $statement->execute($parameters); $catalogs = array(); while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $catalogs[] = new banner_course_CourseCatalog( $this->getOsidIdFromString($row['catalog_id'], 'catalog/'), $row['catalog_title']); } $statement->closeCursor(); return new phpkit_course_ArrayCourseCatalogList($catalogs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function courses()\n {\n return Course::all()->toArray();\n }", "public function getCoursesByCatalog(osid_id_Id $courseCatalogId) {\n \t$lookupSession = $this->manager->getCourseLookupSessionForCatalog($courseCatalogId);\n \t$lookupSession->useIsolatedView();\n \tif ($this->us...
[ "0.7309968", "0.7245353", "0.71065253", "0.71063745", "0.6835415", "0.67810696", "0.6779969", "0.6755087", "0.65623254", "0.64753723", "0.64344716", "0.64170545", "0.63644314", "0.63291925", "0.6309761", "0.6296648", "0.62160844", "0.6184473", "0.60821396", "0.6051443", "0.60...
0.7238173
2
Answer the statement for fetching catalogs
private function getGetCatalogsStatement () { if (!isset(self::$getCatalogsByCourse_stmt)) { self::$getCatalogsByCourse_stmt = $this->manager->getDB()->prepare( "SELECT course_catalog.catalog_id, catalog_title FROM SCBCRSE LEFT JOIN course_catalog_college ON SCBCRSE_COLL_CODE = coll_code LEFT JOIN course_catalog ON course_catalog_college.catalog_id = course_catalog.catalog_id WHERE SCBCRSE_SUBJ_CODE = :subject_code AND SCBCRSE_CRSE_NUMB = :course_number AND SCBCRSE_CSTA_CODE NOT IN ( 'C', 'I', 'P', 'T', 'X' ) GROUP BY SCBCRSE_SUBJ_CODE , SCBCRSE_CRSE_NUMB, catalog_id "); } return self::$getCatalogsByCourse_stmt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fetchCatalogs()\n {\n $Sql = \"SELECT * FROM `db_catalogs`\";\n Parent::query($Sql);\n\n $catalogs = Parent::fetchAll();\n if (empty($catalogs)) {\n return array(\n 'status' => false,\n 'd...
[ "0.68669045", "0.6088272", "0.5808634", "0.5698634", "0.56830096", "0.56573486", "0.55278283", "0.5515977", "0.5488257", "0.54359615", "0.5419701", "0.5405967", "0.5371099", "0.53543603", "0.53422266", "0.5339128", "0.53056455", "0.52927727", "0.5285707", "0.52774066", "0.524...
0.75474966
0
Create a configured instance to use the reCAPTCHA service.
public function __construct($secret, RequestMethod $requestMethod = null) { if (empty($secret)) { throw new \RuntimeException('No secret provided'); } if (!is_string($secret)) { throw new \RuntimeException('The provided secret must be a string'); } $this->secret = $secret; $this->requestMethod = (is_null($requestMethod)) ? new RequestMethod\Post() : $requestMethod; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getCore_Captcha_Plugins_RecaptchaService()\n {\n $instance = new \\phpbb\\captcha\\plugins\\recaptcha();\n\n $instance->set_name('core.captcha.plugins.recaptcha');\n\n return $instance;\n }", "public function __construct()\n\t{\n\t\t$this->app = $this->getApp();\n\n\...
[ "0.6782552", "0.6549907", "0.6544375", "0.63570184", "0.61175424", "0.6014755", "0.6014392", "0.59594023", "0.592351", "0.5882742", "0.58667684", "0.5857527", "0.5857527", "0.5836977", "0.5799355", "0.57936764", "0.57744426", "0.57676804", "0.5727996", "0.5682284", "0.565204"...
0.0
-1
Calls the reCAPTCHA siteverify API to verify whether the user passes CAPTCHA test and additionally runs any specified additional checks
public function verify($response, $remoteIp = null) { // Discard empty solution submissions if (empty($response)) { $recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE)); return $recaptchaResponse; } $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION); $rawResponse = $this->requestMethod->submit($params); $initialResponse = Response::fromJson($rawResponse); $validationErrors = array(); if (isset($this->hostname) && strcasecmp($this->hostname, $initialResponse->getHostname()) !== 0) { $validationErrors[] = self::E_HOSTNAME_MISMATCH; } if (isset($this->apkPackageName) && strcasecmp($this->apkPackageName, $initialResponse->getApkPackageName()) !== 0) { $validationErrors[] = self::E_APK_PACKAGE_NAME_MISMATCH; } if (isset($this->action) && strcasecmp($this->action, $initialResponse->getAction()) !== 0) { $validationErrors[] = self::E_ACTION_MISMATCH; } if (isset($this->threshold) && $this->threshold > $initialResponse->getScore()) { $validationErrors[] = self::E_SCORE_THRESHOLD_NOT_MET; } if (isset($this->timeoutSeconds)) { $challengeTs = strtotime($initialResponse->getChallengeTs()); if ($challengeTs > 0 && time() - $challengeTs > $this->timeoutSeconds) { $validationErrors[] = self::E_CHALLENGE_TIMEOUT; } } if (empty($validationErrors)) { return $initialResponse; } return new Response( false, array_merge($initialResponse->getErrorCodes(), $validationErrors), $initialResponse->getHostname(), $initialResponse->getChallengeTs(), $initialResponse->getApkPackageName(), $initialResponse->getScore(), $initialResponse->getAction() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function recaptchaCheck() { /* Recaptcha checkers. Uses GOOGLE's recaptcha and its keys. */\r\n/* THIS is my private for recaptcha. You can use it to make things more simple. */\r\n $privatekey = \"6Ldz9A4UAAAAAJPKPDuPbJuw0-dmfF5ffvS5Gvz9\";\r\n\r\n $response = $_POST[\"g-recaptcha-response\"]; /* Get respon...
[ "0.64687467", "0.64533365", "0.61026365", "0.60749036", "0.6049979", "0.5906065", "0.5889425", "0.58728063", "0.5861402", "0.58135176", "0.57899165", "0.5778477", "0.5770823", "0.57638043", "0.5743544", "0.5722542", "0.57092774", "0.57092774", "0.5695765", "0.5660688", "0.564...
0.0
-1
Provide a hostname to match against in verify() This should be without a protocol or trailing slash, e.g.
public function setExpectedHostname($hostname) { $this->hostname = $hostname; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setExpectedHostname($hostname);", "public function providerTestValidateHostname() {\n $data = [];\n\n // Verifies that DrupalKernel::validateHostname() prevents invalid\n // characters per RFC 952/2181.\n $data[] = ['security/.drupal.org:80', 'HTTP_HOST with / is invalid'];\n $data...
[ "0.6598658", "0.6573872", "0.6567095", "0.6496184", "0.6348003", "0.63355047", "0.6254787", "0.6187702", "0.6146074", "0.6068135", "0.6065546", "0.6037417", "0.6036384", "0.60188603", "0.60111266", "0.59998816", "0.5993795", "0.5968332", "0.59615105", "0.59593457", "0.5958184...
0.5471763
66
Provide an APK package name to match against in verify()
public function setExpectedApkPackageName($apkPackageName) { $this->apkPackageName = $apkPackageName; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setExpectedApkPackageName($apkPackageName);", "function pkg_valid_name($pkgname) {\n\tglobal $g;\n\n\t$pattern = \"/^{$g['pkg_prefix']}[a-zA-Z0-9\\.\\-_]+$/\";\n\treturn preg_match($pattern, $pkgname);\n}", "public function getPackageName(): string;", "final private static function _is_packag...
[ "0.68557674", "0.57291275", "0.568401", "0.5519098", "0.54599786", "0.53831136", "0.53416795", "0.5322864", "0.5275169", "0.52424484", "0.52022594", "0.5135555", "0.5112247", "0.51108915", "0.50659263", "0.50453436", "0.5005056", "0.49899676", "0.49348432", "0.49188644", "0.4...
0.543826
5
Provide an action to match against in verify() This should be set per page.
public function setExpectedAction($action) { $this->action = $action; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setExpectedAction($action);", "public function compareAction() {}", "public function setAction($action);", "function process_action($target, $action) {\n //implement if needed\n }", "public function invoke($action);", "public function process() {\r\n if(!in_array($this->g...
[ "0.62883633", "0.59462863", "0.5811316", "0.5716279", "0.56683165", "0.566825", "0.56514734", "0.5612385", "0.5597649", "0.5595876", "0.5581954", "0.5573744", "0.55370414", "0.5510328", "0.5502247", "0.54827106", "0.54756814", "0.5464875", "0.5464698", "0.5457394", "0.5454893...
0.0
-1
Provide a threshold to meet or exceed in verify() Threshold should be a float between 0 and 1 which will be tested as response >= threshold.
public function setScoreThreshold($threshold) { $this->threshold = floatval($threshold); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setScoreThreshold($threshold);", "function get_transactions_above_value($threshold){\n $str_query=\"select * from pos_transaction where value>='$threshold'\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n...
[ "0.6488406", "0.6393344", "0.6302953", "0.6243177", "0.6031278", "0.59723234", "0.58438903", "0.57997197", "0.57864684", "0.5721246", "0.55929744", "0.5545257", "0.5450716", "0.54054844", "0.53428936", "0.52180785", "0.51332116", "0.51332116", "0.51241356", "0.5105014", "0.50...
0.5935286
6
Provide a timeout in seconds to test against the challenge timestamp in verify()
public function setChallengeTimeout($timeoutSeconds) { $this->timeoutSeconds = $timeoutSeconds; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setChallengeTimeout($timeoutSeconds);", "public function timeout($timeout);", "public function timeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public function getTimeout();", "public fu...
[ "0.68132716", "0.66660714", "0.6626068", "0.6111107", "0.6111107", "0.6111107", "0.6111107", "0.6111107", "0.6111107", "0.5895993", "0.5865279", "0.5846795", "0.58215666", "0.5765856", "0.57617676", "0.5760493", "0.572379", "0.57025176", "0.568224", "0.56288534", "0.55841595"...
0.0
-1
Method that must be defined by all child module used by framework to get module information
public static function moduleInfo(&$simbio) { return array('module-name' => 'Master', 'module-desc' => 'Master files management', 'module-depends' => array()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getInfoModule() {}", "public function getModule();", "public function getModule();", "private function load_module_info() {\n\t\t$data = array ();\n\t\t$data['module_label'] = $this->module_label;\n\t\t$data['module_labels'] = $this->module_labels;\n\t\t$data['module'] = $this->module;\n\t...
[ "0.85971874", "0.74024475", "0.74024475", "0.730566", "0.7292428", "0.7291644", "0.7193384", "0.71907175", "0.7148661", "0.7122135", "0.70950717", "0.70412594", "0.70339775", "0.70339775", "0.6989202", "0.69622874", "0.6939425", "0.685093", "0.6813878", "0.68136656", "0.68136...
0.6671535
27
Method that must be defined by all child module used by framework to get module privileges type
public static function modulePrivileges(&$simbio) { return array( 'add master data', 'remove master data' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getAdminType();", "function ipmiPrivileges($type = null) {\n\t$types = array(\n\t\tIPMI_PRIVILEGE_CALLBACK => _('Callback'),\n\t\tIPMI_PRIVILEGE_USER => _('User'),\n\t\tIPMI_PRIVILEGE_OPERATOR => _('Operator'),\n\t\tIPMI_PRIVILEGE_ADMIN => _('Admin'),\n\t\tIPMI_PRIVILEGE_OEM => _('OEM'),...
[ "0.7220386", "0.6639526", "0.6635746", "0.64840984", "0.63243467", "0.62715", "0.62298864", "0.6213673", "0.6213673", "0.62069505", "0.61775535", "0.61433846", "0.61323035", "0.6126639", "0.60831785", "0.607015", "0.6035757", "0.60328794", "0.6013467", "0.60112995", "0.600548...
0.0
-1
Method to add module data
public function add(&$simbio, $str_args) { if (!User::isUserLogin()) { // return false; } // master file type $this->dbTable = $str_args; // auto generate fields from database $this->autoGenerateFields($simbio); // create form $_form = new FormOutput('master-file', 'index.php?p=master/save/'.$this->dbTable, 'post'); $_form->submitName = 'add'; $_form->submitValue = __('Simpan'); $_form->submitAjax = true; $_form->formInfo = __('Lengkapi semua ruas mandatori'); // auto generate form $_elms = $this->autoGenerateForm($simbio, $_form); // add form and set form field value foreach ($_elms as $_elm) { if (in_array($_elm['id'], array('id_unit'))) { $_elm['label'] = 'Unit Kerja'; $_elm['type'] = 'dropdown'; $_elm['options'] = self::getMasterData($simbio, 'unit_kerja'); } $_form->add($_elm); } $simbio->loadView($_form, 'MASTER_FILE_FORM'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadModuleData() {}", "public function add(){\n echo \"Add a module !\\n\";\n }", "function processData() \n {\n \n // store values in table manager object.\n $moduleID = $this->dataManager->getModuleID();\n $moduleCreator = new ModuleCreator( $moduleID,...
[ "0.71217054", "0.6959261", "0.6852349", "0.68445635", "0.67746633", "0.6763167", "0.671581", "0.66234916", "0.65804213", "0.6554896", "0.63872904", "0.633732", "0.63257754", "0.63152164", "0.6279557", "0.626317", "0.62627834", "0.620296", "0.6183524", "0.6164829", "0.6131474"...
0.0
-1
Get master table data
public static function getMasterData($simbio, $str_master_table) { if (in_array($str_master_table, self::$tables)) { $_master_data = array(); $_q = $simbio->dbQuery('SELECT * FROM {'.$str_master_table.'} LIMIT 1'); // fetch field info $_flds = $_q->fetch_fields(); $_q->close(); // set sort field $_sort_field = $_flds[1]->name; $_q = $simbio->dbQuery('SELECT * FROM {'.$str_master_table.'} ORDER BY '.$_sort_field.' LIMIT 1000'); if ($_q->num_rows > 0) { while ($_d = $_q->fetch_row()) { if (isset($_flds[2]->name) && $_flds[2]->name != 'input_date' && isset($_d[2])) { $_master_data[] = array($_d[0], $_d[1].' - '.$_d[2]); } else { $_master_data[] = array($_d[0], $_d[1]); } } } $_q->close(); return $_master_data; } return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentMasterTable() {\n\t\treturn @$_SESSION[EW_PROJECT_NAME . \"_\" . $this->TableVar . \"_\" . EW_TABLE_MASTER_TABLE];\n\t}", "public function getMasterTable() {\n if (!$this->MasterTable) {\n $sm = $this->getServiceLocator();\n $this->MasterTable = $sm->get('Api\\Model\\Mas...
[ "0.7530011", "0.74559563", "0.7332237", "0.68519515", "0.6614915", "0.65567803", "0.6460373", "0.63384694", "0.6235048", "0.62010175", "0.61675686", "0.6153977", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.61340225", "0.613237...
0.6598948
5
Get master table data
public static function getMasterValueByID($simbio, $arr_master_table, $mix_id) { if (in_array($arr_master_table['table'], self::$tables)) { $_value = ''; $_q = $simbio->dbQuery('SELECT '.implode(',', $arr_master_table['value_fields']).' FROM {'.$arr_master_table['table'].'} WHERE '.$arr_master_table['primary_key'].'=%d', $mix_id); // echo sprintf('SELECT '.implode(',', $arr_master_table['value_fields']).' FROM {'.$arr_master_table['table'].'} WHERE '.$arr_master_table['primary_key'].'=%d', $mix_id); // fetch field info $_d = $_q->fetch_row(); $_q->close(); if ($_d && count($_d) > 1) { $_value = implode(' - ', $_d); return $_value; } return $_d[0]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentMasterTable() {\n\t\treturn @$_SESSION[EW_PROJECT_NAME . \"_\" . $this->TableVar . \"_\" . EW_TABLE_MASTER_TABLE];\n\t}", "public function getMasterTable() {\n if (!$this->MasterTable) {\n $sm = $this->getServiceLocator();\n $this->MasterTable = $sm->get('Api\\Model\\Mas...
[ "0.7530011", "0.74559563", "0.7332237", "0.68519515", "0.6614915", "0.6598948", "0.65567803", "0.6460373", "0.63384694", "0.6235048", "0.62010175", "0.61675686", "0.6153977", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6144949", "0.6134022...
0.0
-1
Automatically create datagrid for master file table
private function generateDatagrid(&$simbio, $str_args) { $_master_tables = $this->global['db_prefix'].$this->dbTable.' AS mst '; if ($this->dbTable != 'unit_kerja') { $this->relation['id_unit'] = array('table' => 'unit_kerja', 'display_field' => 'nama_unit', 'pk_field' => 'id_unit'); } // include datagrid library $simbio->loadLibrary('Datagrid', SIMBIO_BASE.'Databases'.DSEP.'Datagrid.inc.php'); // create datagrid instance $_datagrid = new Datagrid($this->dbc); $_datagrid->numToShow = 20; // create an array of fields to show in datagrid $_fields = array(); $_primary_keys = array(); $_f = 0; foreach ($this->dbFields as $_fld => $_fld_info) { $_fld_label = ucwords(str_replace('_', ' ', $_fld)); $_fields[$_fld_label] = 'mst.'.$_fld; if (isset($_fld_info['isPrimary'])) { $_primary_keys[] = $_fld_label; } if (isset($this->relation[$_fld])) { $_rel_table = $this->global['db_prefix'].$this->relation[$_fld]['table']; $_fields[$_fld_label] = $_rel_table.'.'.$this->relation[$_fld]['display_field']; $_master_tables .= ' LEFT JOIN `'.$_rel_table.'` ON `mst`.'.$_fld.'='.'`'.$_rel_table.'`.'.$this->relation[$_fld]['pk_field']; } if ($_f == $this->gridMaxField) { break; } $_f++; } // set column to view in datagrid $_datagrid->setSQLColumn($_fields); // set primary key for detail view $_datagrid->setPrimaryKeys($_primary_keys); // set record actions $_action['Del.'] = '<input type="checkbox" name="record[]" value="{rowIDs}" />'; $_action['Edit'] = '<a class="datagrid-links" href="index.php?p=master/update/'.$this->dbTable.'/{rowIDs}"><b class="icon-edit"></b>&nbsp;</a>'; $_datagrid->setRowActions($_action); // set multiple record action options $_action_options[] = array('0', 'Pilih tindakan'); $_action_options[] = array('master/remove/'.$this->dbTable, 'Hapus rekod terpilih'); $_datagrid->setActionOptions($_action_options); // set result ordering $_datagrid->setSQLOrder('mst.input_date DESC'); // search criteria if (isset($_GET['keywords'])) { $_search = $simbio->filterizeSQLString($_GET['keywords'], true); $_criteria = ''; $_datagrid->setSQLCriteria($_criteria); } // built the datagrid $_datagrid->create($_master_tables); return $_datagrid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTableModel()\r\n {\r\n?>\r\n // table model\r\n var <?php echo $this->Name; ?>_tableModel = new qx.ui.table.SimpleTableModel();\r\n <?php\r\n if ($this->owner!=null)\r\n {\r\n ?>\r\n <?php echo $this->owner->...
[ "0.59534377", "0.57892495", "0.5734265", "0.5725187", "0.5685025", "0.56577164", "0.56120133", "0.5571964", "0.5557955", "0.55323964", "0.55260295", "0.55165577", "0.55000925", "0.5490411", "0.5462657", "0.545562", "0.5429502", "0.54096806", "0.54002047", "0.53851837", "0.537...
0.5799705
1
Default module page method All module must have this method
public function index(&$simbio, $str_args) { if (!User::isUserLogin()) { // return false; } // master file type $this->dbTable = $str_args?$str_args:self::$tables[0]; // auto generate fields from database $this->autoGenerateFields($simbio); // create datagrid $_datagrid = $this->generateDatagrid($simbio, $str_args); // set header $simbio->headerBlockTitle = ucwords(str_replace('_', ' ', $this->dbTable)); $simbio->headerBlockMenu = array( array('class' => 'add', 'link' => 'master/add/'.$this->dbTable, 'title' => __('Tambah rekod master'), 'desc' => __('Menambahkan rekod baru untuk data master')), array('class' => 'list', 'link' => 'master/index/'.$this->dbTable, 'title' => __('Daftar rekod'), 'desc' => __('Menampilkan daftar semua rekod data master yang ada')) ); // build search form $_quick_search = new FormOutput('search', 'index.php', 'get'); $_quick_search->submitName = 'search'; $_quick_search->submitValue = __('Cari'); // define form elements $_form_items[] = array('id' => 'keywords', 'label' => __('Cari '), 'type' => 'text', 'maxSize' => '200'); $_form_items[] = array('id' => 'p', 'type' => 'hidden', 'value' => 'master/index/'.$this->dbTable); foreach ($_form_items as $_item) { $_quick_search->add($_item); } $simbio->headerBlockContent = $_quick_search; // add to main content $simbio->loadView($_datagrid, 'MASTER_FILE_LIST'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function DoDefault()\n\t\t{\n\t\t\t/*$template = Template::LoadTemplate(\"YageCMS.Core.Module.UserManager.Overview.Overview\",\"VIEW\");\n\t\t\tprint $template->VarDump(true);\n\t\t\treturn \"Hi\";*/\n\t\t\t\n\t\t\t\n\t\t\t/*\n\t\t\t$moduleViewSetup = ConfigurationManager::Instance()->GetParameter(\"YageCMS...
[ "0.73322046", "0.7297878", "0.7297878", "0.72816694", "0.70188147", "0.70183265", "0.70183265", "0.7000012", "0.6995793", "0.68969893", "0.689239", "0.68690187", "0.6855274", "0.6824647", "0.68158984", "0.68158984", "0.6804059", "0.68001795", "0.67993283", "0.6761209", "0.674...
0.0
-1
Module initialization method All preparation for module such as loading library should be doing here
public function init(&$simbio, $str_current_module, $str_current_method, $str_args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function initModuleLoading(){\n\n\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'music.models.*',\n\t\t\t'music.components.*',\n\t\t));\n\t}", "p...
[ "0.79944414", "0.7943459", "0.79376096", "0.78148085", "0.7791336", "0.7789094", "0.7778432", "0.7742173", "0.77374625", "0.7701804", "0.7687868", "0.76704586", "0.7664721", "0.7662219", "0.7640785", "0.7633773", "0.76133424", "0.75972384", "0.75878656", "0.7575734", "0.75746...
0.0
-1
Method returning an array of application main menu and navigation menu
public function menu(&$simbio, $str_menu_type = 'navigation', $str_current_module = '', $str_current_method = '') { $_menu = array(); if ($str_menu_type == 'main') { $_menu[] = array('link' => 'admin/master', 'name' => __('Master File'), 'description' => __('Manajemen tabel data master aplikas Sids.')); } else { if ($str_current_module == 'admin' && $str_current_method == 'master') { foreach (self::$tables as $_master) { $_master_name = ucwords(str_replace('_', ' ', $_master)); $_menu['Master File'][] = array('link' => 'master/index/'.$_master, 'name' => $_master_name, 'description' => $_master_name.__(' data management')); } } } return $_menu; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function menus()\n {\n return [];\n }", "public static function menus(): array\n {\n return [];\n }", "protected function getMainMenuStructure(): array {\n\n return [\n [\n 'id' => 'frontpage',\n 'title' => 'Frontpage',\n 'url' => '/',\n ...
[ "0.7799143", "0.7592768", "0.7521939", "0.7370864", "0.7332759", "0.7288506", "0.72675514", "0.72637385", "0.72116524", "0.7088202", "0.70717186", "0.70092875", "0.7000656", "0.6896716", "0.6866319", "0.6864311", "0.68268526", "0.6820677", "0.6815423", "0.67909867", "0.677421...
0.0
-1
Method to update module data
public function update(&$simbio, $str_args) { if (!User::isUserLogin()) { // return false; } $_table = self::$tables[0]; $_data_id = 0; list($_table, $_data_id) = explode('/', $str_args); // master file type $this->dbTable = $_table; // auto generate fields from database $this->autoGenerateFields($simbio); // get primary key field $_primary_keys = ''; foreach ($this->dbFields as $_fld => $_fld_info) { if (isset($_fld_info['isPrimary'])) { $_primary_keys = $_fld; } } // get record data $_rec = $this->getRecords($simbio, array($_primary_keys => $_data_id)); if (!$_rec) { $simbio->addError('RECORD_NOT_FOUND', __("Master file data not found!")); return; } // create form $_form = new FormOutput('master-file', 'index.php?p=master/save/'.$this->dbTable, 'post'); $_form->submitName = 'update'; $_form->submitAjax = true; $_form->submitValue = __('Update'); $_form->includeReset = true; $_form->disabled = true; $_form->formInfo = '<div class="form-update-buttons btn-group"><a href="#" class="btn form-unlock">'.__('Aktifkan form').'</a>' .' <a href="#" class="btn form-cancel">'.__('Batal').'</a>' .'</div>'; // auto generate form $_elms = $this->autoGenerateForm($simbio); // add form and set form field value foreach ($_elms as $_elm) { if (in_array($_elm['id'], array('id_unit'))) { $_elm['label'] = 'Unit Kerja'; $_elm['type'] = 'dropdown'; $_elm['options'] = self::getMasterData($simbio, 'unit_kerja'); } foreach ($_rec[0] as $_field => $_value) { if ($_elm['id'] == $_field) { $_elm['value'] = $_value; $_form->add($_elm); } } } // add update ID $_form->add(array('id' => 'updateID', 'type' => 'hidden', 'value' => $_data_id)); $simbio->addInfo('UPDATE_RECORD_INFO', __('Anda akan memperbaharui data Master')); $simbio->loadView($_form, 'MASTER_FILE_FORM'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function updateData();", "public function updateData(){\n try{\n $this->dbConnection->query($this->query);\n $this->message = $this->moduleName.' Successfully Updated';\n $this->data = array();\n $this->data['id'] = $this->dbConnection->lastInser...
[ "0.74951243", "0.68189096", "0.67035836", "0.6632226", "0.6598621", "0.6549501", "0.6493647", "0.6460348", "0.64289296", "0.64159244", "0.64119667", "0.64083296", "0.6363425", "0.6354862", "0.6326059", "0.6326059", "0.6325645", "0.63132465", "0.63109565", "0.63109565", "0.631...
0.0
-1
Method to remove module data
public function remove(&$simbio, $str_args) { if (!User::isUserLogin()) { return false; } if (isset($_POST['record'])) { // master file type $this->dbTable = $str_args?$str_args:self::$tables[0]; // auto generate fields from database $this->autoGenerateFields($simbio); // get primary key $_primary_key = 'id'; foreach ($this->dbFields as $_fld => $_fld_info) { if (isset($_fld_info['isPrimary'])) { $_primary_key = $_fld; break; } } // convert scalar var to array var if (!is_array($_POST['record'])) { $_POST['record'][0] = $_POST['record']; } foreach ($_POST['record'] as $_rec_ID) { $_rec_ID = (integer)$_rec_ID; $simbio->dbDelete("`$_primary_key`='$_rec_ID'", $this->dbTable); } } $this->index($simbio, $str_args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeAction()\n {\n $modules = $this->module->fetchAll(\" groupmodule_id = \".$this->_getParam('id'));\n foreach($modules as $key=>$row)\n { \n $this->module->removemodule(APPLICATION_PATH.\"/modules/\".$row->module_name);\n }\n \n ...
[ "0.70985895", "0.69545275", "0.6932643", "0.67992115", "0.66379803", "0.659119", "0.65465677", "0.6498005", "0.6433722", "0.642907", "0.6424151", "0.6416871", "0.62092704", "0.6152032", "0.61490935", "0.61299515", "0.6128562", "0.61229503", "0.6079579", "0.6073565", "0.601677...
0.0
-1
Method to save/update module data
public function save(&$simbio, $str_args) { if (!User::isUserLogin()) { // return false; } // master file type $this->dbTable = $str_args?$str_args:self::$tables[0]; // auto generate fields from database $this->autoGenerateFields($simbio); // get db fields $_primary_key = 'id'; foreach ($this->dbFields as $_fld => $_fld_info) { if (isset($_fld_info['isPrimary'])) { $_primary_key = $_fld; } if (isset($_POST[$_fld])) { $_data[$_fld] = ( preg_match('@.?(char|text|enum)$@i', $_fld_info['dataType']) )?$simbio->filterizeSQLString($_POST[$_fld], true):intval($_POST[$_fld]); } } $_data['input_date'] = date('Y-m-d h:i:s'); $_data['last_update'] = date('Y-m-d h:i:s'); // do update if (isset($_POST['updateID'])) { unset($_data['input_date']); $_id = (integer)$_POST['updateID']; $_update = $simbio->dbUpdate($_data, $this->dbTable, "`$_primary_key`='$_id'"); } else { $_update = $simbio->dbInsert($_data, $this->dbTable); } if (!$_update) { $_msg = 'Failed to update record for Master file data'; $simbio->writeLogs('Master', $_msg, 'MASTER_RECORD_UPDATE_ERROR'); $simbio->addError('MASTER_RECORD_UPDATE_ERROR', $_msg); } else { $_msg = 'Successfully update Master file data'; $simbio->writeLogs('Master', $_msg, 'MASTER_RECORD_UPDATED'); $simbio->addInfo('MASTER_RECORD_UPDATED', $_msg); } // redirect to master file index page $this->index($simbio, $this->dbTable); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveModule($data)\n\t{\n\t\t$name = $data['ModuleClassName'];\n\t\t$moduleID = $this->_getModuleIdByClassName($name);\n\t\tif ( $moduleID == 0 )\n\t\t{\n\t\t\t$this->_insert($data,'SC_modules');\n\t\t\t$moduleID = $this->_lastInsertId('SC_modules');\n\t\t}\n\t\treturn $moduleID;\n\t}", "public fu...
[ "0.6863986", "0.6819415", "0.6723369", "0.6697846", "0.66497135", "0.6458909", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "0.64494574", "...
0.0
-1
Get the unqualified name
public function getName(): string { return $this->getIdentifier()->getName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getNameWithoutPrefix() {}", "public function getQualifiedName();", "public function getQualifiedName() {}", "public function getQualifiedName() {}", "public function getQualifiedName(): string\n {\n return $this->namespace.'.'.$this->name;\n }", "public static function get...
[ "0.7346932", "0.73332214", "0.7279634", "0.7279634", "0.7124419", "0.71087307", "0.70933217", "0.69948006", "0.69948006", "0.69736946", "0.69481564", "0.6903256", "0.6773501", "0.6768882", "0.67205036", "0.6710932", "0.6705424", "0.66589314", "0.66581166", "0.66518205", "0.66...
0.0
-1
Alternative to Input::except() which fails in codeception
function input_except(array $exclude){ return array_except(Input::all(), (array) $exclude); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function throwInputNotFoundException()\n {\n return Response::json([\n 'message' => 'Could not get data from request'\n ], 422);\n\n /**\n * if running tests on call\n */\n if (app()->environment() === 'testing') {\n dd('Could not g...
[ "0.65122175", "0.60696685", "0.60006875", "0.59062546", "0.5772672", "0.57132185", "0.5564742", "0.550555", "0.54889107", "0.5442311", "0.54385823", "0.53909504", "0.53810394", "0.5372019", "0.53598976", "0.5358292", "0.5339781", "0.53192127", "0.5318758", "0.52982247", "0.52...
0.5620455
6
Cycles through each argument added Based on Rails `cycle` method if last argument begins with ":" then it will change the namespace (allows multiple cycle calls within a loop)
function cycle($first_value, $values = '*') { // keeps up with all counters static $count = array(); // get all arguments passed $values = is_array($first_value) ? $first_value : func_get_args(); // set the default name to use $name = 'default'; // check if last items begins with ":" $last_item = end($values); if( substr($last_item, 0, 1) === ':' ) { // change the name to the new one $name = substr($last_item, 1); // remove the last item from the array array_pop($values); } // make sure counter starts at zero for the name if( !isset($count[$name]) ) $count[$name] = 0; // get the current item for its index $index = $count[$name] % count($values); // update the count and return the value $count[$name]++; return $values[$index]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_loop($loop = array())\n {\n }", "public function cyclesAdd()\n {\n $this->cycles++;\n }", "function addOne(&$arg)\n{\n $arg++;\n}", "public function add()\n {\n for ($i = 0 ; $i < func_num_args(); $i++) {\n $this->addSingle(func_get_arg($i));\n }...
[ "0.5135708", "0.50927603", "0.505903", "0.48176682", "0.47834137", "0.47525236", "0.4743625", "0.4655114", "0.46123734", "0.46123734", "0.45069978", "0.44575948", "0.44385505", "0.44325992", "0.44205338", "0.4381066", "0.43750358", "0.43711752", "0.43579373", "0.43499324", "0...
0.5561409
0
If the supplies string is a valid json resource, return an associative array
function json2Array($json){ if($json==null) return array(); $arr = json_decode($json, true); if( json_last_error() != JSON_ERROR_NONE) return array(); return $arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_json($string = null)\r\n\t{\r\n\t\tif(is_string($string))\r\n\t\t{\r\n\t\t\t$string\t\t\t\t\t\t\t\t\t= json_decode($string, true);\r\n\t\t\t\r\n\t\t\tif(json_last_error() == JSON_ERROR_NONE)\r\n\t\t\t{\r\n\t\t\t\treturn $string;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn array();\r\n\t\t\t}\...
[ "0.5787536", "0.57638973", "0.5701759", "0.5531475", "0.5517958", "0.5506513", "0.5486799", "0.54757965", "0.5453338", "0.5398779", "0.53912765", "0.534086", "0.53357196", "0.533428", "0.5289229", "0.5250572", "0.523307", "0.5195189", "0.5179726", "0.51680154", "0.51561034", ...
0.0
-1
Check if input string is a valid YouTube URL and try to extract the YouTube Video ID from it.
function parse_yturl($url) { $pattern = '#^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=|/watch\?.+&v=))([\w-]{11})(?:.+)?$#x'; preg_match($pattern, $url, $matches); return (isset($matches[1])) ? $matches[1] : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function psa_get_youtube_video_id( $string ) {\n\tif( !parse_url( $string, PHP_URL_HOST ) ) return $string;\n\tif ( strpos( $string, 'youtu.be/') === false && strpos( $string, '/embed/') === false ) {\n\t\tparse_str( parse_url( $string, PHP_URL_QUERY ), $query );\n\t\t$id = $query['v'];\n\t} else {\n\t\t$id = base...
[ "0.8411485", "0.82495123", "0.824792", "0.8138633", "0.8127412", "0.79791", "0.79169625", "0.79012144", "0.7766781", "0.77408016", "0.7478344", "0.7469685", "0.73944455", "0.7303336", "0.7261563", "0.723731", "0.71403235", "0.71011704", "0.70969087", "0.7064773", "0.7018505",...
0.7291501
14
Sets the associated page for this section.
public function setPage(Page $page) { $this->_page = $page; $page->setMainSection($this); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPage(Page $page);", "public function setPage($page){\n $this->page = $page;\n }", "public function setPage($page) {\n $this->page = $page;\n }", "public function setPage($page){\n $this->page=$page;\n }", "public function set_page($page);", "public function setP...
[ "0.7570832", "0.7191239", "0.71848774", "0.7127233", "0.7094432", "0.70607567", "0.6882073", "0.65333056", "0.6471929", "0.6470963", "0.6439938", "0.6377672", "0.63725805", "0.6344751", "0.63107556", "0.63107556", "0.63107556", "0.63107556", "0.63107556", "0.63107556", "0.631...
0.6382732
11
Returns the associated page this section.
public function getPage() { return $this->_page; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n {\n return $this->page;\n }", "public function getPage()\n ...
[ "0.70129794", "0.6949067", "0.6949067", "0.6949067", "0.6949067", "0.6949067", "0.6949067", "0.6949067", "0.6949067", "0.6949067", "0.6919423", "0.69082576", "0.68799466", "0.68616587", "0.6840598", "0.6827371", "0.682645", "0.67780584", "0.6752821", "0.6708866", "0.6588224",...
0.68326676
15
Returns the owning pages.
public function getPages() { return $this->_pages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pages()\n {\n return $this->morphedByMany('App\\Page', 'imageable');\n }", "protected function getUpdatablePages() {}", "public function getPages() {}", "public function getPages();", "public function getPages()\n {\n list($page_id, $scope_pages, $scope_page_type) = a...
[ "0.66053075", "0.6475205", "0.6378219", "0.63085014", "0.6237268", "0.6153171", "0.6153171", "0.6153171", "0.6140572", "0.60939455", "0.6089963", "0.6074947", "0.6039638", "0.60146207", "0.60053945", "0.5988762", "0.59450185", "0.5941462", "0.59361243", "0.5932642", "0.592542...
0.61092323
10
Sets the site of this section.
public function setSite(Site $site = null) { $this->_site = $site; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSite(Site $site)\n {\n $this->site = $site;\n }", "public function setSiteUrl()\n {\n }", "function setSite(mvcSiteTools $inSite) {\r\n\t\tif ( $inSite !== $this->_Site ) {\r\n\t\t\t$this->_Site = $inSite;\r\n\t\t}\r\n\t\treturn $this;\r\n\t}", "public function setSite(s...
[ "0.7539692", "0.7077897", "0.70054865", "0.6849499", "0.6572894", "0.65712863", "0.6568946", "0.6520794", "0.65205747", "0.6475266", "0.63864535", "0.6382687", "0.63503516", "0.63258564", "0.6228436", "0.62169963", "0.6196592", "0.61758673", "0.6146123", "0.6143916", "0.61288...
0.663079
4
Returns the site of this section.
public function getSite() { return $this->_site; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function site() {\n return $this->site;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite()\n {\n return $this->site;\n }", "public function getSite() {\n return $t...
[ "0.8407463", "0.83891535", "0.83891535", "0.83756924", "0.8168882", "0.8039346", "0.7752567", "0.75835496", "0.754591", "0.7504701", "0.74444443", "0.74093086", "0.7369299", "0.73334646", "0.721754", "0.7204122", "0.7178554", "0.7178554", "0.7178554", "0.71567166", "0.7154613...
0.8297433
5
A section is never a leaf.
public function isLeaf() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSection()\n {\n return false;\n }", "protected function remove_empty_section_branches() {\n global $PAGE;\n $cache = new navigation_cache('navigation');\n $course = &$PAGE->navigation->find_active_node(navigation_node::TYPE_COURSE);\n if ($course===false...
[ "0.66725105", "0.6545906", "0.6057204", "0.6057204", "0.5985538", "0.5977483", "0.5977483", "0.585672", "0.5825241", "0.578914", "0.5677419", "0.5624979", "0.56155753", "0.55988234", "0.55736804", "0.5494533", "0.5464068", "0.5464068", "0.5464068", "0.5464066", "0.5460845", ...
0.5893778
7
A section is never a leaf.
public function setHasChildren($value) { $this->_has_children = (boolean)$value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSection()\n {\n return false;\n }", "protected function remove_empty_section_branches() {\n global $PAGE;\n $cache = new navigation_cache('navigation');\n $course = &$PAGE->navigation->find_active_node(navigation_node::TYPE_COURSE);\n if ($course===false...
[ "0.66725105", "0.6545906", "0.6057204", "0.6057204", "0.5985538", "0.5977483", "0.5977483", "0.5893778", "0.585672", "0.5825241", "0.578914", "0.5677419", "0.5624979", "0.56155753", "0.55988234", "0.55736804", "0.5494533", "0.5464068", "0.5464068", "0.5464068", "0.5464066", ...
0.0
-1
A section is never a leaf.
public function getHasChildren() { return (boolean)$this->_has_children; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSection()\n {\n return false;\n }", "protected function remove_empty_section_branches() {\n global $PAGE;\n $cache = new navigation_cache('navigation');\n $course = &$PAGE->navigation->find_active_node(navigation_node::TYPE_COURSE);\n if ($course===false...
[ "0.66725105", "0.6545906", "0.6057204", "0.6057204", "0.5985538", "0.5977483", "0.5977483", "0.5893778", "0.585672", "0.5825241", "0.578914", "0.5677419", "0.5624979", "0.56155753", "0.55988234", "0.55736804", "0.5494533", "0.5464068", "0.5464068", "0.5464068", "0.5464066", ...
0.0
-1
Menentukan Grade berdasarkan Nilai Akhir
function grades($nilai) { if($nilai <= 100 ) { $grade = "A"; } if($nilai < 80 ) { $grade = "B"; } if($nilai < 70 ) { $grade = "C"; } if($nilai < 60 ) { $grade = "D"; } if($nilai < 50 ) { $grade = "E"; } return $grade; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVarGrade();", "public function get_grade() {\n return $this->grade;\n }", "function getGrade()\n {\n return $this->_Grade;\n }", "public function getGrade()\r\n\t{\r\n\t\tif($this->getPoint() >= 80)\r\n\t\t\treturn 'A';\r\n\t\telseif ($this->getPoint() >=...
[ "0.7207061", "0.7047783", "0.7008695", "0.7007721", "0.69523835", "0.6938891", "0.68868977", "0.68303984", "0.6691615", "0.6690695", "0.66682035", "0.6661563", "0.6593273", "0.6584052", "0.6560969", "0.6460833", "0.6441955", "0.64155465", "0.63048637", "0.62784374", "0.626580...
0.65849453
13
Get our options and see if we're handling a form submission.
function control() { $options = get_option('ace_widget_recent_posts'); if ( !is_array($options) ) $options = array('title'=>'', 'count' => $this->count, 'hierarchical' => $this->hierarchical, 'dropdown' => $this->dropdown ); if ( !empty($_POST['ace-recent-posts-submit']) ) { $options['title'] = trim(strip_tags(stripslashes($_POST['ace-recent-posts-title']))); $options['number'] = (int) $_POST['ace-recent-posts-number']; if ($options['number'] > 15) $options['number'] = 15;//The limit update_option('ace_widget_recent_posts', $options); } $title = attribute_escape( $options['title'] ); $number = (int) $options['number']; ?> <p> <label for="recent-posts-title"> <?php _e( 'Title:' ); ?> <input class="widefat" id="recent-posts-title" name="ace-recent-posts-title" type="text" value="<?php echo $title; ?>" /> </label> </p> <p> <label for="recent-posts-number"><?php _e('Number of posts to show:'); ?> <input style="width: 25px; text-align: center;" id="recent-posts-number" name="ace-recent-posts-number" type="text" value="<?php echo $number; ?>" /> </label> <br /> <small><?php _e('(at most 15)'); ?></small> </p> <input type="hidden" name="ace-recent-posts-submit" value="1" /> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formSubmitted() {\n return $_SERVER[\"REQUEST_METHOD\"] == 'POST';\n }", "public function isSubmitted()\n\t{\n\t\tif( $this->method == 'post' )\n\t\t{\n\t\t\treturn $this->request->getMethod() == 'post';\n\t\t}\n\n\t\t$arr = $this->request->getQueryString();\n\t\treturn ! empty( $arr );...
[ "0.6788503", "0.6627648", "0.661911", "0.65398306", "0.64038724", "0.63965243", "0.6367015", "0.63334554", "0.6332975", "0.62651044", "0.62470573", "0.6168668", "0.6111619", "0.6091988", "0.60727423", "0.603937", "0.6017523", "0.59924537", "0.59189504", "0.5916218", "0.589619...
0.0
-1
Create facebook connection and validate access token
public function __construct($fb_app_id, $fb_app_secret, $access_token) { $this->facebook = new Facebook(array( 'appId' => $fb_app_id, 'secret' => $fb_app_secret )); if ($access_token !== null) { // Setting new access token $this->facebook->setAccessToken($access_token); } $this->validateAccessToken(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function connectApps()\n {\n $fb = new \\Facebook\\Facebook([\n 'app_id' => $this->appID,\n 'app_secret' => $this->appSecret,\n 'default_graph_version' => $this->defaultGraphVersion,\n ]);\n\n try {\n $token = $fb->getCanvasHelper()->getAc...
[ "0.6591374", "0.63696986", "0.63020337", "0.6217434", "0.6194193", "0.6176499", "0.6064787", "0.6027263", "0.60204273", "0.5958633", "0.59212977", "0.58818954", "0.5816112", "0.58030695", "0.5794017", "0.57783", "0.57736856", "0.57657945", "0.5765237", "0.5759829", "0.5756442...
0.62122715
4
Attempts to query the API to get the user id associated with this access token. User ID set to 0 if fails
private function validateAccessToken() { $this->userID = $this->facebook->getUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserId()\n {\n return $this->accessToken->user_id;\n }", "public static function GetCurrentUserId() {\n try {\n $token = Helper::GetCookies('token');\n $now = new \\DateTime(date('Y-m-d H:i:s'));\n if(!isset($token) || $token == '' || $token...
[ "0.730571", "0.72590524", "0.69499624", "0.69009644", "0.6853799", "0.67540395", "0.67509276", "0.67404866", "0.6724285", "0.6716617", "0.6713127", "0.6693746", "0.66838443", "0.66699106", "0.66598237", "0.66237026", "0.6608571", "0.6599368", "0.6597962", "0.6597962", "0.6597...
0.0
-1
Returns if authentication was successful
public function authIsOk() { return $this->userID !== 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAuthenticatedSuccessfully(): bool;", "public function authenticate() {\n\t\treturn FALSE;\n\t}", "public function checkAuthentication() {}", "public function authenticate()\n {\n IF($this->strategy !== NULL) {\n RETURN $this->strategy->authenticate();\n }\n\n ...
[ "0.8231296", "0.76611745", "0.76102144", "0.7525568", "0.7486134", "0.7458794", "0.74419993", "0.7320155", "0.7299434", "0.7281883", "0.7259513", "0.7226329", "0.72126454", "0.71455526", "0.71359485", "0.71354616", "0.71351135", "0.71262246", "0.7119358", "0.7098791", "0.7097...
0.7001425
41
Get the user's Facebook ID
public function getID() { return $this->userID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFacebookId()\n {\n return $this->facebookId;\n }", "private function getUserId($facebook_id)\n\t{\n\t\t$string = explode('_', $facebook_id, 2);\n\t\treturn $string[0];\n\t}", "public function getFbUserId()\n {\n if ($this->getConfig()->getConfigParam(\"bl_showFbConnect...
[ "0.8021469", "0.7887146", "0.7813785", "0.7807963", "0.77285594", "0.74983585", "0.7475508", "0.7473954", "0.73533684", "0.72988045", "0.72848016", "0.7148909", "0.70154107", "0.699869", "0.693258", "0.6929774", "0.6920728", "0.6898781", "0.6855355", "0.6847155", "0.68357134"...
0.0
-1
Get friends of FB auth'd user
public function getFriendsUsingSL($light = false) { $friends = $this->getFriends($light); $friend_map = array(); foreach ($friends as $friend) { if (!$light) { $friend_map[$friend['uid']] = array( 'id' => $friend['uid'], 'name' => $friend['name'], 'pic' => $friend['pic'] ); } else { $friend_map[$friend['uid']] = array( 'id' => $friend['uid'] ); } } $in_values = ''; $sl_friends = array(); if (!empty($friend_map)) { foreach ($friend_map as $friend) { $in_values .= $friend['id'] . ','; } // Chop off extra ',' $in_values = substr($in_values, 0, strlen($in_values)-1-1); // Get friends with locations and registration IDs $stmt = DB::prepareStatement("SELECT `id`, `lat`, `lng`, UNIX_TIMESTAMP(`last_updated`) AS `last_updated`, `registration_id` FROM `user` WHERE `id` IN ($in_values) AND `lat` IS NOT NULL AND `registration_id` IS NOT NULL"); $stmt->bind_result($friend_id, $lat, $lng, $lastUpdated, $registrationID); $stmt->execute(); while ($stmt->fetch()) { if (!$light) { $sl_friend = new User( $friend_id, $lat, $lng, $lastUpdated, $registrationID, $friend_map[$friend_id]['name'], $friend_map[$friend_id]['pic'] ); } else { $sl_friend = new User($friend_id, $lat, $lng, $lastUpdated); } $sl_friends[$friend_id] = $sl_friend; } $stmt->close(); } return $sl_friends; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFriends(){\r\n\t\t$fql = 'SELECT uid, name, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = '.$this->getFacebookUid().')';\r\n\t\t$fql_result = $this->runFQL($fql, 'fql_get_friends');\r\n\t\treturn $fql_result;\r\n\t}", "public function getFriends() {\n $ret = $this->ge...
[ "0.79389316", "0.72901857", "0.70533687", "0.7043314", "0.69542813", "0.69087744", "0.6857269", "0.6799967", "0.67654395", "0.676466", "0.6751672", "0.6745597", "0.6701479", "0.6683758", "0.661213", "0.65870553", "0.65741247", "0.64629656", "0.64606345", "0.64298075", "0.6423...
0.0
-1
Saves the Target Grade into the database. It either updates or inserts.
public function save() { if($this->id != -1) { $this->update_target_grade(); } else { $this->insert_target_grade(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function insert_target_grade()\r\n {\r\n global $DB;\r\n $params = $this->get_params();\r\n $this->id = $DB->insert_record('block_bcgt_target_grades', $params);\r\n }", "public function save_grade() {\r\n\r\n\t\t\t//new method\r\n\t\t\t$sql = \"UPDATE grades SET student_id = ?,...
[ "0.76819974", "0.73544496", "0.66014427", "0.64346683", "0.6227649", "0.59803945", "0.59065485", "0.58583045", "0.58172953", "0.5750802", "0.5672258", "0.5603101", "0.55894566", "0.55830395", "0.5562536", "0.5552673", "0.54855484", "0.5479278", "0.54779685", "0.5452694", "0.5...
0.82555264
0
so get the current ranking
public function get_target_asp($difference) { //add the difference to the current ranking //get the new breakdown $newRanking = $this->ranking + $difference; return $this->get_new_target_by_ranking($newRanking); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRank();", "public function getCurRank()\n {\n return $this->get(self::_CUR_RANK);\n }", "public abstract function get_rank();", "public function getRanking()\n {\n return $this->ranking;\n }", "public function rank();", "public function getRank()\n {\n ...
[ "0.8226295", "0.81941307", "0.80844074", "0.8084024", "0.7894086", "0.788011", "0.788011", "0.788011", "0.7839821", "0.7786041", "0.7786041", "0.7786041", "0.7786041", "0.7786041", "0.7784351", "0.77632076", "0.77505577", "0.7686182", "0.759928", "0.7598362", "0.73737377", ...
0.0
-1
Deletes the target grade using the target grade id passed in (from the database.)
public static function delete_target_grade($targetGradeID) { global $DB; $DB->delete_records('block_bcgt_target_grades', array('id'=>$targetGradeID)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_grade() {\r\n\t\t\t$sql = \"DELETE FROM grades WHERE id = $this->id;\";\r\n\t\t\tDatabase::$db->query($sql);\r\n\t\t}", "function sqlDeleteGrade()\n\t{\n\t\t$sql = \"\n\t\tDELETE FROM tbl_grade\n\t\tWHERE grade_id = :grade_id\n\t\t\";\n\n\t\treturn $sql;\n\t}", "function sb_assignment_de...
[ "0.7750345", "0.62856454", "0.62751067", "0.6247999", "0.62387985", "0.6219215", "0.6123618", "0.6043811", "0.6039449", "0.60063916", "0.59998786", "0.5998948", "0.59953314", "0.5958848", "0.59498954", "0.5947142", "0.5945185", "0.5928793", "0.5928475", "0.59033436", "0.58987...
0.78142464
0
Gets the params from the object and passes it bak as a new object.
private function get_params() { $params = new stdClass(); $params->grade = $this->grade; $params->ucaspoints = $this->ucaspoints; $params->bcgttargetqualid = $this->bcgttargetqualid; $params->upperscore = $this->upperscore; $params->lowerscore = $this->lowerscore; $params->ranking = $this->ranking; return $params; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function paramsToObject(): self {\n\n $this->params = (object) $this->params;\n return $this;\n }", "private function get_params()\n { \n $params = new stdClass();\n $params->subject = $this->subject;\n return $params;\n }", "public function replacePara...
[ "0.6954757", "0.6427652", "0.62653995", "0.6240043", "0.62165844", "0.59431976", "0.59130406", "0.589339", "0.5872049", "0.58360404", "0.5816288", "0.5816288", "0.57796437", "0.5773873", "0.57411736", "0.5732809", "0.57046664", "0.5700374", "0.56775415", "0.565029", "0.565029...
0.5957257
5
Inserts the target grade into the database.
private function insert_target_grade() { global $DB; $params = $this->get_params(); $this->id = $DB->insert_record('block_bcgt_target_grades', $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\r\n {\r\n if($this->id != -1)\r\n {\r\n $this->update_target_grade();\r\n }\r\n else\r\n {\r\n $this->insert_target_grade();\r\n }\r\n }", "public function test_insert_grade_record() {\n global $DB, $USER;\n\n ...
[ "0.72508174", "0.6786291", "0.6740325", "0.6493337", "0.64287007", "0.6354729", "0.6333785", "0.6196301", "0.612433", "0.6093761", "0.60206985", "0.59183985", "0.5916492", "0.58917445", "0.58423537", "0.56940925", "0.56732213", "0.5664993", "0.5616756", "0.5606822", "0.560106...
0.8400825
0
Gets the params from the object passed in and puts them onto the target grade objectl.
private function extract_params($params) { if(isset($params->id)) { $this->id = $params->id; } $this->grade = $params->grade; $this->ucaspoints = $params->ucaspoints; $this->bcgttargetqualid = $params->bcgttargetqualid; $this->upperscore = $params->upperscore; $this->lowerscore = $params->lowerscore; $this->ranking = $params->ranking; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_params()\r\n {\r\n $params = new stdClass();\r\n $params->grade = $this->grade;\r\n $params->ucaspoints = $this->ucaspoints;\r\n $params->bcgttargetqualid = $this->bcgttargetqualid;\r\n $params->upperscore = $this->upperscore;\r\n $params->lowerscor...
[ "0.59932023", "0.57584214", "0.55334836", "0.5452479", "0.5435454", "0.5434264", "0.5417483", "0.53067166", "0.53067166", "0.53007376", "0.524095", "0.521113", "0.51391417", "0.51391417", "0.51391417", "0.51391417", "0.5138652", "0.5137212", "0.5130605", "0.510307", "0.507424...
0.65404516
0
gets the target grade from the database and loads onto the obj
private function load_target_grade($id) { global $DB; $sql = "SELECT * FROM {block_bcgt_target_grades} WHERE id = ?"; $record = $DB->get_record_sql($sql, array($id)); if($record) { $this->extract_params($record); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_grade_item() {\n if (empty($this->grade_item) && !empty($this->itemid)) {\n $this->grade_item = grade_item::fetch('id', $this->itemid);\n }\n return $this->grade_item;\n }", "function getGrade() {\n return $this->fulfillment['grade_result'];\n }", "public fu...
[ "0.65877765", "0.62621385", "0.6250349", "0.6235341", "0.6168487", "0.61359686", "0.61324453", "0.58930165", "0.5848173", "0.5802586", "0.5740291", "0.5698388", "0.5620369", "0.56131", "0.559986", "0.5583957", "0.5557592", "0.5512564", "0.5430524", "0.5408109", "0.53758657", ...
0.6259448
2
/ Cantidad de lotes inventariados por dia en un rango de fecha
public function verifAvance($fechaIni,$suc,$codigo,$id_inv){ $respuesta = array(); $link = new My(); $link->Query("SELECT COUNT(distinct lote) AS inv FROM inventario WHERE codigo = '$codigo' AND suc = '$suc' AND id_inv=$id_inv"); $link->NextRecord(); $respuesta['inventariados'] = $link->Record['inv']; $link->Query("SELECT COUNT(DISTINCT l.lote) AS lotes FROM articulos a INNER JOIN lotes l ON a.codigo = l.codigo INNER JOIN stock s ON l.codigo = s.codigo AND l.lote = s.lote INNER JOIN historial h ON l.codigo = h.codigo AND l.lote = h.lote WHERE s.cantidad > 0 AND s.suc = '$suc' AND a.codigo = '$codigo' AND h.fecha_hora < '$fechaIni' "); $link->NextRecord(); $respuesta['lotes'] = $link->Record['lotes']; $link->Close(); echo json_encode($respuesta); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_dias ($fecha_inicio, $fecha_fin, $dias_seleccionados){\n //aca debemos tratar el caso del mes de febrero, que puede tener 29 dias si el anio es bisiesto\n $anio=date('Y');\n $febrero=(($anio%400==0) || (($anio%4==0)&&($anio%100 != 0))) ? 29 : 28;\n $t...
[ "0.68693817", "0.6800541", "0.6746871", "0.67025304", "0.658702", "0.65868723", "0.65841895", "0.65793425", "0.653054", "0.6517902", "0.6452507", "0.6425315", "0.64251727", "0.6420067", "0.6412755", "0.63886625", "0.6385905", "0.637453", "0.62960064", "0.6261472", "0.6232876"...
0.0
-1
/ Busca los datos de lote
public function buscarDatosDeCodigo($lote, $suc){ $db = new My(); $my = new My(); $datos = array(); $query = "SELECT a.codigo AS Codigo,l.lote,CONCAT( a.descrip, '-', p.nombre_color) AS Descrip , s.suc, s.cantidad AS Stock, s.estado_venta,a.um AS UM,l.ancho AS Ancho,l.gramaje AS Gramaje,l.tara AS Tara,l.padre AS Padre,s.ubicacion AS U_ubic, l.img AS Img, l.kg_desc AS U_kg_desc,h.fecha_hora AS entDate FROM articulos a INNER JOIN lotes l ON a.codigo = l.codigo INNER JOIN stock s ON l.codigo = s.codigo AND l.lote = s.lote INNER JOIN pantone p ON l.pantone = p.pantone INNER JOIN historial h ON l.codigo = h.codigo AND l.lote = h.lote WHERE s.cantidad > 0 AND s.suc = '$suc' AND l.lote ='$lote' GROUP BY lote ORDER BY h.fecha_hora ASC LIMIT 1"; $my->Query($query); if($my->NextRecord()){ $datos = $my->Record; if(count($datos)){ $datos = array_map("utf8_encode",$datos); // print_r($datos); $rem = "SELECT CONCAT(fecha_cierre,' ',hora_cierre) AS fecha_ingreso FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado = 'Cerrada' AND n.suc_d = '$suc'"; $db->Query($rem); if($db->NumRows() > 0){ $db->NextRecord(); $fecha_ingreso = $db->Record['fecha_ingreso']; $datos['entDate'] = $fecha_ingreso; } // Buscar si esta en una Remision Abierta o En Proceso $rem2 = "SELECT n.n_nro, n.suc_d FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado != 'Cerrada' AND n.suc = '$suc'"; $db->Query($rem2); if($db->NumRows() > 0){ $db->NextRecord(); $n_nro = $db->Record['n_nro']; $destino = $db->Record['suc_d']; $datos['NroRemision'] = $n_nro; $datos['Destino'] = $destino; $datos['Mensaje']="En Remision"; }else{ $datos['Mensaje']="Ok"; } } echo json_encode($datos); }else{ echo '{"Mensaje":"Error: Codigo no encontrado!"}'; } $my->Close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tratarDados(){\r\n\t\r\n\t\r\n }", "public function buscar() {\n $buscarUsuario = new SqlQuery(); //instancio la clase\n (string) $tabla = get_class($this); //uso el nombre de la clase que debe coincidir con la BD \n try {\n $this->refControladorPersisten...
[ "0.7277294", "0.6992221", "0.6970021", "0.6914607", "0.68807626", "0.68654364", "0.6788247", "0.6772586", "0.6770132", "0.6710244", "0.67081934", "0.6697873", "0.66890967", "0.6675472", "0.6667931", "0.6650569", "0.66496074", "0.6638317", "0.6620134", "0.6616847", "0.66155595...
0.6919877
3
/ Busca Hijos y Nietos
public function buscarHijos($lote){ $my_link = new My(); $l_lotes = trim(implode(',',array_map(array($this,'comillas'),explode(',',$lote))),','); $lotes = $l_lotes; $seguir = true; $padre = $l_lotes; while($seguir){ $my_link->Query("SELECT DISTINCT lote FROM lotes WHERE padre in ($padre)"); if($my_link->NumRows() >0 ){ $padre = ''; while($my_link->NextRecord()){ $lotes .= ",'".$my_link->Record['DistNumber']."'"; $padre .= (strlen($padre)>0)?",'".$my_link->Record['lote']."'" : "'".$my_link->Record['lote']."'"; } }else{ $seguir = false; } } $my_link->Close(); return $lotes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function huruf($jenis, $papar)\n{\n \n switch ($jenis) \n {// mula - pilih $jenis\n case 'BESAR':\n $papar = strtoupper($papar);\n break;\n case 'kecil':\n $papar = strtolower($papar);\n break;\n case 'Depan':\n $papar = ucfrist($papar);\n break;\n cas...
[ "0.6456397", "0.6274049", "0.62630326", "0.62465155", "0.62362045", "0.6206677", "0.61101943", "0.61010575", "0.6100775", "0.6051644", "0.603976", "0.6031864", "0.6021395", "0.59560406", "0.59295666", "0.5915728", "0.59094906", "0.59057176", "0.58976185", "0.5864395", "0.5863...
0.56479734
54
Nuevo proceso de inventario
public function nuevo_inventario($usuario,$suc){ $respuesta = array(); $my = new My(); $my->Query("INSERT INTO inventario_cab (usuario, suc,inicio) VALUES ('$usuario', '$suc',CURRENT_TIMESTAMP)"); if($my->AffectedRows()>0){ $my->Query("SELECT id_inv,inicio, DATE_FORMAT(inicio,'%d/%m/%Y %H:%i:%s') AS fechaFormat FROM inventario_cab WHERE suc='$suc' AND estado='En_proceso' ORDER BY id_inv DESC LIMIT 1"); if($my->NextRecord()){ $respuesta['id_inv'] = $my->Record['id_inv']; $respuesta['fechaIni'] = $my->Record['inicio']; $respuesta['fechaFormat'] = $my->Record['fechaFormat']; $my->Close(); }else{ $respuesta['erro'] = 'No se pudo generar nuevo proceso de inventario!'; } } echo json_encode($respuesta); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contarInventario(){\n\t}", "function evt__procesar(){\n $m = $this->dep('datos')->tabla('mesa')->get();\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Ingreso con perfil junta_electoral\n $m['estado'] ...
[ "0.7659881", "0.66327256", "0.63721544", "0.614789", "0.6137141", "0.60667646", "0.6021031", "0.5918047", "0.59020275", "0.58971465", "0.5884642", "0.58771527", "0.5867386", "0.58673763", "0.5856808", "0.5838169", "0.5837837", "0.58061534", "0.5792422", "0.57709295", "0.57521...
0.0
-1
Apply criteria in query repository
public function apply($model, RepositoryInterface $repository) { $user = \Auth::user()->centrodistribuicao_id; /* $m = $model->join('estoques', 'produtos.id', '=', 'estoques.produto_id') ->where('estoques.centrodistribuicao_id', 1) ->where('estoques.quantidade', '>', 0) ->select('estoques.produto_id')->get(); $m = $m->map(function ($values) { return $values->produto_id; }); */ return $model->whereIn('produtos.id', $m->all()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function applyCriteria(){\n\n if( $this->skipCriteria === true )\n return $this;\n\n $criteria = $this->getCriteria();\n\n foreach($criteria as $c){\n if( $c instanceof Criteria ){\n $this->query = $c->apply($this->query, $this);\n }\n...
[ "0.6811799", "0.6661819", "0.6607693", "0.65704405", "0.6328398", "0.6313058", "0.6246386", "0.6239954", "0.6103051", "0.6103051", "0.60741377", "0.603045", "0.6022999", "0.5984234", "0.5976314", "0.5937813", "0.59150434", "0.58896244", "0.5838984", "0.58384633", "0.57891655"...
0.0
-1
Create a new rule instance FirstMessageRule constructor.
public function __construct($length) { $this->length = $length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testFirstMessage()\n {\n $message = new PrivateMessage();\n $conversation = new Conversation();\n $this->assertNull($conversation->getFirstMessage());\n\n $conversation->setFirstMessage($message);\n $this->assertSame($message, $conversation->getFirstMessag...
[ "0.5509883", "0.5039489", "0.5022983", "0.49700826", "0.49374124", "0.49327034", "0.4930594", "0.49112386", "0.48845673", "0.48426783", "0.4807106", "0.47827804", "0.4769932", "0.47661114", "0.4756298", "0.4724198", "0.469507", "0.46549273", "0.4641241", "0.46378624", "0.4624...
0.0
-1
Determine if the validation rule passes.
public function passes($attribute, $value) { $user = Auth::user(); if (strlen($value) > 200 && !$user->messages()->count()) return false; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidationPassed();", "public function passes()\n {\n $validator = $this->validator->make($this->data, $this->rules, $this->messages);\n \n if($validator->fails())\n {\n $this->errors = $validator->messages();\n return false;\n }\n \n return true;\n }", "publi...
[ "0.8134079", "0.7997835", "0.7949278", "0.7919281", "0.7847517", "0.7822461", "0.7803436", "0.76242334", "0.74825335", "0.7478956", "0.7434276", "0.73734236", "0.72997475", "0.72766656", "0.72679114", "0.72175634", "0.72138244", "0.7207498", "0.72072244", "0.7204593", "0.7193...
0.0
-1
Get the validation error message.
public function message() { return "The first :attribute may not be greater than $this->length characters."; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\...
[ "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8207248", "0.8094182", "0.8061137", "0.80309856", "0.8023962", "0.79981095", "0.7994271", "0.79576373", "0.7955562", "0.7948321", "0.7938317", "0.7914095", "0.78989285", "0.78862643", "0.78477675...
0.0
-1
Get the document root for this project. Attempts getcwd(), falls back to directory traversal.
public static function getBasepath() { if (!self::$basePath) { $candidate = getcwd() ?: dirname(dirname(dirname(dirname(__FILE__)))); self::$basePath = rtrim($candidate, DIRECTORY_SEPARATOR); } return self::$basePath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getDocumentRoot()\r\n\t{\r\n\t\tstatic $documentRoot = null;\r\n\t\tif ($documentRoot != null)\r\n\t\t\treturn $documentRoot;\r\n\r\n\t\t$context = Application::getInstance()->getContext();\r\n\t\tif ($context != null)\r\n\t\t{\r\n\t\t\t$server = $context->getServer();\r\n\t\t\tif ($server !...
[ "0.77884465", "0.77728826", "0.7559595", "0.7470992", "0.7424415", "0.7360421", "0.73509467", "0.72946316", "0.7242076", "0.7206801", "0.7203336", "0.7173848", "0.71488136", "0.7139579", "0.7137348", "0.712162", "0.71142805", "0.708802", "0.70875156", "0.7023154", "0.6984831"...
0.6434071
52
Called after every "composer update" command, or after a "composer install" command has been executed without a lock file present
public static function postCreateProject(Event $event) { $io = $event->getIO(); $config = [ 'ddevShouldStart' => $io->askConfirmation('Would you like DDEV to start after the installation is complete?: [y/n] ', true), ]; self::updateDDevName(); self::copyEnv(); self::removeReadme(); self::installNpm(); if ($config['ddevShouldStart']) { self::startDDEV(); } exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function composerReload()\n {\n $composer = $this->findComposer();\n\n $process = new Process($composer.' dump-autoload');\n $process->setTimeout(null); // Setting timeout to null to prevent installation from stopping at a certain point in time\n $process->setWorkingDirectory...
[ "0.67744786", "0.66449744", "0.6560022", "0.65232295", "0.64771456", "0.6392589", "0.6374537", "0.6369589", "0.62225974", "0.62208426", "0.61451256", "0.59309155", "0.5912523", "0.58803487", "0.5861002", "0.585759", "0.58228296", "0.58164436", "0.5771563", "0.5738708", "0.568...
0.0
-1
Update the sitename placeholder in .ddev/config.yaml with the directory name
protected static function updateDDevName(): void { $base = self::getBasepath(); $directories = explode('/', $base); $directoryName = array_pop($directories); $ddevConfigPath = $base . '/.ddev/config.yaml'; if (file_exists($ddevConfigPath)) { $ddevConfig = file_get_contents($ddevConfigPath); $ddevConfig = str_replace('{sitename}', $directoryName, $ddevConfig); file_put_contents($ddevConfigPath, $ddevConfig); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateConfigApp() : void\n {\n $this->domainName = Str::title(Str::lower(Str::studly($this->domainName)));\n $configAppFilePath = config_path(\"app.php\");\n $oldValue = \"/*NewDomainsServiceProvider*/\";\n $newValue = \"App\\\\\".config(\"domain.pat...
[ "0.56040007", "0.53270847", "0.5232809", "0.5228946", "0.5197544", "0.50947136", "0.506499", "0.50548595", "0.5019438", "0.49987584", "0.49904034", "0.49785993", "0.4973142", "0.4967103", "0.49667454", "0.4963577", "0.49460825", "0.49360842", "0.4933854", "0.4931945", "0.4928...
0.80105674
0
Copies the .env.example to .env if it doesn't exist
protected static function copyEnv(): void { $base = self::getBasepath(); $envPath = $base . '/.env'; $examplePath = $base . '/.env.example'; if (file_exists($examplePath) && !file_exists($envPath)) { copy($examplePath, $envPath); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createEnvFile()\n {\n if (! file_exists('.env')) {\n copy('.env.example', '.env');\n $this->line('.env file successfully created');\n }\n }", "public static function copyEnv()\n {\n // Get VCAP_APPLICATION\n $vcapsApplication = json_de...
[ "0.7551238", "0.6644462", "0.6558725", "0.6294258", "0.61804384", "0.61367", "0.61296517", "0.60745007", "0.6059287", "0.60549015", "0.6017924", "0.59529054", "0.59469897", "0.59280616", "0.5917926", "0.58679223", "0.5857066", "0.5803609", "0.57858473", "0.5783957", "0.576681...
0.8148647
0
Runs "npm install" if a package.json file is present in the project.
protected static function installNpm(): void { $basePath = self::getBasepath(); $themePath = $basePath . '/themes/default/'; if (file_exists($themePath . '/package.json')) { echo shell_exec('ddev theme install'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function installNpm()\n {\n $basePath = self::getBasepath();\n $themePath = $basePath . '/themes/default/';\n\n if (file_exists($themePath . '/package.json')) {\n $current = __DIR__;\n chdir($themePath);\n echo shell_exec('npm install');\n ...
[ "0.7334342", "0.65567833", "0.632692", "0.5848454", "0.5686467", "0.56734914", "0.5594058", "0.5585572", "0.55724037", "0.5552601", "0.53995436", "0.53933674", "0.5317014", "0.5310664", "0.5308959", "0.5298278", "0.5278894", "0.52740926", "0.5262637", "0.52132183", "0.5210076...
0.69844997
1
Removes README.md from the project.
protected static function removeReadme(): void { $basePath = self::getBasepath(); if (file_exists($basePath . '/README.md')) { unlink($basePath . '/README.md'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function removeReadme()\n {\n $basePath = self::getBasepath();\n\n if (file_exists($basePath . '/README.md')) {\n unlink($basePath . '/README.md');\n }\n }", "protected function createReadme() :void\n {\n $path = app_path('readme.md');\n\n S...
[ "0.79977196", "0.67315334", "0.61825985", "0.5848066", "0.5719331", "0.56311715", "0.54835165", "0.5389537", "0.53789705", "0.5251935", "0.5251701", "0.5218745", "0.51502585", "0.506788", "0.50622153", "0.50605273", "0.5029634", "0.500807", "0.5003002", "0.4989636", "0.498699...
0.79444027
1
Database functions Alters a database the multiple return vals are for postgres 8+ which support more functionality in alter database
function alterDatabase($dbName, $newName, $newOwner = '', $comment = '') { //ignore $newowner, not supported pre 8.0 //ignore $comment, not supported pre 8.2 $this->clean($dbName); $this->clean($newName); $status = $this->alterDatabaseRename($dbName, $newName); if ($status != 0) return -3; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upgrade_4_pgsql() { \n $table_domain = table_by_key('domain');\n $table_admin = table_by_key('admin');\n $table_alias = table_by_key('alias');\n $table_domain_admins = table_by_key('domain_admins');\n $table_log = table_by_key('log');\n $table_mailbox = table_by_key('mailbox');\n $tab...
[ "0.60884917", "0.6075634", "0.6018623", "0.59913206", "0.5980806", "0.5889722", "0.58788276", "0.58231515", "0.57746106", "0.574591", "0.5724935", "0.5694065", "0.55582935", "0.55403566", "0.55365884", "0.55107427", "0.55073565", "0.5465511", "0.5456876", "0.5450064", "0.5427...
0.0
-1
Return all database available on the server
function getDatabases($currentdatabase = NULL) { global $conf, $misc; $server_info = $misc->getServerInfo(); if (isset($conf['owned_only']) && $conf['owned_only'] && !$this->isSuperUser()) { $username = $server_info['username']; $this->clean($username); $clause = " AND pu.usename='{$username}'"; } else $clause = ''; if ($currentdatabase != NULL) { $this->clean($currentdatabase); $orderby = "ORDER BY pdb.datname = '{$currentdatabase}' DESC, pdb.datname"; } else $orderby = "ORDER BY pdb.datname"; if (!$conf['show_system']) $where = ' AND NOT pdb.datistemplate'; else $where = ' AND pdb.datallowconn'; $sql = "SELECT pdb.datname AS datname, pu.usename AS datowner, pg_encoding_to_char(encoding) AS datencoding, (SELECT description FROM pg_description pd WHERE pdb.oid=pd.objoid) AS datcomment FROM pg_database pdb, pg_user pu WHERE pdb.datdba = pu.usesysid {$where} {$clause} {$orderby}"; return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listDatabases(){\n\t\treturn $this->instance->listDatabases();\n\t}", "public function get_dbs()\n\t{\n\t\treturn $this->driver_query('db_list');\n\t}", "function database_list(){\n\t\treturn($this->q2obj(\"show databases\"));\n\t}", "public function getDatabases(){\n $pdo = $this->pdo...
[ "0.8290723", "0.82333374", "0.8066683", "0.79989105", "0.7912126", "0.7908097", "0.7880011", "0.7820951", "0.7769765", "0.7720403", "0.7697992", "0.768049", "0.7621503", "0.7573571", "0.74720955", "0.7403186", "0.73112625", "0.72658414", "0.7236399", "0.7157369", "0.7119026",...
0.6921328
26
Searches all system catalogs to find objects that match a certain name.
function findObject($term, $filter) { global $conf; /*about escaping: * SET standard_conforming_string is not available before 8.2 * So we must use PostgreSQL specific notation :/ * E'' notation is not available before 8.1 * $$ is available since 8.0 * Nothing specific from 7.4 **/ // Escape search term for ILIKE match $term = str_replace('_', '\\_', $term); $term = str_replace('%', '\\%', $term); $this->clean($term); $this->clean($filter); // Exclude system relations if necessary if (!$conf['show_system']) { // XXX: The mention of information_schema here is in the wrong place, but // it's the quickest fix to exclude the info schema from 7.4 $where = " AND pn.nspname NOT LIKE 'pg\\\\_%' AND pn.nspname != 'information_schema'"; $lan_where = "AND pl.lanispl"; } else { $where = ''; $lan_where = ''; } // Apply outer filter $sql = ''; if ($filter != '') { $sql = "SELECT * FROM ("; } $sql .= " SELECT 'SCHEMA' AS type, oid, NULL AS schemaname, NULL AS relname, nspname AS name FROM pg_catalog.pg_namespace pn WHERE nspname ILIKE '%{$term}%' {$where} UNION ALL SELECT CASE WHEN relkind='r' THEN 'TABLE' WHEN relkind='v' THEN 'VIEW' WHEN relkind='S' THEN 'SEQUENCE' END, pc.oid, pn.nspname, NULL, pc.relname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn WHERE pc.relnamespace=pn.oid AND relkind IN ('r', 'v', 'S') AND relname ILIKE '%{$term}%' {$where} UNION ALL SELECT CASE WHEN pc.relkind='r' THEN 'COLUMNTABLE' ELSE 'COLUMNVIEW' END, NULL, pn.nspname, pc.relname, pa.attname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn, pg_catalog.pg_attribute pa WHERE pc.relnamespace=pn.oid AND pc.oid=pa.attrelid AND pa.attname ILIKE '%{$term}%' AND pa.attnum > 0 AND NOT pa.attisdropped AND pc.relkind IN ('r', 'v') {$where} UNION ALL SELECT 'FUNCTION', pp.oid, pn.nspname, NULL, pp.proname || '(' || pg_catalog.oidvectortypes(pp.proargtypes) || ')' FROM pg_catalog.pg_proc pp, pg_catalog.pg_namespace pn WHERE pp.pronamespace=pn.oid AND NOT pp.proisagg AND pp.proname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'INDEX', NULL, pn.nspname, pc.relname, pc2.relname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn, pg_catalog.pg_index pi, pg_catalog.pg_class pc2 WHERE pc.relnamespace=pn.oid AND pc.oid=pi.indrelid AND pi.indexrelid=pc2.oid AND NOT EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc2.tableoid AND d.objid = pc2.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) AND pc2.relname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'CONSTRAINTTABLE', NULL, pn.nspname, pc.relname, pc2.conname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn, pg_catalog.pg_constraint pc2 WHERE pc.relnamespace=pn.oid AND pc.oid=pc2.conrelid AND pc2.conrelid != 0 AND CASE WHEN pc2.contype IN ('f', 'c') THEN TRUE ELSE NOT EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pc2.tableoid AND d.objid = pc2.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) END AND pc2.conname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'CONSTRAINTDOMAIN', pt.oid, pn.nspname, pt.typname, pc.conname FROM pg_catalog.pg_type pt, pg_catalog.pg_namespace pn, pg_catalog.pg_constraint pc WHERE pt.typnamespace=pn.oid AND pt.oid=pc.contypid AND pc.contypid != 0 AND pc.conname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'TRIGGER', NULL, pn.nspname, pc.relname, pt.tgname FROM pg_catalog.pg_class pc, pg_catalog.pg_namespace pn, pg_catalog.pg_trigger pt WHERE pc.relnamespace=pn.oid AND pc.oid=pt.tgrelid AND ( pt.tgisconstraint = 'f' OR NOT EXISTS (SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = pt.tableoid AND d.objid = pt.oid AND d.deptype = 'i' AND c.contype = 'f')) AND pt.tgname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'RULETABLE', NULL, pn.nspname AS schemaname, c.relname AS tablename, r.rulename FROM pg_catalog.pg_rewrite r JOIN pg_catalog.pg_class c ON c.oid = r.ev_class LEFT JOIN pg_catalog.pg_namespace pn ON pn.oid = c.relnamespace WHERE c.relkind='r' AND r.rulename != '_RETURN' AND r.rulename ILIKE '%{$term}%' {$where} UNION ALL SELECT 'RULEVIEW', NULL, pn.nspname AS schemaname, c.relname AS tablename, r.rulename FROM pg_catalog.pg_rewrite r JOIN pg_catalog.pg_class c ON c.oid = r.ev_class LEFT JOIN pg_catalog.pg_namespace pn ON pn.oid = c.relnamespace WHERE c.relkind='v' AND r.rulename != '_RETURN' AND r.rulename ILIKE '%{$term}%' {$where} "; // Add advanced objects if show_advanced is set if ($conf['show_advanced']) { $sql .= " UNION ALL SELECT CASE WHEN pt.typtype='d' THEN 'DOMAIN' ELSE 'TYPE' END, pt.oid, pn.nspname, NULL, pt.typname FROM pg_catalog.pg_type pt, pg_catalog.pg_namespace pn WHERE pt.typnamespace=pn.oid AND typname ILIKE '%{$term}%' AND (pt.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = pt.typrelid)) {$where} UNION ALL SELECT 'OPERATOR', po.oid, pn.nspname, NULL, po.oprname FROM pg_catalog.pg_operator po, pg_catalog.pg_namespace pn WHERE po.oprnamespace=pn.oid AND oprname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'CONVERSION', pc.oid, pn.nspname, NULL, pc.conname FROM pg_catalog.pg_conversion pc, pg_catalog.pg_namespace pn WHERE pc.connamespace=pn.oid AND conname ILIKE '%{$term}%' {$where} UNION ALL SELECT 'LANGUAGE', pl.oid, NULL, NULL, pl.lanname FROM pg_catalog.pg_language pl WHERE lanname ILIKE '%{$term}%' {$lan_where} UNION ALL SELECT DISTINCT ON (p.proname) 'AGGREGATE', p.oid, pn.nspname, NULL, p.proname FROM pg_catalog.pg_proc p LEFT JOIN pg_catalog.pg_namespace pn ON p.pronamespace=pn.oid WHERE p.proisagg AND p.proname ILIKE '%{$term}%' {$where} UNION ALL SELECT DISTINCT ON (po.opcname) 'OPCLASS', po.oid, pn.nspname, NULL, po.opcname FROM pg_catalog.pg_opclass po, pg_catalog.pg_namespace pn WHERE po.opcnamespace=pn.oid AND po.opcname ILIKE '%{$term}%' {$where} "; } // Otherwise just add domains else { $sql .= " UNION ALL SELECT 'DOMAIN', pt.oid, pn.nspname, NULL, pt.typname FROM pg_catalog.pg_type pt, pg_catalog.pg_namespace pn WHERE pt.typnamespace=pn.oid AND pt.typtype='d' AND typname ILIKE '%{$term}%' AND (pt.typrelid = 0 OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = pt.typrelid)) {$where} "; } if ($filter != '') { // We use like to make RULE, CONSTRAINT and COLUMN searches work $sql .= ") AS sub WHERE type LIKE '{$filter}%' "; } $sql .= "ORDER BY type, schemaname, relname, name"; return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fetchCatalogByName($name)\n {\n $Sql = \"SELECT * FROM `db_catalogs` WHERE name = :name\";\n Parent::query($Sql);\n\n Parent::bindParams('name', $name);\n $catalog = Parent::fetch();\n if (empty($catalog)) {\n retur...
[ "0.59638155", "0.57524866", "0.57524866", "0.57524866", "0.5720699", "0.5650301", "0.5650301", "0.5636713", "0.5564572", "0.55217874", "0.54367834", "0.53571254", "0.527989", "0.5147975", "0.5137915", "0.5086411", "0.50156116", "0.5009181", "0.5007363", "0.50065666", "0.49934...
0.5123369
15
Returns table locks information in the current database
function getLocks() { global $conf; if (!$conf['show_system']) $where = "AND pn.nspname NOT LIKE 'pg\\\\_%'"; else $where = "AND nspname !~ '^pg_t(emp_[0-9]+|oast)$'"; $sql = "SELECT pn.nspname, pc.relname AS tablename, pl.transaction, pl.pid, pl.mode, pl.granted FROM pg_catalog.pg_locks pl, pg_catalog.pg_class pc, pg_catalog.pg_namespace pn WHERE pl.relation = pc.oid AND pc.relnamespace=pn.oid {$where} ORDER BY nspname,tablename"; return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocks();", "protected function getLockTablesQuery()\n {\n $newDbName = $this->newDbName;\n $oldDbName = $this->oldDbName;\n\n $tablesLocks = array_map(function ($table) use ($newDbName, $oldDbName) {\n return [\"{$newDbName}.{$table} WRITE\", \"{$oldDbName}.{$table}...
[ "0.7128183", "0.6891073", "0.6674592", "0.63838595", "0.63678104", "0.62678874", "0.6111381", "0.6071616", "0.60571986", "0.60114866", "0.60066295", "0.59425944", "0.58664453", "0.5799368", "0.577263", "0.57592314", "0.57064563", "0.5694649", "0.5665413", "0.5633671", "0.5626...
0.794663
0
Returns the current database encoding
function getDatabaseEncoding() { $sql = "SELECT getdatabaseencoding() AS encoding"; return $this->selectField($sql, 'encoding'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEncoding() {\n\t\treturn $this->fetchRow('PRAGMA encoding');\n\t}", "public function getEncoding()\n {\n return $this->fetchRow('PRAGMA encoding');\n }", "function getEncoding() {\n\t\treturn mysql_client_encoding($this->connection);\n\t}", "public function encoding()\n {\n ...
[ "0.82511604", "0.81630945", "0.79951113", "0.79760355", "0.787582", "0.772699", "0.7725211", "0.7709512", "0.7694289", "0.76809746", "0.7680298", "0.7680298", "0.7680298", "0.7680298", "0.7650099", "0.76317376", "0.76317376", "0.76009744", "0.76009744", "0.75444674", "0.75089...
0.88552
0
Table functions Protected method which alter a table SHOULDN'T BE CALLED OUTSIDE OF A TRANSACTION
protected function _alterTable($tblrs, $name, $owner, $schema, $comment, $tablespace) { /* $schema and tablespace not supported in pg74- */ $this->fieldArrayClean($tblrs->fields); // Comment $status = $this->setComment('TABLE', '', $tblrs->fields['relname'], $comment); if ($status != 0) return -4; // Owner $this->fieldClean($owner); $status = $this->alterTableOwner($tblrs, $owner); if ($status != 0) return -5; // Rename $this->fieldClean($name); $status = $this->alterTableName($tblrs, $name); if ($status != 0) return -3; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "public function tableModify()\n {\n }", "private function _alter() {\n\t\t$queries = array();\n\t\t\n\t\t$queries[] = ('BEGIN TRANSACTION');\n\t\t$q = \"SELECT ...
[ "0.7687906", "0.7687906", "0.7687906", "0.7687906", "0.6505686", "0.64326775", "0.6249446", "0.6198668", "0.61982983", "0.61132956", "0.60054153", "0.5980545", "0.59110594", "0.59095955", "0.589591", "0.58638173", "0.5855509", "0.5824177", "0.5822611", "0.58222103", "0.580783...
0.58309734
17
Alters a column in a table OR view
function alterColumn($table, $column, $name, $notnull, $oldnotnull, $default, $olddefault, $type, $length, $array, $oldtype, $comment) { $status = $this->beginTransaction(); if ($status != 0) return -1; // @@ NEED TO HANDLE "NESTED" TRANSACTION HERE if ($notnull != $oldnotnull) { $status = $this->setColumnNull($table, $column, !$notnull); if ($status != 0) { $this->rollbackTransaction(); return -2; } } // Set default, if it has changed if ($default != $olddefault) { if ($default == '') $status = $this->dropColumnDefault($table, $column); else $status = $this->setColumnDefault($table, $column, $default); if ($status != 0) { $this->rollbackTransaction(); return -3; } } // Rename the column, if it has been changed if ($column != $name) { $status = $this->renameColumn($table, $column, $name); if ($status != 0) { $this->rollbackTransaction(); return -4; } } // The $name and $table parameters must be cleaned for the setComment function. // It's ok to do that here since this is the last time these variables are used. $this->fieldClean($name); $this->fieldClean($table); $status = $this->setComment('COLUMN', $name, $table, $comment); if ($status != 0) { $this->rollbackTransaction(); return -5; } return $this->endTransaction(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeColumn($table, $oldCol, $newCol, $type=false);", "public function modifyColumn($tableName, $schemaName, $column){ }", "public function modify()\r\n\t{\r\n\t\tif( ! $this->loaded())\r\n\t\t{\r\n\t\t\tthrow new Kohana_Exception('Unable to modify an unloaded column :col', array(\r\n\t\t\t\t'col'\t=...
[ "0.75989735", "0.6809616", "0.66632706", "0.6628158", "0.66102254", "0.65701663", "0.65083814", "0.6422439", "0.6413528", "0.6340099", "0.63200897", "0.6173714", "0.6142707", "0.61085284", "0.61059654", "0.60837543", "0.6080613", "0.6073623", "0.6070434", "0.6037789", "0.6032...
0.580935
53
Return all tables in current database (and schema)
function getTables($all = false) { $c_schema = $this->_schema; $this->clean($c_schema); if ($all) { // Exclude pg_catalog and information_schema tables $sql = "SELECT schemaname AS nspname, tablename AS relname, tableowner AS relowner FROM pg_catalog.pg_tables WHERE schemaname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') ORDER BY schemaname, tablename"; } else { $sql = "SELECT c.relname, pg_catalog.pg_get_userbyid(c.relowner) AS relowner, pg_catalog.obj_description(c.oid, 'pg_class') AS relcomment, reltuples::bigint FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind = 'r' AND nspname='{$c_schema}' ORDER BY c.relname"; } return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables((array) $this->connection->getConfig('schema'))\n );\n }", "protected function getAllTables()\n {\n return $this->getConnection()->select(\n $this->gram...
[ "0.8500952", "0.8346688", "0.8285438", "0.80537945", "0.78236204", "0.7798909", "0.77354", "0.77112806", "0.7689545", "0.7685804", "0.7680288", "0.76460004", "0.76428217", "0.7618494", "0.7617454", "0.7603091", "0.7570923", "0.75654423", "0.7544136", "0.75136375", "0.74983394...
0.74652255
21
Returns the current default_with_oids setting
function getDefaultWithOid() { // 8.0 is the first release to have this setting // Prior releases don't have this setting... oids always activated return 'on'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultWithOid() {\n\n\t\t$sql = \"SHOW default_with_oids\";\n\n\t\treturn $this->selectField($sql, 'default_with_oids');\n\t}", "protected function get_default() {\n\t\treturn array( 'ownerID' => 0 );\n\t}", "function get_defaultsetting() {\n return $this->defaultsetting;\n }", "public...
[ "0.8139143", "0.65943444", "0.6342786", "0.62780774", "0.61722475", "0.6169658", "0.60390615", "0.6026518", "0.60127527", "0.5982875", "0.5978619", "0.5910437", "0.5862489", "0.5839659", "0.5837869", "0.5837418", "0.58335173", "0.58161354", "0.57959735", "0.57930255", "0.5787...
0.76608455
1
Constraint functions Returns a list of all constraints on a table, including constraint name, definition, related col and referenced namespace, table and col if needed
function getConstraintsWithFields($table) { $c_schema = $this->_schema; $this->clean($c_schema); $this->clean($table); // get the max number of col used in a constraint for the table $sql = "SELECT DISTINCT max(SUBSTRING(array_dims(c.conkey) FROM '^\\\\[.*:(.*)\\\\]$')) as nb FROM pg_catalog.pg_constraint AS c JOIN pg_catalog.pg_class AS r ON (c.conrelid=r.oid) JOIN pg_catalog.pg_namespace AS ns ON (r.relnamespace=ns.oid) WHERE r.relname = '{$table}' AND ns.nspname='{$c_schema}'"; $rs = $this->selectSet($sql); if ($rs->EOF) $max_col = 0; else $max_col = $rs->fields['nb']; $sql = ' SELECT c.oid AS conid, c.contype, c.conname, pg_catalog.pg_get_constraintdef(c.oid, true) AS consrc, ns1.nspname as p_schema, r1.relname as p_table, ns2.nspname as f_schema, r2.relname as f_table, f1.attname as p_field, f1.attnum AS p_attnum, f2.attname as f_field, f2.attnum AS f_attnum, pg_catalog.obj_description(c.oid, \'pg_constraint\') AS constcomment, c.conrelid, c.confrelid FROM pg_catalog.pg_constraint AS c JOIN pg_catalog.pg_class AS r1 ON (c.conrelid=r1.oid) JOIN pg_catalog.pg_attribute AS f1 ON (f1.attrelid=r1.oid AND (f1.attnum=c.conkey[1]'; for ($i = 2; $i <= $rs->fields['nb']; $i++) { $sql.= " OR f1.attnum=c.conkey[$i]"; } $sql.= ')) JOIN pg_catalog.pg_namespace AS ns1 ON r1.relnamespace=ns1.oid LEFT JOIN ( pg_catalog.pg_class AS r2 JOIN pg_catalog.pg_namespace AS ns2 ON (r2.relnamespace=ns2.oid) ) ON (c.confrelid=r2.oid) LEFT JOIN pg_catalog.pg_attribute AS f2 ON (f2.attrelid=r2.oid AND ((c.confkey[1]=f2.attnum AND c.conkey[1]=f1.attnum)'; for ($i = 2; $i <= $rs->fields['nb']; $i++) $sql.= " OR (c.confkey[$i]=f2.attnum AND c.conkey[$i]=f1.attnum)"; $sql .= sprintf(")) WHERE r1.relname = '%s' AND ns1.nspname='%s' ORDER BY 1", $table, $c_schema); return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getConstraints($tableName) {\n $constraints = DbManager::query(\"select TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME,\n REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE\n where table_name = '$tableName'\");\n return $...
[ "0.746639", "0.693201", "0.6890931", "0.6868531", "0.6831753", "0.6791077", "0.6779372", "0.6769578", "0.6655093", "0.6639738", "0.6578574", "0.6568467", "0.65648335", "0.655904", "0.65273464", "0.6445459", "0.635602", "0.6333815", "0.63224715", "0.6318673", "0.6258683", "0...
0.71316516
1
Sequence functions Returns all sequences in the current database
function getSequences($all = false) { $c_schema = $this->_schema; $this->clean($c_schema); if ($all) { // Exclude pg_catalog and information_schema tables $sql = "SELECT n.nspname, c.relname AS seqname, u.usename AS seqowner FROM pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_namespace n WHERE c.relowner=u.usesysid AND c.relnamespace=n.oid AND c.relkind = 'S' AND n.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast') ORDER BY nspname, seqname"; } else { $sql = "SELECT c.relname AS seqname, u.usename AS seqowner, pg_catalog.obj_description(c.oid, 'pg_class') AS seqcomment FROM pg_catalog.pg_class c, pg_catalog.pg_user u, pg_catalog.pg_namespace n WHERE c.relowner=u.usesysid AND c.relnamespace=n.oid AND c.relkind = 'S' AND n.nspname='{$c_schema}' ORDER BY seqname"; } return $this->selectSet( $sql ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_sequences()\n\t{\n\t\treturn $this->driver_query('sequence_list');\n\t}", "public function getSequences()\n {\n $main_actions = [\n 'sequence' => \\adminer\\lang('Create sequence'),\n ];\n\n $headers = [\n \\adminer\\lang('Name'),\n ];\n\n ...
[ "0.8136024", "0.7423928", "0.7077528", "0.64897966", "0.6129248", "0.60549", "0.59157425", "0.58499014", "0.5774951", "0.57231396", "0.57211506", "0.56081337", "0.55795294", "0.5522043", "0.5512508", "0.5490074", "0.54655147", "0.5461807", "0.5416555", "0.54039043", "0.533166...
0.7641541
1
Function functions Returns all details for a particular function
function getFunction($function_oid) { $this->clean($function_oid); $sql = " SELECT pc.oid AS prooid, proname, pg_catalog.pg_get_userbyid(proowner) AS proowner, nspname as proschema, lanname as prolanguage, pg_catalog.format_type(prorettype, NULL) as proresult, prosrc, probin, proretset, proisstrict, provolatile, prosecdef, pg_catalog.oidvectortypes(pc.proargtypes) AS proarguments, pg_catalog.obj_description(pc.oid, 'pg_proc') AS procomment FROM pg_catalog.pg_proc pc, pg_catalog.pg_language pl, pg_catalog.pg_namespace n WHERE pc.oid = '$function_oid'::oid AND pc.prolang = pl.oid AND n.oid = pc.pronamespace "; return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderFunctionDetail() {\n\n reset($this->accessModifiers);\n while (list($k, $access) = each($this->accessModifiers)) {\n if (0 == count($this->functions[$access]))\n continue;\n\n reset($this->functions[$access]);\n while (list($name, $functi...
[ "0.7440821", "0.71500134", "0.70728546", "0.70372677", "0.69395137", "0.6679136", "0.6670362", "0.65871537", "0.65620303", "0.65513647", "0.65463567", "0.6498408", "0.63662654", "0.6245372", "0.62339294", "0.6212506", "0.6208981", "0.6194244", "0.61845285", "0.6155663", "0.61...
0.0
-1
Returns a list of all casts in the database
function getCasts() { global $conf; if ($conf['show_system']) $where = ''; else $where = " AND n1.nspname NOT LIKE 'pg\\\\_%' AND n2.nspname NOT LIKE 'pg\\\\_%' AND n3.nspname NOT LIKE 'pg\\\\_%' "; $sql = " SELECT c.castsource::pg_catalog.regtype AS castsource, c.casttarget::pg_catalog.regtype AS casttarget, CASE WHEN c.castfunc=0 THEN NULL ELSE c.castfunc::pg_catalog.regprocedure END AS castfunc, c.castcontext, obj_description(c.oid, 'pg_cast') as castcomment FROM (pg_catalog.pg_cast c LEFT JOIN pg_catalog.pg_proc p ON c.castfunc=p.oid JOIN pg_catalog.pg_namespace n3 ON p.pronamespace=n3.oid), pg_catalog.pg_type t1, pg_catalog.pg_type t2, pg_catalog.pg_namespace n1, pg_catalog.pg_namespace n2 WHERE c.castsource=t1.oid AND c.casttarget=t2.oid AND t1.typnamespace=n1.oid AND t2.typnamespace=n2.oid {$where} ORDER BY 1, 2 "; return $this->selectSet($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCasts()\n {\n return $this->casts;\n }", "public function getCasts()\n {\n return $this->casts;\n }", "public function getCasts()\n {\n $this->casts = array_merge($this->casts, [$this->getKeyName() => 'string']);\n\n return parent::getCasts();\n ...
[ "0.76228124", "0.76228124", "0.7091324", "0.67955893", "0.6617984", "0.64450264", "0.63517183", "0.63517183", "0.60695297", "0.6037045", "0.5944794", "0.5936853", "0.589986", "0.5887058", "0.5881256", "0.5836797", "0.5819469", "0.5765844", "0.57294995", "0.5715946", "0.568175...
0.72561485
2
Get translation as JSON string, from country code
public function getLanguage(string $countryCode) : string { $countryCode = strtolower($countryCode); if (isset($this->languageFilePaths[$countryCode]) === false) { $countryCode = $this->defaultLanguage; } $languageFileContent = $this->languageFilePaths[$countryCode]; // All comments are stripped from file, in order to make the JSON valid. // https://stackoverflow.com/questions/17776942/remove-fake-comments-from-json-file#17776997 $languageFileContent = trim(preg_replace("#/\*.*?\*/#s", "", file_get_contents($languageFileContent))); return $languageFileContent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function jsonSerialize()\n\t{\n\t\treturn $this->getTranslatedMessage();\n\t}", "abstract public function getLocaleCode();", "abstract public function countryISOCode();", "public function getCountry(): string\n {\n return $this->result->country_name;\n }", "public function getCountryNam...
[ "0.63338083", "0.6330433", "0.6239339", "0.61867195", "0.6186317", "0.6165376", "0.6097946", "0.6086784", "0.59307575", "0.59307575", "0.58631027", "0.58631027", "0.58317655", "0.58258826", "0.5795918", "0.57515574", "0.57169867", "0.57101166", "0.56969184", "0.56895137", "0....
0.5740372
16
Create a new event instance.
public function __construct(Payment $payment, $fromDeleted) { $this->payment = $payment; $this->fromDeleted = $fromDeleted; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createEvent()\n {\n return new Event();\n }", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = ...
[ "0.8178475", "0.73455495", "0.67515916", "0.6665345", "0.66544545", "0.66479546", "0.6640835", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6556383", "0.6543442", "0.64682955", "0.645909", "0.64520663", "0.6441302", "0.6438299", "0.63917476", "0.6371641", "0.6371641...
0.0
-1
Join fields to entity
protected function _joinFields() { $this->addAttributeToSelect('name')->addAttributeToSelect('sku')->addAttributeToSelect('cost'); $barcodeAttribute = $this->_scopeConfig->getValue('advancedstock/attributes/barcode_attribute'); if ($barcodeAttribute) $this->addAttributeToSelect($barcodeAttribute); $this->addAttributeToFilter('type_id', ['nin' => ['grouped', 'configurable', 'bundle', 'configurator']]); $this->getSelect()->join( ['wi' => $this->getTable('bms_advancedstock_warehouse_item')], 'wi_product_id = e.entity_id', ['*'] ); $this->getSelect()->joinLeft( ['sh' => $this->getTable('bms_advancedstock_sales_history')], 'wi_id = sh_warehouse_item_id', ['*'] ); $this->getSelect()->join( ['csi' => $this->getTable('cataloginventory_stock_item')], '(product_id = e.entity_id and stock_id = 1)', [] ); $this->getSelect()->where('((use_config_manage_stock = 1) || (use_config_manage_stock = 0 and manage_stock = 1))'); $this->getSelect()->columns(new \Zend_Db_Expr($this->getAvgPerWeekExpression().' as average_per_week')); $this->getSelect()->columns(new \Zend_Db_Expr($this->getRunOutExpression().' as run_out')); $this->getSelect()->columns(new \Zend_Db_Expr($this->getQtyOrderExpression().' as qty_to_order')); //$this->getSelect()->columns(new \Zend_Db_Expr('(wi.wi_physical_quantity * e.cost) as stock_value')); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _joinFields()\n {\n $reviewTable = $this->_resource->getTableName('review');\n $reviewDetailTable = $this->_resource->getTableName('review_detail');\n\n $this->addAttributeToSelect('name')->addAttributeToSelect('sku');\n\n $this->getSelect()->join(\n ['r...
[ "0.6516211", "0.6396712", "0.63415706", "0.6277079", "0.614865", "0.59897226", "0.5849751", "0.5816252", "0.57412124", "0.5577579", "0.5491818", "0.54328716", "0.5419498", "0.54173064", "0.5387934", "0.5314214", "0.5296718", "0.52721334", "0.52659696", "0.52652955", "0.523065...
0.58859336
6
Set order to attribute
public function setOrder($attribute, $dir = 'DESC') { switch ($attribute) { case 'wi_warehouse_id': case 'wi_physical_quantity': case 'wi_quantity_to_ship': case 'wi_available_quantity': case 'sh_range_1': case 'sh_range_2': case 'sh_range_3': $this->getSelect()->order($attribute . ' ' . $dir); break; case 'qty_to_order': $this->getSelect()->order(new \Zend_Db_Expr($this->getQtyOrderExpression() . ' ' . $dir)); break; case 'average_per_week': $this->getSelect()->order(new \Zend_Db_Expr($this->getAvgPerWeekExpression() . ' ' . $dir)); break; case 'run_out': $this->getSelect()->order(new \Zend_Db_Expr($this->getRunOutExpression() . ' ' . $dir)); break; default: parent::setOrder($attribute, $dir); break; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOrder($order);", "public function setOrder($value)\n {\n $key = $this->determineOrderColumnName();\n $this->attributes[$key] = $value;\n }", "public function setOrderAttribute($value)\n {\n $this->attributes['order'] = (GeneralFunctions::isSetAndIsNotNull($value)) ? $v...
[ "0.7499959", "0.74818605", "0.7376002", "0.7376002", "0.7332707", "0.70515233", "0.692388", "0.68264264", "0.67073274", "0.6705456", "0.6675893", "0.665964", "0.66119516", "0.65664285", "0.6565385", "0.6565385", "0.653806", "0.6481922", "0.6481922", "0.6454192", "0.64292324",...
0.6650814
12
Add attribute to filter
public function addAttributeToFilter($attribute, $condition = null, $joinType = 'inner') { switch ($attribute) { case 'wi_warehouse_id': case 'wi_physical_quantity': case 'wi_quantity_to_ship': case 'wi_available_quantity': case 'sh_range_1': case 'sh_range_2': case 'sh_range_3': $conditionSql = $this->_getConditionSql($attribute, $condition); $this->getSelect()->where($conditionSql); break; case 'qty_to_order': $conditionSql = $this->_getConditionSql($this->getQtyOrderExpression(), $condition); $this->getSelect()->where($conditionSql); break; case 'average_per_week': $conditionSql = $this->_getConditionSql($this->getAvgPerWeekExpression(), $condition); $this->getSelect()->where($conditionSql); break; case 'run_out': $conditionSql = $this->_getConditionSql($this->getRunOutExpression(), $condition); $this->getSelect()->where($conditionSql); break; default: parent::addAttributeToFilter($attribute, $condition, $joinType); break; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFilter(callable $filter);", "public function setAdditionalFilter($dataProvider, $filter);", "public function addFilter(DFilter $filter) {\n\t\t$this->filters[] = $filter;\n\t}", "public function attachFilter($name = '', $filter) {\n $this->filters[$name] = new $filter;\n }", "public ...
[ "0.6746683", "0.6650492", "0.6430959", "0.64063287", "0.63845795", "0.6310975", "0.63001966", "0.62289894", "0.6170719", "0.6141554", "0.61096406", "0.60613745", "0.6031739", "0.5983939", "0.59713864", "0.58694994", "0.5853175", "0.5850134", "0.58432376", "0.5842469", "0.5835...
0.5842674
19
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $duracion = DuracionResultado::findOrNew($request->get('duracion_id')); $duracion->resultado = $request->get('resultados'); $duracion->duracion = $request->get('duracion'); $duracion->competencia_id = $request->input('competencia.id'); $duracion->save(); return new DuracionResultadoResource($duracion); }
{ "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.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0....
0.0
-1
Display the specified resource.
public function show(DuracionResultado $duracionResultado) { // }
{ "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(DuracionResultado $duracionResultado) { // }
{ "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, DuracionResultado $duracionResultado) { // }
{ "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(DuracionResultado $duracionResultado) { $duracionResultado->delete(); return response()->json(null, 204); }
{ "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
Transform the resource into an array.
public function toArray($request) { return [ 'id' => $this->id, 'nickname' => $this->nickname, 'gender' => $this->gender, 'avatar' => $this->avatar, 'country' => $this->country, 'city' => $this->city, 'language' => $this->language, 'created_at' => date('Y-m-d H:i:s', strtotime($this->created_at)), 'updated_at' => date('Y-m-d H:i:s', strtotime($this->updated_at)) ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function toArray(): array\n {\n if (is_null($this->r...
[ "0.7750928", "0.7750928", "0.7715773", "0.75906307", "0.7310379", "0.7138024", "0.7134791", "0.7096877", "0.7096877", "0.70968604", "0.70968604", "0.70968604", "0.70968604", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.70955557", "0.7...
0.0
-1
/ $this>headers>setCookie('test', 'cookie'); $this>headers>send(); $this>assertEquals([], xdebug_get_headers());
public function testSend() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetCookiesHttpServer(): void\n {\n $this->configRequest(['cookies' => ['split_test' => 'abc']]);\n $this->get('/request_action/cookie_pass');\n $this->assertResponseOk();\n $this->assertResponseContains('\"split_test\":\"abc\"');\n $this->assertHeader('X-Mi...
[ "0.74277216", "0.70848256", "0.6984563", "0.6957108", "0.67911106", "0.66231006", "0.6580187", "0.65333396", "0.6527926", "0.64989823", "0.64690745", "0.6466123", "0.64127684", "0.6394232", "0.6379793", "0.63755244", "0.63631946", "0.6328431", "0.6327872", "0.63015187", "0.62...
0.0
-1
Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && true) { $isValid = true; } } return $isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkPageAllowed() {\n\n if (!$this->user->isPersonnalManager()) {\n\n header('Location: ./index.php');\n exit();\n }\n }", "public function restricted()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n if (iss...
[ "0.7618707", "0.7074496", "0.68970746", "0.6848366", "0.6788773", "0.6780954", "0.6756694", "0.66982704", "0.6679623", "0.66776997", "0.66607356", "0.66436356", "0.6604535", "0.65991277", "0.6586007", "0.65640384", "0.6561144", "0.65506417", "0.65426815", "0.6541643", "0.6539...
0.0
-1
Run the database seeds.
public function run() { $this->disableForeignKeys(); $user = User::query()->find(1); $user->assignRole(config('access.users.app_admin_role')); $this->enableForeignKeys(); }
{ "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.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.784195...
0.0
-1
see if cancel was pressed
function create_content_array() { if ($this->fetch_post('cancel', false)) { $this->redirect(page::fetch_post('redirect')); } else { // set action url $action = INFORMAL_URLBASE . '?' . $_SERVER['QUERY_STRING']; // find out where this page has been called from $redirect = $_SERVER['HTTP_REFERER']; // create form instance $form = new form('add', 'post', $action); // add text input field and make mandatory $form->addElement('text', 'name', 'Form Name'); $form->set_mandatory('name'); // add hidden field for redirect target $form->addElement('hidden', 'redirect', $redirect); // add buttons $button_submit = &HTML_QuickForm::createElement('submit', 'submit', 'erstelle Form', 'class="submitButton"'); $button_cancel = &HTML_QuickForm::createElement('submit', 'cancel', 'abbrechen', 'class="submitButton"'); // group buttons $form->addGroup(array($button_submit, $button_cancel)); // see if form validates if ($form->validate()) { $name = $form->getElementValue('name'); $all_forms = new all_forms(); $new_form_id = $all_forms->add_form($name); // redirect either to a given url or the http referer if ($this->redirect_url) { // %d is replaced by new form id $url = sprintf($this->redirect_url, $new_form_id); $this->redirect($url); } else { $this->redirect(page::fetch_post('redirect')); } } else { $content['form'] = $form->smarty_html($this); } // return content html for page return $content; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleCancel() {\n // logit('HC: ' . print_r($this->data, true));\n if ($this->data['submit_button'] == 'Cancel') {\n $this->data = array();\n $this->error = array();\n $this->_redirector->gotoUrl($this->mainpage);\n }\n }", "public function actionCancel()\n {\n }",...
[ "0.7119034", "0.7016405", "0.7013433", "0.69426024", "0.69426024", "0.68540275", "0.6848081", "0.67984027", "0.67675555", "0.6685239", "0.66083664", "0.65632224", "0.6557483", "0.65522313", "0.6509323", "0.6506732", "0.6497725", "0.6466793", "0.6400419", "0.6353753", "0.63531...
0.0
-1
\\ START POST Function //\\
public function post(){ if($this->access_role->is_Active() == false) show_404(); $this->load->model('Post_Model'); if($_SERVER['REQUEST_METHOD'] === 'POST') { if( $this->form_validation->run('post_validation') ) { if($_FILES['post_image']['size'] != 0) { $this->Post_Model->add_post(); } else { $error = ['class'=>'warning','text'=> 'No Image Selected']; $this->session->set_flashdata('sms_flash', $error); redirect('Dashboard/post'); } } else { $error = ['class'=>'warning','text'=> validation_errors()]; $this->session->set_flashdata('sms_flash', $error); } } $data = $this->Post_Model->post_info(); $this->load->view('admin/post_content',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function post() \n {\n \n }", "function _post()\r\n\t\t{\r\n\t\t}", "function post();", "function write_post()\n {\n }", "abstract public function post();", "public function post();", "public function post();", "public function post();", "function post_file()\r\n\t{\r\n\r\n\t}", ...
[ "0.85348463", "0.8466836", "0.8258295", "0.7930064", "0.7884478", "0.7743751", "0.7743751", "0.7743751", "0.73749197", "0.7303346", "0.72069985", "0.70646524", "0.7046873", "0.6978631", "0.6962482", "0.69349486", "0.6922956", "0.69029635", "0.68972075", "0.68956995", "0.68873...
0.0
-1
\\ END POST Function //\\ \\ START CATEGORY Function //\\
public function category() { if($this->access_role->is_Admin() == false) show_404(); $this->load->model('Category_Model'); if($_SERVER['REQUEST_METHOD'] == 'POST') { if($this->form_validation->run('category_insert') ){ $this->Category_Model->add_category(); } else { $error = ['class'=>'warning','text'=> validation_errors()]; $this->session->set_flashdata('sms_flash', $error); redirect('Dashboard/category'); } } else{ $data = $this->Category_Model->view_category(); } $this->load->view('admin/category_content',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCategory()\r\n {\r\n }", "function my_separate_category() {\n return 1;\n }", "function the_category($separator = '', $parents = '', $post_id = \\false)\n {\n }", "function getName() { return 'TestPostAddCategory'; }", "function tep_show_category($counter) {\r\n\r\n// ...
[ "0.6765676", "0.6659078", "0.63262916", "0.6324029", "0.63071084", "0.63043565", "0.62662876", "0.6253508", "0.6248295", "0.62446135", "0.6235306", "0.62332076", "0.6205529", "0.6196976", "0.6189756", "0.6166129", "0.6166129", "0.6166129", "0.6151942", "0.60984045", "0.609127...
0.0
-1
\\ END CATEGORY Function //\\ \\ START TAG Function //\\
public function tag($pg=false) { if($this->access_role->is_Active() == false) show_404(); if($_SERVER['REQUEST_METHOD'] == 'POST') { if( $this->session->userdata('admin_role') == '0' ) redirect('Dashboard'); if($this->form_validation->run('tag_insert') ) { $this->load->model('Tag_Model'); $this->Tag_Model->add_tag(); } else { $error = ['class'=>'warning','text'=> validation_errors()]; $this->session->set_flashdata('sms_flash', $error); redirect('Dashboard/tag/'.$data['pg']); } } $this->load->model('Tag_Model'); $data = $this->Tag_Model->view_tag(); $data['pg']=($pg)?(integer)$pg:null; $this->load->view('admin/tag_content',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doTagStuff(){}", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "function BeginTag($str){\r\n echo \"+TAG:\".$str;\r\n}", "function tag($tag_name, $op, $pref = '', $nl = false, $extra = '')\n{\n echo $pref . '<' ;\n if ($op == 'close') {\n echo '/' ;\n }\n echo $tag_nam...
[ "0.7170192", "0.6592882", "0.6592882", "0.6447048", "0.63799304", "0.61879015", "0.6162634", "0.6115123", "0.6049846", "0.5985015", "0.5983553", "0.59690225", "0.59629804", "0.5927101", "0.5904852", "0.5900184", "0.58810663", "0.5836787", "0.58299714", "0.5804441", "0.5786801...
0.0
-1
\\ END TAG Function //\\ \\ START NAVIGATION Function //\\
public function navigation(){ if($this->access_role->is_Admin() == false) show_404(); if($_SERVER['REQUEST_METHOD'] == 'POST') { if($this->form_validation->run('navigation_insert') ){ $this->load->model('Nav_Model'); $this->Nav_Model->add_nav(); } $error = ['class'=>'warning','text'=> validation_errors()]; $this->session->set_flashdata('sms_flash', $error); redirect('Dashboard/navigation'); } else { $this->load->model('Nav_Model'); $data = $this->Nav_Model->view_nav(); $this->load->view('admin/nav_content',$data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jfk2013_main_nav() {\r\n\techo get_jfk2013_main_nav();\r\n}", "function navigation (){\n}", "function nav_main() {\n\n\techo '\n\t\n\t\t<ul>\n\t\t\t<li><a href=\"index.php?page=home\">Home</a></li>\n\t\t\t<li><a href=\"index.php?page=gallery\">Gallery</a></li>\n\t\t\t<li><a href=\"index.php?page=blog\...
[ "0.68989885", "0.68812793", "0.6858369", "0.6838174", "0.6769389", "0.6755942", "0.66455317", "0.6418297", "0.6369736", "0.63646525", "0.63554704", "0.63433754", "0.6328853", "0.6320391", "0.6315856", "0.63106203", "0.6305554", "0.6287137", "0.6287137", "0.6283971", "0.627817...
0.0
-1