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 |
|---|---|---|---|---|---|---|
Display a listing of the resource. | public function index()
{
$this->statusText = 'success';
$this->statusCode = 200;
return response()->json([
'status_code' => $this->statusCode,
'status' => $this->statusText,
'data' => Book::all()
])->setStatusCode($this->statusCode, $this->statusText);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(BookPostRequest $request)
{
try {
$book = Book::create(
$request->only([
'name','isbn','authors','country','number_of_pages','publisher','release_date'
])
);
$this->statusCode = 201;
$this->statusText = 'success';
} catch(Exception $exception) {
Log::alert("Something went wrong. Book not created. " . $exception->getMessage());
}
return response()->json([
'status_code' => $this->statusCode,
'status' => $this->statusText,
'data' => ["book" => $book]
])->setStatusCode(201, 'success');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
try {
$book = Book::find($id);
$this->statusCode = 200;
$this->statusText = 'success';
} catch (Exception $e) {
Log::alert("Something went wrong. " . $e->getMessage());
}
return response()->json([
'status_code' => $this->statusCode,
'status' => $this->statusText,
'data' => $book == null ?[]:$book // If book is null return empty array
]);
} | {
"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(BookPostRequest $request, $id)
{
try {
$book = Book::find($id);
$book->update(
$request->only([
'name','isbn','authors','country','number_of_pages','publisher','release_date'
])
);
$this->statusCode = 200;
$this->statusText = 'success';
$this->message = 'The book My First Book was updated successfully';
} catch (Exception $exception) {
Log::alert("Something went wrong. " . $exception->getMessage());
} catch (Error $error) {
Log::alert("An error occured. " . $error->getMessage());
}
return response()->json([
'status_code' => $this->statusCode,
'status' => $this->statusText,
'message' => $this->message,
'data' => $book == null ?[]:$book // If book is null return empty array
])->setStatusCode($this->statusCode, $this->statusText);
} | {
"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.7423347",
"0.70622426",
"0.70568657",
"0.6896551",
"0.65835553",
"0.64519453",
"0.6348333",
"0.6212436",
"0.61450946",
"0.6122591",
"0.6114199",
"0.6101911",
"0.60876113",
"0.60528636",
"0.60177964",
"0.6006609",
"0.59725446",
"0.594558",
"0.59395295",
"0.5938792",
"0.5893... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$book = Book::find($id);
try {
$book->delete();
$this->statusCode = 200;
$this->statusText = 'success';
$this->message = 'The book My First Book was deleted successfully';
$book = null;
} catch (Exception $exception) {
Log::alert("Something went wrong. " . $exception->getMessage());
} catch (Error $error) {
Log::alert("An error occured. " . $error->getMessage());
}
return response()->json([
'status_code' => $this->statusCode,
'status' => $this->statusText,
'message' => $this->message,
'data' => is_null($book) ? []:$book
])->setStatusCode($this->statusCode, $this->statusText);
} | {
"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 |
Create a new command instance. | public function __construct()
{
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }",
"pu... | [
"0.8010746",
"0.7333379",
"0.72606754",
"0.7164165",
"0.716004",
"0.7137585",
"0.6748632",
"0.67234164",
"0.67178184",
"0.6697025",
"0.6677973",
"0.66454077",
"0.65622073",
"0.65437883",
"0.64838654",
"0.64696646",
"0.64292693",
"0.6382209",
"0.6378306",
"0.63773245",
"0.6315... | 0.0 | -1 |
Execute the console command. | public function handle()
{
// retrieve the username from the option
$username = $this->option('username');
// if no username was passed to the option, prompt the user to enter the username
if (!$username) $username = $this->ask('what is the user\'s username?');
// retrieve the user with the specified email
$user = User::where('username', $username)->first();
if (!$user) {
// show an error and exist if the user does not exist
$this->error('No user with that username.');
return;
}
// Print a warning
$this->info('A new secret will be generated for '.$user->username);
$this->info('This action will invalidate the previous secret key.');
// ask for confirmation if not forced
if (!$this->option('force') && !$this->confirm('Do you wish to continue?')) return;
// initialise the 2FA class
$google2fa = app('pragmarx.google2fa');
// generate a new secret key for the user
$user->google2fa_secret = $google2fa->generateSecretKey();
// save the user
$user->save();
// show the new secret key
$this->info('A new secret has been generated for '.$user->username);
$this->info('The new secret is: '.$user->google2fa_secret);
} | {
"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.6469971",
"0.64641356",
"0.6427384",
"0.6349752",
"0.63188183",
"0.62750113",
"0.6261585",
"0.6261214",
"0.6235854",
"0.6225116",
"0.6222161",
"0.6214144",
"0.6193531",
"0.6191337",
"0.6183868",
"0.61772275",
"0.61766857",
"0.6172786",
"0.6149171",
"0.6148903",
"0.61484134... | 0.0 | -1 |
Alterar dados de SicasConsultaMedica | public function alterar($oSicasConsultaMedica = NULL){
if($oSicasConsultaMedica == NULL){
// recebe dados do formulario
$post = DadosFormulario::formSicasConsultaMedica(NULL, 2);
// valida dados do formulario
$oValidador = new ValidadorFormulario();
if(!$oValidador->validaFormSicasConsultaMedica($post,2)){
$this->msg = $oValidador->msg;
return false;
}
// cria variaveis para validacao com as chaves do array
foreach($post as $i => $v) $$i = utf8_encode($v);
// cria objeto para grava-lo no BD
$oSicasAtendimento = new SicasAtendimento($cd_atendimento);
$oSicasMedico = new SicasMedico($cd_medico);
$oSicasTipoAtendimento = new SicasTipoAtendimento($cd_tipo_atendimento);
$oSicasConsultaMedica = new SicasConsultaMedica($cd_consulta_medica,$oSicasAtendimento,$dt_consulta,$oSicasMedico,$qp_paciente,$exame_fisico,$exame_solicitado,$diag_paciente,$oSicasTipoAtendimento,$resultado,$tratamento,$status);
}
$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();
if(!$oSicasConsultaMedicaBD->alterar($oSicasConsultaMedica)){
$this->msg = $oSicasConsultaMedicaBD->msg;
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Alterar() {\n $SQL = \"UPDATE dd_dados_domicilio SET \n IDTIPOLOGRADOURO ='\" . $this->IDTIPOLOGRADOURO . \"',\n NOMELOGRADOURO ='\" . $this->NOMELOGRADOURO . \"',\n NUMDOMICILIO ='\" . $this->NUMDOMICILIO . \"',\n COMPLEMENTO ='\" . $this->COMPLEMENTO . \"',\n BA... | [
"0.6761109",
"0.6747411",
"0.66255254",
"0.6487145",
"0.64740616",
"0.6313572",
"0.6304311",
"0.62440556",
"0.6227445",
"0.6141292",
"0.6141292",
"0.61313254",
"0.61217004",
"0.60833186",
"0.6046655",
"0.5988509",
"0.5977099",
"0.59689313",
"0.5963143",
"0.5945785",
"0.594379... | 0.70868915 | 0 |
Selecionar registro de SicasConsultaMedica | public function get($cd_consulta_medica){
$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();
if($oSicasConsultaMedicaBD->msg != ''){
$this->msg = $oSicasConsultaMedicaBD->msg;
return false;
}
if(!$obj = $oSicasConsultaMedicaBD->get($cd_consulta_medica)){
$this->msg = $oSicasConsultaMedicaBD->msg;
return false;
}
return $obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function consultar($valor){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->consultar($valor);\r\n }",
"public function consultar($valor){\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\t\r\n\t\treturn $oSicasCon... | [
"0.6924992",
"0.6905642",
"0.66673225",
"0.6591213",
"0.65494305",
"0.6537351",
"0.6494126",
"0.647959",
"0.64312047",
"0.6421163",
"0.64095503",
"0.640615",
"0.6396983",
"0.6394402",
"0.6382237",
"0.6377017",
"0.63721186",
"0.6359905",
"0.6354635",
"0.6354372",
"0.63191575",... | 0.6116096 | 38 |
Consultar registros de SicasConsultaMedica | public function consultar($valor){
$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();
return $oSicasConsultaMedicaBD->consultar($valor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function consultar($valor){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->consultar($valor);\r\n }",
"public function consultar_asistencia()\n\t{\n\t\t$this->seguridad_lib->acceso_metodo(__METHOD__);\n\n\t\t$datos['titulo_con... | [
"0.6942287",
"0.6733404",
"0.6662758",
"0.6646386",
"0.66270703",
"0.6613926",
"0.6568316",
"0.65396035",
"0.6521171",
"0.6500633",
"0.647779",
"0.64602244",
"0.64294916",
"0.6425878",
"0.64187217",
"0.6413232",
"0.64018667",
"0.6383395",
"0.63566506",
"0.635061",
"0.6348245"... | 0.6920164 | 1 |
Total de registros de SicasConsultaMedica | public function totalColecao(){
$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();
return $oSicasConsultaMedicaBD->totalColecao();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function totalRegistros();",
"public function totalColecao(){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->totalColecao();\r\n }",
"public function total(){\n $total = $this->qualification + $this->referee_report + $... | [
"0.7712316",
"0.72848725",
"0.71452045",
"0.71007335",
"0.7094024",
"0.7076156",
"0.69729894",
"0.69729894",
"0.69711214",
"0.6940392",
"0.6938759",
"0.6914168",
"0.69066447",
"0.6897834",
"0.6897834",
"0.6897834",
"0.68754953",
"0.687157",
"0.68109006",
"0.67490286",
"0.6713... | 0.7308667 | 1 |
Display a listing of the resource. | public function index()
{
//
if (Auth::check()) {
$servicios = Servicios::lists('nombre', 'id')->toArray();
$tipovehiculos = TipoVehiculos::lists('nombre', 'id')->toArray();
$carros = Tickets::whereNull('fecha_fin')->where('id_tipo_vehiculo', 2)->count();
$motos = Tickets::whereNull('fecha_fin')->where('id_tipo_vehiculo', 1)->count();
$stock = Configuraciones::find(1);
$stock_carros = 0;
$stock_motos = 0;
if (count($stock) > 0) {
$stock_carros = $stock->stock_carros - $carros;
$stock_motos = $stock->stock_motos - $motos;
}
return view('home', compact('tipovehiculos', 'servicios', 'carros', 'motos', 'stock_carros', 'stock_motos'));
}
$this->configurar();
return view('auth.login');
} | {
"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.7447426",
"0.73628515",
"0.73007894",
"0.7249563",
"0.7164474",
"0.7148467",
"0.71320325",
"0.7104678",
"0.7103152",
"0.7100512",
"0.7048493",
"0.6994995",
"0.69899315",
"0.6935843",
"0.6899995",
"0.68999326",
"0.6892163",
"0.6887924",
"0.6867505",
"0.6851258",
"0.6831236"... | 0.0 | -1 |
Show the form for creating a new resource. | public function configurar()
{
//
$count = Perfiles::select()->get()->count();
if ($count == 0) {
$permisos = Funcionalidades::select()->get();
Perfiles::create(['nombre' => 'Super Su','usuario'=>1]);
foreach ($permisos as $value) {
Permisos::create(['id_perfil' => 1, 'id_funcionalidad' => $value->id]);
}
User::create(['name' => 'Admin', 'email' => 'Admin', 'password' => 'Admin', 'id_perfil' => 1,'usuario'=>1]);
}
} | {
"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 |
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.72855324",
"0.71447515",
"0.7132799",
"0.6641042",
"0.66208744",
"0.6566955",
"0.65249777",
"0.6509032",
"0.6447701",
"0.63756555",
"0.6373163",
"0.63650846",
"0.63650846",
"0.63650846",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.63416... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8232636",
"0.81890994",
"0.68296117",
"0.64987075",
"0.649589",
"0.64692974",
"0.64633286",
"0.63640857",
"0.6307513",
"0.6281809",
"0.621944",
"0.61926234",
"0.61803305",
"0.6173143",
"0.61398774",
"0.6119022",
"0.61085826",
"0.6106046",
"0.60947937",
"0.6078597",
"0.6047... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6671365",
"0.6660839",
"0.66361386",
"0.6632988",
"0.6624729",
"0.6542195",
"0.6541645",
"0.6466739",
"0.6288393",
"0.61767083",
"0.6129533",
"0.608954",
"0.6054169",
"0.60443425",
"0.60073143",
"0.59338665",
"0.59317696",
"0.592145",
"0.5920155",
"0.59065086",
"0.5897853"... | 0.0 | -1 |
/check db if it exists | public function checkRule($attribute , $params){
/* @var $dispoModel Disposale*/
if(!isset($this->$attribute) || empty($this->$attribute)) {
$this->addError($attribute, "Can't check rule. You must provide a mobile number");
}
$criteria = new CDbCriteria();
$criteria->compare("phone_number", $this->$attribute);
$criteria->order = "date_created DESC";
$dispoModel = Disposale::model()->find($criteria);
$isValid = true;
if($dispoModel && !empty($dispoModel) ){
$dt1Str = date("Y-m-d H:i:s", strtotime($dispoModel->date_created));
$dt2Str = date("Y-m-d H:i:s", strtotime("+0 day" ));
$dt1Obj = new DateTime($dt1Str);
$dt2Obj = new DateTime($dt2Str);
$dateDifference = $dt2Obj->diff($dt1Obj)->format("%a");
$dateDifference = intval($dateDifference);
$limitDays = intval(\Yii::app()->params['time_limit']);
/*After 182 days , if equal to 182 still not valid*/
if($dateDifference <= $limitDays){
$lastInsertData = $dispoModel->date_created;
$this->addError($attribute, "Sorry we cant process your data . You must wait {$limitDays} days before we accept your submittion. Last insert was $lastInsertData. Difference is $dateDifference and limit is $limitDays");
}
}
return $isValid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function check_db() {\n if (ee()->db->table_exists($this->table_name)) {\n return true;\n }\n return $this->make_db();\n }",
"function check_db(){\n if( ! $this->database_exists() ){\n $this->create_table();\n }\n }",
"private function databaseExists()\n {\... | [
"0.82061476",
"0.8138522",
"0.7823927",
"0.7654133",
"0.7641225",
"0.75991696",
"0.75792825",
"0.7383631",
"0.73750216",
"0.7296919",
"0.726372",
"0.7212905",
"0.7189636",
"0.7186857",
"0.7182226",
"0.7101757",
"0.70768374",
"0.7069163",
"0.70016026",
"0.6931981",
"0.6925691"... | 0.0 | -1 |
Determine whether the user can view any auth keys. | public function viewAny(User $user)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}",
"public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}",
"public function isAuth()\n {\n return !empty($this->getAuth());\n ... | [
"0.7311336",
"0.7311336",
"0.6992952",
"0.6953791",
"0.6908594",
"0.689607",
"0.68775856",
"0.68194455",
"0.68071055",
"0.67989105",
"0.67931837",
"0.67931837",
"0.6769009",
"0.67582893",
"0.6753815",
"0.67512685",
"0.67490816",
"0.67455643",
"0.67341554",
"0.6729043",
"0.672... | 0.0 | -1 |
Determine whether the user can view the auth key. | public function view(User $user, ServerAuthKey $key)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize(): bool\n {\n return Auth::check() &&\n $this->user()->tokenCan('view:store');\n }",
"public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }",
"private function needs_auth($key) {\r\n ... | [
"0.71165687",
"0.70232266",
"0.70149255",
"0.6954253",
"0.6951727",
"0.69380736",
"0.69380736",
"0.6935705",
"0.6929637",
"0.68999326",
"0.6896748",
"0.6879138",
"0.6869468",
"0.6834831",
"0.6834831",
"0.6830553",
"0.6830075",
"0.6816279",
"0.6816279",
"0.68064576",
"0.679505... | 0.0 | -1 |
Determine whether the user can create auth keys. | public function create(User $user)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }",
"public function authorize()\n {\n return request()->user()->tokenCan('user_create');\n }",
"public function authorize()\n {\n return $this->user()->can('user.create... | [
"0.6793201",
"0.667927",
"0.6672964",
"0.66629946",
"0.66337085",
"0.65405536",
"0.65239227",
"0.65009564",
"0.6405132",
"0.63977623",
"0.6390538",
"0.6382776",
"0.63803464",
"0.637184",
"0.6364304",
"0.63537645",
"0.6347217",
"0.634115",
"0.63377446",
"0.63377446",
"0.633375... | 0.0 | -1 |
Determine whether the user can update the auth key. | public function update(User $user, ServerAuthKey $key)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }",
"public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }",
"public function authorize()\n {\n return $this-... | [
"0.7179042",
"0.71339506",
"0.7041955",
"0.70295286",
"0.7014738",
"0.6918626",
"0.6911941",
"0.6851657",
"0.6848956",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6794654",
"0.6789655",
"0.6761919",
"0.6752804",
... | 0.63458 | 40 |
Determine whether the user can delete the auth key. | public function delete(User $user, ServerAuthKey $key)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }",
"public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === A... | [
"0.71674985",
"0.7098086",
"0.7003756",
"0.69318014",
"0.6883532",
"0.6870792",
"0.67175364",
"0.6716931",
"0.67065954",
"0.6683553",
"0.66813636",
"0.66421056",
"0.6630496",
"0.66079456",
"0.65796137",
"0.6564912",
"0.65543044",
"0.65510374",
"0.65465724",
"0.6542628",
"0.64... | 0.6393031 | 28 |
Determine whether the user can restore the auth key. | public function restore(User $user, ServerAuthKey $key)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'restore' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }",
"public function hasValidResetKey()\n {\n return (boolean) $... | [
"0.69855917",
"0.6302176",
"0.6097778",
"0.60794586",
"0.6045934",
"0.6015025",
"0.59512925",
"0.5928465",
"0.59031117",
"0.58317214",
"0.5807743",
"0.5799083",
"0.5779006",
"0.5767851",
"0.57035506",
"0.566946",
"0.5643295",
"0.5632672",
"0.56311005",
"0.5609709",
"0.5603563... | 0.6545664 | 1 |
Determine whether the user can permanently delete the auth key. | public function forceDelete(User $user, ServerAuthKey $key)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }",
"public function canDelete()\n {\n $exist = $this->getModelObj('permission')->wher... | [
"0.6867733",
"0.6854661",
"0.67626876",
"0.66012883",
"0.65867436",
"0.6525934",
"0.6523325",
"0.65090764",
"0.64961904",
"0.6459987",
"0.6443412",
"0.6424533",
"0.6412226",
"0.6406179",
"0.63955843",
"0.638317",
"0.63720894",
"0.6329093",
"0.62502366",
"0.6231591",
"0.622776... | 0.5926593 | 58 |
Determine whether the user can add a server host. | public function addServerHost(User $user, ServerAuthKey $key)
{
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasServer(string $name): bool {}",
"public function host_exist() {\n return D( 'User/Host' )->host_exist_verifition( array( 'usr_login_id' => get_session_id() ) );\n }",
"public function shouldCheckHttpHost()\n {\n return !Director::is_cli() && isset($_SERVER['HTTP_HOST']);\... | [
"0.6472003",
"0.6393594",
"0.63456297",
"0.6293234",
"0.6217722",
"0.6145836",
"0.606648",
"0.60478276",
"0.6045852",
"0.60220313",
"0.6005659",
"0.5988217",
"0.59685993",
"0.5964756",
"0.59636235",
"0.5941678",
"0.5936683",
"0.59210706",
"0.5901499",
"0.58996457",
"0.5896767... | 0.67002326 | 0 |
Determine whether the user can add a server user. | public function addServerUser(User $user, ServerAuthKey $key)
{
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canAdd($user) {\n return $user->isPeopleManager();\n }",
"public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }",
"static function canAdd(IUser $user, $context = null) {\n return $user instanceof User && $user->isAdmini... | [
"0.70821613",
"0.704561",
"0.6672832",
"0.6655912",
"0.6635948",
"0.6586314",
"0.657896",
"0.6531571",
"0.6461797",
"0.63717586",
"0.633014",
"0.6312042",
"0.6239829",
"0.6237385",
"0.6187394",
"0.6161564",
"0.6125677",
"0.61196476",
"0.6110488",
"0.60980946",
"0.6093692",
... | 0.6936872 | 2 |
Belongsto relations with Login. | public function lastLogin()
{
return $this->belongsTo(Login::class, 'last_login_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function user()\n {\n return $this->belongsTo(Login::class);\n }",
"public function user()\n {\n return $this->belongsTo('App\\User', 'User_id', 'login');\n }",
"public function user(): BelongsTo;",
"public function user(){\n\n //class midwife belongs to class user\n \n... | [
"0.69116247",
"0.6444018",
"0.6379764",
"0.6277993",
"0.62036026",
"0.6177529",
"0.6175737",
"0.617133",
"0.60704774",
"0.6066184",
"0.60560846",
"0.6048374",
"0.596342",
"0.59607387",
"0.59390515",
"0.59387124",
"0.59165674",
"0.59137344",
"0.5902882",
"0.588653",
"0.5885671... | 0.57055295 | 79 |
HasOne relations with Company. | public function company()
{
return $this->hasOne(Company::class, 'user_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function company()\n {\n return $this->hasOne('Company', 'id', 'id_company');\n }",
"public function company(){\n return $this->hasOne(Company::class,\"id\",\"company_id\");\n }",
"public function company()\n {\n return $this->hasOne('App\\Company', 'ID', 'CompanyID')->w... | [
"0.82446015",
"0.8226465",
"0.77412397",
"0.7544776",
"0.7363962",
"0.73254365",
"0.7307821",
"0.7307821",
"0.7307821",
"0.7307821",
"0.7307821",
"0.7307821",
"0.72803974",
"0.72589546",
"0.72589546",
"0.72477114",
"0.72477114",
"0.72477114",
"0.72477114",
"0.72477114",
"0.72... | 0.7528057 | 4 |
HasMany relations with Supplier. | public function suppliers()
{
return $this->hasMany(Supplier::class, 'user_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ingredientSuppliers(){\n return $this->hasMany(SupplierStock::class);\n }",
"public function suppliers()\n {\n return $this->hasMany(Supplier::class, 'company_id');\n }",
"public function supplierCategories()\n {\n return $this->hasMany(SupplierCategory::class);... | [
"0.7359611",
"0.7352941",
"0.7278318",
"0.6679716",
"0.6664582",
"0.6633591",
"0.6619525",
"0.6559151",
"0.6543436",
"0.6474368",
"0.64389324",
"0.6331953",
"0.63283694",
"0.63153934",
"0.62894416",
"0.6273715",
"0.6272637",
"0.621121",
"0.6205322",
"0.6191232",
"0.6136154",
... | 0.7179051 | 3 |
Belongsto relations with Role. | public function role()
{
return $this->belongsTo(Role::class, 'role_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function roles(){\n return $this->belongsToMany('App\\Role');\n }",
"public function user(): BelongsTo;",
"public function role(){\n return $this->belongsTo('App\\Role');\n }",
"public function roles() {\n return $this->belongsToMany('Models\\Role');\n }",
"public function ro... | [
"0.6871722",
"0.68545955",
"0.68347853",
"0.68115896",
"0.6788262",
"0.6772199",
"0.67279565",
"0.6720843",
"0.67184514",
"0.6687727",
"0.6687497",
"0.6687497",
"0.6674111",
"0.66615576",
"0.6648316",
"0.6640452",
"0.6640452",
"0.6640452",
"0.6640452",
"0.6640452",
"0.6640452... | 0.63597524 | 66 |
vendor/bin/phpunit filter testloginSuccess tests/Feature/LoginTest.php | public function testloginSuccess(){
$param = ['username' => 'vinhpd5', 'password' => 'Vinh12345'];
$response = $this->json("post",'/api/v1/login',$param)
->assertStatus(200);
$response->dump();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testLogin(): void { }",
"public function testProfileUnilogin()\n {\n\n }",
"public function testRuns()\n {\n $this->assertTrue(true);\n }",
"function test_sample() {\n\t\t$this->assertTrue( true );\n\t}",
"public function testLoginWrongPassword(): void { }",
"public fun... | [
"0.6651927",
"0.6591212",
"0.65688473",
"0.6525722",
"0.6520796",
"0.65022594",
"0.64440554",
"0.64282894",
"0.64226294",
"0.64029247",
"0.6368482",
"0.63472927",
"0.63465667",
"0.62917674",
"0.6288201",
"0.62816435",
"0.62756354",
"0.6270722",
"0.6257606",
"0.6234697",
"0.62... | 0.6163566 | 36 |
Lista pedidos para a tabela | public function tableList()
{
$list = (self::MODEL)::orderBy('clientes.created_at', 'DESC');
$list = $this->handleRequest($list);
return $this->listResponse(ClientTransformer::tableList($list));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tableList()\n {\n $list = (self::MODEL)::with(['cliente', 'endereco'])\n ->join('clientes', 'clientes.id', '=', 'pedidos.cliente_id')\n ->leftJoin('pedido_notas', 'pedido_notas.pedido_id', '=', 'pedidos.id')\n ->orderBy('pedidos.created_at', 'DESC');\n\n ... | [
"0.6800633",
"0.6675996",
"0.66327876",
"0.65428084",
"0.65190554",
"0.650985",
"0.6507186",
"0.65030855",
"0.6488347",
"0.64208376",
"0.64027786",
"0.63812923",
"0.63733274",
"0.63321155",
"0.6325322",
"0.6301346",
"0.62995714",
"0.62982136",
"0.6295512",
"0.62880707",
"0.62... | 0.6079181 | 42 |
Altera o email do cliente | public function changeEmail($cliente_id)
{
try {
$email = \Request::get('email');
$data = (self::MODEL)::find($cliente_id);
$data->email = $email;
$data->save();
return $this->showResponse($data);
} catch (\Exception $exception) {
return $this->clientErrorResponse([
'exception' => '[' . $exception->getLine() . '] ' . $exception->getMessage()
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function changeEmail()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['new_email']) || $request['new_email']==\"\")... | [
"0.70404285",
"0.69316673",
"0.6927139",
"0.69175583",
"0.6824979",
"0.6813773",
"0.6729215",
"0.66532266",
"0.66166764",
"0.6589006",
"0.6583843",
"0.6566653",
"0.6562603",
"0.65510255",
"0.65164363",
"0.6454262",
"0.64516854",
"0.64249766",
"0.6392025",
"0.63789344",
"0.636... | 0.71975356 | 0 |
Search clients by taxvat and name based on term | public function search($term)
{
try {
$list = (self::MODEL)
::with('enderecos')
->where('nome', 'LIKE', "%{$term}%")
->orWhere('taxvat', 'LIKE', "%{$term}%")
->get();
return $this->listResponse(ClientTransformer::directSearch($list));
} catch (\Exception $exception) {
return $this->listResponse([]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClientByNameOrSurnameOrDni() {\n $term = Request::input('term', '');\n $results = array();\n $queries = User::where('role_id', 6)\n ->where(function($query) use ($term){\n $query->where('name', 'LIKE', '%'.$term.'%');\n ... | [
"0.5964222",
"0.58904326",
"0.58880407",
"0.5870145",
"0.5857385",
"0.58512956",
"0.58434504",
"0.58061737",
"0.57879436",
"0.57647765",
"0.5729846",
"0.57204103",
"0.5701965",
"0.56787694",
"0.56764734",
"0.5640589",
"0.5637458",
"0.56226903",
"0.5610206",
"0.5608447",
"0.55... | 0.62356377 | 0 |
constructor that initializes shelves | function __construct()
{
$this->shelf = new SplFixedArray(10);
include("../Database/db_connect.php");
$shelf_id_results = mysqli_query($dbhandle, "SELECT DISTINCT(Shelfid) FROM shelves WHERE Groupnumber = '31' ORDER BY Shelfid") or die(mysql_error());
// $i = 0;
// while($row = mysqli_fetch_array($shelf_id_results) && $i < 10)
// {
// $this->shelf[$i] = new shelf($row['Shelfid']);
// $i++;
// }
for($i = 0; $i < 10; $i++)
{
$this->shelf[$i] = new shelf($i);
}
//set copyID to value of highest found copyID
$result = mysqli_query($dbhandle, "SELECT * FROM bookscopy WHERE Groupnumber = '31'") or die(mysql_error());
$highest_copyID = 0;
while($row = mysqli_fetch_array($result))
{
if($row['Copyid'] > $highest_copyID)
{
$highest_copyID = $row['Copyid'];
}
}
$this->copyid = $highest_copyID;
include("../Database/db_close.php");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->shelfs[0] = new Shelf;\n $this->shelfs[1] = new Shelf;\n $this->shelfs[2] = new Shelf;\n }",
"function __construct()\n\t{\n parent::__construct();\n\t\t$this->set_table_name(\"shelf\");\n\n\t}",
"public function __construct()\n {\n... | [
"0.7105411",
"0.6188716",
"0.5965632",
"0.5897682",
"0.58831143",
"0.5865134",
"0.5843209",
"0.58344215",
"0.57937664",
"0.5765493",
"0.57462496",
"0.57411635",
"0.5698522",
"0.5690351",
"0.5674755",
"0.5655588",
"0.5643194",
"0.5641339",
"0.5641339",
"0.5639945",
"0.5603471"... | 0.6195977 | 1 |
check database for bookID | public function addBook($bookID, $bookTitle, $author)
{
include("../Database/db_connect.php");
$result = mysqli_query($dbhandle, "SELECT * FROM books WHERE Groupnumber = '31' AND Bookid = '$bookID'") or die (mysql_error());
//if this book doesn't exist, add it to database
if(mysqli_num_rows($result) == 0)
{
mysqli_query($dbhandle, "INSERT INTO books (Groupnumber, Bookid, Booktitle, Author)
VALUES ('31', '$bookID', '$bookTitle', '$author')");
}
//add this book to first not full shelf with incremented copyID
for($i = 0; $i < 10; $i++)
{
if($this->shelf[$i]->hasSpace())
{
$this->shelf[$i]->addBook($bookID, ++$this->copyid, $bookTitle, $author);
break;
}
if($i == 10)
{
$_SESSION["error"] = "Cannot add book, library full";
}
}
include("../Database/db_close.php");
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkBooklistID($booklist_id) {\n $query = 'select * from `'. $this->_table1 . '` where booklist_id = ' . $booklist_id . ';';\n\n if ($this->query($query)) return true;\n else return false;\n }",
"function isBookExists($book, $connection) {\n $q = mysqli_query($connection, 'SE... | [
"0.704528",
"0.6779156",
"0.66037446",
"0.655546",
"0.63998103",
"0.63399404",
"0.6162267",
"0.6012148",
"0.600279",
"0.600212",
"0.59805155",
"0.5972165",
"0.5923847",
"0.59002465",
"0.58707213",
"0.5834729",
"0.57784534",
"0.5762515",
"0.57581306",
"0.57447696",
"0.57383",
... | 0.5455936 | 50 |
check database for bookID | public function deleteBook($bookID)
{
include("../Database/db_connect.php");
$result = mysqli_query($dbhandle, "SELECT * FROM books WHERE Groupnumber = '31' AND Bookid='$bookID'") or die (mysql_error());
//if this book doesn't exist, error out
if(mysqli_num_rows($result) == 0)
{
$_SESSION["error"] = "cannot delete book, book doesn't exist";
}
//if it exists get a list of copyID's
else
{
$result2 = mysqli_query($dbhandle, "SELECT * from bookscopy WHERE Groupnumber = '31' AND Bookid = '$bookID'") or die (mysql_error());
$copyIDList = array();
while($row = mysqli_fetch_array($result2))
{
$result3 = mysqli_query($dbhandle, "SELECT * FROM shelves WHERE Groupnumber = '31' AND Copyid = '$row[Copyid]'") or die (mysql_error());
$shelf_data = mysqli_fetch_array($result3);
$copyIDList[$shelf_data['Copyid']] = $shelf_data['Shelfid'];
}
//remove book from database
//remove copy id's from shelf
foreach($copyIDList as $copyIDKey => $shelfIDValue)
{
for($i = 0; $i < 10; $i++)
{
if($this->shelf[$i]->index == $shelfIDValue)
{
$this->shelf[$i]->deleteBook($copyIDKey);
mysqli_query($dbhandle, "DELETE FROM loanHistory WHERE Groupnumber = '31' AND Copyid = '$copyIDKey'");
}
}
}
mysqli_query($dbhandle, "DELETE FROM bookscopy WHERE Groupnumber = '31' AND Bookid = '$bookID'") or die (mysql_error());
mysqli_query($dbhandle, "DELETE FROM books WHERE Groupnumber = '31' AND Bookid = '$bookID'") or die (mysql_error());
}
include("../Database/db_close.php");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkBooklistID($booklist_id) {\n $query = 'select * from `'. $this->_table1 . '` where booklist_id = ' . $booklist_id . ';';\n\n if ($this->query($query)) return true;\n else return false;\n }",
"function isBookExists($book, $connection) {\n $q = mysqli_query($connection, 'SE... | [
"0.70448494",
"0.67799956",
"0.6606398",
"0.655717",
"0.64013803",
"0.6340386",
"0.61626315",
"0.60127604",
"0.6005234",
"0.60011965",
"0.5981333",
"0.59744704",
"0.5925375",
"0.5903045",
"0.58713275",
"0.58331156",
"0.5772607",
"0.5764631",
"0.57604665",
"0.5741016",
"0.5740... | 0.55758774 | 41 |
finnBrukere VISNING AV BRUKERE | function visFinnStudenter() {
$visning = $_GET['visning']; //sjekker hva som er satt til visning
if ($visning == "visAlle") { //vis alle registrerte
$svar = 'Dette er en liste over alle registrerte brukere på Hibu Alumni:
<!--Luft-->
<br /><br />
<!--Viser alle registrerte-->
'; //linjeskift for bedre oversikt i kildekoden
$tilkobling = kobleTil(); //opprett tilkobling til db
//henter ut alle registrerte sortert på etternavn
$sql = "SELECT * FROM tblstudent, tblBrukertype,tblCampus, tblFagomrade ";
$sql .= "WHERE sbId = bId AND scId = cId ";
$sql .= "AND sfId = fId ORDER BY sEtternavn ASC;";
$resultat = mysql_query($sql, $tilkobling);
$antall = mysql_num_rows($resultat);
$svar .= finnBrukere($antall, $resultat);
mysql_close($tilkobling); //lukker tilkobling til db
} else if ($visning == "sokNavn") { //søk på navn
$svar = visSkjemaNavn();
if (isset($_POST['FINNNAVN']) && $_POST['FINNNAVN'] == "Søk på navn") { //søker på navn
$svar = "<br />" . finnVedNavn();
} //if (isset($_POST['FINNNAVN']))
} else { //søk på e-post
$svar = visSkjemaEpost();
if (isset($_POST['FINNMAIL']) && $_POST['FINNMAIL'] == "Søk på e-post") { //søker på e-post
$svar = "<br />" . finnVedMail();
} //if (isset($_POST['FINNMAIL']))
} //if($visning == "visAlle")
return $svar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function bernafas()\n \t{\n \t\techo 'Bernafas menggunakan hidung, '.PHP_EOL;\n \t}",
"function personnaliser_bandeau_bas_fin($flux){\n\tif (defined('_PERSO_BANDEAU_BAS_FIN'))\n\t\treturn afficher_noisettes(_PERSO_BANDEAU_BAS_FIN, $flux, false);\n}",
"function personnaliser_bandeau_haut_fin($fl... | [
"0.67214084",
"0.64541084",
"0.6371226",
"0.62604755",
"0.62402827",
"0.6175199",
"0.6042527",
"0.5958838",
"0.59103376",
"0.5881947",
"0.5876115",
"0.58665204",
"0.5863414",
"0.58529574",
"0.58024865",
"0.57831776",
"0.5774092",
"0.5749593",
"0.5729317",
"0.5716869",
"0.5716... | 0.5315017 | 77 |
Run the database seeds. | public function run()
{
\App\Product::create([
'name' => "Ireland's Eye Tour - Adult",
'img' => 'images/defalut1',
'price' => 15,
'description' => 'Irelands Eye Adult Fare'
]);
\App\Product::create([
'name' => "Ireland's Eye Tour - Child",
'img' => 'images/defalut1',
'price' => 10,
'description' => 'Irelands Eye Child Fare'
]);
\App\Product::create([
'name' => "Ireland's Eye Tour - Family(1)",
'img' => 'images/defalut1',
'price' => 40,
'description' => 'Irelands Eye Family (2 Adults, 2 Children)'
]);
\App\Product::create([
'name' => "Ireland's Eye Tour - Family(2)",
'img' => 'images/defalut1',
'price' => 50,
'description' => 'Irelands Eye Family (2 Adults, 3 Children)'
]);
\App\Product::create([
'name' => 'Howth Cliffs Cruise',
'img' => 'images/defalut2',
'price' => 25,
'description' => 'Single Fare Cliffs Cruise'
]);
\App\Product::create([
'name' => 'Fishing Trip Half Day',
'img' => 'images/defalut3',
'price' => 300,
'description' => 'Fishing Tip - Half Day'
]);
\App\Product::create([
'name' => 'Fishing Trip Full Day',
'img' => 'images/defalut3',
'price' => 500,
'description' => 'Fishing Tip - Full Day'
]);
// factory(App\Product::class, 10)->create();
} | {
"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 |
Create a new component instance. | public function __construct(Banner $banner)
{
$this->banner = $banner;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createComponent($name) {\n\t\trequire_once(\"component/\".$name.\"/\".$name.\".inc\");\n\t\t$c = new $name($name);\n\t\t$this->components[$name] = &$c;\n\t\t$this->{$name} = &$c;\n\t}",
"function componentBuilder() { $this->__construct(); }",
"public function make()\n {\n if (self::$... | [
"0.7047387",
"0.6538835",
"0.6472938",
"0.64619654",
"0.644458",
"0.63163316",
"0.62928647",
"0.62711805",
"0.61932147",
"0.6130113",
"0.60918456",
"0.6054137",
"0.6054137",
"0.6054137",
"0.60504675",
"0.60455096",
"0.6040762",
"0.60270166",
"0.5991097",
"0.59777457",
"0.5976... | 0.0 | -1 |
Get the view / contents that represent the component. | public function render()
{
$banners = $this->banner->query()->where('banner_type_id', 1)->get();
return view('components.slideshow', [
'banners' => $banners
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getViewComponent();",
"public function getView() {\n\t\treturn $this -> st_view;\n\t}",
"public function getView() {\n\t\treturn $this->view;\n\t}",
"public function getView() {\n\t\treturn $this->view;\n\t}",
"public function getView()\r\n {\r\n return $this->_controller->getView... | [
"0.7673564",
"0.7260388",
"0.7230339",
"0.7230339",
"0.72272044",
"0.7194038",
"0.7191513",
"0.718442",
"0.71783614",
"0.71783614",
"0.71783614",
"0.71783614",
"0.71783614",
"0.71783614",
"0.71783614",
"0.71783614",
"0.7155549",
"0.71496713",
"0.71488863",
"0.7143502",
"0.713... | 0.0 | -1 |
Writing data to inaccessible properties is not allowed. | public function __set($name, $value)
{
throw new \Foundation\Exception\BadMethodCallException('Writing data to inaccessible properties is not allowed.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allowProperties() {}",
"public function __set($name, $value)\n {\n throw new \\BadMethodCallException( 'Writing data to inaccessible properties is not allowed.' );\n }",
"public function __set($name, $value)\n {\n throw new \\BadMethodCallException( 'Writing data to inacc... | [
"0.72508687",
"0.69337857",
"0.69337857",
"0.67343277",
"0.6566614",
"0.6495448",
"0.636735",
"0.6366949",
"0.633614",
"0.633614",
"0.633614",
"0.62791896",
"0.6121855",
"0.6091132",
"0.6064741",
"0.6030389",
"0.59832495",
"0.5933866",
"0.5933866",
"0.5932761",
"0.59182084",
... | 0.68128353 | 4 |
Reading data from inaccessible properties is not allowed. | public function __get($name)
{
throw new \Foundation\Exception\BadMethodCallException('Reading data from inaccessible properties is not allowed.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allowProperties() {}",
"public function shouldSkipUnknownProperties() {}",
"abstract protected function getProperties();",
"function shouldSkipUnknownProperties() ;",
"abstract protected function get_properties();",
"protected function _getReadonlyProperties()\n {\n return array(... | [
"0.70132905",
"0.6672684",
"0.6667319",
"0.66350776",
"0.6629763",
"0.65768623",
"0.65514445",
"0.64856416",
"0.63355434",
"0.6268636",
"0.6250038",
"0.6249849",
"0.61742264",
"0.61074954",
"0.5956313",
"0.5937971",
"0.5937971",
"0.5937971",
"0.59364015",
"0.59116644",
"0.588... | 0.7304745 | 1 |
Get max test value. | public function getMax()
{
return $this->_fMax;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_max_value() {\n return self::MAX_VALUE;\n }",
"public function getMaximum() {\r\n return $this->maximumvalue;\r\n }",
"public function getMax()\n {\n return $this->_maxValue;\n }",
"public function getMax() {\n return $this->max;\n }",
"... | [
"0.7771248",
"0.76428515",
"0.75863665",
"0.7565985",
"0.75242317",
"0.75242317",
"0.7517526",
"0.74832684",
"0.7371807",
"0.7368707",
"0.72871304",
"0.7230127",
"0.716215",
"0.714987",
"0.7086326",
"0.7067433",
"0.70319915",
"0.70197314",
"0.7018528",
"0.6955017",
"0.6879785... | 0.7246587 | 11 |
Get min test value. | public function getMin()
{
return $this->_fMin;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_min_value() {\n return self::MIN_VALUE;\n }",
"public function getMin()\n {\n return $this->_minValue;\n }",
"function getMin() { return $this->readMinValue(); }",
"public function getMinimum() {\r\n return $this->minimumvalue;\r\n }",... | [
"0.78881514",
"0.7673716",
"0.76587135",
"0.7611042",
"0.7573013",
"0.7487576",
"0.74131024",
"0.73673594",
"0.73673594",
"0.73371464",
"0.73365784",
"0.7320705",
"0.7308258",
"0.7258835",
"0.7249831",
"0.7211859",
"0.7182904",
"0.7171559",
"0.71557456",
"0.70183116",
"0.6937... | 0.7437993 | 6 |
add measure test values. | public function add($fTimeStart, $fTimeStop)
{
if (! is_float($fTimeStart) || ! is_float($fTimeStop) || ($fTimeStart <= 0) || ($fTimeStop <= 0)) {
throw new \Foundation\Exception\InvalidArgumentException('Bad time values.');
}
// Difference of $fTimeStop and $fTimeStart
$fDiff = $fTimeStop - $fTimeStart;
// Save the difference
$this->_aTests[$this->_iIndex++] = $fDiff;
// Add
$this->_fSum += $fDiff;
if (is_null($this->_fMin)) {
// First values
$this->_fMin = $this->_fMax = $fDiff;
} else {
// Save the maximum
if ($fDiff > $this->_fMax) {
$this->_fMax = $fDiff;
}
// Save the minimum
if ($fDiff < $this->_fMin) {
$this->_fMin = $fDiff;
}
}//if( is_float(...
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSum() {\n $variable1 = new qti_variable('single', 'integer', array('value' => 5));\r\n $this->assertEquals(15, qti_variable::sum($variable1, $variable1, $variable1)->value);\n }",
"static function measureResults(){\n\t\tforeach(self::$measures as $name=>$measure){\n\t\t\t$tot... | [
"0.57549894",
"0.55907315",
"0.5539389",
"0.55329645",
"0.5356713",
"0.5352505",
"0.5290971",
"0.5281737",
"0.52726936",
"0.5245316",
"0.52375513",
"0.52367014",
"0.5235069",
"0.52315944",
"0.5224261",
"0.52114034",
"0.5206639",
"0.5171178",
"0.5166256",
"0.51408285",
"0.5128... | 0.0 | -1 |
Wandle das Objekt in ein Array um. | public function toArray(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function limpaArrayIdsObjetosManipulados()\n {\n \t// limpando o array de ids de objetos manipulados\n \t$this->_arrayObjetosManipulados = array();\n }",
"private function get_object_array($array){\n \n }",
"private function createArrayable()\n {\n $this->data = $this->da... | [
"0.6667859",
"0.6601735",
"0.63734484",
"0.6352802",
"0.63129896",
"0.6243303",
"0.6238651",
"0.61987364",
"0.6157543",
"0.61566037",
"0.6155527",
"0.6148893",
"0.6130941",
"0.6129876",
"0.61292124",
"0.61292124",
"0.610069",
"0.610069",
"0.608758",
"0.608758",
"0.60874826",
... | 0.59858924 | 66 |
Alias, damit Twig auf pId zugreifen kann. | public function getPId(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIdHtml($id = null)\n {\n if ($id == null) {\n $id = $this->id;\n }\n\n if (preg_match('/^plg[0-9]+$/', $id)) {\n return '';\n }\n\n return \" id=\\\"$id\\\"\";\n }",
"function ID($id)\n {\n if (false !== $ctrl = \\ClickBlocks\\MVC\\Pa... | [
"0.58233166",
"0.5753074",
"0.56468546",
"0.5468302",
"0.5424321",
"0.54222184",
"0.5420809",
"0.5415787",
"0.54107136",
"0.53836846",
"0.53829163",
"0.53718877",
"0.53683823",
"0.5358299",
"0.53443015",
"0.532863",
"0.5288122",
"0.52872103",
"0.528619",
"0.5279452",
"0.52771... | 0.0 | -1 |
=============Opens the connection to the data base | function sql(){
$this->conn = mysql_connect($this->hostname, $this->username , $this->password);
mysql_select_db($this->dbName, $this->conn);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function open_db() {\n\n\t\t//var_dump($this->connection); exit;\n\n\t\t\n\n\t}",
"protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"protected function openConn() {\n $database = new Database();\n $this->... | [
"0.82821095",
"0.81911016",
"0.818798",
"0.8017345",
"0.7972819",
"0.7926587",
"0.78627294",
"0.7813157",
"0.77977175",
"0.7788649",
"0.77702636",
"0.7744126",
"0.77286124",
"0.772785",
"0.770578",
"0.76958483",
"0.76919866",
"0.76553005",
"0.76535815",
"0.7603186",
"0.757278... | 0.0 | -1 |
=============Sumbits a query formats the result if there is one | function query($quer){
unset($this->result);
unset($this->resultie);
$this->result = mysql_query($quer, $this->conn);
if(mysql_error()){
return false;
}
if($this->result){
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function queryFormatter(){\n return $this->querySqlFormatter->getSqlPrepareFormatter($this->SqlPrepareFormatterHandleObject());\n }",
"protected function formatResult()\n\t{\n\t\t$this->arResult =& $this->dbResult;\n\t\t$this->arResult['ERRORS'] =& $this->errors;\n\n\t\t$this->arResult['FORM_ID... | [
"0.62978035",
"0.5942261",
"0.58997035",
"0.5876688",
"0.58302045",
"0.5766125",
"0.57557344",
"0.5747838",
"0.57430667",
"0.57045746",
"0.5689845",
"0.5672577",
"0.5635167",
"0.56319404",
"0.5616203",
"0.5608865",
"0.5605476",
"0.5592597",
"0.5588501",
"0.55671",
"0.55644464... | 0.0 | -1 |
Run the database seeds. | public function run()
{
$faker = Faker\Factory::create();
foreach (range(1, 20) as $index) {
$user = new \App\User;
$user->email = $faker->email;
$user->name = $faker->name;
$user->password = bcrypt('secret');
$user->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 |
Run the database seeds. | public function run(Faker $faker)
{
for ($i=0; $i < 20 ; $i++) {
$title = $faker->sentence(2);
$newSection = new Section;
$newSection->title = $title;
$newSection->page_id = rand(1,10);
$newSection->slug = Str::slug($title);
$newSection->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.80130625",
"0.79795986",
"0.79764974",
"0.79524934",
"0.7950615",
"0.79505694",
"0.7944086",
"0.7941758",
"0.7938509",
"0.79364634",
"0.79335415",
"0.7891555",
"0.78802574",
"0.78790486",
"0.7878107",
"0.7875447",
"0.78703815",
"0.7869534",
"0.7851931",
"0.7850407",
"0.784... | 0.0 | -1 |
Make a grid builder. | protected function grid()
{
$grid = new Grid(new Engine());
$grid->column('id', __('#'));
$grid->column('power_station_id', __('Power station'))
->display(function ($userId) {
$u = PowerStation::find($userId);
if (!$u)
return "-";
return $u->name;
})
->sortable();
$grid->column('name', __('Tank Name'));
return $grid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId)... | [
"0.72539544",
"0.72184885",
"0.70634",
"0.7004036",
"0.6996125",
"0.6985094",
"0.69537497",
"0.69282764",
"0.6927315",
"0.69252354",
"0.69226766",
"0.6922334",
"0.690793",
"0.68896127",
"0.6888781",
"0.6878292",
"0.6845856",
"0.6825797",
"0.68184733",
"0.6811281",
"0.68021184... | 0.69233316 | 10 |
Make a show builder. | protected function detail($id)
{
$show = new Show(Engine::findOrFail($id));
$show->field('power_station_id', __('Power station id'))
->as(function ($userId) {
$u = PowerStation::find($userId);
if (!$u)
return "-";
return $u->name;
});
$show->field('name', __('Name'));
$show->field('details', __('Details'));
$show->field('photo', __('Photo'))->image();
$show->field('id', __('Id'));
$show->field('created_at', __('Created'))
->as(function ($item) {
return Carbon::parse($item)->diffForHumans();
});
return $show;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function buildShowLayout(): void;",
"public function buildShowLayout()\n {\n $this->addSection('Section', function(ShowLayoutSection $section) {\n $section->addColumn(6, function(ShowLayoutColumn $column) {\n $column->withSingleField('id');\n $column->w... | [
"0.6526378",
"0.65068364",
"0.6488276",
"0.64457935",
"0.6348684",
"0.6289494",
"0.62589526",
"0.62589526",
"0.62589526",
"0.62589526",
"0.62530345",
"0.62369376",
"0.62369376",
"0.62369376",
"0.62308425",
"0.62241685",
"0.6219827",
"0.6176313",
"0.6117705",
"0.6117705",
"0.6... | 0.0 | -1 |
Make a form builder. | protected function form()
{
$form = new Form(new Engine());
$form->text('name', __('Name'))
->required();
$form->select('power_station_id', __('Power station'))
->options(PowerStation::all()->pluck('name', 'id'))
->required();
$form->image('photo', __('Photo'));
$form->textarea('details', __('Details'));
return $form;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n ... | [
"0.7876884",
"0.7563207",
"0.7518167",
"0.7356229",
"0.7287756",
"0.7230112",
"0.71921307",
"0.7176219",
"0.71556574",
"0.71318495",
"0.7072142",
"0.70605636",
"0.70538306",
"0.70511967",
"0.70281005",
"0.70109546",
"0.700963",
"0.7000893",
"0.699135",
"0.6986861",
"0.6979974... | 0.68068945 | 55 |
Returns the static model of the specified AR class. | public static function model($className=__CLASS__)
{
return parent::model($className);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function model()\r\n {\r\n return static::class;\r\n }",
"public static function model() {\n return parent::model(get_called_class());\n }",
"public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }",
"public static function model($cl... | [
"0.74836576",
"0.7380479",
"0.7153653",
"0.7139917",
"0.7061897",
"0.7031516",
"0.6927712",
"0.6927712",
"0.6924855",
"0.6902187",
"0.6894202",
"0.6894202",
"0.6889197",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
"0.6869",
... | 0.0 | -1 |
Retrieves a list of models based on the current search/filter conditions. | public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('article_id',$this->article_id);
$criteria->compare('channel_id',$this->channel_id);
$criteria->compare('class_id',$this->class_id);
$criteria->compare('title',$this->title,true);
$criteria->compare('sub_title',$this->sub_title,true);
$criteria->compare('summary',$this->summary,true);
$criteria->compare('content',$this->content,true);
$criteria->compare('keyword',$this->keyword,true);
$criteria->compare('hits',$this->hits);
$criteria->compare('seacher_text',$this->seacher_text,true);
$criteria->compare('add_date',$this->add_date,true);
$criteria->compare('add_userid',$this->add_userid);
$criteria->compare('update_date',$this->update_date,true);
$criteria->compare('update_userid',$this->update_userid);
$criteria->compare('is_recommend',$this->is_recommend);
$criteria->with = array('cmsChannel','cmsClass');
return new CActiveDataProvider($this, array(
'sort'=>array(
'defaultOrder'=>'article_id DESC',
),
'criteria'=>$criteria,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModels();",
"public function getModels();",
"public function findAll($model);",
"public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w... | [
"0.67437106",
"0.67437106",
"0.6606826",
"0.64798707",
"0.63799495",
"0.63465333",
"0.63098687",
"0.6301961",
"0.62535083",
"0.62510264",
"0.62510264",
"0.61105317",
"0.607652",
"0.60729367",
"0.60462666",
"0.6035773",
"0.6031625",
"0.601425",
"0.5982388",
"0.5979458",
"0.597... | 0.0 | -1 |
Attributes Associations Operations XXX | abstract public function otherfoo(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getModelAttributes();",
"abstract protected function attributes();",
"public function attributes();",
"function GetAttributes();",
"public function copyAttributesToKey()\n\t{\n\t\t$primarykey = $this->factory->getPrimarykey ;\n\t\tforeach( $primarykey->fields as $n=>$field )\n\t... | [
"0.6695176",
"0.6565526",
"0.64103806",
"0.6217968",
"0.61547035",
"0.6154543",
"0.61341363",
"0.6127167",
"0.6127167",
"0.6127167",
"0.6127167",
"0.6127167",
"0.6127167",
"0.6127167",
"0.6127167",
"0.6127167",
"0.60417813",
"0.59917015",
"0.59913695",
"0.5981657",
"0.5981657... | 0.0 | -1 |
Sync the changes that were pending for the recurring downtime configuration after apply config is complete Runs after apply/reconfigure subsys command has been completed | function recurringdowntime_apply_pending_changes($cbtype, &$cbargs)
{
// Verify this is an apply config and it finished successfully
if ($cbargs['command'] != COMMAND_NAGIOSCORE_APPLYCONFIG || $cbargs['return_code'] != 0) {
return;
}
// Verify there are pending changes
$pending = recurringdowntime_get_pending_changes();
if (empty($pending)) {
return;
}
// Apply the actual changes to the cfg
$cfg = recurringdowntime_get_cfg();
foreach ($pending as $p) {
if (array_key_exists('host_name', $p)) {
$cfg[$p['cfg_id']]['host_name'] = $p['host_name'];
} else if (array_key_exists('service_description', $p)) {
$cfg[$p['cfg_id']]['service_description'] = $p['service_description'];
} else if (array_key_exists('hostgroup_name', $p)) {
$cfg[$p['cfg_id']]['hostgroup_name'] = $p['hostgroup_name'];
} else if (array_key_exists('servicegroup_name', $p)) {
$cfg[$p['cfg_id']]['servicegroup_name'] = $p['servicegroup_name'];
}
}
recurringdowntime_write_cfg($cfg);
recurringdowntime_update_pending_changes(array());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reload_all_sync() {\n\tglobal $config;\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* set up our timezone */\n\tsystem_timezone_configure();\n\n\t/* set up our hostname */\n\tsystem_hostname_configure();\n\n\t/* make hosts file */\n\tsystem_hosts_generate();\n\n\t/* generate re... | [
"0.69894373",
"0.6581784",
"0.62709355",
"0.6176952",
"0.6142984",
"0.6103777",
"0.6029013",
"0.59590673",
"0.5909277",
"0.57832086",
"0.57815963",
"0.5752379",
"0.572294",
"0.571582",
"0.56891197",
"0.56780326",
"0.5594504",
"0.55939543",
"0.546231",
"0.5432511",
"0.542029",... | 0.73544157 | 0 |
Verify this is a CCM restore and it finished successfully | function recurringdowntime_cancel_pending_changes($cbtype, &$cbargs)
{
if ($cbargs['command'] != COMMAND_RESTORE_NAGIOSQL_SNAPSHOT || $cbargs['return_code'] != 0) {
return;
}
recurringdowntime_update_pending_changes(array());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function test_restore() {\n global $DB;\n\n $startcount = $DB->count_records('course_modules');\n\n // Delete the course module.\n course_delete_module($this->quiz->cmid);\n\n // Try restoring.\n $recyclebin = new \\tool_recyclebin\\course_bin($this->course->id);\n ... | [
"0.6416231",
"0.6049549",
"0.6006898",
"0.5812048",
"0.57552874",
"0.5680208",
"0.5574116",
"0.5537464",
"0.55361307",
"0.54596514",
"0.5448089",
"0.53727376",
"0.53646904",
"0.53248435",
"0.5281273",
"0.5278927",
"0.5262136",
"0.52608436",
"0.5260694",
"0.52380925",
"0.52371... | 0.0 | -1 |
Sync the modified host/service objects Runs after CCM host or service is saved Runs after Bulk Renaming Tool is saved | function recurringdowntime_ccm_hostservice_sync($cbtype, &$cbargs)
{
$cfg = recurringdowntime_get_cfg();
$pending = recurringdowntime_get_pending_changes();
// Check if the object is part of the pending changes
foreach ($pending as $i => $p) {
if ($p['object_id'] == $cbargs['id']) {
$tmp = $p;
if ($cbargs['type'] == 'host') {
$tmp['host_name'] = $cbargs['host_name'];
} else if ($cbargs['type'] == 'service') {
$tmp['service_description'] = $cbargs['service_description'];
}
$pending[$i] = $tmp;
recurringdowntime_update_pending_changes($pending);
return;
}
}
// Check if host name changed
if ($cbargs['type'] == 'host') {
// Check if host name changed
if (!empty($cbargs['old_host_name']) && $cbargs['host_name'] != $cbargs['old_host_name']) {
foreach ($cfg as $id => $c) {
if ($c['schedule_type'] == 'host' || $c['schedule_type'] == 'service') {
// Replace config host_name that used the old host name
if ($c['host_name'] == $cbargs['old_host_name']) {
$pending[] = array(
'cfg_id' => $id,
'object_id' => $cbargs['id'],
'host_name' => $cbargs['host_name']
);
}
}
}
}
// Check for service description change
} else if ($cbargs['type'] == 'service') {
// This one is complicated ... we will only do the hosts defined directly to the service
if (!empty($cbargs['old_service_description']) && $cbargs['service_description'] != $cbargs['old_service_description']) {
foreach ($cfg as $id => $c) {
if (array_key_exists('service_description', $c) && $c['service_description'] == $cbargs['old_service_description']) {
// Get all hosts attached to service
$sql = "SELECT host_name FROM nagiosql.tbl_lnkServiceToHost AS lnk
LEFT JOIN nagiosql.tbl_host AS h ON h.id = lnk.idSlave
WHERE idMaster = ".intval($cbargs['id']).";";
if (!($rs = exec_sql_query(DB_NAGIOSQL, $sql))) {
continue;
}
// Check all hosts against current cfg
$arr = $rs->GetArray();
foreach ($arr as $a) {
if ($c['host_name'] == $a['host_name']) {
$pending[] = array(
'cfg_id' => $id,
'object_id' => $cbargs['id'],
'service_description' => $cbargs['service_description']
);
}
}
}
}
}
}
// Save pending changes
recurringdowntime_update_pending_changes($pending);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function afterSyncing() {}",
"public function run_sync_process(){\n //Verify if module is enabled\n if(Mage::helper('connector')->isEnabled()) {\n\n \t//Set sync type\n \t\t$sync_type = Minematic_Connector_Model_Config::SYNC_TYPE_MAGENTO_SIDE;\n\n //Log Starting sync pr... | [
"0.5997599",
"0.58403236",
"0.5769199",
"0.5768103",
"0.5746364",
"0.55999434",
"0.5587502",
"0.5563259",
"0.5528158",
"0.5499976",
"0.5495799",
"0.54830134",
"0.545524",
"0.54161316",
"0.5412736",
"0.5392773",
"0.5353069",
"0.53394127",
"0.5325165",
"0.52678555",
"0.52451086... | 0.65392864 | 0 |
Sync the modified host/service group objects Runs after CCM hostgroup or servicegroup is saved | function recurringdowntime_ccm_group_sync($cbtype, &$cbargs)
{
$cfg = recurringdowntime_get_cfg();
$pending = recurringdowntime_get_pending_changes();
// Check if the object is part of the pending changes
foreach ($pending as $i => $p) {
if ($p['object_id'] == $cbargs['id']) {
$tmp = $p;
if ($cbargs['type'] == 'hostgroup') {
$tmp['hostgroup_name'] = $cbargs['hostgroup_name'];
} else if ($cbargs['type'] == 'servicegroup') {
$tmp['servicegroup_name'] = $cbargs['servicegroup_name'];
}
$pending[$i] = $tmp;
recurringdowntime_update_pending_changes($pending);
return;
}
}
if ($cbargs['type'] == 'hostgroup') {
if ($cbargs['old_hostgroup_name'] != $cbargs['hostgroup_name']) {
foreach ($cfg as $id => $c) {
if (array_key_exists('hostgroup_name', $c) && $c['hostgroup_name'] == $cbargs['old_hostgroup_name']) {
$pending[] = array(
'cfg_id' => $id,
'object_id' => $cbargs['id'],
'hostgroup_name' => $cbargs['hostgroup_name']
);
}
}
}
} else if ($cbargs['type'] == 'servicegroup') {
if ($cbargs['old_servicegroup_name'] != $cbargs['servicegroup_name']) {
foreach ($cfg as $id => $c) {
if (array_key_exists('servicegroup_name', $c) && $c['servicegroup_name'] == $cbargs['old_servicegroup_name']) {
$pending[] = array(
'cfg_id' => $id,
'object_id' => $cbargs['id'],
'servicegroup_name' => $cbargs['servicegroup_name']
);
}
}
}
}
// Save pending changes
recurringdowntime_update_pending_changes($pending);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function syncSystemGroup()\n\t{\n\t\t$members = Owner::getIds($this->get('id'), Owner::ROLE_COLLABORATOR, 1);\n\t\t$authors = Owner::getIds($this->get('id'), Owner::ROLE_AUTHOR, 1);\n\t\t$managers = Owner::getIds($this->get('id'), Owner::ROLE_MANAGER, 1);\n\n\t\t$all = array_merge($members, $managers, $au... | [
"0.65281314",
"0.6265716",
"0.5901688",
"0.58230424",
"0.58114886",
"0.5726704",
"0.57096225",
"0.551641",
"0.55151224",
"0.54759413",
"0.54642814",
"0.54345965",
"0.54327697",
"0.5428166",
"0.5390167",
"0.5378169",
"0.53712213",
"0.53666484",
"0.53377974",
"0.53340757",
"0.5... | 0.6503954 | 1 |
Get all the currently pending changes | function recurringdowntime_get_pending_changes()
{
$obj = get_option('recurringdowntime_pending_changes', array());
if (!is_array($obj)) {
$obj = json_decode(base64_decode($obj), true);
}
return $obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChanges();",
"public function getChanges();",
"public function getAllPending(): array;",
"public function pending(): array\n {\n $migrationFileCount = (int)iterator_count(\n new FilesystemIterator(\n database_path(\"migrations\"),\n Filesy... | [
"0.721943",
"0.721943",
"0.7215002",
"0.660223",
"0.6552115",
"0.65078187",
"0.6488784",
"0.6419888",
"0.6408856",
"0.63456696",
"0.6257276",
"0.61297596",
"0.6128742",
"0.61237305",
"0.611416",
"0.61054206",
"0.61008227",
"0.6098508",
"0.6029957",
"0.6028592",
"0.60273767",
... | 0.57728755 | 33 |
Save the pending changes for recurringdowntime | function recurringdowntime_update_pending_changes($arr)
{
if (empty($arr)) {
$arr = array();
}
// Save the array into an option
$encoded = base64_encode(json_encode($arr));
set_option('recurringdowntime_pending_changes', $encoded);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _saveStatus()\n {\n try {\n\n /**\n * update task statuses with completion days\n */\n foreach( $this->_status as $key => $val ) {\n\n if ( in_array( $key, $this->_tasks ) ) {\n $task = Mage::getModel('jirafe_analytics/install'... | [
"0.62430805",
"0.61941457",
"0.61738515",
"0.6168474",
"0.614667",
"0.6138163",
"0.6027674",
"0.60228664",
"0.60148114",
"0.599616",
"0.59917647",
"0.59449524",
"0.5884287",
"0.5881827",
"0.5867828",
"0.58606964",
"0.58519536",
"0.585153",
"0.58460206",
"0.5843906",
"0.583567... | 0.61668426 | 4 |
Convert a PHP array containing recurring downtime config to a string appropriate for downtime's schedule.cfg | function recurringdowntime_array_to_cfg($arr)
{
if (count($arr) == 0) {
return "";
}
$cfg_str = "";
foreach ($arr as $sid => $schedule) {
if (count($schedule) == 0) {
continue;
}
$cfg_str .= "define schedule {\n";
$cfg_str .= "\tsid\t\t\t$sid\n";
foreach ($schedule as $var => $val) {
// get a sane tab count for proper viewing/troubleshooting
$tabs = "\t\t";
if ($var == 'servicegroup_name' || $var == 'service_description')
$tabs = "\t";
if ($var == 'user' || $var == 'comment' || $var == 'time' || $var == 'svcalso')
$tabs .= "\t";
$cfg_str .= "\t$var{$tabs}$val\n";
}
$cfg_str .= "}\n\n";
}
return $cfg_str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recurringdowntime_get_cfg()\n{\n recurringdowntime_check_cfg();\n $cfg = file_get_contents(RECURRINGDOWNTIME_CFG);\n return recurringdowntime_cfg_to_array($cfg);\n}",
"function recurringdowntime_write_cfg($cfg)\n{\n if (is_array($cfg)) {\n $cfg_str = recurringdowntime_array_to_cfg($cf... | [
"0.6528919",
"0.6488773",
"0.57189596",
"0.56734097",
"0.56181705",
"0.547865",
"0.53784984",
"0.53151447",
"0.53020585",
"0.5278031",
"0.5262727",
"0.5217304",
"0.52019185",
"0.5122828",
"0.51058817",
"0.5093991",
"0.50462073",
"0.5026799",
"0.5025568",
"0.50076693",
"0.5005... | 0.8173625 | 0 |
Write the configuration to disk | function recurringdowntime_write_cfg($cfg)
{
if (is_array($cfg)) {
$cfg_str = recurringdowntime_array_to_cfg($cfg);
} else {
$cfg_str = $cfg;
}
recurringdowntime_check_cfg();
file_put_contents(RECURRINGDOWNTIME_CFG, $cfg_str);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\t... | [
"0.7919214",
"0.7683364",
"0.7529462",
"0.7458428",
"0.7436946",
"0.7223807",
"0.72200584",
"0.7038828",
"0.6849049",
"0.6818717",
"0.67896545",
"0.66835475",
"0.66254646",
"0.6616327",
"0.65586376",
"0.6401861",
"0.6281222",
"0.62663823",
"0.62024844",
"0.6164189",
"0.613743... | 0.56806964 | 57 |
/ Make sure cfg file exists, and if not, create it. | function recurringdowntime_check_cfg()
{
if (!file_exists(RECURRINGDOWNTIME_CFG)) {
$fh = @fopen(RECURRINGDOWNTIME_CFG, "w+");
fclose($fh);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testCreateConfigFile(){\n\t\tTestsHelper::Print(\"testing magratheaConfig checking if we can create a config file...\");\n\t\t$this->magConfig->Save();\n\t\t$this->assertTrue(file_exists($this->configPath.\"/\".$this->fileName));\n\t}",
"function testCreateConfigFile(){\n\t\t\techo \"testing magratheaCo... | [
"0.68288004",
"0.6795925",
"0.6556549",
"0.64912236",
"0.64732426",
"0.64545083",
"0.6379413",
"0.6316263",
"0.62382543",
"0.62193733",
"0.61433065",
"0.60766554",
"0.60611635",
"0.6059164",
"0.6027296",
"0.60121304",
"0.59842795",
"0.59118146",
"0.5885892",
"0.5874434",
"0.5... | 0.6995747 | 0 |
Get config from cfg file | function recurringdowntime_get_cfg()
{
recurringdowntime_check_cfg();
$cfg = file_get_contents(RECURRINGDOWNTIME_CFG);
return recurringdowntime_cfg_to_array($cfg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }",
"private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }",
"public function get_config()\n\t{\n\t\treturn $this->cfg;\n\t}"... | [
"0.72819453",
"0.72819453",
"0.7159724",
"0.7155",
"0.7139405",
"0.71316093",
"0.7127597",
"0.7127073",
"0.7127073",
"0.7127073",
"0.7127073",
"0.7127073",
"0.7127073",
"0.7127073",
"0.7127073",
"0.7123976",
"0.71106136",
"0.7102897",
"0.70881253",
"0.7046577",
"0.70100635",
... | 0.0 | -1 |
Get downtime schedule for specified host | function recurringdowntime_get_host_cfg($host = false)
{
$cfg = recurringdowntime_get_cfg();
$ret = array();
foreach ($cfg as $sid => $schedule) {
if (array_key_exists('schedule_type', $schedule)) {
if ($schedule["schedule_type"] == "hostgroup") {
continue;
}
if ($schedule["schedule_type"] == "servicegroup") {
continue;
}
if ($schedule["schedule_type"] == "service") {
continue;
}
}
if ($host && !(strtolower($schedule["host_name"]) == strtolower($host))) {
continue;
}
if (array_key_exists('host_name', $schedule)) {
if (is_authorized_for_host(0, $schedule["host_name"])) {
$ret[$sid] = $schedule;
}
}
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recurringdowntime_get_service_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n conti... | [
"0.5987272",
"0.5782062",
"0.5704168",
"0.55294657",
"0.55109507",
"0.5332869",
"0.53317463",
"0.53317463",
"0.5288101",
"0.52256316",
"0.52190703",
"0.5199032",
"0.5156059",
"0.5156059",
"0.5024774",
"0.50046283",
"0.49804658",
"0.49520847",
"0.49520847",
"0.4936416",
"0.492... | 0.6442558 | 0 |
Get downtime schedule for specified host | function recurringdowntime_get_service_cfg($host = false)
{
$cfg = recurringdowntime_get_cfg();
$ret = array();
foreach ($cfg as $sid => $schedule) {
if (array_key_exists('schedule_type', $schedule)) {
if ($schedule["schedule_type"] == "hostgroup") {
continue;
}
if ($schedule["schedule_type"] == "servicegroup") {
continue;
}
if ($schedule["schedule_type"] == "host") {
continue;
}
}
if ($host && !(strtolower($schedule["host_name"]) == strtolower($host))) {
continue;
}
if (array_key_exists('host_name', $schedule)) {
if (array_key_exists('service_description', $schedule)) {
if ($schedule["service_description"] != '*') {
$search_str = $schedule["service_description"];
if (strstr($schedule["service_description"], "*")) {
$search_str = "lk:" . str_replace("*", "%", $schedule["service_description"]);
}
if (!is_authorized_for_service(0, $schedule["host_name"], $search_str)) {
continue;
}
}
}
if (is_authorized_for_host(0, $schedule["host_name"])) {
$ret[$sid] = $schedule;
}
}
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue... | [
"0.6441508",
"0.5780437",
"0.5704298",
"0.55298406",
"0.5511373",
"0.53337395",
"0.5330446",
"0.5330446",
"0.5286463",
"0.52236176",
"0.52180034",
"0.51969993",
"0.51543605",
"0.51543605",
"0.502302",
"0.5002092",
"0.49786305",
"0.4949699",
"0.4949699",
"0.49372575",
"0.49258... | 0.5986708 | 1 |
Get downtime schedule for specified hostgroup | function recurringdowntime_get_hostgroup_cfg($hostgroup = false)
{
$cfg = recurringdowntime_get_cfg();
$ret = array();
foreach ($cfg as $sid => $schedule) {
if (array_key_exists('schedule_type', $schedule)) {
if ($schedule["schedule_type"] != "hostgroup") {
continue;
}
}
if ($hostgroup && !(strtolower($schedule["hostgroup_name"]) == strtolower($hostgroup))) {
continue;
}
if (array_key_exists('hostgroup_name', $schedule)) {
if (is_authorized_for_hostgroup(0, $schedule["hostgroup_name"])) {
$ret[$sid] = $schedule;
}
}
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recurringdowntime_get_host_cfg($host = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] == \"hostgroup\") {\n continue... | [
"0.5926294",
"0.57772595",
"0.5629028",
"0.5561237",
"0.5469031",
"0.5372213",
"0.53004146",
"0.5245684",
"0.5170883",
"0.5101887",
"0.49500608",
"0.4927373",
"0.4859486",
"0.4842459",
"0.4835791",
"0.48098764",
"0.47947094",
"0.47947094",
"0.4790069",
"0.47781736",
"0.475573... | 0.6838731 | 0 |
Get downtime schedule for specified servicegroup | function recurringdowntime_get_servicegroup_cfg($servicegroup = false)
{
$cfg = recurringdowntime_get_cfg();
$ret = array();
foreach ($cfg as $sid => $schedule) {
if (array_key_exists('schedule_type', $schedule)) {
if ($schedule["schedule_type"] != "servicegroup") {
continue;
}
}
if ($servicegroup && !(strtolower($schedule["servicegroup_name"]) == strtolower($servicegroup))) {
continue;
}
if (array_key_exists('servicegroup_name', $schedule)) {
if (is_authorized_for_servicegroup(0, $schedule["servicegroup_name"])) {
$ret[$sid] = $schedule;
}
}
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recurringdowntime_get_hostgroup_cfg($hostgroup = false)\n{\n $cfg = recurringdowntime_get_cfg();\n $ret = array();\n foreach ($cfg as $sid => $schedule) {\n if (array_key_exists('schedule_type', $schedule)) {\n if ($schedule[\"schedule_type\"] != \"hostgroup\") {\n ... | [
"0.58345044",
"0.5736114",
"0.53156585",
"0.5276781",
"0.52673954",
"0.51724213",
"0.516231",
"0.5149847",
"0.51063615",
"0.5032685",
"0.50106406",
"0.4944303",
"0.4937936",
"0.4937936",
"0.49121478",
"0.48890203",
"0.4878822",
"0.48649114",
"0.4848549",
"0.48189926",
"0.4777... | 0.68916076 | 0 |
$date = date("Ymd H:m:s"); | function setLog($proceso,$sucursal,$usuario){
$data = array(
'proceso_id' => $proceso,
'sucursal_id' => $sucursal,
'id_usuario' => $usuario
);
$this->db->insert(self::sys_procesos_log,$data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getsystime() {\n\n return date('Y-m-d H:i:s');\n\n}",
"function getDatetime(){\n return date('Y-m-d H:i:s');\n}",
"function make_date(){\n return strftime(\"%Y-%m-%d %H:%M:%S\", time());\n}",
"function set_datetime($date)\n{\n return date(\"Y-m-d H:i:s\", strtotime($date));\n}",
"function... | [
"0.7524576",
"0.75133795",
"0.7349966",
"0.7185182",
"0.7143101",
"0.71200067",
"0.71122646",
"0.708537",
"0.7019367",
"0.69959235",
"0.69857705",
"0.69281536",
"0.68814355",
"0.6862768",
"0.685329",
"0.6845252",
"0.6810569",
"0.68083584",
"0.6808149",
"0.67769957",
"0.677264... | 0.0 | -1 |
Make a grid builder. | protected function grid()
{
$grid = new Grid(new ProductSku);
$grid->column('id', 'ID');
$grid->column('name', 'sku名称')->editable();
$grid->column('sku_number', 'sku编号')->editable();
// $grid->column('description', 'sku描述');
$grid->product("所属商品")->display(function ($product) {
return $product['name'];
});
$grid->column('price', '原价')->editable();
$grid->column('stock', '库存量')->editable();
$grid->column('is_on_sale', '是否上架')->using([0 => '否', 1 => '是']);
$grid->column('primary_picture', '商品主图');
$grid->column('retail_price', '零售价格')->editable();
$grid->column('is_promotion', '是否促销')->using([0 => '否', 1 => '是']);
$grid->column('promotion_price', '促销价格')->editable();
return $grid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function grid()\n {\n $grid = new Grid(new Formulario());\n\n $grid->disableExport();\n\n $grid->column('name', __('Nombre'));\n $grid->column('description', __('Descripción'));\n $grid->column('go_to_formulario', 'Continuar a formulario')->display(function ($formId)... | [
"0.72541326",
"0.7218252",
"0.7064843",
"0.70040804",
"0.6995721",
"0.69847125",
"0.695367",
"0.6928443",
"0.6927314",
"0.69256824",
"0.6923453",
"0.69233567",
"0.6922796",
"0.6907988",
"0.6889554",
"0.6888196",
"0.6878719",
"0.6845261",
"0.68254143",
"0.6818076",
"0.6810526"... | 0.6491189 | 87 |
Make a show builder. | protected function detail($id)
{
$productSku = ProductSku::findOrFail($id);
$show = new Show($productSku);
$show->field('id', 'ID');
$show->field('name', 'sku名称');
$show->field('sku_number', 'sku编号');
$show->field('description', 'sku描述');
$show->field('product', '所属商品')->as(function ($product) {
return $product->name;
});
$show->field('price', '原价');
$show->field('stock', '库存量');
$show->field('is_on_sale', '是否上架')->using([0 => '否', 1 => '是']);
$show->field('primary_picture', '商品主图');
$show->field('retail_price', '零售价格');
$show->field('is_promotion', '是否促销')->using([0 => '否', 1 => '是']);
$show->field('promotion_price', '促销价格');
return $show;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function buildShowLayout(): void;",
"public function buildShowLayout()\n {\n $this->addSection('Section', function(ShowLayoutSection $section) {\n $section->addColumn(6, function(ShowLayoutColumn $column) {\n $column->withSingleField('id');\n $column->w... | [
"0.6526378",
"0.65068364",
"0.6488276",
"0.64457935",
"0.6348684",
"0.6289494",
"0.62589526",
"0.62589526",
"0.62589526",
"0.62589526",
"0.62530345",
"0.62369376",
"0.62369376",
"0.62369376",
"0.62308425",
"0.62241685",
"0.6219827",
"0.6176313",
"0.6117705",
"0.6117705",
"0.6... | 0.0 | -1 |
Make a form builder. | protected function form()
{
$form = new Form(new ProductSku);
$products = Product::all()->pluck("name", "id")->toArray();
$form->display('id', 'ID');
$form->text('name', 'sku名称');
$form->text('sku_number', 'sku编号');
$form->textarea('description', 'sku描述');
$form->select('product_id', '所属商品')->options($products);
$form->decimal('price', '原价');
$form->number('stock', '库存量')->default(0);
$form->switch('is_on_sale', '是否上架')->default(1);
$form->text('primary_picture', '商品主图')->default('');
$form->decimal('retail_price', '零售价格');
$form->switch('is_promotion', '是否促销')->default(0);
$form->decimal('promotion_price', '促销价格')->default(0.00);
return $form;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n ... | [
"0.7879594",
"0.7565762",
"0.75185436",
"0.73564214",
"0.7287918",
"0.7232044",
"0.7194646",
"0.71785986",
"0.7157999",
"0.7133095",
"0.7074416",
"0.7062337",
"0.7057251",
"0.70530677",
"0.7030334",
"0.7013398",
"0.7013392",
"0.700392",
"0.6994234",
"0.6989912",
"0.69835144",... | 0.0 | -1 |
Get All Data from this method. | public function __construct() {
//load database in autoload libraries
parent::__construct();
$this->load->model('DashboardModal');
if(!$this->session->userdata('id'))
{
redirect('login');
}
$this->load->helper('url', 'form');
$this->load->library('form_validation');
$this->load->library('form_validation');
$this->load->library('upload');
$this->load->model('ImageModel');
$this->load->library('session');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function all () {\n return $this -> data;\n }",
"public function getAllData() {\n\t\treturn $this->data;\n\t}",
"public function get_all_data()\n\t{\n\t\treturn $this->_data;\n\t}",
"public function getAllData() {\n\t\treturn $this->_data;\n\t}",
"public function get_all () {\r\n\t\tretur... | [
"0.85840416",
"0.84294516",
"0.8429239",
"0.8336666",
"0.83070374",
"0.8305469",
"0.8240841",
"0.8240841",
"0.8240841",
"0.8224393",
"0.82223606",
"0.82223606",
"0.82218486",
"0.8201272",
"0.81959414",
"0.8194866",
"0.818217",
"0.8144788",
"0.8144788",
"0.8144788",
"0.8128181... | 0.0 | -1 |
Store Data from this method. | public function store()
{
$products=new DashboardModal;;
$products->insert_product();
redirect(base_url('LoginDashboard'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store()\n\t {\n\t //\n\t }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store() {\n\t\t//\n\t}",
"p... | [
"0.78831536",
"0.7853703",
"0.7706655",
"0.7706655",
"0.7706655",
"0.7704193",
"0.7704193",
"0.7704193",
"0.7616251",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.76076007",
"0.7... | 0.0 | -1 |
Edit Data from this method. | public function edit($id)
{
$product = $this->db->get_where('codeigniter_register', array('id' => $id))->row();
$this->load->view('includes/header');
$this->load->view('dashboard/edit',array('product'=>$product));
$this->load->view('includes/footer');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function updateData();",
"public function edit() {\n\t\t\t\n\t\t}",
"public function edit()\n {\n \n }",
"public function edit()\n\t{\n\t\t//\n\t}",
"protected function editar()\n {\n }",
"public function edit( )\r\n {\r\n //\r\n }",
"public function edit()... | [
"0.72822595",
"0.71372586",
"0.6881146",
"0.6873769",
"0.6872038",
"0.6818677",
"0.67760456",
"0.67701715",
"0.67240393",
"0.67240393",
"0.67240393",
"0.6721128",
"0.67084634",
"0.67084634",
"0.6629793",
"0.6628123",
"0.6626255",
"0.6626255",
"0.6626255",
"0.6600118",
"0.6600... | 0.0 | -1 |
Update Data from this method. | public function update($id)
{
$products=new DashboardModal;;
$products->update_product($id);
redirect(base_url('LoginDashboard'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function updateData();",
"protected function update() {}",
"protected function _update()\n {\n \n }",
"protected function _update()\n {\n \n }",
"public function update()\r\n {\r\n \r\n }",
"public function update()\n {\n }",... | [
"0.8132871",
"0.7496503",
"0.7255103",
"0.7255103",
"0.6973369",
"0.69371736",
"0.6861455",
"0.68517387",
"0.68387526",
"0.6798161",
"0.67917156",
"0.67531496",
"0.67020714",
"0.67020714",
"0.6683915",
"0.66772294",
"0.6671383",
"0.6658202",
"0.6658202",
"0.66477835",
"0.6639... | 0.0 | -1 |
Delete Data from this method. | public function delete($id)
{
$this->db->where('id', $id);
$this->db->delete('codeigniter_register');
redirect(base_url('codeigniter_register'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }",
"public function delete($data)\n {\n }",
"public function delete($data)\n {\n }",
"public function clearData() {\n unset($this->data);\n }"... | [
"0.79104495",
"0.75630206",
"0.75630206",
"0.73789",
"0.71398276",
"0.7054691",
"0.7028456",
"0.70002383",
"0.69834363",
"0.69571",
"0.69564706",
"0.6931199",
"0.691435",
"0.6901109",
"0.6900521",
"0.6887708",
"0.6884362",
"0.6879276",
"0.6869475",
"0.6869475",
"0.68693346",
... | 0.0 | -1 |
Display a listing of the resource. | public function index($cliente_id)
{
$locacao = Cliente::find($cliente_id)->locacoes()->get();;
return view('locacao.index', compact('locacao'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create($id)
{
$cliente = Cliente::findOrFail($id);
return view('locacao.create' , compact('cliente'));
} | {
"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, $id)
{
//dd($request);
$cliente = Cliente::findOrFail($id);
$validatedData = $request->validate([
'dataLocacao' => 'required|max:255',
'dataEntrega' => 'required|max:255',
'valor' => 'required|max:15'
]);
$locacao = new Locacao;
//$pedido = $validatedData;
$locacao->cliente_id = $id;
$locacao->data = $request->input('data');
$locacao->valor = $request->input('valor');
$locacao->save();
$cliente->locacoes->push($locacao);
$cliente->save();
//Pessoa::whereId($pessoa->id)->update($validatedData);
return redirect(route('cliente.index'))->with('success', 'is successfully saved');
} | {
"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.72855324",
"0.71447515",
"0.7132799",
"0.6641042",
"0.66208744",
"0.6566955",
"0.65249777",
"0.6509032",
"0.6447701",
"0.63756555",
"0.6373163",
"0.63650846",
"0.63650846",
"0.63650846",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.63416... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8232636",
"0.81890994",
"0.68296117",
"0.64987075",
"0.649589",
"0.64692974",
"0.64633286",
"0.63640857",
"0.6307513",
"0.6281809",
"0.621944",
"0.61926234",
"0.61803305",
"0.6173143",
"0.61398774",
"0.6119022",
"0.61085826",
"0.6106046",
"0.60947937",
"0.6078597",
"0.6047... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($cliente_id, Locacao $locacao)
{
return view('locacao.edit', compact('cliente_id', 'locacao'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update($cliente_id, Request $request, Locacao $locacao)
{
$validatedData = $request->validate([
'dataLocacao' => 'required|max:255',
'dataEntrega' => 'required|max:255',
'valor' => 'required|max:15',
]);
// dd($validatedData);
//locacao::update($validatedData);
$locacao->data = $request->input('data');
$locacao->valor = $request->input('valor');
$locacao->save();
return redirect(route('cliente.locacao.index', $cliente_id))->with('success', 'Rent is successfully saved');
} | {
"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($cliente_id, Locacao $locacao)
{
// $locacao = locacao::findOrFail($locacao->id);
$locacao->delete();
return redirect(route('cliente.locacao.index', $cliente_id))->with('success', 'Rent is successfully deleted');
} | {
"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.6671365",
"0.6660839",
"0.66361386",
"0.6632988",
"0.6624729",
"0.6542195",
"0.6541645",
"0.6466739",
"0.6288393",
"0.61767083",
"0.6129533",
"0.608954",
"0.6054169",
"0.60443425",
"0.60073143",
"0.59338665",
"0.59317696",
"0.592145",
"0.5920155",
"0.59065086",
"0.5897853"... | 0.0 | -1 |
Load request values from environment | public function __construct()
{
// Use POST and GET if there are any
if (!empty($_GET) || !empty($_POST))
{
// GET POST and GET values
$values = array_merge($_POST, $_GET);
// Trim values
$trim_func = function (&$item, $key) {
$item = trim($item);
};
array_walk_recursive($values, $trim_func);
// Store values
$this->assign($values);
}
// If command line, then also parse arguments
if (PHP_SAPI == 'cli')
{
$values = $_SERVER['argv'];
array_shift($values);
foreach ($values as $arg)
{
parse_str($arg, $params);
if (!empty($params))
{
$this->assign($params);
}
}
}
// Set NULL to be returned for undefined values
$this->setUndefinedValue(null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function load()\n {\n $data = array(\n 'get' => (isset($_GET)) ? $_GET : null, \n 'post' => (isset($_POST)) ? $_POST : null,\n 'request' => (isset($_REQUEST)) ? $_REQUEST : null,\n 'files' => (isset($_FILES)) ? $_FILES : null,\n 'serv... | [
"0.6168943",
"0.61480606",
"0.61329156",
"0.6039796",
"0.6032748",
"0.6025325",
"0.5972167",
"0.59245706",
"0.5905273",
"0.58701926",
"0.5858606",
"0.58585787",
"0.5821272",
"0.5805023",
"0.5780787",
"0.5726633",
"0.57041657",
"0.56705743",
"0.5660793",
"0.5636668",
"0.561254... | 0.0 | -1 |
Return a variable in super global array | private function getGLOBAL($variable, $name)
{
if (!empty($this->undefValue) || (isset($GLOBALS[$variable])
&& is_array($GLOBALS[$variable])
&& array_key_exists($name, $GLOBALS[$variable])))
{
return $GLOBALS[$variable][$name];
}
else
{
return $this->undefValue;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function variables(): array;",
"public function variables(): array;",
"public function getGlobals();",
"public function getGlobals();",
"public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }",
"public function getAvailableVariabl... | [
"0.70819163",
"0.70819163",
"0.66705555",
"0.66705555",
"0.65966976",
"0.6475029",
"0.646486",
"0.63875175",
"0.6374696",
"0.6342084",
"0.6342084",
"0.63091856",
"0.62967837",
"0.6276462",
"0.62549055",
"0.62433237",
"0.6215405",
"0.62122333",
"0.62053347",
"0.6186555",
"0.61... | 0.0 | -1 |
Methods for returning variables in super global arrays | public function getCOOKIE($name) { return $this->getGLOBAL('_COOKIE', $name); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function variables(): array;",
"public function variables(): array;",
"public function getGlobals();",
"public function getGlobals();",
"public function getGlobals()\n {\n }",
"public function getGetVariables();",
"public function getGlobals()\n {\n return [\n 'cache' ... | [
"0.7648373",
"0.7648373",
"0.710164",
"0.710164",
"0.69003475",
"0.68881285",
"0.6883657",
"0.6852582",
"0.6838942",
"0.6838942",
"0.68377554",
"0.68244547",
"0.6745534",
"0.66831845",
"0.66654193",
"0.6621989",
"0.6596047",
"0.6590983",
"0.6588172",
"0.65783304",
"0.6570518"... | 0.0 | -1 |
Return an instance of object | public static function getInstance()
{
$class_name = get_called_class();
if (empty(self::$instances[$class_name]))
{
self::$instances[$class_name] = new $class_name();
}
return self::$instances[$class_name];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }",
"public function newInstance(): object;",
"public function getInstance(): object;",
"abstract public function instance();",
"public function instance();",
"abstract public function get_ins... | [
"0.79393303",
"0.7881171",
"0.7769631",
"0.7508021",
"0.74731755",
"0.74381894",
"0.73974174",
"0.73840225",
"0.73424196",
"0.7328931",
"0.72247314",
"0.7096461",
"0.7096461",
"0.7035041",
"0.70289683",
"0.70289683",
"0.70272654",
"0.70269793",
"0.7020026",
"0.7016876",
"0.70... | 0.0 | -1 |
Reset database to known state | public function setUp()
{
TestConfiguration::setupDatabase();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function reset()\n {\n self::$dbm = null;\n }",
"protected function resetDb()\n {\n if (is_readable(PHPUNIT_WEBROOT . '/app/database/bolt.db')) {\n unlink(PHPUNIT_WEBROOT . '/app/database/bolt.db');\n copy(PHPUNIT_ROOT . '/resources/db/bolt.db', PHPUN... | [
"0.7485755",
"0.73346984",
"0.7331069",
"0.7276688",
"0.72642976",
"0.7081225",
"0.7026163",
"0.69762933",
"0.69408697",
"0.69161314",
"0.68803287",
"0.68199927",
"0.67913103",
"0.6765225",
"0.6739657",
"0.6739456",
"0.6738869",
"0.6738869",
"0.6693763",
"0.6687193",
"0.66856... | 0.0 | -1 |
Tests impact of several boolean settings simultaneously. | public function testSpecifyingFieldNameSpecifyingBoolValues1()
{
$testName = 'MyField';
$fieldSetting = array(
'label' => 'Label',
'footnote' => 'Footnote',
'hide' => false,
'readOnly' => false,
'recommended' => true);
$field = new Application_Model_Field($testName, $fieldSetting);
// Test all methods that don't have unmet preconditions.
$this->assertSame($testName, $field->getDbFieldName());
$this->assertFalse($field->isReadOnly());
$this->assertTrue($field->isVisible());
$this->assertSame("Label", $field->getLabel());
$this->assertSame("Footnote", $field->getFieldFootnote());
// Recommended will not be true because the field is not in the table
$this->assertFalse($field->isRecommended());
$this->assertFalse($field->isDiscouraged());
$this->_assertNoMetaInfo($field);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSetAndRetrieveBoolean(): void\n {\n $key = \"A test key\";\n $this->testNotStrict->set($key, true);\n $actual = $this->testNotStrict->get($key);\n $this->assertTrue($actual);\n $this->testNotStrict->set($key, false);\n $actual = $this->testNotStrict-... | [
"0.63476765",
"0.6294186",
"0.62608695",
"0.6260179",
"0.6086997",
"0.6086696",
"0.6028529",
"0.6017502",
"0.5926697",
"0.58748007",
"0.5869335",
"0.5716484",
"0.56961155",
"0.56292003",
"0.56189394",
"0.5593241",
"0.5574341",
"0.55518603",
"0.55393416",
"0.5497705",
"0.54878... | 0.55801624 | 16 |
Tests impact of several boolean settings simultaneously. | public function testSpecifyingFieldNameSpecifyingBoolValues2()
{
$testName = 'MyField';
$fieldSetting = array(
'label' => 'Label',
'footnote' => 'Footnote',
'hide' => true,
'readOnly' => true,
'recommended' => false,
'discouraged' => true);
$field = new Application_Model_Field($testName, $fieldSetting);
// Test all methods that don't have unmet preconditions.
$this->assertSame($testName, $field->getDbFieldName());
$this->assertTrue($field->isReadOnly());
$this->assertFalse($field->isVisible());
$this->assertSame("Label", $field->getLabel());
$this->assertSame("Footnote", $field->getFieldFootnote());
$this->assertFalse($field->isRecommended());
// Discouraged will not be true because the field is not in the table
$this->assertFalse($field->isDiscouraged());
$this->_assertNoMetaInfo($field);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSetAndRetrieveBoolean(): void\n {\n $key = \"A test key\";\n $this->testNotStrict->set($key, true);\n $actual = $this->testNotStrict->get($key);\n $this->assertTrue($actual);\n $this->testNotStrict->set($key, false);\n $actual = $this->testNotStrict-... | [
"0.63476765",
"0.6294186",
"0.62608695",
"0.6260179",
"0.6086997",
"0.6086696",
"0.6028529",
"0.6017502",
"0.5926697",
"0.58748007",
"0.5869335",
"0.5716484",
"0.56961155",
"0.56292003",
"0.56189394",
"0.5593241",
"0.55801624",
"0.5574341",
"0.55393416",
"0.5497705",
"0.54878... | 0.55518603 | 18 |
Assumed visible because columns shown by default (even though | public function testWhenColsShownByDefaultAndHideNotSpecified()
{
// no label provide), and not explicitly hidden.
$testName = 'MyField';
$showColsByDefault = 'true';
$field = new Application_Model_Field($testName, array(),
array(), $showColsByDefault);
$this->assertTrue($field->isVisible());
$this->assertSame("MyField", $field->getLabel());
$this->_assertNoMetaInfo($field);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function showColumn()\n\t{\n\t\techo '<thead>\n\t\t\t<th></th>';\n\t\t\t\n\t\t\tforeach ($this->col_show as $col)\n\t\t\t\techo '<th>' . $col . '</th>';\n\t\t\n\t\techo '</thead>';\n\t}",
"public function get_hidden_columns()\r\n {\r\n return array();\r\n }",
"public function toString()\n ... | [
"0.72374153",
"0.70898914",
"0.7089616",
"0.7075522",
"0.7056172",
"0.7056172",
"0.6979283",
"0.6977216",
"0.6961342",
"0.69556785",
"0.69125164",
"0.6852285",
"0.6800841",
"0.6800841",
"0.67913556",
"0.65988576",
"0.65859056",
"0.6560013",
"0.6558168",
"0.6556573",
"0.654099... | 0.68087703 | 12 |
Assumed visible because columns shown by default, but | public function testWhenColsShownByDefaultButHideIsTrue()
{
// explicitly hidden with 'hide' set to true.
$testName = 'MyField';
$fieldSetting = array(
'label' => 'Label',
'hide' => true);
$showColsByDefault = 'true';
$field = new Application_Model_Field($testName, $fieldSetting,
array(), $showColsByDefault);
$this->assertFalse($field->isVisible());
$this->assertSame("Label", $field->getLabel());
$this->_assertNoMetaInfo($field);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toString()\n {\n return 'All column is visible.';\n }",
"private function showColumn()\n\t{\n\t\techo '<thead>\n\t\t\t<th></th>';\n\t\t\t\n\t\t\tforeach ($this->col_show as $col)\n\t\t\t\techo '<th>' . $col . '</th>';\n\t\t\n\t\techo '</thead>';\n\t}",
"public function get_hidden_c... | [
"0.71218276",
"0.70857346",
"0.7060256",
"0.7058681",
"0.7021207",
"0.7021207",
"0.6947317",
"0.69387156",
"0.69169515",
"0.6906879",
"0.688181",
"0.68798614",
"0.6851356",
"0.6846464",
"0.6846464",
"0.68138963",
"0.68125784",
"0.6785917",
"0.6734491",
"0.6661822",
"0.6640833... | 0.63937855 | 27 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.