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
Store a newly created resource in storage.
public function store(Request $request) { $file[] = $request->file('images'); foreach ( $request->file('images') as $file) { $postImage = new Images; $name = Str::random(10); $url = \Storage::putFileAs('images',$file,$name . '.' . $file->extension()); $postImage->project_id = $request->project_id; $postImage->url = $url; $postImage->save(); } $Project = Project::create([ 'project_id' => $request->project_id, 'project_name' => $request->project_name, 'project_description' => $request->project_description, ]); return response($Project, Response::HTTP_CREATED); // $Project = Project::create($request->only('project_id','project_name','images','project_description')); // return response($Project, Response::HTTP_CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "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.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665",...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $Project = Project::find($id); $Project->Project($request->all()); return response( new ProjectResource($Project), 202); }
{ "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) { $Project = Project::destroy($id); return response(new ProjectResource($Project), 204); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Show the detail news
public function show($id){ DB::table('ab_news')->where('id', $id)->increment('visit'); $news = News::where('id', '=', $id)->first(); \Log::debug(request()->url(). ':'.$news->visit); // $news = DB::table('ab_news')->where('id', $id)->first(); return view('news.show', ['news' => $news]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(){\r\r\n $news = $this->New->find($_GET['id']);\r\r\n $this->render('news.show', compact('news'));\r\r\n }", "public function show(news $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n ...
[ "0.8381032", "0.7961891", "0.7846172", "0.7846172", "0.7846172", "0.7846172", "0.7838067", "0.78235257", "0.7773279", "0.76337266", "0.7628666", "0.7550014", "0.7452697", "0.7413637", "0.73826534", "0.7358465", "0.7344281", "0.7318524", "0.731642", "0.73020774", "0.7255603", ...
0.7328753
17
Populate the backend with a given object
public function loadFromContainer(AssetContainer $assetContainer) { return $this->setAssetContainer($assetContainer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populate($object)\n {\n }", "public function loadFromObject($object){\n foreach ($object as $property => $value) {\n //we must ignore this fields\n if(\\in_array($property,['_type','_primary_key','id'])){\n continue;\n }\n $t...
[ "0.6495365", "0.59811455", "0.5955187", "0.5865298", "0.5849499", "0.569184", "0.5690149", "0.56476426", "0.5627689", "0.56019646", "0.5582479", "0.55808735", "0.557279", "0.55501485", "0.55498064", "0.55498064", "0.55300677", "0.5499112", "0.5498392", "0.5497256", "0.5493030...
0.0
-1
Get the currently assigned image resource, or generates one if not yet assigned. Note: This method may return null if error
public function getImageResource() { // Get existing resource if ($this->image) { return $this->image; } // Load container $assetContainer = $this->getAssetContainer(); if (!$assetContainer) { return null; } // Avoid repeat load of broken images $hash = $assetContainer->getHash(); $variant = $assetContainer->getVariant(); if ($this->hasFailed($hash, $variant)) { return null; } // Validate stream is readable // Note: Mark failed regardless of whether a failed stream is exceptional or not $error = self::FAILED_MISSING; try { $stream = $assetContainer->getStream(); if ($this->isStreamReadable($stream)) { $error = null; } else { return null; } } finally { if ($error) { $this->markFailed($hash, $variant, $error); } } // Handle resource $error = self::FAILED_UNKNOWN; try { // write the file to a local path so we can extract exif data if it exists. // Currently exif data can only be read from file paths and not streams $tempPath = $this->config()->get('local_temp_path') ?? TEMP_PATH; $path = tempnam($tempPath ?? '', 'interventionimage_'); if ($extension = pathinfo($assetContainer->getFilename() ?? '', PATHINFO_EXTENSION)) { //tmpnam creates a file, we should clean it up if we are changing the path name unlink($path ?? ''); $path .= "." . $extension; } $bytesWritten = file_put_contents($path ?? '', $stream); // if we fail to write, then load from stream if ($bytesWritten === false) { $resource = $this->getImageManager()->make($stream); } else { $this->setTempPath($path); $resource = $this->getImageManager()->make($path); } // Fix image orientation try { $resource->orientate(); } catch (NotSupportedException $e) { // noop - we can't orientate, don't worry about it } $this->setImageResource($resource); $this->markSuccess($hash, $variant); $this->warmCache($hash, $variant); $error = null; return $resource; } catch (NotReadableException $ex) { // Handle unsupported image encoding on load (will be marked as failed) // Unsupported exceptions are handled without being raised as exceptions $error = self::FAILED_INVALID; } finally { if ($error) { $this->markFailed($hash, $variant, $error); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImageResource()\n {\n return $this->image;\n }", "protected function getImageResource () {\n $extension = strtolower( strrchr ( $this->source, '.' ) );\n\n // Convert image to resource object according to its type.\n switch ( $extension ) {\n case '.jpg':\n ...
[ "0.7010775", "0.6907486", "0.6688713", "0.662025", "0.65964097", "0.65314513", "0.6418584", "0.6211641", "0.6211423", "0.6195503", "0.6170121", "0.6170121", "0.6156974", "0.6156974", "0.6156974", "0.61560833", "0.6118317", "0.6080568", "0.6028364", "0.6028364", "0.60184735", ...
0.6193577
10
Populate the backend from a local path
public function loadFrom($path) { // Avoid repeat load of broken images $hash = sha1($path ?? ''); if ($this->hasFailed($hash, null)) { return $this; } // Handle resource $error = self::FAILED_UNKNOWN; try { $this->setImageResource($this->getImageManager()->make($path)); $this->markSuccess($hash, null); $error = null; } catch (NotReadableException $ex) { // Handle unsupported image encoding on load (will be marked as failed) // Unsupported exceptions are handled without being raised as exceptions $error = self::FAILED_INVALID; } finally { if ($error) { $this->markFailed($hash, null, $error); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init($path);", "public function load($path);", "public function load($path);", "public function load($path);", "public function getLocalPath($path);", "private function setUpBackend() {}", "public function setPath($path){ }", "public function getLocalPath();", "public static functio...
[ "0.6020126", "0.5828016", "0.5828016", "0.5828016", "0.5734319", "0.5692236", "0.56519675", "0.5638863", "0.55679893", "0.55672985", "0.55594873", "0.55368894", "0.5517783", "0.54752153", "0.54752153", "0.54739505", "0.5462235", "0.5462235", "0.5462235", "0.5462235", "0.54558...
0.0
-1
Write the backend to a local path
public function writeTo($path) { try { $resource = $this->getImageResource(); if (!$resource) { throw new BadMethodCallException("Cannot write corrupt file to store"); } $resource->save($path, $this->getQuality()); } catch (NotWritableException $e) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveTo(string $path);", "public function getWritePath();", "public function storeTo($path = './') {\n\t\tfile_put_contents($path . $this->filename, $this->content);\t\n\t}", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n...
[ "0.6304256", "0.6120411", "0.60172886", "0.59497416", "0.59109455", "0.5791783", "0.57749224", "0.57536596", "0.5736895", "0.5613975", "0.5613975", "0.55904967", "0.55020666", "0.5496044", "0.54399943", "0.54069716", "0.54058266", "0.54022664", "0.5383037", "0.5376265", "0.53...
0.0
-1
Return dimensions as array with cache enabled
protected function getDimensions() { // Default result $result = [0, 0]; // If we have a resource already loaded, this means we have modified the resource since the // original image was loaded. This means the "Variant" tuple key is out of date, and we don't // have a reliable cache key to load from, or save to. If we use the original tuple as a key, // we would run the risk of overwriting the original dimensions in the cache, with the values // of the resized instead. // Instead, we use the immediately available dimensions attached to this resource, and we will // rely on cache warming in writeToStore to save these values, where the "Variant" becomes available, // before the next time this variant is loaded into memory. $resource = $this->image; if ($resource) { return $this->getResourceDimensions($resource); } // Check if we have a container $container = $this->getAssetContainer(); if (!$container) { return $result; } // Check cache for unloaded image $cache = $this->getCache(); $key = $this->getDimensionCacheKey($container->getHash(), $container->getVariant()); if ($cache->has($key)) { return $cache->get($key); } // Cache-miss $resource = $this->getImageResource(); if ($resource) { $result = $this->getResourceDimensions($resource); $cache->set($key, $result); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDimensions() {\n\t\treturn $this->dimensions->toArray();\n\t}", "public function getDimensions() {}", "public function getDimensions();", "public function getDimensions();", "public function getDimensions(): array\n\t{\n\t\treturn $this->processor->getDimensions();\n\t}", "public funct...
[ "0.72013", "0.70207644", "0.7018129", "0.7018129", "0.7014032", "0.6944247", "0.6850004", "0.6826895", "0.673235", "0.6443212", "0.6355589", "0.6317518", "0.6316493", "0.6158237", "0.61134976", "0.60630894", "0.6056573", "0.5971882", "0.5961361", "0.59124047", "0.5824726", ...
0.6508993
9
Get dimensions from the given resource
protected function getResourceDimensions(InterventionImage $resource) { /** @var Size $size */ $size = $resource->getSize(); return [ $size->getWidth(), $size->getHeight() ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDimensions()\n {\n // Default result\n $result = [0, 0];\n\n // If we have a resource already loaded, this means we have modified the resource since the\n // original image was loaded. This means the \"Variant\" tuple key is out of date, and we don't\n //...
[ "0.7257647", "0.6941101", "0.6867788", "0.6799203", "0.6799203", "0.65367496", "0.6470272", "0.637269", "0.6363442", "0.63431126", "0.63061464", "0.62931883", "0.6199035", "0.61546206", "0.61029106", "0.6037696", "0.6032481", "0.59951085", "0.5990251", "0.596798", "0.5874682"...
0.6570042
5
Cache key for recording errors
protected function getErrorCacheKey($hash, $variant = null) { return self::CACHE_MARK . sha1($hash . '-' . $variant); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function errorCacheKey()\n {\n // Returns a new number every x minutes\n return (int)(time() / 60 / 3);\n }", "private function cacheKey()\n {\n return sprintf('contact-permissons-%s', $this->client->patientContactId);\n }", "public function getCacheKey()\n {\n ...
[ "0.76409405", "0.647879", "0.63879037", "0.6336151", "0.6257586", "0.62017477", "0.61370665", "0.59960765", "0.5915032", "0.5831583", "0.57889944", "0.5785367", "0.5775781", "0.5760549", "0.57366824", "0.5709728", "0.5704724", "0.570445", "0.5675897", "0.5669169", "0.5641255"...
0.5835539
9
Cache key for dimensions for given container
protected function getDimensionCacheKey($hash, $variant = null) { return self::CACHE_DIMENSIONS . sha1($hash . '-' . $variant); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function calculateCacheKey()\n {\n if ($this->_cacheKey === null) {\n $key = [__CLASS__, Yii::$app->requestedRoute];\n if (is_array($this->variations)) {\n foreach ($this->variations as $value) {\n $key[] = $value;\n }\n ...
[ "0.64946055", "0.618433", "0.6171773", "0.61240554", "0.6103964", "0.6052702", "0.6049449", "0.5994975", "0.594321", "0.58983666", "0.5892559", "0.5881405", "0.5847667", "0.58197445", "0.5740596", "0.570528", "0.5694504", "0.56800574", "0.56666285", "0.56533295", "0.5652369",...
0.6314004
1
Warm dimension cache for the given asset
protected function warmCache($hash, $variant = null) { // Warm dimension cache $key = $this->getDimensionCacheKey($hash, $variant); $resource = $this->getImageResource(); if ($resource) { $result = $this->getResourceDimensions($resource); $this->getCache()->set($key, $result); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function buildSpriteDataAndCreateCacheEntry() {}", "public function getCache();", "protected function getCacheModule() {}", "private static function getAssetCache($asset)\n\t{\n\t\treturn new AssetCache\n\t\t(\t$asset\n\t\t,\tnew FilesystemCache(self::cachePath())\n\t\t);\n\t}", "protected...
[ "0.5057346", "0.50521183", "0.49822682", "0.4969355", "0.4966165", "0.49424198", "0.4926269", "0.48793554", "0.4820696", "0.4813766", "0.48108497", "0.48038468", "0.48013285", "0.47988585", "0.47981292", "0.47946182", "0.47656912", "0.47438052", "0.4728983", "0.47258827", "0....
0.54231393
0
Set the quality to a value between 0 and 100
public function setQuality($quality) { $this->quality = $quality; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setQuality($value) {\n\t\t$this->_quality = $value;\n\t}", "public function setQuality($quality);", "public function setQuality($quality);", "public function setQuality($quality);", "public function quality($quality = 100)\n {\n if(is_numeric($quality))\n {\n $th...
[ "0.8168144", "0.78837025", "0.78837025", "0.78837025", "0.7682368", "0.76328367", "0.75868124", "0.7327609", "0.7066521", "0.7057268", "0.7054614", "0.7013433", "0.69637066", "0.69614404", "0.6952476", "0.6952476", "0.6913004", "0.6871415", "0.6861292", "0.6856504", "0.677984...
0.6641235
27
Resize an image, skewing it as necessary.
public function resize($width, $height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height) { return $resource->resize($width, $height); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sharpenImage()\n\t{\n\t\t$this->checkImage();\n\n\t\tif (!$this->saveState && $this->sharpen == true) {\n\t\t\t$sharpness = $this->findSharp($this->width, $this->optimalWidth);\n\t\t\t$sharpenMatrix = array(\n\t\t\t\tarray(-1, -2, -1),\n\t\t\t\tarray(-2, $sharpness + 12, -2),\n\t\t\t\tarray(-1, -2...
[ "0.62883055", "0.62711394", "0.62004495", "0.61790395", "0.605369", "0.60505104", "0.60281974", "0.5977015", "0.59388775", "0.59349555", "0.5901326", "0.58924353", "0.58707166", "0.5784166", "0.5764854", "0.5763827", "0.5746553", "0.5741907", "0.57404655", "0.57319355", "0.57...
0.0
-1
Resize the image by preserving aspect ratio. By default, it will keep the image inside the maxWidth and maxHeight. Passing useAsMinimum will make the smaller dimension equal to the maximum corresponding dimension
public function resizeRatio($width, $height, $useAsMinimum = false) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height, $useAsMinimum) { return $resource->resize( $width, $height, function (Constraint $constraint) use ($useAsMinimum) { $constraint->aspectRatio(); if (!$useAsMinimum) { $constraint->upsize(); } } ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n...
[ "0.64798206", "0.6374751", "0.62817496", "0.6263326", "0.6260494", "0.62429357", "0.61854905", "0.61782223", "0.610051", "0.6014141", "0.6002788", "0.5983225", "0.5946629", "0.59023577", "0.59015405", "0.58619773", "0.58607596", "0.5823537", "0.58031416", "0.5801501", "0.5797...
0.7134943
0
Resize an image by width. Preserves aspect ratio.
public function resizeByWidth($width) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width) { return $resource->widen($width); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeToWidth($width)\n {\n //obtine ratio dividiendo ancho dada entre el ancho actual de la imagen.\n $ratio = $width / $this->getWidth();\n //obtiene altura con la altura actual de la imagen por el ratio.\n $height = $this->getheight() * $ratio;\n ...
[ "0.75898075", "0.7455255", "0.71634877", "0.70652676", "0.6963934", "0.68762547", "0.687175", "0.6850629", "0.6800198", "0.6783009", "0.6516139", "0.64880043", "0.6432726", "0.64112836", "0.6378269", "0.6376734", "0.63554865", "0.63530046", "0.6346494", "0.6342696", "0.630889...
0.7392828
2
Resize an image by height. Preserves aspect ratio.
public function resizeByHeight($height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($height) { return $resource->heighten($height); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeToHeight($height)\n {\n //obtine ratio dividiendo altura dada entre la altura actual de la imagen.\n $ratio = $height / $this->getHeight();\n //obtiene ancho con el ancho actual de la imagen por el ratio.\n $width = $this->getWidth() * $ratio;\n ...
[ "0.74732393", "0.7271189", "0.71495664", "0.7078089", "0.7023826", "0.70215297", "0.6987465", "0.6900425", "0.68663824", "0.6851944", "0.66551864", "0.66511315", "0.6648589", "0.6626812", "0.65997976", "0.6573563", "0.6556508", "0.65451425", "0.6469766", "0.6456662", "0.64444...
0.7065418
4
Return a clone of this image resized, with space filled in with the given colour
public function paddedResize($width, $height, $backgroundColor = "FFFFFF", $transparencyPercent = 0) { $resource = $this->getImageResource(); if (!$resource) { return null; } // caclulate the background colour $background = $resource->getDriver()->parseColor($backgroundColor)->format('array'); // convert transparancy % to alpha $background[3] = 1 - round(min(100, max(0, $transparencyPercent)) / 100, 2); // resize the image maintaining the aspect ratio and then pad out the canvas return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height, $background) { return $resource ->resize( $width, $height, function (Constraint $constraint) { $constraint->aspectRatio(); } ) ->resizeCanvas( $width, $height, 'center', false, $background ); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function palettizeImage($newImage, $w, $h, $palette) {\n\n $pImage = imagecreate($w, $h);\n imagesavealpha($pImage, true);\n imagealphablending($pImage, false);\n\n // Convert histogram colors to palette\n foreach ($palette as $c) {\n list($r, $g, $b, $a) = explode(','...
[ "0.56789774", "0.5674645", "0.5539324", "0.5478769", "0.5323904", "0.530985", "0.52030927", "0.51074916", "0.5093699", "0.5056652", "0.50259376", "0.49967209", "0.49957815", "0.49675417", "0.49555638", "0.49253905", "0.49153274", "0.4911768", "0.49092442", "0.4903191", "0.488...
0.0
-1
Resize an image to cover the given width/height completely, and crop off any overhanging edges.
public function croppedResize($width, $height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($width, $height) { return $resource->fit($width, $height); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crop( $x = 0, $y = 0, $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, $x, $y, $w, $h, $w, $h );\n\t...
[ "0.6801627", "0.67763376", "0.6725753", "0.66238195", "0.6589467", "0.65783393", "0.6551591", "0.6524436", "0.64539176", "0.643251", "0.63902557", "0.63791174", "0.63740593", "0.63693756", "0.6321373", "0.6316384", "0.6189324", "0.6165461", "0.61213005", "0.6112218", "0.61122...
0.5893267
38
Crop's part of image.
public function crop($top, $left, $width, $height) { return $this->createCloneWithResource( function (InterventionImage $resource) use ($top, $left, $height, $width) { return $resource->crop($width, $height, $left, $top); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crop()\n {\n }", "public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}", "function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\...
[ "0.80794173", "0.7953355", "0.76265067", "0.7534818", "0.7509675", "0.73519826", "0.7330338", "0.7281966", "0.72596693", "0.712091", "0.70829874", "0.70485884", "0.69685996", "0.6954911", "0.69505244", "0.69221693", "0.6827314", "0.67656493", "0.6737879", "0.66659284", "0.663...
0.58647734
81
Modify this image backend with either a provided resource, or transformation
protected function createCloneWithResource($resourceOrTransformation) { // No clone with no argument if (!$resourceOrTransformation) { return null; } // Handle transformation function if (is_callable($resourceOrTransformation)) { // Fail if resource not available $resource = $this->getImageResource(); if (!$resource) { return null; } // Note: Closure may simply modify the resource rather than return a new one $resource = clone $resource; $resource = call_user_func($resourceOrTransformation, $resource) ?: $resource; // Clone with updated resource return $this->createCloneWithResource($resource); } // Ensure result is of a valid type if (!$resourceOrTransformation instanceof InterventionImage) { throw new InvalidArgumentException("Invalid resource type"); } // Create clone $clone = clone $this; $clone->setImageResource($resourceOrTransformation); return $clone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function transformResource($resource);", "protected function renderResource()\n {\n $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());\n $this->resource = $processedImageInfo['resource'];\n $this->wi...
[ "0.64512944", "0.6165758", "0.595881", "0.56702685", "0.55832666", "0.5572471", "0.5388291", "0.53775483", "0.5333663", "0.53016365", "0.52967274", "0.5237945", "0.5171434", "0.516492", "0.5164222", "0.51603127", "0.5143059", "0.5078773", "0.5059693", "0.50337255", "0.4996388...
0.519873
12
Clear any cached errors / metadata for this image
protected function markSuccess($hash, $variant = null) { $key = $this->getErrorCacheKey($hash, $variant); $this->getCache()->deleteMultiple([ $key.'_reason', $key.'_ttl' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function flushImageCache(): void\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "private function flushImageCache()\n {\n $this->imagesCache = null;\n $this->variantImages = null;\n }", "public function reset() {\r\n\t\t$this->images = arra...
[ "0.71796775", "0.71544987", "0.6787552", "0.6783337", "0.671859", "0.66466254", "0.6508462", "0.64881015", "0.64715195", "0.64292955", "0.63989615", "0.63916427", "0.6384879", "0.6368545", "0.6348757", "0.6344052", "0.63346267", "0.6331779", "0.63088506", "0.6306654", "0.6296...
0.0
-1
Mark this image as failed to load
protected function markFailed($hash, $variant = null, $reason = self::FAILED_UNKNOWN) { $key = $this->getErrorCacheKey($hash, $variant); // Get TTL for error $errorTTLs = $this->config()->get('error_cache_ttl'); $ttl = isset($errorTTLs[$reason]) ? $errorTTLs[$reason] : $errorTTLs[self::FAILED_UNKNOWN]; // Detect increasing waits if (is_string($ttl) && strstr($ttl ?? '', ',')) { $ttl = preg_split('#\s*,\s*#', $ttl ?? ''); } if (is_array($ttl)) { $index = min( $this->getCache()->get($key.'_ttl', -1) + 1, count($ttl ?? []) - 1 ); $this->getCache()->set($key.'_ttl', $index); $ttl = $ttl[$index]; } if (!is_numeric($ttl)) { throw new LogicException("Invalid TTL {$ttl}"); } // Treat 0 as unlimited $ttl = $ttl ? (int)$ttl : null; $this->getCache()->set($key.'_reason', $reason, $ttl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markAsFailed();", "protected function markAsFailed()\n {\n $this->view->success = false;\n }", "public function setFailed()\n {\n $this->update(['status' => static::STATUS_FAILED]);\n }", "public function markError()\n {\n $this->setStatus(self::STATE_ERROR...
[ "0.72546685", "0.6515678", "0.6252314", "0.60602546", "0.6017387", "0.59708804", "0.59174836", "0.5904026", "0.5904026", "0.5895635", "0.58673996", "0.57675785", "0.5737397", "0.5722287", "0.57211345", "0.57153195", "0.5667451", "0.5649304", "0.56259716", "0.5565741", "0.5535...
0.0
-1
Determine reason this file could not be loaded. Will return one of the FAILED_ constant values, or null if not failed
protected function hasFailed($hash, $variant = null) { $key = $this->getErrorCacheKey($hash, $variant); return $this->getCache()->get($key.'_reason', null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkForErrors(){\n if(!ModuleLoader::moduleIsLoaded($this->module)) $this->throwError('TemplateLoader01', 'Module '.$this->module.' either does not exist, or has not been installed in this theme');\n\n return null;\n }", "public function getFailureReason();", "public function getFail...
[ "0.60769", "0.6068941", "0.60292214", "0.5944004", "0.59032696", "0.5871621", "0.58607167", "0.5795164", "0.5790313", "0.5783166", "0.5777504", "0.5766939", "0.56873566", "0.56666434", "0.5663245", "0.5644817", "0.56188756", "0.56018174", "0.55415857", "0.55310243", "0.552919...
0.0
-1
Make sure we clean up the image resource when this object is destroyed
public function __destruct() { //skip the `getImageResource` method because we don't want to load the resource just to destroy it if ($this->image) { $this->image->destroy(); } // remove our temp file if it exists if (file_exists($this->getTempPath() ?? '')) { unlink($this->getTempPath() ?? ''); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __destruct()\n {\n if (is_resource($this->_image))\n {\n // Free all resources\n imagedestroy($this->_image);\n }\n }", "public function __destruct()\n {\n if (is_resource($this->image)) {\n // free up memory\n imagedestroy($this->image);\n ...
[ "0.857253", "0.8547465", "0.8442191", "0.84332794", "0.841615", "0.8321722", "0.8319423", "0.83164895", "0.82763046", "0.81757265", "0.80256635", "0.8010804", "0.7884571", "0.78385234", "0.7827356", "0.78146917", "0.74372905", "0.7317846", "0.7262516", "0.7223612", "0.7079487...
0.8151313
10
This function is triggered early in the request if the "flush" query parameter has been set. Each class that implements Flushable implements this function which looks after it's own specific flushing functionality.
public static function flush() { if (Config::inst()->get(static::class, 'flush_enabled')) { /** @var CacheInterface $cache */ $cache = Injector::inst()->get(CacheInterface::class . '.InterventionBackend_Manipulations'); $cache->clear(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _prepareFlush() {\r\n\r\n }", "protected function _completeFlush() {\r\n\r\n }", "public function preFlush(): void\n {\n $this->setParams(clone $this->getParams());\n }", "public static function flush() {\n\t\tstatic::$flush = true;\n\t}", "public function flush()\n\t{\n\n...
[ "0.75262713", "0.7165165", "0.71292955", "0.67982394", "0.6663898", "0.6656445", "0.6656445", "0.6656445", "0.6656445", "0.66558087", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66547954", "0.66130644", "0...
0.0
-1
Validate the stream resource is readable
protected function isStreamReadable($stream) { if (empty($stream)) { return false; } if ($stream instanceof StreamInterface) { return $stream->isReadable(); } // Ensure resource is stream type if (!is_resource($stream)) { return false; } if (get_resource_type($stream) !== 'stream') { return false; } // Ensure stream is readable $meta = stream_get_meta_data($stream); return isset($meta['mode']) && (strstr($meta['mode'] ?? '', 'r') || strstr($meta['mode'] ?? '', '+')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkResource() {\n if (is_resource($this->_handler) && (get_resource_type($this->_handler) == 'stream')) {\n \treturn true;\n }\n return false;\n }", "public function isReadable() {}", "public function isReadable();", "public function isReadable()\n {\n }", "f...
[ "0.74711883", "0.7309637", "0.72668195", "0.6908942", "0.6855464", "0.6760469", "0.65523773", "0.6506465", "0.6476693", "0.6476693", "0.64503235", "0.6316515", "0.6279597", "0.6249807", "0.6232123", "0.62214226", "0.62036026", "0.616552", "0.61577404", "0.6142873", "0.6101894...
0.6393198
11
Authenticate and retrieve stock
function mkmapi($url) { /** * Declare and assign all needed variables for the request and the header * * @var $method string Request method * @var $url string Full request URI * @var $appToken string App token found at the profile page * @var $appSecret string App secret found at the profile page * @var $accessToken string Access token found at the profile page (or retrieved from the /access request) * @var $accessSecret string Access token secret found at the profile page (or retrieved from the /access request) * @var $nonce string Custom made unique string, you can use uniqid() for this * @var $timestamp string Actual UNIX time stamp, you can use time() for this * @var $signatureMethod string Cryptographic hash function used for signing the base string with the signature, always HMAC-SHA1 * @var version string OAuth version, currently 1.0 */ global $appToken,$appSecret,$accessToken,$accessSecret; $method = "GET"; $nonce = uniqid(); $timestamp = time(); $signatureMethod = "HMAC-SHA1"; $version = "1.0"; /** * Gather all parameters that need to be included in the Authorization header and are know yet * * @var $params array|string[] Associative array of all needed authorization header parameters */ $params = array( 'realm' => $url, 'oauth_consumer_key' => $appToken, 'oauth_token' => $accessToken, 'oauth_nonce' => $nonce, 'oauth_timestamp' => $timestamp, 'oauth_signature_method' => $signatureMethod, 'oauth_version' => $version, ); /** * Start composing the base string from the method and request URI * * @var $baseString string Finally the encoded base string for that request, that needs to be signed */ $baseString = strtoupper($method) . "&"; $baseString .= rawurlencode($url) . "&"; /* * Gather, encode, and sort the base string parameters */ $encodedParams = array(); foreach ($params as $key => $value) { if ("realm" != $key) { $encodedParams[rawurlencode($key)] = rawurlencode($value); } } ksort($encodedParams); /* * Expand the base string by the encoded parameter=value pairs */ $values = array(); foreach ($encodedParams as $key => $value) { $values[] = $key . "=" . $value; } $paramsString = rawurlencode(implode("&", $values)); $baseString .= $paramsString; /* * Create the signingKey */ $signatureKey = rawurlencode($appSecret) . "&" . rawurlencode($accessSecret); /** * Create the OAuth signature * Attention: Make sure to provide the binary data to the Base64 encoder * * @var $oAuthSignature string OAuth signature value */ $rawSignature = hash_hmac("sha1", $baseString, $signatureKey, true); $oAuthSignature = base64_encode($rawSignature); /* * Include the OAuth signature parameter in the header parameters array */ $params['oauth_signature'] = $oAuthSignature; /* * Construct the header string */ $header = "Authorization: OAuth "; $headerParams = array(); foreach ($params as $key => $value) { $headerParams[] = $key . "=\"" . $value . "\""; } $header .= implode(", ", $headerParams); /* * Get the cURL handler from the library function */ $curlHandle = curl_init(); /* * Set the required cURL options to successfully fire a request to MKM's API * * For more information about cURL options refer to PHP's cURL manual: * http://php.net/manual/en/function.curl-setopt.php */ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array($header)); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false); /** * Execute the request, retrieve information about the request and response, and close the connection * * @var $content string Response to the request * @var $info array Array with information about the last request on the $curlHandle */ $content = curl_exec($curlHandle); $info = curl_getinfo($curlHandle); curl_close($curlHandle); /* * Convert the response string into an object * * If you have chosen XML as response format (which is standard) use simplexml_load_string * If you have chosen JSON as response format use json_decode * * @var $decoded \SimpleXMLElement|\stdClass Converted Object (XML|JSON) */ $xml = simplexml_load_string($content); $json = json_encode($xml); return $json;//string }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStockroom()\n {\n $this->load->model('stockroom/exchange');\n $response = $this->model_stockroom_exchange->getStockroom();\n if ($response) {\n foreach ($response as $stockroom) {\n $this->model_stockroom_exchange->parseStockroomResponse($stockro...
[ "0.5991866", "0.58625036", "0.5808488", "0.57697", "0.5739778", "0.5721598", "0.566032", "0.5641281", "0.5605235", "0.56048983", "0.54911333", "0.5485446", "0.5479109", "0.5469757", "0.54511493", "0.5446254", "0.5424345", "0.5424089", "0.5416881", "0.5409933", "0.54009503", ...
0.0
-1
/ Get the cURL handler from the library function
function curl($url,$header) { $curlHandle = curl_init(); /* * Set the required cURL options to successfully fire a request to MKM's API * * For more information about cURL options refer to PHP's cURL manual: * http://php.net/manual/en/function.curl-setopt.php */ curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array($header)); curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false); /** * Execute the request, retrieve information about the request and response, and close the connection * * @var $content string Response to the request * @var $info array Array with information about the last request on the $curlHandle */ $content = curl_exec($curlHandle); $info = curl_getinfo($curlHandle); curl_close($curlHandle); return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_handler() {\r\n }", "protected function _getCommHandler() {\n if (!isset($this->_ch)) {\n $this->_ch = curl_init();\n }\n return $this->_ch;\n }", "protected function &getCurlHandle() {\n\t\twfProfileIn( 'BS::'.__METHOD__ );\n\t\tif ( $this->curlConnectionCounter > 200 ) {\n\t\t\...
[ "0.6418839", "0.63910264", "0.62964374", "0.626891", "0.62320316", "0.6181204", "0.6181204", "0.6010601", "0.6000701", "0.59794104", "0.5960487", "0.58511984", "0.5840672", "0.58248115", "0.57842904", "0.5738323", "0.5725987", "0.570481", "0.570481", "0.5697207", "0.5656987",...
0.0
-1
Run the database seeds.
public function run(Faker $faker) { $pack1 = new Pack; $pack1 -> pname = '手袋单人份'; $pack1 -> save(); $pack2 = new Pack; $pack2 -> pname = '礼盒双人份'; $pack2 -> save(); $pack3 = new Pack; $pack3 -> pname = '全家福礼包'; $pack3 -> 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
Show all emails lists
public function emailsLists(MailerRepo $mailerService) { $lists = $mailerService->getAll(); $menu_control = view()->shared('menu_control'); $menu_control['page'] = 'emails'; $menu_control['category'] = 'options'; return view('mailer::emails', compact('lists','menu_control')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function emailList()\n {\n return array(\n 'temp@yahoo.com',\n 'something@outlook.com',\n 'anything@yahoo.com',\n );\n }", "function listEmails(){\n \n $conn = $this->connect();\n $ret = '';\n \n ...
[ "0.7397555", "0.73086494", "0.7304704", "0.72429377", "0.72284794", "0.7096396", "0.6961561", "0.68926024", "0.6844237", "0.6803378", "0.67854947", "0.67702174", "0.66724527", "0.6640241", "0.6627167", "0.66057324", "0.65522814", "0.65025574", "0.6501332", "0.6476535", "0.646...
0.64831
19
Update information by id
public function update($id, Request $request, MailerRepo $mailerService) { if(!$mailerService->update($id, $request->all())){ return response('При обновлении страницы возникли ошибки', 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($id){\n\t\t//\n\t}", "public function update($id){\n\t\t//\n\t}", "public function update($id) {\r\n //\r\n }", "public function update($id);", "public function update($id);", "public function update($id)\n\t {\n\t //\n\t }", "public function update($id) {\n ...
[ "0.86462885", "0.86462885", "0.8629003", "0.85983187", "0.85983187", "0.8538499", "0.8535516", "0.8535516", "0.85254216", "0.8512869", "0.8512869", "0.8512869", "0.8512869", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154", "0.8505154"...
0.0
-1
Show form for creating with information from db
public function edit($id, MailerRepo $mailerService) { if(!($list = $mailerService->getByID($id))){ return response('Товар не найден', 404); } $menu_control = view()->shared('menu_control'); $menu_control['page'] = 'emails'; $menu_control['category'] = 'options'; $templates = $mailerService->findTemplates(); $events = $mailerService->findEvents(); return view('mailer::edit', compact('menu_control', 'templates', 'events', 'list')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n\t{\n\t\treturn $this->s...
[ "0.7815603", "0.76920563", "0.75792426", "0.7565053", "0.7565053", "0.75552344", "0.75521153", "0.74542415", "0.74542415", "0.7418911", "0.73886937", "0.7293856", "0.7293856", "0.7293856", "0.7293856", "0.72826177", "0.727549", "0.72719425", "0.72471315", "0.72471315", "0.722...
0.0
-1
Show empty form for creating
public function create(MailerRepo $mailerService) { $menu_control = view()->shared('menu_control'); $menu_control['page'] = 'emails'; $menu_control['category'] = 'options'; $list = ''; $templates = $mailerService->findTemplates(); $events = $mailerService->findEvents(); return view('mailer::create', compact('menu_control', 'templates','events', 'list')); }
{ "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\t{\n\t\treturn $this->showForm('create');\n\t}", "public function index_onCreateForm()\n\t{\n\t\tparent::create(...
[ "0.73233974", "0.73233974", "0.731111", "0.7294763", "0.7272326", "0.72639996", "0.72378975", "0.72378975", "0.71542114", "0.71015596", "0.7094181", "0.70874786", "0.707055", "0.707055", "0.70632225", "0.7062699", "0.7003931", "0.6997655", "0.69948727", "0.6988913", "0.698375...
0.0
-1
Saving information in db
public function store(Request $request, MailerRepo $mailerService) { if(!$list = $mailerService->create($request->all())){ return response('При создании страницы возникли ошибки', 500); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'author_id' => $this->author_id,\n 'clothingname' => $this->clothingname,\n 'clothingtype' => $this->clothingtype,\n 'tempmin' => $this->temp...
[ "0.79930234", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7909372", "0.7805213", "0.77904713", ...
0.0
-1
Delete information by id
public function destroy($id, MailerRepo $mailerService) { if(!($list = $mailerService->destroy($id))){ return response('Список не найден', 404); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public fu...
[ "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "0.8528575", "...
0.0
-1
Execute the console command.
public function fire() { $action = $this->argument('action'); $key = $this->argument('key'); $index = $this->option('index'); $start = $this->option('start'); $end = $this->option('end'); $value = $this->option('value'); $increment = $this->option('increment'); $serialize = $this->option('serialize') ?: false; $unserialize = $this->option('unserialize') ?: false; $isAction = function ($actions) use ($action) { $actions = func_get_args(); return (in_array($action, $actions)); }; $results = null; if ($isAction('get', 'pluck', 'exists')) { $results = $this->keystone->$action($key, $index); } if ($isAction('type', 'first', 'last', 'shift', 'pop')) { $results = $this->keystone->$action($key); } if ($isAction('range')) { $results = $this->keystone->$action($key, $start, $end); } if ($isAction('put', 'add')) { if (isset($index)) { // Trying to put only a hash key, same as push $this->keystone->push($key, [$index => $value]); } else { // Pushing an entire value if (substr($value, 0, 2) == "<?") { $value = substr($value, 2); $value = eval("return $value;"); } $this->keystone->$action($key, $value, $serialize); } $results = $this->keystone->get($key); } if ($isAction('push')) { if (isset($index)) { // Pushing an new key/value into a hash $this->keystone->$action($key, [$index => $value]); $results = $this->keystone->get($key); } else { // Pushing a value onto a list (this won't append to strings) $this->keystone->$action($key, [$value]); $this->info("Pushed $value to $key"); } } if ($isAction('increment')) { $this->keystone->$action($key, $increment); $results = $this->keystone->get($key); } if ($isAction('forget')) { if (isset($key)) { if ($this->keystone->exists($key)) { $this->keystone->forget($key, $index); if (isset($index)) { $results = $this->keystone->get($key); $this->info("Removed $index from $key"); } else { $this->info("Deleted $key"); } } else { $this->info("Key Not Found $key"); } } else { // Delete from stdin, for piping // ex: keystone keys dynatron/metric::* | keystone forget while ($key = trim(fgets(STDIN))) { if ($this->keystone->exists($key)) { $this->keystone->forget($key); $this->info("Deleted $key"); } else { $this->info("Key Not Found $key"); } } } } if ($isAction('keys')) { $results = $this->keystone->$action($key); foreach ($results as $result) { // Plain text echo, no colors for piping echo $result."\n"; } $results = null; } if ($isAction('values', 'where')) { $results = $this->keystone->$action($key, $index, $value); } if ($isAction('namespaces')) { $results = $this->keystone->namespaces(); } // Output results if (isset($results)) { if ($this->isSerialized($results) && $unserialize) { // Data is serialized and we requested to unserialize dump($this->unserialize($results)); } elseif ($unserialize) { // Data was not serialized, but unserialize was requested. // If data is array, loop array and attemp to unserialize each key if (is_array($results)) { $newResults = []; foreach ($results as $key => $value) { $newResults[$key] = $this->unserialize($value); } dump($newResults); } else { // Was not an array, can't unserialize, just print $this->info($results); } } else { // Not serialized, and not requested to unserialize if (is_string($results)) { $this->info($results); } else { dump($results); } } } }
{ "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.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.614841...
0.0
-1
Unserialize data only if serialized
private function unserialize($value) { $data = @unserialize($value); if ($value === 'b:0;' || $data !== false) { // Unserialization passed, return unserialized data return $data; } else { // Data was not serialized, return raw data return $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function unSerializeData();", "#[\\ReturnTypeWillChange]\n public function __unserialize($data)\n {\n }", "function maybe_unserialize($data)\n {\n }", "public function unserialize($data) {}", "#[\\ReturnTypeWillChange]\n public function unserialize($data...
[ "0.83863485", "0.7991397", "0.7956306", "0.7507648", "0.7331182", "0.7087662", "0.6974963", "0.6907907", "0.685702", "0.6849524", "0.6812769", "0.6785934", "0.6775981", "0.6771382", "0.6709784", "0.67068046", "0.67002845", "0.6644394", "0.6591143", "0.65483737", "0.65483737",...
0.6077919
37
Check if data is serialized
private function isSerialized($value) { $data = @unserialize($value); if ($value === 'b:0;' || $data !== false) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isSerialized($data) {\n return (@unserialize($data) !== false);\n }", "function is_serialized_string($data)\n {\n }", "function is_serialized( $data ) {\n if ( !is_string( $data ) )\n return false;\n $data = trim( $data );\n if ( 'N;' == $d...
[ "0.8278237", "0.79831296", "0.7584531", "0.75694233", "0.7553779", "0.75530547", "0.7462606", "0.7457799", "0.7319665", "0.7280343", "0.7269413", "0.7127563", "0.69708014", "0.67302525", "0.6687354", "0.66627616", "0.6567839", "0.6550785", "0.6538204", "0.65301126", "0.650267...
0.69689167
13
Get the console command arguments.
protected function getArguments() { return array( array('action', InputArgument::REQUIRED, 'Keystone action (get, put, pluck, range...)'), array('key', InputArgument::OPTIONAL, 'Keystone key (namespace optional)'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArgs()\n {\n return $this->meta[Cli::ARGS] ?? [];\n }", "private function getArguments() {\n return array_slice($argv, 1);\n }", "public function getArgs() {\n return $this->commandArgs;\n }", "public function getCommandLineArguments()\n {\n retur...
[ "0.7929734", "0.79042095", "0.7831461", "0.7587314", "0.75166816", "0.70980483", "0.7015334", "0.7015334", "0.7015334", "0.7015334", "0.7015334", "0.7011597", "0.7011597", "0.6969377", "0.6941954", "0.6919662", "0.69183534", "0.6889421", "0.6861143", "0.68576336", "0.6853908"...
0.0
-1
Get the console command options.
protected function getOptions() { return array( array('index', null, InputOption::VALUE_OPTIONAL, 'Index of assoc or hash', null), array('start', null, InputOption::VALUE_OPTIONAL, 'Start of array range', 0), array('end', null, InputOption::VALUE_OPTIONAL, 'End of array range', -1), array('value', null, InputOption::VALUE_OPTIONAL, 'Value to put or where by', null), array('increment', null, InputOption::VALUE_OPTIONAL, 'Increment size', 1), array('serialize', null, InputOption::VALUE_NONE, 'Enable serialization on put requets'), array('unserialize', null, InputOption::VALUE_NONE, 'Unserialize result'), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getOptions() {\n return [\n ['env', null, InputOption::VALUE_OPTIONAL, 'The environment the command should run under.', null],\n ];\n }", "protected function getOptions()\n {\n return [\n ['command', null, InputOption::VALUE_OPTIONAL, 'The termi...
[ "0.7800682", "0.77591324", "0.751765", "0.7345173", "0.73404354", "0.7306238", "0.72790045", "0.7268271", "0.7237944", "0.71917665", "0.715652", "0.7155546", "0.7137", "0.71122515", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.71094...
0.0
-1
Register any authentication / authorization services.
public function boot(): void { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerServices()\n {\n $this->app->bind(SocialProvidersManager::class, SocialiteProvidersManager::class);\n\n $this->app->singleton(TwoFactor::class, function () {\n return new AuthyTwoFactor(new Client());\n });\n }", "private function registerServices(...
[ "0.72354007", "0.71589875", "0.7079502", "0.6915011", "0.68823606", "0.6849547", "0.68487203", "0.6807684", "0.6782182", "0.6766861", "0.66449594", "0.66097814", "0.66028416", "0.65698564", "0.6569168", "0.6555622", "0.6550605", "0.6517851", "0.6503696", "0.6492679", "0.64715...
0.0
-1
/ Depending on the PostgreSQL bytea_output configuration parameter, data may be encoded either in the "hex" or "escape" format, which may be recognized by the '\x' prefix.
public function parseValue(string $extRepr) { if (substr($extRepr, 0, 2) == '\\x') { return hex2bin(substr($extRepr, 2)); } else { return pg_unescape_bytea($extRepr); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function php_compat_pg_escape_bytea($data)\n{\n return str_replace(\n array(chr(92), chr(0), chr(39)),\n array('\\\\\\134', '\\\\\\000', '\\\\\\047'),\n $data);\n}", "function escByteA($binData) {\n\t\t/**\n\t\t* \\134 = 92 = backslash, \\000 = 00 = NULL, \\047 = 39 = Single Quote\n\t\...
[ "0.76556927", "0.6882429", "0.5864207", "0.56274456", "0.54919904", "0.54556006", "0.54482746", "0.5421804", "0.5417485", "0.54032284", "0.53092694", "0.52839684", "0.52824676", "0.52824676", "0.52824676", "0.52824676", "0.5258293", "0.5241531", "0.5238199", "0.52213067", "0....
0.0
-1
This function select all the users in the BD.
function get_All_Users() { try { include("model.php"); $sql = "SELECT nomJoueur, mdpJoueur FROM joueurs"; // Preparation de la requete $req = $pdo->prepare($sql); // execution de la requete $req->execute(); return $req->fetchAll(PDO::FETCH_OBJ); } catch (PDOException $e) { echo $e->getMessage(); die("<br /> Erreur dans la BDD "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectAllUser(){\n return $this->connect->getData(\"SELECT * FROM `tbl_register_user`\");\n }", "public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }", "public function selectAll(){\r\n $query = 'SELECT * FROM use...
[ "0.8290759", "0.81308943", "0.8105524", "0.81006145", "0.7964357", "0.79626465", "0.79510367", "0.7936831", "0.7922818", "0.7893146", "0.78811073", "0.78608334", "0.78590924", "0.78508765", "0.78123677", "0.7794148", "0.77921736", "0.7789722", "0.77786744", "0.77579117", "0.7...
0.75251746
37
This function seek in the BD if a name exist.
function get_not_userName($nomJoueur) { try { include("model.php"); $sql = "SELECT nomJoueur FROM joueurs WHERE nomJoueur = '$nomJoueur'"; // Preparation de la requete $req = $pdo->prepare($sql); // execution de la requete $req->execute(); $id = $req->fetch(); return $id[0]; // If only one data is return } catch (PDOException $e) { echo $e->getMessage(); die("<br /> Erreur dans la BDD "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exist($name, $db) {\n $resultSet = $db -> query(\"SELECT * from Pokedex WHERE name = '$name'\");\n $count = $resultSet->rowCount();\n return (!$count == 0);\n }", "public function is_existing($name) {\n $data = $this->get_names();\n\n foreach($data as $line){\n i...
[ "0.6840963", "0.65607345", "0.63920194", "0.6267259", "0.6245223", "0.6210305", "0.6144683", "0.60551125", "0.6046651", "0.60351205", "0.60201865", "0.6003058", "0.6003058", "0.5971136", "0.59492093", "0.59492093", "0.59145004", "0.5894571", "0.5894571", "0.5894571", "0.58886...
0.0
-1
This function seek in the BD if a password exist for a user name.
function get_not_userPassWord($nomJoueur, $motDePasse) { try { include("model.php"); $sql = "SELECT mdpJoueur FROM joueurs WHERE nomJoueur = '$nomJoueur' AND mdpJoueur = '$motDePasse'"; // Preparation de la requete $req = $pdo->prepare($sql); // execution de la requete $req->execute(); $id = $req->fetch(); return $id[0]; // If only one data to return } catch (PDOException $e) { echo $e->getMessage(); die("<br /> Erreur dans la BDD "); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUser($userName, $password){\n\t\n\tglobal $usersTable;\n\tglobal $db;\n\t$selectQuery=\"select password from $usersTable where userName = '\" . $userName . \"'\";\n\t$resultSet = mysqli_query($db, $selectQuery) or die(mysqli_error($db));\n\t$row = mysqli_fetch_assoc($resultSet);\n\t\n\tif($password =...
[ "0.73521686", "0.725659", "0.72081256", "0.7106622", "0.70412844", "0.7036506", "0.6964978", "0.6958193", "0.69576037", "0.69556", "0.6932257", "0.69253606", "0.69008696", "0.6892556", "0.6877676", "0.68324995", "0.6829286", "0.68254775", "0.68055534", "0.67981565", "0.679611...
0.0
-1
/ Helper to return the header of this page
public function getHeader($title = null) { return 'Vm2Mage - '.$this->__($title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_header() {\n $this->do_header();\n return $this->c_header;\n }", "public function getPageHeader()\n\t{\n\t\treturn $this->_pageHeader;\n\t}", "function get_header()\n\t{\n\t\treturn $this->header;\n\t}", "function get_header(){\n\t\tglobal $FANNIE_ROOT;\n\t\tob_start();\n\t\t$page_...
[ "0.8268982", "0.8170547", "0.81232756", "0.8051281", "0.8041833", "0.79532087", "0.7906315", "0.79019773", "0.78623784", "0.78461534", "0.7831519", "0.7778275", "0.7754698", "0.7724358", "0.7711097", "0.76586735", "0.76539236", "0.7609281", "0.76052064", "0.7597662", "0.75807...
0.0
-1
/ Helper to return the menu
public function getMenu() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function returnMenu() {\n }", "public function getMenu();", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function gene...
[ "0.86792254", "0.85568064", "0.80998826", "0.80998826", "0.80998826", "0.80998826", "0.80998826", "0.80998826", "0.79804134", "0.7918201", "0.7902923", "0.7902923", "0.7896651", "0.7855538", "0.7746947", "0.7690069", "0.763288", "0.75908524", "0.75657713", "0.75543475", "0.75...
0.7387634
30
/ Helper to add a check to this list
private function addResult($group, $check, $status = 0, $description = '') { $checks = $this->system_checks; $checks[$group][] = array( 'check' => $this->__($check), 'status' => $status, 'description' => $this->__($description), ); $this->system_checks = $checks; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addCheck(string $check): void\n {\n $this->checks[] = $check;\n }", "public function contains(self $item, $checkAgainstThis = true) {}", "public function makeCheck_In()\n {}", "public static function add_check( $name, $check ) {\n\n\t\tif ( ! preg_match( '#^[A-Za-z0-9-]+$#', $...
[ "0.66823465", "0.60192966", "0.5837272", "0.57955647", "0.573405", "0.57142764", "0.5643155", "0.55922496", "0.5584262", "0.55525064", "0.55189776", "0.5507246", "0.54952514", "0.5478058", "0.5409064", "0.53934973", "0.53793", "0.53669035", "0.53669035", "0.53669035", "0.5366...
0.48504543
73
/ Check the license key
public function getChecks() { $result = (version_compare(phpversion(), '5.2.8', '>=')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'PHP version', $result, "PHP version 5.2.8 or higher is needed. A latest PHP version is always recommended."); $current = ini_get('memory_limit'); $result = (version_compare($current, '255M', '>')) ? self::CHECK_OK : self::CHECK_WARNING; $this->addResult('system', 'PHP memory', $result, "The minimum requirement for Magento itself is 256Mb. Current memory: ".$current); $result = (function_exists('json_decode')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'JSON', $result, 'The JSON-extension for PHP is needed'); $result = (function_exists('curl_init')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'CURL', $result, 'The CURL-extension for PHP is needed'); $result = (function_exists('simplexml_load_string')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'SimpleXML', $result, 'The SimpleXML-extension for PHP is needed'); $result = (in_array('ssl', stream_get_transports())) ? self::CHECK_OK : self::CHECK_WARNING; $this->addResult('system', 'OpenSSL', $result, 'PHP support for OpenSSL is needed if you want to use HTTPS'); $result = (function_exists('iconv')) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'iconv', $result, 'The iconv-extension for PHP is needed'); $result = (ini_get('safe_mode')) ? self::CHECK_ERROR : self::CHECK_OK; $this->addResult('system', 'Safe Mode', $result, 'PHP Safe Mode is strongly outdated and not supported by either Joomla! or Magento'); $result = (ini_get('magic_quotes_gpc')) ? self::CHECK_ERROR : self::CHECK_OK; $this->addResult('system', 'Magic Quotes GPC', $result, 'Magic Quotes GPC is outdated and should be disabled'); $remote_domain = 'api.yireo.com'; $result = (@fsockopen($remote_domain, 80, $errno, $errmsg, 5)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Firewall', $result, 'Firewall needs to allow outgoing access on port 80.'); $logfile = Mage::helper('vm2mage')->getDebugLog(); $result = (@is_writable($logfile)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Logfile', $result, 'Logfile "'.$logfile.'" should be writable'); $import_dir = Mage::getBaseDir('media').DS.'import'; if(!is_dir($import_dir)) @mkdir($import_dir); $result = (@is_writable($import_dir)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Import folder', $result, 'Import-folder "'.$import_dir.'" should be writable'); $catalog_dir = Mage::getBaseDir('media').DS.'catalog'; if(!is_dir($catalog_dir)) @mkdir($catalog_dir); $result = (@is_writable($catalog_dir)) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'Catalog folder', $result, 'Catalog-folder "'.$catalog_dir.'" should be writable'); $collection = Mage::getResourceModel('api/user_collection'); $result = ($collection->count() > 0) ? self::CHECK_OK : self::CHECK_ERROR; $this->addResult('system', 'API-user', $result, 'You should create an API-user with API resource-access'); return $this->system_checks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function askVerifyAndSaveLicenseKey()\n{\n if (empty($_POST['key']))\n {\n renderLicenseForm('Please enter a license key'); \n exit();\n } else {\n $license_key = preg_replace('/[^A-Za-z0-9-_]/', '', trim($_POST['key'])); \n }\n $checker = new Am_LicenseChecker($license_key, API...
[ "0.7806488", "0.7665851", "0.7619072", "0.74316496", "0.7363147", "0.7223081", "0.71550155", "0.7136895", "0.7031993", "0.6980417", "0.6964824", "0.6884779", "0.68461883", "0.68192184", "0.6797082", "0.6780947", "0.6767832", "0.66656244", "0.6638206", "0.6618068", "0.6565596"...
0.0
-1
Auto generated seed file
public function run() { \DB::table('cms_role')->delete(); \DB::table('cms_role')->insert(array ( 0 => array ( 'id' => 1, 'name' => '超级管理员', 'grade' => 1, 'ifDefault' => 1, ), 1 => array ( 'id' => 2, 'name' => '管理员', 'grade' => 2, 'ifDefault' => 1, ), 2 => array ( 'id' => 3, 'name' => '普通用户', 'grade' => 9, 'ifDefault' => 1, ), 3 => array ( 'id' => 7, 'name' => '测试', 'grade' => 3, 'ifDefault' => 0, ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machi...
[ "0.741271", "0.72163844", "0.71867263", "0.7150963", "0.7011614", "0.6992453", "0.6889081", "0.6877449", "0.68096465", "0.679051", "0.67819595", "0.6763185", "0.6725394", "0.67226577", "0.67199546", "0.67100257", "0.6709864", "0.67040205", "0.6703833", "0.66986066", "0.668487...
0.0
-1
variable for db credentials
function getFromDB($sql_query) { static $config; // check if database credentials is available if(!isset($config)) { $config = parse_ini_file(__DIR__ . '/../../private/config.ini'); } // check credentials is set if(empty($config)) { http_response_code(503); return NULL; } // connected with database $mysqli = mysqli_connect($config['db_host'], $config['db_user'], $config['db_pass'], $config['db_name'], 3306); $mysqli->set_charset('utf-8'); // check mySQL connection if ($mysqli->connect_errno) { http_response_code(503); return NULL; } // Check SQL query if (!($stmt = $mysqli->query($sql_query))) { return NULL; } // Check closing DB connection if (!$mysqli->close()) { http_response_code(503); return NULL; } // Check response is not empty if (empty($stmt)) { http_response_code(503); return NULL; } return $stmt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function credentials() {\n\t\t return array(PHPLM_DBHOST, PHPLM_DBUSER, PHPLM_DBPASS);\n\t\t}", "function getDbCredentials()\n{ \n return getSettings()['database'];\n}", "abstract public function credentials();", "function get_object_credentials() {\n\t\treturn array(\n\t\t\t'host' => $this->host,...
[ "0.7748187", "0.7596032", "0.71588916", "0.6906264", "0.67888165", "0.6601261", "0.6599854", "0.6533641", "0.6533467", "0.652549", "0.6501147", "0.6451688", "0.63013524", "0.629642", "0.6257948", "0.62371576", "0.6235841", "0.6215079", "0.6169965", "0.61547124", "0.61542743",...
0.0
-1
Run the database seeds.
public function run() { $rootCategories = json_decode( file_get_contents(database_path('data/rootCategories.json')), true ); // dd($rootCategories); // Category::insert($rootCategories['items']); foreach ($rootCategories['items'] as $item) { // dd($item); Category::create($item); } }
{ "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 controller instance.
public function __construct() { /*$this->middleware('auth'); $this->middleware('role:lender'); $this->middleware(CompleteBankAccount::class)->only('loan');*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82678324", "0.8173564", "0.78118384", "0.7706353", "0.76816905", "0.7659159", "0.74858105", "0.7406485", "0.7298472", "0.7253435", "0.7196091", "0.7174443", "0.7016074", "0.6989523", "0.69837826", "0.69728553", "0.69640046", "0.69357765", "0.6897687", "0.689282", "0.687757...
0.0
-1
key name > file handle
public function __construct() { $this->dbDir = XRef::getConfigValue("xref.data-dir"); XRef::createDirIfNotExist($this->dbDir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function file($key);", "function setFilename($key);", "public function key()\n {\n return $this->fileObject->key();\n }", "private function read($key){\r\n}", "public function getFileKey()\n {\n return isset($this->FileKey) ? $this->FileKey : null;\n }", "public function ...
[ "0.7484022", "0.6425851", "0.6149607", "0.6135508", "0.601857", "0.5945169", "0.5803151", "0.5705117", "0.5697515", "0.5697102", "0.5663136", "0.5661743", "0.56582373", "0.56432676", "0.56324184", "0.56083417", "0.5587841", "0.5555309", "0.55534756", "0.55534756", "0.55239314...
0.0
-1
die('aaa '.$dataIni.' a aa');
public function tableNota($dataIni, $dataFim, $idobra) { $obra = new clsObra(); $obra->preencheDados($idobra); $html = 'Período da busca: ' . $dataIni . ' à ' . $dataFim . ' - Obra: ' . $obra->getDescricao() . ' </br> </br> <table border = "3" cellspacing = "2" cellpadding = "2"> <tr height = "2"> <b><span style="font-size: 20px">Adição por Nota Fiscal</span></b> <th align = "center" class = "small" width = "600px">Descri&ccedil;&atilde;o</th> <th align = "center" class = "small" width = "150px">Quantidade</th> <th align = "center" class = "small" width = "150px">Data Entrada</th> </tr>'; $SQL = "SELECT mt.IDMATERIAL, mn.QUANTMATNOTA AS ESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ', un.SIGLAUNID) AS MATERIAL, nf.DATAENTRADA, mt.TIPOMATERIAL FROM notafiscal nf INNER JOIN compra cp ON nf.IDCOMPRA = cp.IDCOMPRA INNER JOIN obra ob ON cp.IDOBRA = ob.IDOBRA INNER JOIN material_nota mn ON nf.IDNOTA = mn.IDNOTA INNER JOIN item it ON mn.IDITEM = it.IDITEM INNER JOIN material mt ON it.IDMATERIAL = mt.IDMATERIAL INNER JOIN unidade un ON it.IDUNIDADE = un.IDUNIDADE WHERE 1=1 AND mn.QUANTMATNOTA > 0"; if ($idobra != '0') { $SQL.=" AND ob.IDOBRA =" . $idobra . " "; } if ($dataIni != null && $dataFim != null) { $SQL.=" AND STR_TO_DATE(nf.DATAENTRADA,'%d/%m/%Y') BETWEEN STR_TO_DATE('" . $dataIni . "','%d/%m/%Y') AND STR_TO_DATE('" . $dataFim . "','%d/%m/%Y')"; } $SQL.=" ORDER BY STR_TO_DATE(nf.DATAENTRADA,'%d/%m/%Y'), mt.DESCMATERIAL "; $con = new gtiConexao(); $con->gtiConecta(); $tbl = $con->gtiPreencheTabela($SQL); $con->gtiDesconecta(); //die($SQL); foreach ($tbl as $chave => $linha) { if ($linha['TIPOMATERIAL'] != "CONTA") { $html .= ' <tr height = "1"> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['MATERIAL']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['ESTOQUE']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['DATAENTRADA']) . ' </td> </tr>'; } } $html .= '</table>'; //die(print_r($arrayNota)); return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toDie($msg) {\n $data = array(\"error\" => $msg);\n print_result($data);\n die();\n}", "function toDie( $msg ) {\n global $content;\n //echo $msg;\n //include( '/data/project/xtools/public_html/common/footer.php' );\n //die();\n $content->assign( \"error\", $msg );\n assignContent()...
[ "0.61333644", "0.5939844", "0.58546686", "0.5767093", "0.5694066", "0.5684049", "0.56765395", "0.5672284", "0.56707007", "0.5586421", "0.5450101", "0.542132", "0.5420109", "0.53563964", "0.53261036", "0.53144586", "0.5298241", "0.52937573", "0.5280195", "0.52694637", "0.52650...
0.0
-1
DIE($idobra. ' dwdqw '.$idcentro);
public function RelatorioCentroCusto($idobra, $idcentro) { $obra = new clsObra(); $obra->preencheDados($idobra); $centroNome = ""; if ($idcentro > 0) { $centro = new clsCentroCusto(); $centro->RetornaCentroCusto($idcentro); $centroNome = " - Centro de Custo: " . $centro->getDescCentro(); } $html = '<table border = "3" cellspacing = "2" cellpadding = "2"> <tr height = "2"> </br> <b><span style="font-size: 20px">Retirada de Material</span></b> </br> <span align="center" style="font-size: 20px">Obra: ' . $obra->getDescricao() . $centroNome . '</span> <th align = "center" class = "small" width = "150px">Data Retirada</th> <th align = "center" class = "small" width = "600px">Material</th> <th align = "center" class = "small" width = "150px">Quantidade</th> </tr>'; $SQL = "SELECT re.QUANTRETIRADA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL FROM retirada_estoque re INNER JOIN material mt ON re.IDMATERIAL = mt.IDMATERIAL INNER JOIN unidade un ON re.IDUNIDADE = un.IDUNIDADE WHERE re.IDOBRA = " . $idobra . ""; //die($SQL); if ($idcentro > 0) { $SQL.=" AND re.IDCENTRO =" . $idcentro . " "; } $SQL.=" ORDER BY STR_TO_DATE(re.DATARETESTOQUE,'%d/%m/%Y'), mt.DESCMATERIAL "; $con = new gtiConexao(); $con->gtiConecta(); $tbl = $con->gtiPreencheTabela($SQL); $con->gtiDesconecta(); //die($SQL); foreach ($tbl as $chave => $linha) { $html .= ' <tr height = "1"> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['DATARETESTOQUE']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['MATERIAL']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . $linha['QUANTRETIRADA'] . ' </td> </tr>'; } $html .= '</table> '; $html .= '<table border = "3" cellspacing = "2" cellpadding = "2"> <tr height = "2"> </br> <b><span style="font-size: 20px">Retirada de Material - Soma Geral</span></b> <th align = "center" class = "small" width = "650px">Material</th> <th align = "center" class = "small" width = "250px">Quantidade</th> </tr>'; $SQL = "SELECT SUM(re.QUANTRETIRADA) SOMA, re.DATARETESTOQUE, CONCAT(mt.DESCMATERIAL, ' / ' , un.SIGLAUNID) MATERIAL FROM retirada_estoque re INNER JOIN material mt ON re.IDMATERIAL = mt.IDMATERIAL INNER JOIN unidade un ON re.IDUNIDADE = un.IDUNIDADE WHERE re.IDOBRA = " . $idobra . ""; //die($SQL); if ($idcentro > 0) { $SQL.=" AND re.IDCENTRO =" . $idcentro . " "; } $SQL.=" GROUP BY mt.DESCMATERIAL ORDER BY mt.DESCMATERIAL "; $con = new gtiConexao(); $con->gtiConecta(); $tbl = $con->gtiPreencheTabela($SQL); $con->gtiDesconecta(); //die($SQL); foreach ($tbl as $chave => $linha) { $html .= ' <tr height = "1"> <td align = "center" class = "small" width = "100px"> ' . htmlentities($linha['MATERIAL']) . ' </td> <td align = "center" class = "small" width = "100px"> ' . $linha['SOMA'] . ' </td> </tr>'; } $html .= '</table> '; //die(print_r($arrayNota)); return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fTraeAuxiliar($pTip, $pCod){\n global $db, $cla, $olEsq;\n $slDato= substr($olEsq->par_Clave,4,2);\n if ($slDato == \"CL\") { // el movimiento se asocia al Cliente\n $iAuxi = $cla->codProv;\n }\n else {\n $iAuxi = NZ(fDBValor($db, \"fistablassri\", \"tab_txtData3\", \"tab_codTab...
[ "0.60263354", "0.5740359", "0.56125563", "0.5595033", "0.5550792", "0.5546501", "0.5527708", "0.55199057", "0.5504964", "0.5492563", "0.548664", "0.54574996", "0.54550743", "0.5449072", "0.5439263", "0.54296976", "0.5426049", "0.54183483", "0.5414306", "0.5402282", "0.5397226...
0.0
-1
Test all primary routes These are routes that do not redirect or are not legacy These are all anonymouse pages so no authentication is needed
public function testPrimaryRoutes() { /* //Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // Test base route // Should show post id 1 $response = $this->call('GET', '/'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(1, $post->id); $this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid); // Test /home is post 1 $clicksBefore = Router::where('slug', '=', 'home')->first()->clicks; $response = $this->call('GET', '/home'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(1, $post->id); $this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid); $clicksAfter = Router::where('slug', '=', 'home')->first()->clicks; $this->assertEquals(++$clicksBefore, $clicksAfter); // Test /about is post 2 $response = $this->call('GET', '/about'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(2, $post->id); $this->assertEquals('f1112648-782e-aad3-785d-640fcfefaa9b', $post->uuid); // ##### Login as mReschke ##### Auth::login(User::find(2)); Auth::user()->login(); // Test /13/mreschke-home-page (non named route) $response = $this->call('GET', '/13/mreschke-home-page'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(13, $post->id); $this->assertEquals('1a52e0e3-3174-7b2b-a582-03a39e52e34a', $post->uuid); // Test /14/squaethem-home-page (non named route) $response = $this->call('GET', '/14/squaethem-home-page'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(14, $post->id); $this->assertEquals('e80e907e-50d4-8ed4-70f7-5d1815672966', $post->uuid); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOtherRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// /google redirects to http://google.com\n\t\t$clicksBefore = Router::where('slug', '=', 'google')->fir...
[ "0.7635416", "0.75495064", "0.72012395", "0.7131753", "0.679797", "0.64963436", "0.64317816", "0.6409451", "0.6356825", "0.63330024", "0.6329054", "0.6320729", "0.62511474", "0.62154156", "0.6175246", "0.61190987", "0.6111697", "0.6094165", "0.60707617", "0.60170734", "0.6000...
0.7303038
2
Test all secondary routes These are the routes that redirect to the primarys Like /guid, or /post/1 or even /1 if static route enabled
public function testSecondaryRoutes() { /*//Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // Test /1 redirects to /home $this->call('GET', '/1'); $this->assertRedirectedTo('/home'); // Test /1/anything/here redirects to /home $this->call('GET', '/1/anything/here'); $this->assertRedirectedTo('/home'); // Test /1 redirects to /home $this->call('GET', '/post/1'); $this->assertRedirectedTo('/home'); // Test /9d3e171a-62a9-e958-bdfa-d6f224ca8cad redirects to /home $this->call('GET', '/9d3e171a-62a9-e958-bdfa-d6f224ca8cad'); $this->assertRedirectedTo('/home'); // Test /home2 is post 1 (this is an optional route to post 1) // /home2 displays post 1, it does not redirect to /home $clicksBefore = Router::where('slug', '=', 'home2')->first()->clicks; $response = $this->call('GET', '/home2'); $post = $response->original['post']; $this->assertResponseOk(); $this->assertViewHas('post'); $this->assertEquals(1, $post->id); $this->assertEquals('9d3e171a-62a9-e958-bdfa-d6f224ca8cad', $post->uuid); $clicksAfter = Router::where('slug', '=', 'home2')->first()->clicks; $this->assertEquals(++$clicksBefore, $clicksAfter); // Test /home3 which is a disabled route $this->call('GET', '/home3'); $this->assertResponseStatus(404); // ##### Login as mReschke ##### Auth::login(User::find(2)); Auth::user()->login(); // Test /13/blah redirects to /13/mreschke-home-page $this->call('GET', '/13/blah'); $this->assertRedirectedTo('/13/mreschke-home-page'); // Test /13 and /13/ redirects to /13/mreschke-home-page $this->call('GET', '/13'); $this->assertRedirectedTo('/13/mreschke-home-page'); $this->call('GET', '/13/'); $this->assertRedirectedTo('/13/mreschke-home-page'); // Test /13 redirects to /13/mreschke-home-page $this->call('GET', '/post/13'); $this->assertRedirectedTo('/13/mreschke-home-page'); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOtherRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// /google redirects to http://google.com\n\t\t$clicksBefore = Router::where('slug', '=', 'google')->fir...
[ "0.7204182", "0.6919818", "0.6698115", "0.6589368", "0.6526395", "0.63424766", "0.6289119", "0.618975", "0.6177964", "0.6166853", "0.6137895", "0.6047036", "0.6030814", "0.5938619", "0.59225214", "0.5891399", "0.586563", "0.58331573", "0.58331037", "0.58169955", "0.5803621", ...
0.7643486
0
Test all legacy routes These are old mrcore4 routes like /topic/1 or /files/1
public function testLegacyRoutes() { /*//Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // Test /topic/1 redirects to /home $this->call('GET', '/topic/1'); $this->assertRedirectedTo('/home'); $this->call('GET', '/topic/1/doesnt/matter'); $this->assertRedirectedTo('/home'); // ?? files/1 does not currently redirect // not sure if it should or not yet */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testOtherRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// /google redirects to http://google.com\n\t\t$clicksBefore = Router::where('slug', '=', 'google')->fir...
[ "0.68819845", "0.6517291", "0.6515215", "0.64230275", "0.63861775", "0.637783", "0.6365655", "0.6297713", "0.6234368", "0.6229927", "0.6049419", "0.6035521", "0.6035405", "0.59113884", "0.5872114", "0.5870536", "0.5868843", "0.5864645", "0.5854764", "0.58521515", "0.5803533",...
0.818495
0
Test all other routes
public function testOtherRoutes() { /*//Filters disabled during unit tests unless you enable them //I need them enabled because they log the user in as anonymous Route::enableFilters(); // /google redirects to http://google.com $clicksBefore = Router::where('slug', '=', 'google')->first()->clicks; $this->call('GET', '/google'); $this->assertRedirectedTo('http://google.com'); $clicksAfter = Router::where('slug', '=', 'google')->first()->clicks; $this->assertEquals(++$clicksBefore, $clicksAfter); // /google2 is a disabled route $this->call('GET', '/google2'); $this->assertResponseStatus(404); $this->call('GET', '/99/invalid'); $this->assertResponseStatus(404); $this->call('GET', '/this/is/invalid'); $this->assertResponseStatus(404); // Test search route // ?? // Test net route // ?? // Test login route $this->call('GET', '/login'); $this->assertResponseOk(); // Test logout route redirects to / $this->call('GET', '/logout'); $this->assertRedirectedTo('/'); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSecondaryRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /1 redirects to /home\n\t\t$this->call('GET', '/1');\n\t\t$this->assertRedirectedTo('/home')...
[ "0.79910094", "0.7811927", "0.75201195", "0.732454", "0.7244227", "0.71635914", "0.714568", "0.71409196", "0.71266437", "0.711719", "0.7026858", "0.7017001", "0.68593204", "0.6837021", "0.6762935", "0.66284937", "0.659048", "0.65550375", "0.65054977", "0.64900243", "0.6480425...
0.86215246
0
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8399528", "0.83755803", "0.83755803", "0.8342532", "0.8252005", "0.8246491", "0.82114965", "0.81451535", "0.81095713", "0.80819905", "0.799094", "0.79885143", "0.79823685", "0.7959513", "0.7950321", "0.7947592", "0.7925319", "0.7914417", "0.7899287", "0.7892423", "0.788904...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ "title" => "required|string", "description" => "required|string", "feature_image" => "required|image", "tags" => "required|array", "tags.*" => "required|numeric|exists:tags,id", "categories" => "required|array", "categories.*" => "required|numeric|exists:categories,id", ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
Returns a piece of html code that can be used to represent this attribute in an HTML form.
function edit($record="", $fieldprefix="") { global $config_atkroot; $theme = &atkTheme::getInstance(); $page = &atkPage::getInstance(); $page->register_script($config_atkroot."atk/javascript/newwindow.js"); $page->register_script($config_atkroot."atk/javascript/class.atktoolbar.js"); $res = '<a href="javascript:modifySelection(\'<b>\',\'</b>\');"><img src="'.$theme->iconPath("bold","toolbar").'" border="0" alt="Vet"></a> '; $res .= '<a href="javascript:modifySelection(\'<i>\',\'</i>\');"><img src="'.$theme->iconPath("italic","toolbar").'" border="0" alt="Schuin"></a> '; $res .= '<a href="javascript:modifySelection(\'<u>\',\'</u>\');"><img src="'.$theme->iconPath("underline","toolbar").'" border="0" alt="Onderstreept"></a>'; // TODO/FIXME:This is platform specific code and should not be here // I think is still needed for older platform version (M1, M2) $res .= '&nbsp;<img src="'.$theme->iconPath("delimiter","toolbar").'" border="0">&nbsp;'; $res .= '<a href="javascript:popupSelection(\'pagesel.php\',\'pagesel\');" onmouseover="selectie=document.selection.createRange();"><img src="'.$theme->iconPath("link","toolbar").'" border="0" alt="Link"></a>'; return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHtml()\n {\n $attributes = $this->getAttributes();\n $attributes['value'] = htmlspecialchars($this->getValue());\n $attributes['type'] = 'hidden';\n $attributesStr = $this->_buildAttributeStr($attributes);\n\n $html = '<input ' . $attributesStr . ' />';\n ...
[ "0.768959", "0.75875455", "0.7459536", "0.7262452", "0.7262452", "0.72188574", "0.71481836", "0.70739156", "0.7048384", "0.70387965", "0.70116943", "0.70078874", "0.6993859", "0.6989263", "0.6961465", "0.69199276", "0.6918598", "0.6843283", "0.6837678", "0.6827859", "0.679207...
0.0
-1
Returns the requested restore point for restoring an objects previous state.
public function getRestorePoint($id) { return $this->find('first', array( 'conditions' => array( 'RestorePoint.id' => $id ), 'fields' => array( 'RestorePoint.id', 'RestorePoint.model', 'RestorePoint.entity_id', 'RestorePoint.json_object' ), 'contain' => array() )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getPreviousPartitionStep()\n\t{\n\t\t// Fetch the partition steps and wanted partitioning of the last saved action\n\t\t$undoStep = array_pop($this->undoArray);\n\n\t\t// If it is NULL, there are no undo steps\n\t\tif (is_null($undoStep))\n\t\t\treturn(NULL);\n\n\t\t// If the current partition ste...
[ "0.64847505", "0.6366852", "0.62068486", "0.61878693", "0.6185421", "0.5793385", "0.5787758", "0.568686", "0.5645128", "0.5561892", "0.55159336", "0.5510167", "0.55079216", "0.55077875", "0.5480652", "0.5460727", "0.54588354", "0.54580903", "0.54289234", "0.54289234", "0.5422...
0.5014429
78
Display a listing of the resource.
public function index() { // return response("2"); }
{ "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.7446377", "0.7361922", "0.72984487", "0.7248631", "0.7162871", "0.7148215", "0.7131838", "0.71028054", "0.7102395", "0.70988023", "0.7048243", "0.6993516", "0.6989079", "0.69341344", "0.69001913", "0.6899167", "0.68920904", "0.6887188", "0.68661547", "0.6849159", "0.683002...
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) { // return $request; //return response("sucsssadsadasdcess"); // $dt = Carbon::now(); //$data = array('balance' => 52525 ); // $data['time'] = '2020-10-02'; $mytime = \Carbon\Carbon::now(+2); $time = $mytime->toDateTimeString(); $bus = Bus::where('DeviceNumber', $request->id)->first(); $bus_id =$bus->id; $lastBalance = Balance::where('bus_id',$bus_id)->latest()->first();; // dd($lastBalance->secretNum); //if($request['id'] == "V155"){ ///device id $data = $request->balance ; $dataAr =explode(',',$data); // dd($dataAr[1]); if($lastBalance->secretNum == $dataAr[1] ){ if($lastBalance->amount == $dataAr[0]){ return response("success"); } else{ $form_data = array( 'secretNum' => $dataAr[1], 'bus_id' => $bus_id, 'amount' => $dataAr[0] ); $lastBalance->update($form_data); return response("success"); } } else{ if($dataAr[0] == 0) { return response("success"); } else { $form_data = array( 'secretNum' => $dataAr[1], 'bus_id' => $bus_id, 'amount' => $dataAr[0] ); Balance::create($form_data); return response("success"); } } //toast(__('Odeme Added Successfully'), 'success'); /* return array( 'b' => 41, //max number is 9999 'a' => 16 , 'l' => 60 , 'e' => "2021-11-09 54:72:47" ); */ return $request; // } /* else if($request['id'] == "6344F814"){ ///card id return array( 'b' => 270, //max number is 9999 'e' => "2021-01-18 33:36:52" ); } else{ return response("error"); } */ // dd($request); // $request['name'] = "post"; //return "ATCSQ"; return response("success"); return $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { return response("2"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $id=8; $data = "AT"; // return "AAA"; // return $id; return response("edit"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.7855416", "0.769519", "0.72748375", "0.724256", "0.7173659", "0.7064689", "0.70549816", "0.6985127", "0.6949479", "0.69474626", "0.694228", "0.6929372", "0.6903047", "0.6899655", "0.6899655", "0.688039", "0.68649715", "0.68618995", "0.68586665", "0.68477386", "0.68366665",...
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
Create a new CompanyIndex instance.
public function __construct(array $response) { $this->recent = new CompanyCollection($response['recent']); $this->featured = new CompanyCollection($response['featured']); $this->featuredCovered = new CompanyCollection($response['featured_cover']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createIndex(): void;", "protected function createIndex(): IndexInterface {\n return Index::create([\n 'name' => $this->getRandomGenerator()->string(),\n 'id' => $this->getRandomGenerator()->name(),\n 'status' => 1,\n 'datasource_settings' => [\n 'entity:entity_test' ...
[ "0.6576632", "0.6568153", "0.6346636", "0.6346636", "0.6239895", "0.6239895", "0.6052615", "0.59345174", "0.59209967", "0.59182644", "0.58549917", "0.5755459", "0.57452416", "0.5714463", "0.57019055", "0.5698787", "0.5695306", "0.56741893", "0.56741893", "0.56726176", "0.5666...
0.0
-1
Get the last 4 companies created.
public function getRecent(): CompanyCollection { return $this->recent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findLastRegistered()\n {\n $qb = $this->createQueryBuilder('u')\n ->select('u')\n ->orderBy('u.createdAt', 'DESC')\n ->setMaxResults(4);\n\n return $qb->getQuery()->getResult();\n }", "public function getlatestCompanies()\n {\n $AdminDashbo...
[ "0.65214723", "0.6336903", "0.5817458", "0.56683236", "0.5655572", "0.56279004", "0.55829984", "0.55439615", "0.55360633", "0.54879475", "0.54395276", "0.54077363", "0.54054815", "0.5404265", "0.53994584", "0.5391355", "0.53852004", "0.5341393", "0.5310871", "0.53099066", "0....
0.6167649
2
Get the featured companies on the VTC page.
public function getFeatured(): CompanyCollection { return $this->featured; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFeaturedCovered(): CompanyCollection\n {\n return $this->featuredCovered;\n }", "public function getfeaturedCities(){\n\t\t $featuredTestimonial = array();\n\t\t $tData = $this->find('all',array('conditions'=>array('CmsCity.is_display'=>1),\n\t\t\t\t\t\t\t\t\t\t\t'fields'=>arr...
[ "0.66041654", "0.62949586", "0.5998069", "0.5930802", "0.5925925", "0.5887295", "0.5881822", "0.57872397", "0.5750885", "0.5621846", "0.562016", "0.5538192", "0.55300665", "0.55181867", "0.5509221", "0.54950464", "0.5485105", "0.5473954", "0.5455649", "0.544388", "0.5436083",...
0.73709166
0
Get the companies with featured cover images on the VTC page.
public function getFeaturedCovered(): CompanyCollection { return $this->featuredCovered; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFeatured(): CompanyCollection\n {\n return $this->featured;\n }", "public function getfeaturedCities(){\n\t\t $featuredTestimonial = array();\n\t\t $tData = $this->find('all',array('conditions'=>array('CmsCity.is_display'=>1),\n\t\t\t\t\t\t\t\t\t\t\t'fields'=>array('CmsCity.*'...
[ "0.6695556", "0.6511657", "0.5851061", "0.584675", "0.58007216", "0.5646993", "0.5573313", "0.54981416", "0.5433945", "0.5427657", "0.5417266", "0.53894633", "0.5386941", "0.5381477", "0.53778076", "0.5364768", "0.5359612", "0.53527004", "0.5304717", "0.527311", "0.5241324", ...
0.7157424
0
Parse a given string and returns a DOMNode tree. This method must throw a ParsingFailedException if parsing failed in order for the sanitizer to catch it and return an empty string.
public function parse($html);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function parse()\n {\n $parserResolver = new ParserResolver();\n $parserResolver->setXMLElement(new \\SimpleXMLElement($this->xmlString));\n \n $parser = $parserResolver->getParser();\n \n return $parser->parse();\n }", "public static function fromString($st...
[ "0.57187355", "0.54517233", "0.5328172", "0.53069144", "0.53008246", "0.5285999", "0.5256355", "0.52395767", "0.52389276", "0.52389276", "0.52331984", "0.5211894", "0.5162238", "0.5115577", "0.5109923", "0.5071678", "0.5058049", "0.50428796", "0.50325835", "0.501811", "0.5012...
0.0
-1
Run the database seeds.
public function run() { DB::table('users')->delete(); User::create([ 'id'=> '1', 'content'=> '曲项向天歌,白毛浮绿水,红掌拨清波', 'is_top'=> '0', 'times'=>'1', ],[ 'id'=> '2', 'content'=> '春眠不觉晓,处处闻啼鸟', 'is_top'=> '0', 'times'=>'2', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8399528", "0.83755803", "0.83755803", "0.8342532", "0.8252005", "0.8246491", "0.82114965", "0.81451535", "0.81095713", "0.80819905", "0.799094", "0.79885143", "0.79823685", "0.7959513", "0.7950321", "0.7947592", "0.7925319", "0.7914417", "0.7899287", "0.7892423", "0.788904...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'title' => 'required|min:4|max:300', 'campana' => 'required', 'fecha' => 'required', 'color' => 'required', 'time' => 'required', 'colortitulos' => 'required', 'colorcontenido' => 'required', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
Run the database seeds.
public function run() { //Se ingresan los primeras profesiones. DB::table('professions')->insert([ 'title'=>'Desarrollador - BackEnd', ]); DB::table('professions')->insert([ 'title'=>'Desarrollador - FrontEnd', ]); DB::table('professions')->insert([ 'title'=>'Desarrollador - DiseñadorWEB', ]); }
{ "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
TODO A voir ?
public function upload(RegistryInterface $doctrine) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "public function AggiornaPrezzi(){\n\t}", "private function _i() {\n }", "public function serch()\n {\n }", "abstract public function getPasiekimai();", "public function boleta()\n\t{\n\t\t//\n\t}", "public function masodik()\n {\n }", "public fun...
[ "0.5916912", "0.59140253", "0.57476854", "0.5641819", "0.5637305", "0.56211185", "0.55811477", "0.5572063", "0.55565256", "0.5538672", "0.55300677", "0.5506529", "0.5502241", "0.5498927", "0.548769", "0.5486198", "0.5478459", "0.5467363", "0.54562503", "0.5419758", "0.5419758...
0.0
-1
Seed the application's database.
public function run() { // $this->call(UsersTableSeeder::class); for ($i = 0; $i < 5; $i++) { $user = factory(User::class)->create(); factory(Event::class, rand(1, 10))->create(['user_id' => $user->id])->each(function ($event) use ($user) { factory(Comment::class, rand(1, 5))->make()->each(function ($comment) use ($user, $event) { $comment->user_id = $user->id; $comment->event_id = $event->id; $event->comments()->save($comment); }); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=...
[ "0.8065584", "0.7848217", "0.76748335", "0.7244791", "0.7217673", "0.7133266", "0.70984626", "0.70752525", "0.7050456", "0.69926506", "0.6988436", "0.6985116", "0.69669306", "0.68992233", "0.68682885", "0.6847507", "0.6831097", "0.68208444", "0.68041754", "0.68041754", "0.680...
0.0
-1
Adds as addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function addToAddItemResponseContainer(\Nogrod\eBaySDK\Trading\AddItemResponseContainerType $addItemResponseContainer) { $this->addItemResponseContainer[] = $addItemResponseContainer; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "public function getAddItemResponseContainer()\n {\n return $this->addItemResponseContainer;\n }", "public funct...
[ "0.6491763", "0.5744059", "0.56799394", "0.5520069", "0.54321295", "0.5125817", "0.5084614", "0.50629765", "0.49899265", "0.4961322", "0.4931706", "0.4908887", "0.48641074", "0.48608473", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.48409438", "0.4...
0.6877524
0
isset addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function issetAddItemResponseContainer($index) { return isset($this->addItemResponseContainer[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContain...
[ "0.60423565", "0.5940875", "0.5757014", "0.5498631", "0.54922956", "0.51727355", "0.50700945", "0.49999502", "0.49951154", "0.49199077", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", "0.49019995", ...
0.46338952
41
unset addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function unsetAddItemResponseContainer($index) { unset($this->addItemResponseContainer[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAddItemResponseContainer(array $addItemResponseContainer)\n {\n $this->addItemResponseContainer = $addItemResponseContainer;\n return $this;\n }", "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContain...
[ "0.62544614", "0.59904194", "0.5827661", "0.535107", "0.52057153", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", "0.51675636", ...
0.50198215
27
Gets as addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function getAddItemResponseContainer() { return $this->addItemResponseContainer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContainer)\n {\n $this->addItemResponseContainer[] = $addItemResponseContainer;\n return $this;\n }", "public function setAddItemResponseContainer(array $addItemResponseConta...
[ "0.5959775", "0.59046954", "0.5823438", "0.57163686", "0.5458576", "0.53723586", "0.5043326", "0.4992391", "0.49779144", "0.48841476", "0.47663286", "0.47312123", "0.47287688", "0.47039816", "0.4698875", "0.46446443", "0.46417227", "0.46344358", "0.46032843", "0.45956284", "0...
0.6049604
0
Sets a new addItemResponseContainer One AddItemResponseContainer container is returned for each listing that was created with the AddItems call. Each container includes the ItemID of each newly created listings, the eBay category each item is listed under, the sellerdefined SKUs of the items (if any), the listing recommendations for each item (if applicable), the start and end time of each listing, and the estimated fees that each listing will incur.
public function setAddItemResponseContainer(array $addItemResponseContainer) { $this->addItemResponseContainer = $addItemResponseContainer; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addToAddItemResponseContainer(\\Nogrod\\eBaySDK\\Trading\\AddItemResponseContainerType $addItemResponseContainer)\n {\n $this->addItemResponseContainer[] = $addItemResponseContainer;\n return $this;\n }", "public function getAddItemResponseContainer()\n {\n return $t...
[ "0.7072615", "0.5942786", "0.54337716", "0.5295369", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", "0.5191135", ...
0.70213115
1
mt_settings_page() displays the page content for the Test Settings submenu
function mt_settings_page() { echo '<h2>' . __('Footer Settings Configurations') . '</h2>'; include_once 'footer_settings_page.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function settings_page() {\r\n\t\tadd_submenu_page( 'edit.php?post_type=news', __( 'Settings', 'news-manager' ), __( 'Settings', 'news-manager' ), 'manage_options', 'news-settings', array( $this, 'options_page' ) );\r\n\t}", "public function render_settings_page()\n {\n }", "public functio...
[ "0.7855251", "0.7832427", "0.7805795", "0.7789956", "0.7750117", "0.77395666", "0.7695139", "0.76718956", "0.76469487", "0.76038", "0.7589724", "0.75269854", "0.75242305", "0.7503729", "0.75036204", "0.75002176", "0.74980265", "0.7484816", "0.74529904", "0.7425605", "0.738488...
0.0
-1
Setup before running any test case
public static function setUpBeforeClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "...
[ "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "...
0.0
-1
Setup before running each test case
public function setUp() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "...
[ "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136364", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "0.8136321", "...
0.0
-1
Clean up after running each test case
public function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public fu...
[ "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7987785", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "0.7986567", "...
0.0
-1
Clean up after running all test cases
public static function tearDownAfterClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public fu...
[ "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.797683...
0.0
-1
responds to POST to /phones/create and creates, adds, stores the phone number
public function store(Request $request) { // properly takes into account whether user is changing their own info or another user's info $this->currentPerson = Person::find(auth()->user()->id); for ($i = 1; $i <= 5; $i++) { $adType = 'phoneType-'.$i; $addr1 = 'phoneNumber-'.$i; $type = request()->input($adType); $ad1 = request()->input($addr1); if (! empty($ad1)) { // check to see if this is the database already (someone else's phone) if ($inDB = Phone::where('phoneNumber', $ad1)->first()) { // check that the phone in the database actually belongs to the personID getting edited if ($inDB->personID == request()->input('personID')) { $inDB->updaterID = $this->currentPerson->personID; $inDB->save(); } else { // something if the personIDs do not match } } else { $newAddr = new Phone; $newAddr->personID = request()->input('personID'); $newAddr->phoneType = $type; $newAddr->phoneNumber = $ad1; $newAddr->creatorID = $this->currentPerson->personID; $newAddr->updaterID = $this->currentPerson->personID; $newAddr->save(); } } } if ($this->currentPerson->personID == request()->input('personID')) { return redirect('/profile/my'); } else { return redirect('/profile/'.request()->input('personID')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t{\n\t\t$user = $this->user->where('api_token', '=', $this->token)->first();\n\t\t$attr = Input::get('data');\n\t\t$rules = $this->phone->createRules;\n\n\t\t$validator = Validator::make($attr, $rules);\n\n\t\tif($validator->fails()){\n\t\t\t$errors = $validator->messages();\n\t\t\treturn...
[ "0.7541584", "0.73787135", "0.72263056", "0.71146005", "0.6986629", "0.6949744", "0.6864092", "0.679666", "0.67041075", "0.66784674", "0.6641394", "0.6570964", "0.65355873", "0.64588547", "0.64365685", "0.6387066", "0.6382849", "0.6372621", "0.6348331", "0.6319071", "0.631697...
0.572101
56
responds to POST /phone/id
public function update(Request $request, $id) { $email = Phone::find($id); $name = request()->input('name'); $value = request()->input('value'); $name = substr($name, 0, -1); $email->{$name} = $value; $email->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function savephone() {\n if (isset($_POST['phone'])) {\n $userId = $this->session->userdata('user_id');\n $phone = $this->input->post('phone');\n $result = $this->Users->savephone($phone, $userId);\n if ($result) {\n $this->output\n ...
[ "0.71637064", "0.6726316", "0.6352079", "0.6347137", "0.6222432", "0.62209785", "0.61059386", "0.60315907", "0.5983558", "0.59538597", "0.5950735", "0.5924474", "0.5875218", "0.58472884", "0.5846381", "0.5844666", "0.5832172", "0.5777336", "0.57573754", "0.57351893", "0.57133...
0.0
-1
responds to POST /phone/id/delete
public function destroy($id) { $personID = request()->input('personID'); $this->currentPerson = Person::find(auth()->user()->id); $phone = Phone::find($id); $phone->updaterID = $this->currentPerson->personID; $phone->save(); $phone->delete(); if (request()->input('personID') == $this->currentPerson->personID) { return redirect('/profile/my'); } else { return redirect('/profile/'.$personID); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Request $request, Phone $phone)\n {\n dd('here');\n $all = $request -> all();\n $id = $add['deleteId'];\n $data = new Formbuild();\n $data::where('id', $id)->update(array('phone' => ''));\n return 'Successfully Deleted!';\n }", "public funct...
[ "0.7349547", "0.7333479", "0.71504396", "0.6941135", "0.691386", "0.6870842", "0.68227524", "0.6714072", "0.6707353", "0.6688743", "0.6680144", "0.6636263", "0.6627223", "0.6591351", "0.6562789", "0.6550173", "0.65420365", "0.64737225", "0.6461968", "0.6454821", "0.64542466",...
0.6133787
45
zresetovanie id, aby zacinalo cislovanie od 1
function resetId(){ global $db; $query = "ALTER TABLE parameters auto_increment = 1"; $db->exec($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetId()\n {\n\n $this->id = null;\n\n }", "public static function reset()\n {\n self::$id = 0;\n }", "public function resetId(){\r\n\t\t$this->clientId = null;\r\n\t}", "public function resetIdInformazione($conn){\n\t\t$sth = $conn->prepare(\"set @num := 0\");\n\t\t$sth->e...
[ "0.8087279", "0.7703068", "0.72953516", "0.7042622", "0.69425", "0.6939763", "0.69217104", "0.69184357", "0.685537", "0.685537", "0.6783717", "0.6764147", "0.67019737", "0.6686583", "0.66456586", "0.6637565", "0.6626384", "0.65857273", "0.65784", "0.6573316", "0.6549753", "...
0.67118615
12
1 detalle muchos articulos
public function articulo(){ return $this->belongsTo('App\Models\Articulo'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afficheArticle ($infosArticles) {\n\n foreach ($infosArticles as $key => $articles ) {\n\n if ($key === 0 or $key === 3) {\n $positionArticle = \"left\";\n }\n\n if ($key === 1 or $key === 4) {\n $positionArticle = \"center\";\n }\n\n if ($key =...
[ "0.5988782", "0.5903291", "0.5830731", "0.5777779", "0.5772985", "0.57666725", "0.57552844", "0.56648", "0.5648377", "0.5643173", "0.5620033", "0.56093556", "0.5581485", "0.5579814", "0.5538583", "0.5518999", "0.5518848", "0.5505437", "0.5503941", "0.5466092", "0.5465621", ...
0.0
-1