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 |
|---|---|---|---|---|---|---|
Remove the specified resource from storage. | public function destroy($id)
{
management::find($id)->delete();
return response()->json(['Member Record deleted successfully.']);
} | {
"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 |
// add your own arguments here | protected function configure()
{
// $this->addArguments(array(
// new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),
// ));
$this->addOptions(array(
new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'The environment', 'all'),
));
$this->namespace = 'shakmyth';
$this->name = 'verifyMythsIsActive';
$this->briefDescription = 'Verify the is_active status of each myth';
$this->detailedDescription = <<<EOF
The [verifyMythsIsActive|INFO] task does things.
Call it with:
[php symfony verifyMythsIsActive|INFO]
EOF;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->arguments = func_get_args();\n }",
"abstract public static function args();",
"abstract protected function get_args();",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function initializeArguments() {... | [
"0.70940304",
"0.6904754",
"0.6904368",
"0.68834805",
"0.68834805",
"0.68834805",
"0.6882865",
"0.6789838",
"0.6717955",
"0.66987836",
"0.6692978",
"0.66922987",
"0.6610921",
"0.6588356",
"0.6586563",
"0.65716714",
"0.65672183",
"0.65581787",
"0.65541995",
"0.6550152",
"0.649... | 0.0 | -1 |
initialize the database connection | protected function execute($arguments = array(), $options = array())
{
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
// add your code here
$counter = 0;
$myths = Doctrine::getTable('Myth')->findAll();
foreach ($myths as $myth)
{
$is_active = $myth->getIsActive();
$myth->changeIsActive();
($is_active == $myth->getIsActive()) ? null : $this->logSection($myth->getName().' =>', 'toggle'.$myth->getIsActive());
$counter++;
}
$this->logSection('Verify Myth =>', 'All ('.$counter.') myths are verify.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init()\n {\n $this->_db = Instance::ensure($this->_db, Connection::class);\n }",
"private function initDatabase() {\n \n \n \n }",
"protected function _initDbConnection() {\n\t\tif (!empty($this->db)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Create a new connec... | [
"0.8190012",
"0.8090096",
"0.8049853",
"0.8044886",
"0.79507047",
"0.7940469",
"0.7825467",
"0.77728605",
"0.7688879",
"0.7682012",
"0.76634866",
"0.76477814",
"0.7642274",
"0.76049155",
"0.75472486",
"0.7537571",
"0.7495337",
"0.74828774",
"0.74501574",
"0.74490535",
"0.7443... | 0.0 | -1 |
Installer for File Manager Extplorer Module for Sentora 1.0.0 Version : 100 | function UnZip(){
global $controller;
$zip = new ZipArchive;
$res = $zip->open(getcwd()."/filemanager.zip");
if ($res === TRUE) {
$zip->extractTo("/etc/sentora/panel/etc/apps");
$zip->close();
chmod ("/etc/sentora/panel/etc/apps/filemanager", 0777);
chmod ("/etc/sentora/panel/modules/filemanager", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/module.xml", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/module.zpm", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/end.php", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/code", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/code/controller.ext.php", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/assets", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/assets/icon.png", 0777);
copy("/etc/sentora/panel/modules/filemanager/auth.class1.php" , "/etc/sentora/panel/dryden/ctrl/auth.class1.php");
unlink("/etc/sentora/panel/dryden/ctrl/auth.class.php");
copy("/etc/sentora/panel/modules/filemanager/auth.class2.php" , "/etc/sentora/panel/dryden/ctrl/auth.class.php");
chmod ("/etc/sentora/panel/dryden/ctrl/auth.class.php", 0777);
chmod ("/etc/sentora/panel/dryden/ctrl/auth.class1.php", 0777);
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function pageInstall() {\n\t//expect $_FILE['install']\n\t//extract file to /tmp/\n\t//read module information file\n\t//put files into modules/$module/\n\t//run install class in modules/$module/install.php\n\t//install class may have a custom install form and should return information if install is done.\... | [
"0.5856864",
"0.58448607",
"0.5831132",
"0.57981324",
"0.57818866",
"0.5638754",
"0.56363577",
"0.5614855",
"0.55780894",
"0.5561047",
"0.55593556",
"0.5548429",
"0.55468404",
"0.55131024",
"0.5505031",
"0.5487783",
"0.5471581",
"0.5456339",
"0.5380684",
"0.53454375",
"0.5284... | 0.5214119 | 30 |
Executed after processing extension.json | public static function registerExtension() {
global $wgDonationInterfaceTest,
$wgDonationInterfaceTemplate,
$wgDonationInterfaceErrorTemplate,
$IP;
// Test mode (not for production!)
// Set it if not defined
if ( !isset( $wgDonationInterfaceTest ) || $wgDonationInterfaceTest !== true ) {
$wgDonationInterfaceTest = false;
}
/**
* Default top-level template file.
*/
$wgDonationInterfaceTemplate = __DIR__ . '/gateway_forms/mustache/index.html.mustache';
/**
* Default top-level error template file.
*/
$wgDonationInterfaceErrorTemplate = __DIR__ . '/gateway_forms/mustache/error_form.html.mustache';
// Load the default form settings.
require_once __DIR__ . '/DonationInterfaceFormSettings.php';
// Include composer's autoload if the vendor directory exists. If we have been
// included via Composer, our dependencies should already be autoloaded at the
// top level.
$vendorAutoload = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $vendorAutoload ) ) {
require_once $vendorAutoload;
} else {
require_once __DIR__ . '/gateway_common/WmfFramework.php';
}
if ( defined( 'MEDIAWIKI' ) ) {
// If we're the top-level application, initialize the SmashPig context
$spConfig = GlobalConfiguration::create();
Context::init( $spConfig );
$context = Context::get();
$context->setSourceName( 'DonationInterface' );
$context->setSourceType( 'payments' );
$context->setVersionFromFile( "$IP/.version-stamp" );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _extensionLoaded() {}",
"public function postProcess()\n\t\t{\n\t\t\tforeach ($this->m_activeExtensions as $extension)\n\t\t\t{\n\t\t\t\t$extension->postProcess();\n\t\t\t}\n\t\t}",
"public function processJsonFiles(){\n $filesList = $this->getFileList();\n foreach ($filesList as $... | [
"0.697109",
"0.6882445",
"0.6381743",
"0.6233389",
"0.6082552",
"0.60496193",
"0.5937959",
"0.59204483",
"0.57706773",
"0.57621235",
"0.57584834",
"0.5691561",
"0.56665313",
"0.5618304",
"0.559693",
"0.55778044",
"0.55732644",
"0.555422",
"0.5551745",
"0.55359304",
"0.5535930... | 0.0 | -1 |
Initialize SmashPig context and return configuration object | public static function setSmashPigProvider( $provider ) {
$ctx = Context::get();
$spConfig = ProviderConfiguration::createForProvider(
$provider,
$ctx->getGlobalConfiguration()
);
// FIXME: should set a logger prefix here, but we've got a chicken
// and egg problem with the Gateway constructor
$ctx->setProviderConfiguration( $spConfig );
return $spConfig;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function configure();",
"abstract public function configure();",
"public function configure() {}",
"public function configure() {}",
"protected function initializeConfiguration() {}",
"function __construct() {\n //invoke the init method of the config object in context\n $this->init()... | [
"0.5714789",
"0.5712379",
"0.5621134",
"0.5621134",
"0.5573061",
"0.5556468",
"0.5543287",
"0.5543287",
"0.5530572",
"0.54214585",
"0.53707373",
"0.53609705",
"0.53600633",
"0.53128165",
"0.5301196",
"0.5293151",
"0.52765054",
"0.5258332",
"0.52520496",
"0.5249621",
"0.523578... | 0.5848287 | 0 |
This function checks the user's login details and matches with the DB. | function loginCheck() {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['submit'])) {
global $name, $emailErr, $passwd, $pwdErr, $found, $verify_id;
if (empty($_POST["email"])) {
$emailErr = "email is required";
}
else {
$name = test_input($_POST["email"]);
// check if e-mail address syntax is valid or not
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$name)) {
$emailErr = "Invalid email";
return false;
}
}
if (empty($_POST['pwd'])) {
$pwdErr = "password is required";
}
else {
$passwd = test_input($_POST["pwd"]);
$pass_md = md5($passwd);
}
if (empty($emailErr) && empty($pwdErr)) {
require 'database_connection.php';
$sql = "SELECT user_id,user_name, email_id, password FROM signup";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$uname = $row["user_name"];
$email = $row["email_id"];
$pass = $row["password"];
$user_id = $row["user_id"];
if (($name == $uname || $name == $email) && $pass_md == $pass) {
$_SESSION["user"] = $uname;
$_SESSION["uid"] = $user_id;
$found = 1;
return true;
break;
}
}
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, ... | [
"0.72394574",
"0.72030115",
"0.71856934",
"0.7177519",
"0.7161466",
"0.71586186",
"0.71303",
"0.7108942",
"0.71080065",
"0.71070373",
"0.70705056",
"0.7055901",
"0.70543987",
"0.7051655",
"0.7037782",
"0.70009124",
"0.70007306",
"0.69806457",
"0.69743615",
"0.69551414",
"0.69... | 0.6589936 | 89 |
Maybe this is empty on form submit | public function setTitelAttribute($value)
{
$this->attributes['titel'] = $value ?: null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function has_submit() {\n\t\treturn false;\n\t}",
"public function emptyForm() {\n\t\techo '<div class=\"alert fail\"><span class=\"btnclose\">×</span><strong>Tous les champs sont obligatoires !</strong></div>';\n\t}",
"protected function onSubmit()\r {\r }",
"public function is_empty()\r\... | [
"0.6820928",
"0.6710881",
"0.6626044",
"0.6501099",
"0.64248735",
"0.63099515",
"0.62430865",
"0.62242407",
"0.62117916",
"0.6174912",
"0.61709094",
"0.6168855",
"0.6147136",
"0.61183125",
"0.6102977",
"0.6053826",
"0.6049809",
"0.60445607",
"0.6029926",
"0.597602",
"0.595973... | 0.0 | -1 |
Hash the password on every save, no need for controller Hash::make | public function setPasswordAttribute($value)
{
$this->attributes['password'] = Hash::make($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\... | [
"0.815711",
"0.78428984",
"0.76629037",
"0.70761925",
"0.7037126",
"0.7037126",
"0.6928852",
"0.6924011",
"0.6903809",
"0.6897981",
"0.6873381",
"0.6835683",
"0.683096",
"0.6813082",
"0.6789955",
"0.67718154",
"0.67669815",
"0.675719",
"0.67551816",
"0.67551816",
"0.6741653",... | 0.66238004 | 38 |
Does the user have a particular role? | public function hasRole($name)
{
foreach ($this->roles as $role)
{
if ($role->name == $name) return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasRole(string $role): bool;",
"public function hasRole($user, string $role = 'login'): bool {}",
"function hasRole($role)\n{\n\treturn $this->loggedUser? $this->loggedUser->hasRole($role) : false;\n}",
"public function hasRole() {\n return $this->_has(2);\n }",
"function hasRole($r... | [
"0.846877",
"0.82410717",
"0.8213779",
"0.81345016",
"0.80232525",
"0.8012697",
"0.8003828",
"0.7960044",
"0.7944947",
"0.7892998",
"0.78712577",
"0.7857028",
"0.7839148",
"0.78221345",
"0.781494",
"0.7811899",
"0.78098303",
"0.78036857",
"0.779677",
"0.77737105",
"0.7758718"... | 0.0 | -1 |
Assign a role to the user | public function assignRole($role)
{
return $this->roles()->attach($role);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function assignRole ($name);",
"public function addRole($username, $role);",
"public function attachRole($role);",
"public function attachRole($role);",
"public function setUserRole(User $user, Role $role);",
"public function setRole($role);",
"function SetUserRole ($userRoleId = null, $data = a... | [
"0.79158795",
"0.7518824",
"0.73441774",
"0.73441774",
"0.7329653",
"0.7238251",
"0.71622765",
"0.708678",
"0.70859766",
"0.7076988",
"0.7076078",
"0.70510787",
"0.7037427",
"0.7026698",
"0.7020039",
"0.7019141",
"0.7006399",
"0.7003977",
"0.7003977",
"0.6982611",
"0.6979493"... | 0.6741372 | 31 |
Remove a role from a user | public function removeRole($role)
{
return $this->roles()->detach($role);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeRole($username, $role);",
"function remove_role($role)\n {\n }",
"public function remove_role($role)\n {\n }",
"public function remove_role($role)\n {\n }",
"public function removing_user_from_role_works()\n {\n $this->withoutExceptionHandli... | [
"0.8328603",
"0.8047605",
"0.80001885",
"0.79981226",
"0.7838622",
"0.77902114",
"0.77600473",
"0.7727452",
"0.7659778",
"0.74432653",
"0.7421057",
"0.7352167",
"0.73409647",
"0.7229905",
"0.721011",
"0.70708543",
"0.69848835",
"0.6951225",
"0.6941198",
"0.6930036",
"0.691814... | 0.6813221 | 31 |
Remove all roles from a user | public function removeRoles()
{
return $this->roles()->detach();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function revokeAllRoles ();",
"public function removeRoles() {\n $this->roles()->detach();\n }",
"public function remove_roles() {\n global $wp_roles;\n\n if ( ! class_exists( 'WP_Roles' ) ) {\n return;\n }\n\n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n... | [
"0.77424335",
"0.7733552",
"0.70346934",
"0.7008251",
"0.6859416",
"0.68380576",
"0.67755985",
"0.6739006",
"0.67386967",
"0.67248344",
"0.65176946",
"0.6516138",
"0.64672655",
"0.6457231",
"0.641038",
"0.63459575",
"0.63134104",
"0.631302",
"0.6309296",
"0.63036364",
"0.6298... | 0.68509376 | 5 |
Run the database seeds. | public function run()
{
$houses = new HousesModel();
$houses->name = 'Ha Noi hotel';
$houses->id_address = 1;
$houses->room = 'khách sạn';
$houses->number_room = '4';
$houses->number_bathroom = '2';
$houses->describe = 'VIP';
$houses->price = 10000000;
$houses->id_kind_house = 1;
$houses->id_user = 1;
$houses->month = 1;
$houses->status = 0;
$houses->save();
$houses = new HousesModel();
$houses->name = 'HCM hotel';
$houses->id_address = 2;
$houses->room = 'khách sạn';
$houses->number_room = '5';
$houses->number_bathroom = '2';
$houses->describe = 'VIP';
$houses->price = 10000000;
$houses->id_kind_house = 1;
$houses->id_user = 1;
$houses->month = 1;
$houses->status = 0;
$houses->save();
$houses = new HousesModel();
$houses->name = "Khách sạn";
$houses->id_address = 3;
$houses->room = 'khách sạn';
$houses->number_room = '3';
$houses->number_bathroom = '2';
$houses->describe = 'VIP';
$houses->price = 5000000;
$houses->id_kind_house = 1;
$houses->id_user = 1;
$houses->month = 1;
$houses->status = 1;
$houses->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact... | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.78414... | 0.0 | -1 |
Finds the path to the file where the class is defined. | public function find($class)
{
$classpath = get_object_vars($this->container->getParameter($this->classpath_key));
krsort($classpath);
$current_md5 = md5(RokCommon_Utils_ArrayHelper::toString($classpath));
if ($this->last_md5 != $current_md5) {
$this->last_md5 = $current_md5;
$found_maps = array();
foreach ($classpath as $priority => $priority_paths) {
foreach ($priority_paths as $path) {
if (!in_array($path, $this->checked_paths)) {
$this->checked_paths[] = $path;
if (is_dir($path)) {
$path = $path . DIRECTORY_SEPARATOR . self::MAP_FILE_DEFAULT_NAME;
}
if (!in_array($path, $this->checked_paths) && is_file($path)) {
if (($path_map = @include($path)) && is_array($path_map)) {
$found_maps[] = $path_map;
} else {
if (defined('ROKCOMMON_CORE_DEBUG') && ROKCOMMON_CORE_DEBUG) {
error_log(sprintf('%s: Unable to load map file %s as a valid class map', get_class($this), $path));
}
}
}
}
}
if (isset($this->maps[$priority]) && !empty($found_maps)) {
$this->maps[$priority] = array_merge($this->maps[$priority], (array)$found_maps);
} elseif (!empty($found_maps)) {
$this->maps[$priority] = (array)$found_maps;
}
}
krsort($this->maps);
}
if ('\\' === $class[0]) {
$class = substr($class, 1);
}
foreach ($this->maps as $priority_maps) {
foreach ($priority_maps as $map) {
if (isset($map[$class])) {
return $map[$class];
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findFile($class);",
"public static function getClassPath();",
"public function myFileLocation()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return dirname($reflection->getFileName());\r\n }",
"abstract public function getClassPath();",
"public static func... | [
"0.7509601",
"0.74688923",
"0.739745",
"0.73043525",
"0.72787184",
"0.72032076",
"0.70262086",
"0.7023833",
"0.6967552",
"0.69195265",
"0.67014074",
"0.6699977",
"0.6682627",
"0.66732377",
"0.664041",
"0.6636902",
"0.662658",
"0.662087",
"0.6620328",
"0.658237",
"0.6546706",
... | 0.5654042 | 95 |
Compile the store id. | protected function getStoreId($id = '')
{
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
//$id .= ':'.$this->getState('filter.state');
$id .= ':'.$this->getState('filter.category_id');
return parent::getStoreId($id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _getStoreId() {\n $store_id = 1;\n return $store_id;\n }",
"public function getStoreId();",
"public function getStoreId();",
"public function getStoreId();",
"protected function _getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\n\t\treturn md5($id);\n\t}",
"prot... | [
"0.6626169",
"0.657287",
"0.657287",
"0.657287",
"0.64791393",
"0.63467884",
"0.63437885",
"0.6265582",
"0.61772543",
"0.61418647",
"0.61406773",
"0.61170757",
"0.61020064",
"0.60797566",
"0.6073847",
"0.6021382",
"0.5978879",
"0.5970089",
"0.5970089",
"0.5970089",
"0.5970089... | 0.0 | -1 |
/ $query = ' SELECT a., cc.title AS categorytitle, cc.id AS categoryid, i.title AS imagetitle, i.id AS imageid, ua.name AS editor, u.id AS ratinguserid, u.username AS ratingusername ' . ' FROM __lecturesevents_file_votes AS a ' . ' LEFT JOIN __lecturesevents AS i ON i.id = a.imgid ' . ' LEFT JOIN __lecturesevents_categories AS cc ON cc.id = i.catid ' . ' LEFT JOIN __users AS ua ON ua.id = a.checked_out ' . ' LEFT JOIN __users AS u ON u.id = a.userid' . $where . ' GROUP by a.id' . $orderby; | protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__lecturesevents_file_votes` AS a');
// Join over the language
$query->select('l.title AS language_title');
$query->join('LEFT', '`#__languages` AS l ON l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('ua.id AS ratinguserid, ua.username AS ratingusername, ua.name AS ratingname');
$query->join('LEFT', '#__users AS ua ON ua.id=a.userid');
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');
$query->select('i.title AS file_title, i.id AS file_id');
$query->join('LEFT', '#__lecturesevents AS i ON i.id = a.fileid');
/* // Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
*/
// Join over the categories.
$query->select('c.title AS category_title, c.id AS category_id');
$query->join('LEFT', '#__lecturesevents_categories AS c ON c.id = i.catid');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.state');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by category.
$categoryId = $this->getState('filter.category_id');
if (is_numeric($categoryId)) {
$query->where('i.catid = ' . (int) $categoryId);
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->getEscaped($search, true).'%');
$query->where('( ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')');
}
}
$query->group('a.id');
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering');
$orderDirn = $this->state->get('list.direction');
if ($orderCol == 'a.ordering' || $orderCol == 'category_title') {
$orderCol = 'category_title '.$orderDirn.', a.ordering';
}
$query->order($db->getEscaped($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__','jos_',$query));
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team O... | [
"0.6305692",
"0.60058445",
"0.60003173",
"0.5996246",
"0.5984495",
"0.5952321",
"0.58136487",
"0.5813125",
"0.5808324",
"0.5787987",
"0.5780573",
"0.57668895",
"0.5736544",
"0.57307285",
"0.57198524",
"0.56948423",
"0.56886464",
"0.5685858",
"0.5682705",
"0.566901",
"0.564766... | 0.5619089 | 22 |
Affiche les restaurant d'un theme | public function themeAction($param=null){
$theme = Theme::findAll();
$donne = array('resto'=> $theme);
$int = 1;
foreach ($theme as $i){
$resto = Restaurant::findByIdTheme($i->id);
$donne[$int]=$resto;
$int++;
}
$a = new Affichage($donne);
$a->body($param['act']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_restaurants()\n \t{\n\t\t\t$conn = connect_to_server();\n\t \t\t$sql = \"SELECT nazev, id_provozovna FROM Provozovna;\";\n\t \t\t\n\t \t\tif ($result = $conn->query($sql))\n\t \t\t\t// output data of each row\n\t\t \t\twhile($row = $result->fetch_assoc()) {\n\t\t \techo \"<a href=\\\"... | [
"0.6422781",
"0.6293553",
"0.62799895",
"0.6182467",
"0.60929143",
"0.60662836",
"0.5990429",
"0.5945253",
"0.59234613",
"0.58956194",
"0.5874925",
"0.5871302",
"0.58388495",
"0.58313245",
"0.58262104",
"0.57714844",
"0.57557684",
"0.5741858",
"0.5733746",
"0.5726322",
"0.572... | 0.58562696 | 12 |
Class process method wnich is used to execute this component. | public function process()
{
Phpfox::isUser(true);
/**
* LOCK this feature
*
if($iId = $this->request()->get('id'))
{
$aInvite = Phpfox::getService('customprofiles')->getInviteAnonymousMessage($iId);
if(isset($aInvite['invite_id']) && Phpfox::getUserId() == $aInvite['invite_user_id'])
{
if (Phpfox::isModule('notification'))
{
$type_id = 'customprofiles_anonymousconfirm';
Phpfox::getService('customprofiles.process')->addNotification($type_id, $aInvite['feed_id'], $aInvite['invite_user_id'],$aInvite['user_id']);
Phpfox::getService('customprofiles.process')->removeInviteAnonymousMessage($iId);
}
}
}
**/
$this->url()->send('');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function process()\n {}",
"public function process() {\n }",
"public function process() {\n }",
"public function process() {\n }",
"p... | [
"0.8233692",
"0.8233692",
"0.8233692",
"0.8233692",
"0.80738217",
"0.8051863",
"0.8051863",
"0.8051863",
"0.79689765",
"0.7967932",
"0.7967932",
"0.7967932",
"0.78502846",
"0.7836485",
"0.78293824",
"0.78293824",
"0.7747619",
"0.7648293",
"0.7648293",
"0.7648293",
"0.76307505... | 0.0 | -1 |
Constructor method for Taxes | public function __construct(array $tax = array(), array $taxBreakdownCode = array())
{
$this
->setTax($tax)
->setTaxBreakdownCode($taxBreakdownCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct($tick) {\n global $stperiod;\n global $mtperiod;\n global $ltperiod;\n\n $this->tick = $tick;\n $this->st = new Trend('ST', $stperiod);\n $this->mt = new Trend('MT', $mtperiod);\n $this->lt = new Trend('LT', $ltperiod);\n }",
"public function __construct()\n {\n ... | [
"0.70481944",
"0.60520244",
"0.603004",
"0.60108507",
"0.59459907",
"0.5932816",
"0.59299934",
"0.5812928",
"0.5789796",
"0.5704089",
"0.5678779",
"0.56427",
"0.56231314",
"0.56131005",
"0.561186",
"0.56100655",
"0.5599619",
"0.55664164",
"0.55581516",
"0.55551034",
"0.553838... | 0.0 | -1 |
Add item to Tax value | public function addToTax(\Sabre\UpdateReservation\StructType\AncillaryTax $item)
{
// validation for constraint: itemType
if (!$item instanceof \Sabre\UpdateReservation\StructType\AncillaryTax) {
throw new \InvalidArgumentException(sprintf('The Tax property can only contain items of \Sabre\UpdateReservation\StructType\AncillaryTax, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->Tax[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTax() {\n\t\t$adb = PearDatabase::getInstance();\n\n\t\t$tableName = $this->getTableNameFromType();\n\t\t$taxid = $adb->getUniqueID($tableName);\n\t\t$taxLabel = $this->getName();\n\t\t$percentage = $this->get('percentage');\n\n\t\t//if the tax is not available then add this tax.\n\t\t//Add this... | [
"0.7166932",
"0.660643",
"0.66051143",
"0.6544759",
"0.65325576",
"0.6413176",
"0.6383377",
"0.63763964",
"0.63555014",
"0.6282826",
"0.6167081",
"0.6140034",
"0.60363984",
"0.6033494",
"0.5978659",
"0.59554535",
"0.5951478",
"0.5904062",
"0.589607",
"0.58868414",
"0.58721906... | 0.61471313 | 11 |
Add item to TaxBreakdownCode value | public function addToTaxBreakdownCode(\Sabre\UpdateReservation\StructType\TaxBreakdownCode $item)
{
// validation for constraint: itemType
if (!$item instanceof \Sabre\UpdateReservation\StructType\TaxBreakdownCode) {
throw new \InvalidArgumentException(sprintf('The TaxBreakdownCode property can only contain items of \Sabre\UpdateReservation\StructType\TaxBreakdownCode, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->TaxBreakdownCode[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTax() {\n\t\t$adb = PearDatabase::getInstance();\n\n\t\t$tableName = $this->getTableNameFromType();\n\t\t$taxid = $adb->getUniqueID($tableName);\n\t\t$taxLabel = $this->getName();\n\t\t$percentage = $this->get('percentage');\n\n\t\t//if the tax is not available then add this tax.\n\t\t//Add this... | [
"0.6022677",
"0.5650368",
"0.561249",
"0.5508849",
"0.5507532",
"0.5432416",
"0.540472",
"0.5397493",
"0.5362307",
"0.5269257",
"0.5217888",
"0.52035296",
"0.51972234",
"0.51873654",
"0.51750666",
"0.51657856",
"0.51474166",
"0.51095754",
"0.5083389",
"0.50705147",
"0.5063206... | 0.67118555 | 0 |
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values | public static function __set_state(array $array)
{
return parent::__set_state($array);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Roo... | [
"0.69515294",
"0.6923768",
"0.6576974",
"0.63780874",
"0.6144996",
"0.6124818",
"0.6055735",
"0.60398006",
"0.5923768",
"0.5923768",
"0.5923768",
"0.5923768",
"0.5923768",
"0.58598137",
"0.58370847",
"0.58125174",
"0.58023953",
"0.57166743",
"0.57161003",
"0.5712639",
"0.5690... | 0.0 | -1 |
Method returning the class name | public function __toString()
{
return __CLASS__;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClassName();",
"public function getClassName();",
"public function getClassName() ;",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName()\n {\n ... | [
"0.87522393",
"0.87522393",
"0.8751158",
"0.87397957",
"0.87397957",
"0.87397957",
"0.87397957",
"0.8731564",
"0.8696754",
"0.8673495",
"0.8638432",
"0.8615335",
"0.8603119",
"0.8566906",
"0.8562364",
"0.8555002",
"0.85503733",
"0.85503733",
"0.85425884",
"0.8533183",
"0.8529... | 0.0 | -1 |
Get the value of id | public function getId()
{
return $this->id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getId(){\n\t\t\treturn $this->$id;\n\t\t}",
"public function getId()\n {\n return $this->getValue('id');\n }",
"public function getId() {\n\t\treturn $this -> data['id'];\n\t}",
"function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"function getID() {\n\t\treturn $this->dat... | [
"0.77531433",
"0.75790346",
"0.7551146",
"0.74920887",
"0.7472376",
"0.7445116",
"0.7433321",
"0.7433321",
"0.74298936",
"0.7415067",
"0.7415067",
"0.732741",
"0.7291388",
"0.72722006",
"0.7259057",
"0.7259057",
"0.7255057",
"0.7253809",
"0.72535557",
"0.72535557",
"0.7253555... | 0.0 | -1 |
Set the value of id | public function setId($id)
{
$this->id = $id;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetId($value) { $this->id=$value; }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"function set_id($id) {\... | [
"0.88871074",
"0.843179",
"0.8386374",
"0.82243615",
"0.8207132",
"0.8197505",
"0.8139511",
"0.81316125",
"0.8130276",
"0.81274986",
"0.8092258",
"0.80916125",
"0.807949",
"0.80521345",
"0.80423075",
"0.8040586",
"0.8028681",
"0.8028681",
"0.80261153",
"0.8006119",
"0.8002501... | 0.0 | -1 |
Get the value of nombre | public function getNombre()
{
return $this->nombre;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNombre(){\n //Creamos la consulta\n $sql = \"SELECT nombre FROM usuarios WHERE id_usuario = \".$this->id_user.\";\";\n //obtenemos el array\n $data = $this->getArraySQL($sql);\n //obtenemos el primer elemento, ya que así no tenemos que extraerlo posteriormente\n ... | [
"0.7478505",
"0.7434344",
"0.73567563",
"0.7341521",
"0.73043305",
"0.729088",
"0.7247797",
"0.7226201",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
... | 0.71591437 | 39 |
Set the value of nombre | public function setNombre($nombre)
{
$this->nombre = $nombre;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($n){\n\t\t$this->nombre = $n;\n\t}",
"public function setNombre($nombre) {\n\t\t$this->nombre = $nombre;\n\t}",
"public function ... | [
"0.78101224",
"0.78101224",
"0.77143884",
"0.74746263",
"0.74102265",
"0.74102265",
"0.74102265",
"0.74102265",
"0.74058175",
"0.74005854",
"0.7364611",
"0.72835755",
"0.7268867",
"0.7108571",
"0.7054164",
"0.7028272",
"0.6996061",
"0.6941704",
"0.69088876",
"0.68710977",
"0.... | 0.65546256 | 32 |
Get the value of apellidos | public function getApellidos()
{
return $this->apellidos;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getApellidos(){\n return $this->apellidos;\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->_apellido;\n }... | [
"0.80048215",
"0.79264444",
"0.79264444",
"0.7915871",
"0.7889416",
"0.7882793",
"0.7839877",
"0.70381016",
"0.67566264",
"0.6606118",
"0.6378194",
"0.6378145",
"0.62622064",
"0.623776",
"0.62113965",
"0.62113965",
"0.61512154",
"0.61276686",
"0.60578716",
"0.5984344",
"0.595... | 0.78756535 | 7 |
Set the value of apellidos | public function setApellidos($apellidos)
{
$this->apellidos = $apellidos;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setApellidos($apellidos){\n $this->apellidos = $apellidos;\n }",
"public function setApellidos($apellidos) {\n\t\t$this->apellidos = $apellidos;\n\t}",
"public function setApellido($apellido)\n {\n $this->apellido = $this->db->real_escape_string($apellido);\n\n \n }",
... | [
"0.80841523",
"0.7665547",
"0.7481696",
"0.6967922",
"0.6933774",
"0.68358094",
"0.67287254",
"0.67003113",
"0.67003113",
"0.65600556",
"0.64195305",
"0.63769686",
"0.63769686",
"0.636552",
"0.62784386",
"0.6209964",
"0.6038242",
"0.5965853",
"0.5828855",
"0.5777017",
"0.5694... | 0.6879716 | 6 |
Get the value of email | public function getEmail()
{
return $this->email;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEmail() {\n return $this->getValue('email');\n }",
"function getEmail() {\n\t\treturn $this->getData('email');\n\t}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail(... | [
"0.8002364",
"0.7952843",
"0.7890073",
"0.7890073",
"0.7890073",
"0.7888515",
"0.7888515",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7819241",
"0.7816924",
"0.774737",
"0... | 0.0 | -1 |
Set the value of email | public function setEmail($email)
{
$this->email = $email;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEmail($value)\n {\n $this->_email = $value;\n }",
"public function setEmail($value) {\r\n $this->email = $value;\r\n }",
"public function setEmail($value) {\n if(!strstr($value, \"@\")){\n throw new Exception(\"Errore in setEmail\");\n }\n // se esiste\n\... | [
"0.8320114",
"0.8207443",
"0.81339836",
"0.80443805",
"0.7915434",
"0.78432465",
"0.78333914",
"0.7637634",
"0.7605696",
"0.756671",
"0.75154626",
"0.75154626",
"0.7496423",
"0.7487856",
"0.7484968",
"0.74780154",
"0.74690026",
"0.7465834",
"0.74249554",
"0.73958474",
"0.7376... | 0.0 | -1 |
Determine if the user is authorized to make this request. | public function authorize()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }"... | [
"0.83988106",
"0.8375419",
"0.8375419",
"0.83422995",
"0.8251736",
"0.82455397",
"0.82108665",
"0.8144899",
"0.8109159",
"0.8082",
"0.7990051",
"0.7987851",
"0.798199",
"0.7958163",
"0.7949029",
"0.7946942",
"0.79250675",
"0.7913215",
"0.78981346",
"0.78917295",
"0.78889436",... | 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
$rules = [
'name' => 'required|unique:brands|max:191'
];
if($this->getMethod() == 'PUT' || $this->getMethod() == 'PATCH') $rules['name'] .= ',id, ' . $this->request->get("id");
return $rules;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche... | [
"0.8343821",
"0.8013592",
"0.7936293",
"0.79256666",
"0.7923988",
"0.7904124",
"0.7859339",
"0.7789916",
"0.7783626",
"0.7764009",
"0.77377397",
"0.7732641",
"0.7710237",
"0.7692145",
"0.7685806",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
... | 0.0 | -1 |
Return a speech response of either plaintext or SSML type | public function say($text, $type = self::TYPE_PLAINTTEXT)
{
return $this->respond(self::RESPONSE_TYPE_OUTPUT_SPEECH, $this->getSpeechResponse($text, $type));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getSpeechResponse($text, $type)\n\t{\n\t\t$response = [\n\t\t\t'type' => $type,\n\t\t\t'text' => $text,\n\t\t];\n\n\t\tif ($type === self::TYPE_SSML) {\n\t\t\t$response['ssml'] = $response['text'];\n\n\t\t\tunset($response['text']);\n\t\t}\n\n\t\treturn $response;\n\t}",
"public function textT... | [
"0.65729666",
"0.6135586",
"0.60326725",
"0.59929335",
"0.5739224",
"0.5725024",
"0.56324434",
"0.56298894",
"0.5580013",
"0.5452184",
"0.5444587",
"0.54277897",
"0.5398656",
"0.5280201",
"0.526189",
"0.52449316",
"0.52394897",
"0.5235516",
"0.5233124",
"0.52252895",
"0.51953... | 0.5671842 | 6 |
Return a Card response | public function card(CardInterface $card)
{
return $this->respond(self::RESPONSE_TYPE_CARD, $card->toArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCard() {\n return $this->card;\n }",
"function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan... | [
"0.6849949",
"0.682923",
"0.67764735",
"0.6676103",
"0.6617826",
"0.66177595",
"0.6543389",
"0.64561677",
"0.6348846",
"0.6329933",
"0.6126838",
"0.6120103",
"0.60777456",
"0.604684",
"0.60012907",
"0.5987791",
"0.59828883",
"0.5938717",
"0.5935131",
"0.58965313",
"0.5889521"... | 0.6998666 | 0 |
Return a reprompt response, wrapping a speech response | public function reprompt($reprompt, $type = self::TYPE_PLAINTTEXT)
{
return $this->respond(
self::RESPONSE_TYPE_REPROMPT, [
self::RESPONSE_TYPE_OUTPUT_SPEECH => $this->getSpeechResponse($reprompt, $type),
]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n ... | [
"0.59148437",
"0.5905642",
"0.56824",
"0.56219715",
"0.56104815",
"0.54974437",
"0.548491",
"0.54318166",
"0.54279864",
"0.539601",
"0.5364582",
"0.5350667",
"0.53386617",
"0.53163886",
"0.5295762",
"0.5294509",
"0.5273699",
"0.5264613",
"0.5262042",
"0.5256307",
"0.52530974"... | 0.5964544 | 0 |
Is the session ending? | public function isEnding()
{
return $this->session->expiring();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}",
"public static function sessionClose()\n {\n return true;\n }",
"public static function afnSessionStop()\n {\n @session_unset();\n @session_destroy();\n return true;\n }",
"public function logout()\... | [
"0.7965865",
"0.76960903",
"0.7401781",
"0.73459166",
"0.71515185",
"0.71076417",
"0.70544535",
"0.7033305",
"0.70268667",
"0.7003383",
"0.6970757",
"0.6925148",
"0.6842896",
"0.68338794",
"0.683221",
"0.6814471",
"0.68008876",
"0.67978567",
"0.67450947",
"0.673175",
"0.67193... | 0.871339 | 0 |
End the current session | public function endSession()
{
$this->session->end();
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}",
"private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }",
"public function sessionEnd (){\n $this->load->library( 'nativesession' );\n $this->load->helper('ur... | [
"0.84253466",
"0.84229064",
"0.7923977",
"0.7921572",
"0.7919525",
"0.79044193",
"0.7807676",
"0.7669818",
"0.75881207",
"0.7535007",
"0.7498573",
"0.7480881",
"0.7433788",
"0.74071795",
"0.73748875",
"0.73519677",
"0.73519677",
"0.73519677",
"0.73519677",
"0.73416996",
"0.73... | 0.0 | -1 |
Build a plaintext speech response | protected function getSpeechResponse($text, $type)
{
$response = [
'type' => $type,
'text' => $text,
];
if ($type === self::TYPE_SSML) {
$response['ssml'] = $response['text'];
unset($response['text']);
}
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function textToSpeech($message);",
"public function makeSms()\n {\n $sms = strtoupper($this->search_words);\n switch ($this->definitions_count) {\n case 0:\n $sms .= \" | No definitions found.\";\n break;\n case 1:\n $sms ... | [
"0.6167869",
"0.60034186",
"0.5984724",
"0.5900365",
"0.5865474",
"0.58422834",
"0.57967716",
"0.57681406",
"0.5625163",
"0.56102175",
"0.5600672",
"0.55773574",
"0.55527693",
"0.5546909",
"0.54965687",
"0.5491957",
"0.54363227",
"0.54267955",
"0.54080623",
"0.5381778",
"0.53... | 0.5609711 | 10 |
Build a response in array form | protected function respond($type, array $response)
{
return [
'version' => $this->config['application_version'],
'sessionAttributes' => $this->session->getAttributes(),
'response' => [
$type => $response,
'shouldEndSession' => $this->session->expiring(),
],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toArray() {\r\n \treturn array(\"response\"=>$this->_response);\r\n }",
"public function response(): array\n {\n return [\n 'error' => $this->hasError(),\n 'exists' => $this->exists(),\n 'code' => $this->code,\n 'data' => $this->data,\n ... | [
"0.7442654",
"0.7160023",
"0.71155906",
"0.6987261",
"0.69591796",
"0.6953336",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68078744",
"0.6787875",
"0.6711376",
"0.6705358",
"0.67006713",
"0.66605085",
"0.6640761",
"0.6... | 0.0 | -1 |
Store a newly created Cart in storage and return the data to the user. | public function store(Request $request)
{
if (Auth::guard('api')->check()) {
$userID = auth('api')->user()->getKey();
}
//$user = JWTAuth::authenticate($request->token);
$cart = Cart::create([
'id' => md5(uniqid(rand(), true)),
'key' => md5(uniqid(rand(), true)),
'user_id' => isset($userID) ? $userID : null,
]);
return response()->json([
'Message' => 'A new cart have been created for you!',
'cartToken' => $cart->id,
'cartKey' => $cart->key,
], 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Cart::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCart::create($data);\n\n\t\treturn Redirect::route('carts.index')->with('message', 'Cart crea... | [
"0.81081665",
"0.7560818",
"0.7444694",
"0.7423214",
"0.73532426",
"0.73356307",
"0.7317357",
"0.72753644",
"0.7273217",
"0.72604275",
"0.7255526",
"0.7248813",
"0.724834",
"0.72069544",
"0.71948004",
"0.71945536",
"0.71772474",
"0.71290106",
"0.70973164",
"0.7092513",
"0.708... | 0.70612425 | 23 |
Display the specified Cart. | public function show(Cart $cart, Request $request)
{
// $validator = Validator::make($request->all(), [
// 'cartKey' => 'required',
// ]);
// if ($validator->fails()) {
// return response()->json([
// 'errors' => $validator->errors(),
// ], 400);
// }
// $cartKey = $request->input('cartKey');
// if ($cart->key == $cartKey) {
return response()->json([
'cart' => $cart->id,
'Items in Cart' => $cart->items,
], 200);
// } else {
// return response()->json([
// 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',
// ], 400);
// }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }"... | [
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.8323434",
"0.77528465",
"0.7728337",
"0.7651165",
"0.75253093",
"0.7319019",
"0.73046935",
"0.72852504",
"0.72723085",
"0.7214472",
"0.7184507",
"0.71763086",
"0... | 0.6915275 | 32 |
Remove the specified Cart from storage. | public function destroy(Cart $cart, Request $request)
{
$validator = Validator::make($request->all(), [
'cartKey' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'errors' => $validator->errors(),
], 400);
}
$cartKey = $request->input('cartKey');
if ($cart->key == $cartKey) {
$cart->delete();
return response()->json(null, 204);
} else {
return response()->json([
'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',
], 400);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}",
"public function remove($cartId);",
"public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $... | [
"0.7769094",
"0.7515215",
"0.73774534",
"0.7178666",
"0.71713215",
"0.71102905",
"0.71102905",
"0.71075696",
"0.71075696",
"0.71075696",
"0.70803934",
"0.69930524",
"0.6917314",
"0.69075185",
"0.68733907",
"0.686197",
"0.68597007",
"0.6830262",
"0.68218315",
"0.68168277",
"0.... | 0.65520865 | 38 |
Adds Products to the given Cart; | public function addProducts(Cart $cart, Request $request)
{
$validator = Validator::make($request->all(), [
// 'cartKey' => 'required',
'quantity' => 'required|numeric|min:1|max:10',
'itemName' =>'required',
'size' => 'required',
'color' => 'required',
'itemPriceNDT' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'errors' => $validator->errors(),
], 400);
}
// $cartKey = $request->input('cartKey');
$quantity = $request->input('quantity');
$itemName = $request->input('itemName');
$size = $request->input('size');
$color = $request->input('color');
$itemPriceNDT = $request->input('itemPriceNDT');
$tt = $quantity * $itemPriceNDT;
$aliwangwang = $request->input('aliwangwang');
$shopId = $request->input('shopId');
$shopName = $request->input('shopName');
$shopLink = $request->input('shopLink');
$website = $request->input('website');
$itemImage = $request->input('itemImage');
$itemLink = $request->input('itemLink');
$saleLocation = $request->input('saleLocation');
$stock = $request->input('stock');
// if ($cart->key == $cartKey) {
//check if the the same product is already in the Cart, if true update the quantity, if not create a new one.
$cartItem = CartItem::where([
'cart_id' => $cart->getKey(),
'itemName' => $itemName
])->first();
if ($cartItem) {
$cartItem->quantity = $quantity;
$cartItem->size = $size;
$cartItem->color = $color;
$cartItem->itemPriceNDT = $itemPriceNDT;
CartItem::where([
'cart_id' => $cart->getKey(),
'itemName' => $itemName,
'itemImage' => $itemImage,
'status' => 0,
'itemLink' => $itemLink,
'saleLocation'=> $saleLocation,
'stock'=> $stock,
'aliwangwang'=> $aliwangwang,
'shopId'=> $shopId,
'shopName'=> $shopName,
'shopLink'=> $shopLink,
'website'=> $website
])->update(['quantity' => $quantity,
'size' => $size,
'price' => $tt,
'color' => $color,
'itemPriceNDT'=> $itemPriceNDT,
]);
} else {
CartItem::create([
'cart_id' => $cart->getKey(),
'quantity' => $quantity,
'itemName' => $itemName,
'size' => $size,
'price' => $tt,
'itemPriceNDT' => $itemPriceNDT,
'color' => $color,
'status' => 0,
'itemLink' => $itemLink,
'itemImage'=> $itemImage,
'saleLocation'=> $saleLocation,
'stock'=> $stock,
'aliwangwang'=> $aliwangwang,
'shopId'=> $shopId,
'shopName'=> $shopName,
'shopLink'=> $shopLink,
'website'=> $website
]);
}
$sanpham = DB::table('cart_items')->where('cart_id',$cart->id)->get();
$soluong = DB::table('cart_items')->where('cart_id',$cart->id)->count('quantity');
return response()->json([
'message' => 'The Cart was updated with the given product information successfully',
'thông báo' => 'có '.$soluong.' sản phẩm',
'sản phẩm' => $sanpham,
], 200);
// } else {
// return response()->json([
// 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',
// ], 400);
// }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }",
"public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description... | [
"0.7679751",
"0.75072837",
"0.74739057",
"0.7393167",
"0.7393167",
"0.7326175",
"0.72718024",
"0.7270599",
"0.7206845",
"0.71892416",
"0.71466136",
"0.71236646",
"0.7083336",
"0.7081223",
"0.7073627",
"0.70351636",
"0.7026774",
"0.69907373",
"0.697701",
"0.69648874",
"0.69551... | 0.0 | -1 |
checkout the cart Items and create and order. | public function dathang(Request $request, CartItem $cart_id)
{
$validator = Validator::make($request->all(), [
'phivcnoidia' => 'required',
'discount' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'errors' => $validator->errors(),
], 400);
}
if (Auth::guard('api')->check()) {
$userID = auth('api')->user()->getKey();
}
$cartKey = $request->input('cartKey');
$phivcnoidia = $request->input('phivcnoidia');
$discount = $request->input('discount');
$d = substr('DH000000', 2, 5);
$n =0 ;
$price = DB::table('cart_items')->where('cart_id',$cartKey)->sum('price');
$tygia = 3.335;
$tienhang = round(($price * $tygia) - $discount);
$pdv = 0;
if( $tienhang > 0 && $tienhang < 10000000)
{
$pdv = ROUND($price * 0.05);
}
if( $tienhang > 10000000 && $tienhang < 50000000)
{
$pdv = ROUND($price * 0.04);
}
if( $tienhang > 50000000 && $tienhang < 100000000)
{
$pdv = ROUND($price * 0.03);
}
if( $tienhang > 100000000 && $tienhang < 200000000)
{
$pdv = ROUND($price * 0.02);
}
if( $tienhang >= 200000000)
{
$pdv = ROUND($price * 0.01);
}
$qty= $tienhang + $phivcnoidia + $pdv;
$donhang = DB::table('donhangs')->select('madonhang')->where('cart_item_id',$cart_id)->get();
if ($donhang) {
$donhang3 = DB::table('donhangs')->count('madonhang');
$donhang4 = 'DH'.$d. ($donhang3 + 1);
$donhang = donhang::create([
'user_id' => isset($userID) ? $userID : null,
'madonhang' =>$donhang4,
'cart_item_id' => $cartKey,
'locationship'=> 'null',
'totalqty' => $qty,
'status' => 'mở'
]);
$donhang1 = DB::table('cart_items')->select('cart_items.cart_id','cart_items.name_product','cart_items.size','cart_items.color','cart_items.price','cart_items.quantity')
->where('cart_items.cart_id',$cartKey)->get();
foreach ($donhang1 as $donhang1) {
$chitietdonhang = new chitietdonhang();
$chitietdonhang->donhang_id = $donhang->id;
$chitietdonhang->name_product = $donhang1->name_product;
$chitietdonhang->size = $donhang1->size;
$chitietdonhang->color = $donhang1->color;
$chitietdonhang->price = $donhang1->price;
$chitietdonhang->quantity = $donhang1->quantity;
$chitietdonhang->save();
}
}else{
$donhang4 = 'DH' . $d . $n;
$donhang = donhang::create([
'user_id' => isset($userID) ? $userID : null,
'madonhang' =>$donhang4,
'cart_item_id' => $cartKey,
'locationship'=> 'null',
'totalqty' => $qty,
'status' => 'mở'
]);
$donhang1 = DB::table('cart_items')->select('cart_items.cart_id','cart_items.name_product','cart_items.size','cart_items.color','cart_items.price','cart_items.quantity')->where('cart_items.cart_id',$cartKey)->get();
foreach ($donhang1 as $donhang1) {
$chitietdonhang = new chitietdonhang();
$chitietdonhang->donhang_id = $donhang->id;
$chitietdonhang->name_product = $donhang1->name_product;
$chitietdonhang->size = $donhang1->size;
$chitietdonhang->color = $donhang1->color;
$chitietdonhang->price = $donhang1->price;
$chitietdonhang->quantity = $donhang1->quantity;
$chitietdonhang->save();
}
}
$chitietdonhang3 = DB::table('chitietdonhangs')->select('chitietdonhangs.name_product','chitietdonhangs.size','chitietdonhangs.color','chitietdonhangs.price','chitietdonhangs.quantity')
->join('donhangs','donhangs.id','=','chitietdonhangs.donhang_id')
->where('donhangs.id',$donhang->id)->get();
return response()->json([
'message' => 'Đơn hàng được tạo',
'đơn hàng' => $donhang->madonhang,
'chi tiết đơn hàng' => $chitietdonhang3,
'Tông tiền ( tạm tính)' => $donhang,
], 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveCartItems() {\n $order_id = $this->_order->check_cart($this->_auth->id);\n //echo '<pre>';\n //var_dump($this->_items);\n \n $order_data = array('user_id' => $this->_auth->id, 'order_status'=>'incomplete', 'ip'=>$_SERVER[\"REMOTE_ADDR\"],\n 'items' ... | [
"0.71181166",
"0.7005549",
"0.69881046",
"0.69676185",
"0.6860215",
"0.6766215",
"0.6766215",
"0.67424214",
"0.6662357",
"0.6579462",
"0.6536061",
"0.65321183",
"0.6531296",
"0.6493035",
"0.6487418",
"0.6482323",
"0.64647466",
"0.6456546",
"0.64442086",
"0.6429419",
"0.642517... | 0.0 | -1 |
Execute the console command. | public function handle()
{
$url = 'http://www.everlytic.co.za/';
$seostats = new \SEOstats\SEOstats;
if ($seostats->setUrl($url)) {
// Create a new SEOstats instance.
///dd(SEOstats\Alexa::getGlobalRank());
dd(SEOstats\Social::getLinkedInShares());
// dd(SEOstats\Alexa::getGlobalRank());
// dd(SEOstats\Alexa::getGlobalRank());
// dd(SEOstats\Alexa::getGlobalRank());
// dd(SEOstats\Alexa::getGlobalRank());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }",
"public function handle()\n {\n //get us the Converter class instance and call the convert() meth... | [
"0.6469205",
"0.6463761",
"0.6426904",
"0.63497347",
"0.6316859",
"0.6273603",
"0.6260993",
"0.6260039",
"0.6234982",
"0.6224031",
"0.62203085",
"0.62127924",
"0.61931187",
"0.61907774",
"0.61823803",
"0.61771643",
"0.61763066",
"0.6173071",
"0.614875",
"0.61481935",
"0.61478... | 0.0 | -1 |
SAVE BREWERY DATA TO SQL DB | function saveData($breweryName, $address){
$conn = mysqli_connect('localhost','root','','ratebeer_data');
$brewery_name = $breweryName;
$brewery_name = preg_replace('/((.*?)#41;/', '', $brewery_name);
echo $brewery_name;
$brewery_street = $address['street'];
$brewery_city = $address['city'];
$brewery_state = $address['state'];
$brewery_country = $address['country'];
$brewery_zip = $address['zipcode'];
$brewery_phone = $address['telephone'];
$check_brewery_exist = "SELECT id FROM `ratebeer_breweries` WHERE name = '$brewery_name'";
$brewery_result = mysqli_query($conn, $check_brewery_exist);
if(!$brewery_result || mysqli_num_rows($brewery_result) == 0)
{
$insert_brewery = "INSERT INTO `ratebeer_breweries` (`name`, `city`, `state`, `country`, `zip1`, `phone`)
VALUES ('$brewery_name', '$brewery_city', '$brewery_state', '$brewery_country', '$brewery_zip', '$brewery_phone')";
$insert_brewery_result = mysqli_query($conn, $insert_brewery);
print $insert_brewery_result;
if (mysqli_affected_rows($conn) > 0) {
$output['message'] = "brewery added!";
print json_encode($output);
} else {
$output['message'] = "Brewery denied!";
mysqli_error($conn);
print json_encode($output);
}
}
else {
$output['message'] = 'Sorry, that brewery has already been added';
print json_encode($output);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveToDB()\n {\n }",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public f... | [
"0.68676674",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.66578615",
"0.66575617",
... | 0.0 | -1 |
Get names from RateBeer | function getName($str){
$value = preg_match_all('/<span itemprop=\"name\" class=\"vis\">(.*?)<\/span>/s',$str, $names);
$name = $names[0][0];
$name = strip_tags($name);
return $name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNames() {}",
"public function getNames() {}",
"public function getNames() {}",
"public function getNames();",
"public function get_names()\n {\n }",
"public function getAllNames() {}",
"public function getNames()\n {\n return $this->_name;\n }",
"public ... | [
"0.6409532",
"0.6409132",
"0.6409132",
"0.6375934",
"0.62565887",
"0.6104002",
"0.60389507",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.59252673",
"0.58987516",
"0.58270216",
"0.5816022",
"0.5816022",
"0.5816022",
"0.57544845... | 0.0 | -1 |
Get names from RateBeer | function getAddress($str){
$street = preg_match_all('/<span itemprop=\"streetAddress\">(.*?)<\/span>/s', $str, $streetInfo);
$city = preg_match_all('/<span itemprop=\"addressLocality\">(.*?)<\/span>/s', $str, $cityInfo);
$state = preg_match_all('/<span itemprop=\"addressRegion\">(.*?)<\/span>/s', $str, $stateInfo);
$country = preg_match_all('/<span itemprop=\"addressCountry\">(.*?)<\/span>/s', $str, $countryInfo);
$postalCode = preg_match_all('/<span itemprop=\"postalCode\">(.*?)<\/span>/s', $str, $zipInfo);
$telephone = preg_match_all('/<span itemprop=\"telephone\">(.*?)<\/span>/s', $str, $telephoneInfo);
$Address['street'] = strip_tags($streetInfo[0][0]);
$Address['city'] = strip_tags($cityInfo[0][0]);
$Address['state'] = strip_tags($stateInfo[0][0]);
$Address['country'] = strip_tags($countryInfo[0][0]);
$Address['zipcode'] = strip_tags($zipInfo[0][0]);
$telephone = strip_tags($telephoneInfo[0][0]);
$Address['telephone'] = preg_replace('/\D+/', '', $telephone);
return $Address;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNames() {}",
"public function getNames() {}",
"public function getNames() {}",
"public function getNames();",
"public function get_names()\n {\n }",
"public function getAllNames() {}",
"public function getNames()\n {\n return $this->_name;\n }",
"public ... | [
"0.6409532",
"0.6409132",
"0.6409132",
"0.6375934",
"0.62565887",
"0.6104002",
"0.60389507",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.59252673",
"0.58987516",
"0.58270216",
"0.5816022",
"0.5816022",
"0.5816022",
"0.57544845... | 0.0 | -1 |
THIS FUNCTION IS SET UP FOR RATEBEER | function getBeerList($str){
$info1 = preg_match_all('/<TR class=dataTableRowAlternate>(.*?)<\/TR>/s', $str, $beerInfo);
$info2 = preg_match_all('/<TR class=>(.*?)<\/TR>/s', $str, $beerInfo2);
$beerList = [];
array_push($beerList, $beerInfo[0]);
array_push($beerList, $beerInfo2[0]);
return $beerList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rate()\n {\n\n }",
"public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\... | [
"0.6772126",
"0.6473427",
"0.6347878",
"0.61643046",
"0.6027342",
"0.6019018",
"0.5917252",
"0.59120256",
"0.5902944",
"0.58463955",
"0.58428925",
"0.5840674",
"0.58186555",
"0.5809963",
"0.58029455",
"0.5792277",
"0.57912636",
"0.5774024",
"0.57708704",
"0.57642686",
"0.5760... | 0.0 | -1 |
THIS FUNCTION IS SET UP TO ACCESS BEER ADVOCATE | function getMenu($str){
$str = str_replace(' align="left"', '', $str);
$str = str_replace(' valign="top"', '', $str);
$value = preg_match_all('/<td class=\"hr_bottom_light\">(.*?)<\/td>/s',$str, $menuItems);
$menuItem = [];
$maxCount = 5;
$currentCount = 0;
$listItems = [];
$group = 0;
foreach($menuItems[0] as $key => $value){
$data[$key] = $value;
}
foreach($data as $key => $value) {
switch ($currentCount) {
case 0:
$menuItem[$group]['name'] = $value;
break;
case 1:
$menuItem[$group]['type'] = $value;
break;
case 2:
$menuItem[$group]['abv'] = $value;
break;
case 3:
$menuItem[$group]['rating'] = $value;
break;
case 4:
$menuItem[$group]['hads'] = $value;
break;
case 5:
$menuItem[$group]['bros'] = $value;
break;
}
if($currentCount == $maxCount){
$currentCount = 0;
$group++;
}
else {
$currentCount++;
}
}
// echo '<pre>';
// print_r($menuItem);
// echo '</pre>';
return $menuItem;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function access();",
"public function obtener()\n {\n }",
"public abstract function Ataca();",
"public function helper()\n\t{\n\t\n\t}",
"public function pasaje_abonado();",
"protected function serviceAccessGates()\n {\n //\n }",
"public function attaquerAdversaire() {\n\n ... | [
"0.5906017",
"0.5905525",
"0.5864181",
"0.58463454",
"0.57384217",
"0.56790704",
"0.56567615",
"0.56065696",
"0.55538094",
"0.55462426",
"0.5543906",
"0.5522392",
"0.5493123",
"0.5484569",
"0.5477034",
"0.54596615",
"0.54414576",
"0.5418984",
"0.5418915",
"0.5417625",
"0.5409... | 0.0 | -1 |
Instantiate a new new controller instance. | public function __construct()
{
// authenticate on all routes
$this->middleware('jwt.auth')
->except('home');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n... | [
"0.7746166",
"0.7515459",
"0.7438831",
"0.7266114",
"0.72363627",
"0.7091491",
"0.70629483",
"0.7040762",
"0.6971043",
"0.6957444",
"0.69054586",
"0.68539304",
"0.67931736",
"0.6791609",
"0.6775194",
"0.6774169",
"0.67478454",
"0.6728726",
"0.67086864",
"0.67013943",
"0.66666... | 0.0 | -1 |
Display a listing of the resource. | public function index(Request $request)
{
if ($request->has('slug')) {
$params = $this->validateQueryParams($request, ['slug' => 'string']);
$teams = Team::where('slug', '=', $params['slug'])
->get();
} else {
$user = JWTAuth::parseToken()->authenticate();
$teams = Team::orderBy('name')
->where('user_id', '=', $user->id)
->get();
}
// generate resource
$resource = new Collection($teams, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 200);
} | {
"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.7446838",
"0.7361646",
"0.7299749",
"0.7246801",
"0.7163394",
"0.7148201",
"0.71318537",
"0.7104601",
"0.7101873",
"0.709985",
"0.70487136",
"0.69936216",
"0.6988242",
"0.69347453",
"0.68989795",
"0.68988764",
"0.68909055",
"0.68874204",
"0.68650436",
"0.6848891",
"0.68294... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(TeamRequest $request)
{
// fetch the data
$data = $request->input('data');
// check paid
if ($data['attributes']['paid'] == true) {
// make sure the user is an admin to set paid == true
$authUser = JWTAuth::parseToken()->authenticate();
if ($authUser->role != 'admin') {
$data['attributes']['paid'] = false;
}
}
// create the team
$team = new Team($data['attributes']);
// set the user relation
$team->user_id = $data['relationships']['user']['data']['id'];
$team->save();
// generate resource
$resource = new Item($team, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.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(Team $team)
{
// generate resource
$resource = new Item($team, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Update the specified resource in storage. | public function update(TeamRequest $request, Team $team)
{
// fetch the data
$data = $request->input('data');
// unset paid if user is not an admin
if (isset($data['attributes']['paid']) && JWTAuth::parseToken()->authenticate()->role != 'admin') {
unset($data['attributes']['paid']);
}
// update the team
$team->update($data['attributes']);
// update the user relation
$team->user_id = $data['relationships']['user']['data']['id'];
$team->save();
// generate resource
$resource = new Item($team, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Team $team)
{
// make sure it can be deleted
$this->authorize('delete', $team);
// delete the team
$team->delete();
// return empty response
return response()->json([], 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.6673811",
"0.66624975",
"0.66376764",
"0.66351163",
"0.66280866",
"0.65443397",
"0.6543099",
"0.64656305",
"0.62881804",
"0.61755043",
"0.61278707",
"0.6089098",
"0.60534257",
"0.6043048",
"0.6006416",
"0.593359",
"0.5929751",
"0.5923406",
"0.59201753",
"0.5904145",
"0.589... | 0.0 | -1 |
Method to set the identifier | function setId($id)
{
// Set event id and wipe data
$this->_id = $id;
$this->_data = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }",
"public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }",
"public function setIdentifier($identifier) {\n\t\t$this->_identifier = $identifier;\n\t}",
"public fun... | [
"0.8087153",
"0.79813194",
"0.7700912",
"0.76420516",
"0.76277244",
"0.7592056",
"0.7582691",
"0.75577664",
"0.75145376",
"0.7458617",
"0.7411677",
"0.7411677",
"0.73755467",
"0.7362744",
"0.7303102",
"0.7294954",
"0.7243837",
"0.7165244",
"0.70649076",
"0.7064087",
"0.702600... | 0.0 | -1 |
Logic for the event edit screen | function &getData()
{
if ($this->_loadData())
{
}
else $this->_initData();
return $this->_data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function postEventedit();",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public functi... | [
"0.77536327",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.7045114",
"0.69039947",
"0.69039947",
"0.69039947",
"0.6901066",
"0.68628985",
"0.66963285",
"0.66921026",
"0.66621166",
"0.6643227",
... | 0.0 | -1 |
Method to load content event data | function _loadData()
{
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
$query = 'SELECT e.*, v.venue'
. ' FROM #__eventlist_events AS e'
. ' LEFT JOIN #__eventlist_venues AS v ON v.id = e.locid'
. ' WHERE e.id = '.$this->_id
;
$this->_db->setQuery($query);
$this->_data = $this->_db->loadObject();
return (boolean) $this->_data;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _initData()\r\n\t{\r\n\t\t// Lets load the content if it doesn't already exist\r\n\t\tif (empty($this->_data))\r\n\t\t{\r\n\t\t\t$event = new stdClass();\r\n\t\t\t$event->id\t\t\t\t\t= 0;\r\n\t\t\t$event->locid\t\t\t\t= 0;\r\n\t\t\t$event->catsid\t\t\t\t= 0;\r\n\t\t\t$event->dates\t\t\t\t= null;\r\n\t\t\t... | [
"0.667174",
"0.6552933",
"0.62384725",
"0.62373495",
"0.62373495",
"0.623723",
"0.62293065",
"0.6036788",
"0.603087",
"0.59994173",
"0.59653",
"0.5892774",
"0.58212155",
"0.58128595",
"0.5789365",
"0.5758977",
"0.5755792",
"0.57541746",
"0.57433695",
"0.5724893",
"0.57237333"... | 0.5923792 | 11 |
Method to get the category data | function &getCategories()
{
$query = 'SELECT id AS value, catname AS text'
. ' FROM #__eventlist_categories'
. ' WHERE published = 1'
. ' ORDER BY ordering'
;
$this->_db->setQuery( $query );
$this->_categories = $this->_db->loadObjectList();
return $this->_categories;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCategory() {}",
"public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n ... | [
"0.80687743",
"0.798713",
"0.79618174",
"0.79618174",
"0.7890699",
"0.7785303",
"0.7698785",
"0.7583284",
"0.7583284",
"0.75418496",
"0.75393075",
"0.74915206",
"0.74829",
"0.7455358",
"0.74295855",
"0.73839587",
"0.7342399",
"0.73372525",
"0.73087883",
"0.72982645",
"0.72596... | 0.6903046 | 89 |
Method to initialise the event data | function _initData()
{
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
$event = new stdClass();
$event->id = 0;
$event->locid = 0;
$event->catsid = 0;
$event->dates = null;
$event->enddates = null;
$event->times = null;
$event->endtimes = null;
$event->title = null;
$event->alias = null;
$event->created = null;
$event->author_ip = null;
$event->created_by = null;
$event->published = 1;
$event->registra = 0;
$event->unregistra = 0;
$event->datdescription = null;
$event->meta_keywords = null;
$event->meta_description = null;
$event->recurrence_number = 0;
$event->recurrence_type = 0;
$event->recurrence_counter = '0000-00-00';
$event->datimage = JText::_('SELECTIMAGE');
$event->venue = JText::_('SELECTVENUE');
$this->_data = $event;
return (boolean) $this->_data;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 = $this->data('event_filter');\n }",
"public function __construct($data)\n ... | [
"0.74530226",
"0.735679",
"0.6879214",
"0.68724734",
"0.6731587",
"0.67141885",
"0.67000586",
"0.663197",
"0.66079795",
"0.6539136",
"0.65346944",
"0.65257126",
"0.6476815",
"0.64699435",
"0.6465292",
"0.6430254",
"0.6416313",
"0.64124554",
"0.64093155",
"0.64049137",
"0.6403... | 0.6940052 | 2 |
Method to checkin/unlock the item | function checkin()
{
if ($this->_id)
{
$event = & JTable::getInstance('eventlist_events', '');
return $event->checkin($this->_id);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkin() {\r\n\t\tif ($this->_id) {\r\n\t\t\t$item = & JTable::getInstance('flexicontent_items', '');\r\n\t\t\treturn $item->checkin($this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function testDestiny2SetItemLockState()\n {\n // TODO: implement\n $this->markTestIncomplete(... | [
"0.63259804",
"0.6074651",
"0.5806185",
"0.5789171",
"0.57007205",
"0.56630343",
"0.5626349",
"0.5626118",
"0.5612805",
"0.5603608",
"0.5576718",
"0.5560617",
"0.553384",
"0.5532361",
"0.5532181",
"0.55283535",
"0.55232006",
"0.55149806",
"0.55062294",
"0.5489844",
"0.5474584... | 0.5020224 | 87 |
Method to checkout/lock the item | function checkout($uid = null)
{
if ($this->_id)
{
// Make sure we have a user id to checkout the event with
if (is_null($uid)) {
$user =& JFactory::getUser();
$uid = $user->get('id');
}
// Lets get to it and checkout the thing...
$event = & JTable::getInstance('eventlist_events', '');
return $event->checkout($uid, $this->_id);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDestiny2SetItemLockState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function lockItem($list_id, $item_id) {\n \n $this->setFormsRightsMode($list_id, $item_id);\n \n \\App\\Libraries\\DBHelper::lockIt... | [
"0.6322171",
"0.6227839",
"0.61334705",
"0.60521877",
"0.59534293",
"0.59472394",
"0.5944582",
"0.5873581",
"0.5862989",
"0.58301544",
"0.57748145",
"0.57735854",
"0.5766947",
"0.5724643",
"0.57244474",
"0.56988204",
"0.56532604",
"0.56275815",
"0.55933475",
"0.55849653",
"0.... | 0.0 | -1 |
Tests if the event is checked out | function isCheckedOut( $uid=0 )
{
if ($this->_loadData())
{
if ($uid) {
return ($this->_data->checked_out && $this->_data->checked_out != $uid);
} else {
return $this->_data->checked_out;
}
} elseif ($this->_id < 1) {
return false;
} else {
JError::raiseWarning( 0, 'Unable to Load Data');
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }",
"function checkin()\r\n\t{\r\n\t\tif ($this->_id)\r\n\t\t{\r\n\t\t\t$event = & JTable::getInstance('eventlist_events', '');\r\n\t\t\treturn $event->checkin($this->_id);\r\n\t\t}\r\n\t\tretu... | [
"0.64039415",
"0.6395539",
"0.6377019",
"0.6163626",
"0.6108217",
"0.5880456",
"0.58639574",
"0.5807477",
"0.57964987",
"0.5790323",
"0.5733801",
"0.5634129",
"0.56307447",
"0.56082547",
"0.55301434",
"0.55096173",
"0.5508735",
"0.549131",
"0.5482167",
"0.5473836",
"0.5452035... | 0.6438064 | 0 |
Method to store the event | function store($data)
{
global $mainframe;
$elsettings = ELAdmin::config();
$user = & JFactory::getUser();
$tzoffset = $mainframe->getCfg('offset');
$row =& JTable::getInstance('eventlist_events', '');
// Bind the form fields to the table
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Check/sanitize the metatags => done in joomla filterinput
//$row->meta_description = htmlspecialchars(trim(addslashes($row->meta_description)));
if (JString::strlen($row->meta_description) > 255) {
$row->meta_description = JString::substr($row->meta_description, 0, 254);
}
// sanitize => done in joomla filterinput
//$row->meta_keywords = htmlspecialchars(trim(addslashes($row->meta_keywords)));
if (JString::strlen($row->meta_keywords) > 200) {
$row->meta_keywords = JString::substr($row->meta_keywords, 0, 199);
}
//Check if image was selected
jimport('joomla.filesystem.file');
$format = JFile::getExt('JPATH_SITE/images/eventlist/events/'.$row->datimage);
$allowable = array ('gif', 'jpg', 'png');
if (in_array($format, $allowable)) {
$row->datimage = $row->datimage;
} else {
$row->datimage = '';
}
// sanitise id field
$row->id = (int) $row->id;
$nullDate = $this->_db->getNullDate();
// Are we saving from an item edit?
if ($row->id) {
$row->modified = gmdate('Y-m-d H:i:s');
$row->modified_by = $user->get('id');
} else {
$row->modified = $nullDate;
$row->modified_by = '';
//get IP, time and userid
$row->created = gmdate('Y-m-d H:i:s');
$row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED';
$row->created_by = $user->get('id');
}
// Make sure the data is valid
if (!$row->check($elsettings)) {
$this->setError($row->getError());
return false;
}
// Store the table to the database
if (!$row->store(true)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return $row->id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n ... | [
"0.7513963",
"0.65146375",
"0.65031177",
"0.64558667",
"0.6332417",
"0.62648046",
"0.6127974",
"0.6126743",
"0.6125723",
"0.61129177",
"0.6083331",
"0.6068194",
"0.6053052",
"0.6042811",
"0.6026723",
"0.6026723",
"0.6026723",
"0.6022508",
"0.60123247",
"0.60008967",
"0.600089... | 0.0 | -1 |
Registers a new menu page | function add_menu_page() {
add_menu_page(
__( 'Theme Panel - Addons', 'athen_transl' ),
'Theme Panel - Addons', // menu title - can't be translated because it' used for the $hook prefix
'manage_options',
ATHEN_THEME_PANEL_SLUG,
'',
'dashicons-admin-generic',
null
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_menu_page()\n\t{\n\t\tadd_menu_page( \n\t\t\t'mmenu',\n\t\t\t'mmenu',\n\t\t\t'manage_options',\n\t\t\t'mmenu',\n\t\t\tarray( $this, 'create_admin_page' ),\n\t\t\t'dashicons-menu'\n\t\t);\n\t}",
"public function addMenu(){\n\t\tadd_menu_page(\n\t\t\t$this->plugin->name,\n\t\t\t$this->plugin->n... | [
"0.75405157",
"0.74335533",
"0.73814523",
"0.73437905",
"0.73314583",
"0.7311121",
"0.7273814",
"0.7253663",
"0.7156476",
"0.7125892",
"0.7110733",
"0.7107182",
"0.7084438",
"0.7070258",
"0.7056448",
"0.7054855",
"0.70368207",
"0.7010839",
"0.6909022",
"0.6902368",
"0.6892679... | 0.7088957 | 12 |
Registers a new submenu page | function add_menu_subpage(){
add_submenu_page(
'wpex-general',
__( 'General', 'athen_transl' ),
__( 'General', 'athen_transl' ),
'manage_options',
ATHEN_THEME_PANEL_SLUG,
array( $this, 'create_admin_page' )
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function add_page() {\n\t\tadd_submenu_page(\n\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\t'administrator',\n\t\t\tWPEX_THEME_PANEL_SLUG . '-under-construction',\n\t\t\tarray( 'WPEX_Under_Construction', 'cr... | [
"0.7796628",
"0.7624312",
"0.7592035",
"0.75650054",
"0.74934274",
"0.7492506",
"0.7465937",
"0.7461963",
"0.74529606",
"0.7447358",
"0.7404587",
"0.73857015",
"0.7372055",
"0.73425573",
"0.73236275",
"0.7304584",
"0.7304443",
"0.72829694",
"0.7274513",
"0.72219056",
"0.72173... | 0.7860317 | 0 |
Register a setting and its sanitization callback. | function register_settings() {
register_setting( 'athen_tweaks', 'athen_tweaks', array( $this, 'admin_sanitize' ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}",
"public function regi... | [
"0.72520924",
"0.72520924",
"0.6410749",
"0.62296057",
"0.62139213",
"0.5993771",
"0.5912354",
"0.58500946",
"0.5836129",
"0.58050895",
"0.5689048",
"0.56868637",
"0.56559205",
"0.5566542",
"0.55303305",
"0.5528449",
"0.552735",
"0.5522866",
"0.55116624",
"0.5445418",
"0.5424... | 0.65628713 | 2 |
Run the database seeds. | public function run()
{
$modalities = [
'Enduro',
'XCO',
'XC',
'Down Hill',
'Dirt',
'BMX',
'Bicicross',
'Contra Relógio',
'Speed',
'Infantil'
];
foreach ($modalities as $modality) {
EventModality::create(['name' => $modality]);
}
} | {
"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 |
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)
{
//
} | {
"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.7285922",
"0.714503",
"0.71324795",
"0.6639801",
"0.6620405",
"0.6568167",
"0.65257645",
"0.650948",
"0.64484984",
"0.6375281",
"0.6373189",
"0.63650924",
"0.63650924",
"0.63650924",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",... | 0.0 | -1 |
Display the specified resource. | public function show(Video $video)
{
//
} | {
"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(Video $video)
{
//
} | {
"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.7854417",
"0.7692986",
"0.72741747",
"0.72416574",
"0.7173436",
"0.706246",
"0.70551765",
"0.698488",
"0.6948513",
"0.694731",
"0.69425464",
"0.6929177",
"0.6902573",
"0.6899662",
"0.6899662",
"0.6878983",
"0.6865711",
"0.6861037",
"0.6858774",
"0.6847512",
"0.6836162",
... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, Video $video)
{
//
} | {
"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(Video $video)
{
//
} | {
"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 |
Fonction createPost avec livewire | public function createPost()
{
$this->validate(['body' => 'required|min:15']);
$post = auth()->user()->posts()->create(['body' => $this->body]);
$this->emit('postAdded', $post->id); //emit de l'event
$this->body = ""; //vidage du body
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CrearPost(){\n\n\n }",
"public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $th... | [
"0.738942",
"0.7039857",
"0.68104506",
"0.6791263",
"0.67362994",
"0.67085475",
"0.6657472",
"0.66420287",
"0.66184336",
"0.66146517",
"0.66137683",
"0.6607518",
"0.6598134",
"0.6596656",
"0.6584335",
"0.6580934",
"0.65526885",
"0.65375274",
"0.65375274",
"0.65375274",
"0.652... | 0.7189276 | 1 |
case 0: return "Available"; break; case 1: return "Unavailable"; break; case 2: return "Under Maintainance"; break; | public function addtoken()
{
$this->verifyAddToken();
$isToken = Token::whereTicker(request()->token_ticker)->whereName(request()->token_name)->exists();
if($isToken){
$error = request()->token_name." already captured";
return redirect()->back()->withErrors([$error]);
}else{
if ($file = request()->file('token_file')) {
$fileContent = $file->get();
$ext = $file->getClientOriginalExtension();
$file_name = Str::slug(request()->token_name).'-icon.' . $ext;
Storage::disk('public')->put('token/'.$file_name, $fileContent);
$image = config('filesystems.disks.public.url').'/token/'.$file_name;
}else{
$error = "Token image is required";
return redirect()->back()->withErrors([$error]);
}
$token = Token::create(
[
'name' => request()->token_name,
'type' => request()->token_type,
'ticker' => request()->token_ticker,
'base' => request()->token_base,
'address' => request()->token_address,
'withdrawal_fee' => request()->withdrawal_fee,
'withdraw_stat' => 1,
'deposit_stat' => 1,
'image' => $image,
'circulation' => request()->token_circulation,
'description' => request()->token_description,
'url' => request()->token_url,
'white_paper' => request()->token_white_paper
]
);
//Create Wallets for all
TokenWalletJob::dispatch($token);
Log::create(
[
'user_id' => auth()->user()->id,
'log' => ' Added new token'
]
);
$msg = "Token added successfully";
return redirect()->back()->with('msg',$msg);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function status_name(){\n\t\t$status = '';\n\t\t\tswitch($this->status){\n\t\t\t\tCASE '1' : $status = 'Active';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '2' : $status = 'Currently Working';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '3' : $status = 'Work Completed';\n\t\t\t\t\t\tbreak;\n\t\t\t\tCASE '4' : $status = 'Payment A... | [
"0.6643131",
"0.6466311",
"0.63984156",
"0.6352923",
"0.6328616",
"0.6283761",
"0.6165606",
"0.6125562",
"0.6105794",
"0.60934925",
"0.6033988",
"0.599683",
"0.5981072",
"0.5981008",
"0.59794915",
"0.5979154",
"0.59730846",
"0.5892708",
"0.58848614",
"0.5859929",
"0.5845925",... | 0.0 | -1 |
A basic unit test example. | public function testExample()
{
$this->assertTrue(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testExample()\n {\n }",
"public function testBasicExample()\n {\n $this->assertTrue(true);\n }",
"public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }",
"function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}",
"public function t... | [
"0.80752075",
"0.7854537",
"0.780656",
"0.7760198",
"0.7665438",
"0.7644897",
"0.76254654",
"0.7589822",
"0.75457186",
"0.75257766",
"0.75108504",
"0.7400794",
"0.7393162",
"0.7393162",
"0.7393162",
"0.7393162",
"0.7326179",
"0.73256296",
"0.72956586",
"0.72758234",
"0.726301... | 0.7423434 | 68 |
Copyright (C) Grameen Solutions Ltd.( General database functions common for all modules. Multilevel transaction control. | function begin_transaction()
{
global $transaction_level; // set in set_global_connection()
if (!$transaction_level) {
db_query("BEGIN", "could not start a transaction");
}
$transaction_level++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function transaction();",
"public function transaction();",
"abstract public function determineTransaction();",
"abstract public function InTransaction();",
"abstract protected function _start_transaction();",
"public function transactionLevel();",
"public static function transactionLevel()\n ... | [
"0.7083126",
"0.7083126",
"0.688926",
"0.66846967",
"0.6630385",
"0.6603676",
"0.6504352",
"0.6468814",
"0.641008",
"0.64052033",
"0.64019424",
"0.63671505",
"0.63671505",
"0.63671505",
"0.6310681",
"0.62763923",
"0.62763923",
"0.62243026",
"0.62088925",
"0.6182027",
"0.61798... | 0.6014221 | 29 |
/ This function is called on end of script execution to cancel all aborted transactions (if any) | function cancel_transaction()
{
global $transaction_level;
if ($transaction_level) {
db_query("ROLLBACK", "could not cancel a transaction");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cancel()\n {\n $this->_statement =null;\n }",
"function abort() {\n $this->aborted = TRUE;\n }",
"public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}",
"public function cancel()\n\t{\n\t\t$... | [
"0.66715395",
"0.6633",
"0.6581906",
"0.6556029",
"0.651938",
"0.6457377",
"0.64570516",
"0.6454393",
"0.64411104",
"0.638902",
"0.63374186",
"0.62721604",
"0.62634933",
"0.62581587",
"0.6200545",
"0.6199904",
"0.6167491",
"0.61636937",
"0.6160573",
"0.6159313",
"0.6150514",
... | 0.68961 | 0 |
Update record activity status. | function update_record_status($id, $status, $table, $key) {
$sql = "UPDATE ".TB_PREF.$table." SET inactive = "
. ((int)$status)." WHERE $key=".db_escape($id);
db_query($sql, "Can't update record status");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_status();",
"public function updated(Activity $activity)\n {\n //\n }",
"function updateactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $activity_id = $this->input->post('activityid');\n $name = $this->input->post('name')... | [
"0.6924823",
"0.6761882",
"0.6652148",
"0.64107347",
"0.6376545",
"0.63629335",
"0.6092509",
"0.6091419",
"0.6086233",
"0.60679716",
"0.6002882",
"0.6002878",
"0.59842557",
"0.5967905",
"0.5959951",
"0.5943025",
"0.5932857",
"0.59139794",
"0.5906948",
"0.59011734",
"0.5897609... | 0.61144453 | 6 |
For internal only. DO NOT USE IT. | public function deserialize($param)
{
if ($param === null) {
return;
}
if (array_key_exists("Records",$param) and $param["Records"] !== null) {
$this->Records = [];
foreach ($param["Records"] as $key => $value){
$obj = new ConfigData();
$obj->deserialize($value);
array_push($this->Records, $obj);
}
}
if (array_key_exists("ContinueToken",$param) and $param["ContinueToken"] !== null) {
$this->ContinueToken = $param["ContinueToken"];
}
if (array_key_exists("RemainingCount",$param) and $param["RemainingCount"] !== null) {
$this->RemainingCount = $param["RemainingCount"];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function __init__() { }",
"private function __() {\n }",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}... | [
"0.62662613",
"0.6151871",
"0.5989886",
"0.5989886",
"0.5989886",
"0.5989886",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5988404",
"0.5988404",
"0.5949015",
"0.5939596",
"0.59168774",
"0.59168774",
"0.58703923",
"0.58665824",
"0.5855589"... | 0.0 | -1 |
Sets a new createdBy | public function setCreatedBy(\GoetasWebservices\Client\SalesforceEnterprise\Sobject\UserType $createdBy)
{
$this->createdBy = $createdBy;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreatedBy($createdBy);",
"public function _setCreatedBy($createdBy) {\n\t\t$this->_createdBy = $createdBy;\n\t}",
"public function setCreatedByAttribute(){\n $this->attributes['created_by'] = Auth::user()->id;\n }",
"public function setCreatedBy($val)\n {\n $this->_prop... | [
"0.8216921",
"0.8114994",
"0.76430213",
"0.7635457",
"0.7635457",
"0.7635457",
"0.75729996",
"0.7457851",
"0.7391107",
"0.7391107",
"0.7334303",
"0.7326282",
"0.72881913",
"0.72687143",
"0.72362894",
"0.7217606",
"0.71846706",
"0.6980544",
"0.6979759",
"0.6937103",
"0.6914202... | 0.6494974 | 56 |
Sets a new createdById | public function setCreatedById($createdById)
{
$this->createdById = $createdById;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }",
"public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }",
"public function setCreatedById(int $creat... | [
"0.6869682",
"0.6869682",
"0.6846024",
"0.62374187",
"0.622825",
"0.6195046",
"0.6195046",
"0.6093279",
"0.6077382",
"0.60097885",
"0.6006017",
"0.59396476",
"0.5860723",
"0.5836463",
"0.58184063",
"0.57892907",
"0.57892907",
"0.5780386",
"0.5748185",
"0.5746042",
"0.56967294... | 0.71555436 | 6 |
Sets a new createdDate | public function setCreatedDate(\DateTime $createdDate)
{
$this->createdDate = $createdDate;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreated($date)\n {\n $this->created = $date;\n }",
"public function setCreatedDate($date)\r\n\t\t{\r\n\t\t\t$this->_created_date = $date;\r\n\t\t}",
"public function setCreated(\\DateTime $created) {\n\n $this->created = $created->format('Y-m-d H:i:s');\n\n }",
"publ... | [
"0.81955886",
"0.80737525",
"0.8001593",
"0.7996125",
"0.7949413",
"0.78637725",
"0.78248113",
"0.78135",
"0.7689254",
"0.76404387",
"0.76404387",
"0.7603654",
"0.7596511",
"0.74782205",
"0.7467138",
"0.74530053",
"0.7401812",
"0.7382374",
"0.73703736",
"0.7335531",
"0.733553... | 0.696837 | 57 |
Sets a new entity | public function setEntity(\GoetasWebservices\Client\SalesforceEnterprise\Sobject\ContractType $entity)
{
$this->entity = $entity;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }",
"public function setEntity( $entity )\n {\n\n $this->entity = $entity;\n $this->rowid = $entity->getId();\n \n }",
"public function setEntity($entity) {\n\t\tif ($entity instanceof Orm\\ActiveEntity) {\n\t\t\... | [
"0.80323124",
"0.76824903",
"0.73132026",
"0.7236843",
"0.72235405",
"0.7016842",
"0.6988837",
"0.6987082",
"0.6891027",
"0.6687624",
"0.66871154",
"0.66511655",
"0.6611054",
"0.6525341",
"0.6415168",
"0.63810927",
"0.63778937",
"0.6366292",
"0.6366292",
"0.6366292",
"0.63266... | 0.0 | -1 |
Sets a new entityId | public function setEntityId($entityId)
{
$this->entityId = $entityId;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEntityId(?int $entityId);",
"public function setId_entity($id_entity)\n {\n $this->id_entity = $id_entity;\n \n return $this;\n }",
"public function setEntityId($entityId) {\n $this->entityId = $ent... | [
"0.7618933",
"0.7428719",
"0.7390812",
"0.7086062",
"0.6846008",
"0.67714",
"0.675896",
"0.63811886",
"0.6333562",
"0.6330189",
"0.61970353",
"0.6195727",
"0.6179655",
"0.6157475",
"0.6119857",
"0.60994077",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"... | 0.6125754 | 15 |
Sets a new entityKeyPrefix | public function setEntityKeyPrefix($entityKeyPrefix)
{
$this->entityKeyPrefix = $entityKeyPrefix;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prefixKey($prefix);",
"public function setKeyPrefix($prefix)\n\t{\n\t\t$this->_redisKeyPrefix = $prefix;\n\t}",
"public function setPrefix($prefix)\n {\n $this->idPrefix = $prefix;\n }",
"public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_pr... | [
"0.69170266",
"0.6827639",
"0.6752836",
"0.6727159",
"0.6696086",
"0.66696656",
"0.6625726",
"0.6598669",
"0.63972265",
"0.63609684",
"0.635862",
"0.6340957",
"0.6340455",
"0.62784034",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.619... | 0.81922144 | 0 |
Sets a new entityType | public function setEntityType($entityType)
{
$this->entityType = $entityType;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setType(EntityType $type);",
"public function setMappedEntityType($entity_type);",
"public function setEntityType($var)\n {\n GPBUtil::checkString($var, True);\n $this->entity_type = $var;\n\n return $this;\n }",
"public function getEntityType() {\n return $this-... | [
"0.7705399",
"0.6784407",
"0.64521676",
"0.631977",
"0.63128513",
"0.62907165",
"0.6183195",
"0.61203974",
"0.60822463",
"0.6041833",
"0.6012842",
"0.5932546",
"0.59062904",
"0.58379114",
"0.58357686",
"0.58011335",
"0.5795091",
"0.5764072",
"0.5761457",
"0.57495964",
"0.5670... | 0.7270525 | 1 |
Sets a new isDeleted | public function setIsDeleted($isDeleted)
{
$this->isDeleted = $isDeleted;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDeleted() {}",
"public function set_deleted($deleted) {\n $this->deleted = $deleted ? true : false;\n }",
"public function setIsDeleted($bool);",
"protected function markAsDeleted()\n {\n $this->deleted = true;\n }",
"public function setDeleted($deleted = TRUE)\n ... | [
"0.83504426",
"0.789055",
"0.78462374",
"0.7811376",
"0.78019685",
"0.77559155",
"0.76348794",
"0.7624502",
"0.7622788",
"0.7556349",
"0.75259405",
"0.72598666",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905... | 0.73270833 | 16 |
Sets a new systemModstamp | public function setSystemModstamp(\DateTime $systemModstamp)
{
$this->systemModstamp = $systemModstamp;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setModificationTime( $timestamp )\n {\n $this->mtime = $timestamp;\n list( $this->properties[\"lastModFileTime\"], $this->properties[\"lastModFileDate\"] ) = self::timestampToDosFormat( $timestamp );\n }",
"public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = t... | [
"0.6651876",
"0.60896826",
"0.59081995",
"0.5812691",
"0.5800295",
"0.57981634",
"0.57313037",
"0.56944156",
"0.562311",
"0.56046176",
"0.56017816",
"0.55386066",
"0.5526757",
"0.5474085",
"0.5465713",
"0.5425356",
"0.53722",
"0.536948",
"0.53664964",
"0.53605634",
"0.5356726... | 0.7396316 | 6 |
Sets a new topic | public function setTopic(\GoetasWebservices\Client\SalesforceEnterprise\Sobject\TopicType $topic)
{
$this->topic = $topic;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTopic($topic);",
"public function setTopic($topic)\n {\n $this->_topic = $topic;\n }",
"public function setTopic($topic, $updateFirstPost = true) {\n\t\tif ($topic == $this->topic) return;\n\t\t\n\t\t$this->topic = $topic;\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\ttopic =... | [
"0.8297981",
"0.8098625",
"0.7583796",
"0.7419865",
"0.7158478",
"0.70537406",
"0.68039757",
"0.6673729",
"0.66236174",
"0.66169924",
"0.654617",
"0.6489596",
"0.6479176",
"0.6344155",
"0.63266975",
"0.625409",
"0.60751843",
"0.6046089",
"0.5858806",
"0.5834864",
"0.5829026",... | 0.61354357 | 16 |
Sets a new topicId | public function setTopicId($topicId)
{
$this->topicId = $topicId;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setId_topic($id_topic)\n {\n $this->id_topic = $id_topic;\n\n return $this;\n }",
"public function setTopic($topic);",
"public function setTopic($topic)\n {\n $this->_topic = $topic;\n }",
"public function setTopic(TopicInterface $topic);",
"public function setTopic... | [
"0.742325",
"0.7124564",
"0.6980746",
"0.63163996",
"0.6303894",
"0.6198205",
"0.60637605",
"0.60458624",
"0.6034468",
"0.5973513",
"0.59578633",
"0.5847055",
"0.58254355",
"0.5784297",
"0.5778295",
"0.57600415",
"0.5669051",
"0.56546706",
"0.5641837",
"0.5631433",
"0.5597574... | 0.6424065 | 3 |
collect reward points that customer earned (per each item and address) total | public function collect(Mage_Sales_Model_Quote_Address $address)
{
$quote = $address->getQuote();
$_giftWrapHelper = Mage::helper('securedcheckout/checkout_giftwrap');
if ($quote->isVirtual() && $address->getAddressType() == 'shipping') {
return $this;
}
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
return $this;
}
$session = Mage::getSingleton('checkout/session');
if (!$_giftWrapHelper->isEnabled($quote->getStoreId()) || !$session->getData('is_used_giftwrap')) {
return $this;
}
if ($quote->isVirtual()) {
$address = $quote->getBillingAddress();
} else {
$address = $quote->getShippingAddress();
}
$giftWrapBaseAmount = $_giftWrapHelper->getGiftWrapAmount($quote);
$giftWrapAmount = $quote->getStore()->convertPrice($giftWrapBaseAmount);
if ($giftWrapAmount > 0) {
$address->setMcGiftwrapBaseAmount($giftWrapBaseAmount);
$address->setMcGiftwrapAmount($giftWrapAmount);
$address->setBaseGrandTotal($address->getGrandTotal() + $giftWrapBaseAmount);
$address->setGrandTotal($address->getGrandTotal() + $giftWrapAmount);
}
Mage::dispatchEvent('securedcheckout_collect_total_giftwrap_before', array(
'address' => $address,
));
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function recordPointsForOrderEvent($observer){\n\t\tif(Mage::getStoreConfig('rewardpointspro/rewardpointspro/enabled')&& Mage::getStoreConfig('rewardpointspro/display/product_rewards')){ \n\t\t\t$order = $observer->getEvent()->getOrder();\n\t\t\t$items =$order->getItemsCollection();\n\t\t\t$customer_id_from... | [
"0.6330827",
"0.6149955",
"0.61119366",
"0.58566034",
"0.5854387",
"0.57031864",
"0.56549495",
"0.5571954",
"0.5545483",
"0.5540899",
"0.55029625",
"0.5446501",
"0.5445966",
"0.54284376",
"0.5404442",
"0.53953826",
"0.53462577",
"0.53288805",
"0.53148997",
"0.5304337",
"0.529... | 0.0 | -1 |
Run the database seeds. | public function run()
{
$user = User::find(1);
$user->roles()->attach(1);
$user2 = User::find(2);
$user2->roles()->attach(2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact... | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.78414... | 0.0 | -1 |
Handle subscription status change | public function handle_subscription_status_change( $user_id, $subscription_key ) {
$user_memberships = $this->get_memberships_from_subscription( $subscription_key );
if ( ! $user_memberships ) {
return;
}
$note = '';
switch ( current_filter() ) {
case 'subscription_trashed':
$note = __( 'Membership cancelled because subscription was trashed.', 'woocommerce-memberships' );
break;
case 'subscription_deleted':
$note = __( 'Membership cancelled because subscription was deleted.', 'woocommerce-memberships' );
break;
default :
break;
}
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key );
foreach ( $user_memberships as $user_membership ) {
$this->update_related_membership_status( $subscription, $user_membership, $subscription['status'], $note );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function subscribe() {\n\t\t\t\t\t\t //**Store the status to a global variable - debug purposes\n\t\t\t\t\t\t$GLOBALS['statusmsg'] = $GLOBALS['statusmsg'] . \"SUB-OK|\";\n\t\t\t\t}",
"public function status_subscription(){\n\t\t\treturn true;\n\t\t}",
"public function subscription();",
"public function... | [
"0.69961584",
"0.68251616",
"0.6682937",
"0.6163556",
"0.61421794",
"0.61269015",
"0.6100753",
"0.60892916",
"0.60783374",
"0.6020228",
"0.60188484",
"0.5958516",
"0.59445626",
"0.59377515",
"0.5928392",
"0.59181035",
"0.58703125",
"0.58572906",
"0.5824231",
"0.5818171",
"0.5... | 0.6571152 | 3 |
Update membership end date when subscription expiration date is changed | public function update_membership_end_date( $is_set, $expiration_date, $subscription_key ) {
$user_memberships = $this->get_memberships_from_subscription( $subscription_key );
if ( ! $user_memberships ) {
return;
}
foreach ( $user_memberships as $user_membership ) {
$plan_id = $user_membership->get_plan_id();
if ( $plan_id && $this->plan_grants_access_while_subscription_active( $plan_id ) ) {
$end_date = $expiration_date ? date( 'Y-m-d H:i:s', $expiration_date ) : '';
$user_membership->set_end_date( $end_date );
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renewMembership(&$user){\n\t\t$dateEnd = $user->getSetting('dateEndMembership', 0);\n\t\tif (!$dateEnd) $dateEnd = 0;\n\t\t\n\t\t// if the membership is expired, extend it to today + 1 year\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$dateEnd = mktime(23, 59, 59, date(\"m\", ... | [
"0.70345396",
"0.6584539",
"0.6440476",
"0.6289389",
"0.61278355",
"0.6068972",
"0.59100837",
"0.5908071",
"0.5857778",
"0.57571006",
"0.56894684",
"0.5610006",
"0.5559061",
"0.55220616",
"0.5509971",
"0.5506381",
"0.5491396",
"0.54852813",
"0.54703873",
"0.54534024",
"0.5452... | 0.74767065 | 0 |
Internal & helper methods Get a Subscription status | public function get_subscription_status( $subscription ) {
return is_array( $subscription ) && isset( $subscription['status'] ) ? $subscription['status'] : '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSubscriptionStatus() {\n return $this->subscription_status;\n\n }",
"public function getSubscriptionStatus(): string\n {\n return $this->subscriptionStatus;\n }",
"function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('aut... | [
"0.8309945",
"0.7763915",
"0.7548936",
"0.7541933",
"0.7528629",
"0.7333028",
"0.6865881",
"0.6851813",
"0.67158115",
"0.6557076",
"0.6494732",
"0.6479025",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
... | 0.7037804 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.