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
return boolean as string 'true' / 'false'
function bool2str($bool) { if($bool ===false) return 'false'; else return 'true'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}", "public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function bool_to_string($value) {\n ...
[ "0.80348504", "0.80206877", "0.78751075", "0.7846424", "0.76890635", "0.7611359", "0.7559533", "0.7543506", "0.7523593", "0.75164706", "0.74617386", "0.7412224", "0.7410573", "0.7393141", "0.73901856", "0.7379897", "0.73708546", "0.7250726", "0.7164452", "0.71530366", "0.7104...
0.8142804
0
compare two objects. Arguments are passed byreference test: equals, not equal, equal identity, not equal identity
function compareObjects(&$ob1, &$ob2) { print_pre('o1 == o2 : ' . bool2str($ob1 == $ob2)); print_pre('o1 != o2 : ' . bool2str($ob1 != $ob2)); print_pre('o1 === o2 : ' . bool2str($ob1 === $ob2)); print_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equals($other);", "public function equals( $A, $B );", "public function equals($other) { return $this->obj==Sandbox::unwrap($other); }", "protected function compareObjects(object $a, object $b): int\n {\n // see https://github.com/php/php-src/issues/10513\n return strcmp(spl_object_...
[ "0.6673335", "0.65883684", "0.6582047", "0.6493526", "0.6361353", "0.6307741", "0.62992543", "0.6271147", "0.6259657", "0.62595", "0.62512934", "0.6212965", "0.62024915", "0.614383", "0.61387986", "0.60835725", "0.6081624", "0.60350287", "0.6030523", "0.60098636", "0.6003072"...
0.7712369
0
Private function used to create flash messages.
private function create($message, $type, $icon) { session()->flash('flash_message', [ 'type' => $type, 'message' => $message, 'icon' => $icon ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addFlashMessages() {}", "protected function renderFlashMessages() {}", "public function renderFlashMessages() {}", "public function prepareFlashMessages()\n {\n global $session;\n\n $messages = [];\n foreach ($session->getFlashBag()->all() as $msgType => $msg) {\n ...
[ "0.7982978", "0.7585968", "0.7531636", "0.7033895", "0.6959473", "0.6919559", "0.6755891", "0.67464936", "0.6726649", "0.6724016", "0.66906536", "0.6656272", "0.66116333", "0.6606081", "0.6582779", "0.65679413", "0.65459204", "0.6528431", "0.6479382", "0.6456712", "0.6441896"...
0.0
-1
Returns a rules checker object that will be used for validating application integrity.
public function buildRules(RulesChecker $rules) { $rules->add($rules->existsIn(['community_id'], 'Communities')); return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildRules(RulesChecker $rules): RulesChecker\n {\n return $rules;\n }", "private static function rules() : mixed\n {\n return AppContainer::get(Constants::validatorRules);\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::c...
[ "0.64002764", "0.6388235", "0.6269912", "0.62365985", "0.61949646", "0.60835993", "0.6026187", "0.6018978", "0.60069567", "0.59928614", "0.5965456", "0.59599984", "0.59508055", "0.59508055", "0.58873993", "0.58730704", "0.5868297", "0.58623487", "0.5858684", "0.58502865", "0....
0.0
-1
Determine whether the user can view any dictations.
public function viewAny(User $user) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function canView(): bool\n {\n return true;\n }", "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n ...
[ "0.7072534", "0.7014345", "0.6995714", "0.6938637", "0.6833039", "0.67313796", "0.6724647", "0.6687632", "0.6654833", "0.6518234", "0.6486282", "0.6467284", "0.64662343", "0.6464162", "0.64623916", "0.644497", "0.6425268", "0.6425268", "0.6425268", "0.6418657", "0.6400825", ...
0.0
-1
Determine whether the user can view the dictation.
public function view(User $user, Dictation $dictation) { return $user->id === $dictation->user_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function canView(): bool\n {\n return true;\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function isViewAllowed()\n {\n ...
[ "0.74905837", "0.7298032", "0.7290971", "0.72378844", "0.7138538", "0.70307034", "0.6966617", "0.6963488", "0.69623107", "0.69537485", "0.6918316", "0.69056845", "0.6903895", "0.6873843", "0.6839047", "0.68114954", "0.6795878", "0.67919475", "0.67753685", "0.6734841", "0.6711...
0.6753222
19
Determine whether the user can create dictations.
public function create(User $user) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canCreate();", "public function canCreate();", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "protected function canCreate() {}", "function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "pu...
[ "0.7158591", "0.7158591", "0.7004075", "0.69176805", "0.68762827", "0.6832613", "0.67593026", "0.6733605", "0.6602696", "0.65521336", "0.65363324", "0.6513328", "0.64837", "0.64715225", "0.6460786", "0.6424019", "0.6411944", "0.64056706", "0.63699055", "0.6365257", "0.6364605...
0.0
-1
Determine whether the user can update the dictation.
public function update(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }...
[ "0.78191936", "0.7513647", "0.7455891", "0.7445574", "0.73001844", "0.7274134", "0.72438014", "0.7217646", "0.7213381", "0.71922386", "0.7091518", "0.70465964", "0.7042569", "0.7037029", "0.70344555", "0.6999047", "0.6937136", "0.69240123", "0.685919", "0.6846411", "0.6843108...
0.0
-1
Determine whether the user can delete the dictation.
public function delete(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "function canDelete() {\n return true;\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function canDelete()\n {...
[ "0.79159534", "0.78139716", "0.76370144", "0.74723876", "0.74192196", "0.7407923", "0.73950195", "0.73861104", "0.7362543", "0.7338666", "0.7330357", "0.7299596", "0.72884685", "0.71308345", "0.70646924", "0.7033108", "0.6986036", "0.6975732", "0.69755286", "0.6970839", "0.69...
0.0
-1
Determine whether the user can restore the dictation.
public function restore(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'restore' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "protected function onRestored()\n {\n return true;\n }",...
[ "0.76101106", "0.68357676", "0.6747794", "0.6736294", "0.6730892", "0.6663075", "0.6510922", "0.63686544", "0.62280303", "0.61537766", "0.61485004", "0.60238856", "0.6009483", "0.59762996", "0.58748925", "0.58485657", "0.579583", "0.5768369", "0.5701781", "0.567785", "0.56678...
0.58742285
15
Determine whether the user can permanently delete the dictation.
public function forceDelete(User $user, Dictation $dictation) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "function canDelete() {\n return true;\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function canDelete()\n {...
[ "0.76287955", "0.74983025", "0.73779213", "0.71810025", "0.7165875", "0.716579", "0.7095819", "0.70777774", "0.7065983", "0.700559", "0.69961786", "0.6994746", "0.69793594", "0.68531954", "0.68305475", "0.68183374", "0.67991", "0.6768283", "0.67620677", "0.67223704", "0.67102...
0.0
-1
Add state to set
public function add(StateInterface $state) { $name = $state->getName(); $type = $state->getType(); $list = $type . 'States'; $this->{$list}[$name] = $state; $this->allStates[$name] = $state; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addState(StateInterface $state): void;", "public function addState(StateInterface $state);", "function pushState(): void\n {\n $this->stateStack[] = [$this->valid, $this->offset, $this->index, $this->current];\n }", "protected function putState($state)\n {\n if (isset($...
[ "0.64755154", "0.6398877", "0.58800834", "0.57094663", "0.562746", "0.56158966", "0.5545052", "0.54456574", "0.54235566", "0.53961194", "0.5389267", "0.53542286", "0.5325835", "0.5318576", "0.53116035", "0.5289421", "0.52742255", "0.52713084", "0.5242942", "0.5222725", "0.519...
0.54165334
9
Remove state from set
public function remove($name) { if (!$this->has($name)) { return false; } $type = $this->get($name)->getType(); unset($this->allStates[$name]); unset($this->{$type}[$name]); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function remove_set( $key ) {\n\t\tif ( self::$sets && isset( self::$sets[ $key ] ) ) {\n\t\t\tunset( self::$sets[ $key ] );\n\t\t}\n\t}", "abstract public function removeState(array $options);", "function clearState() ;", "protected static function clearState() {}", "public function clearSta...
[ "0.7005896", "0.6792375", "0.6364541", "0.63238066", "0.6317997", "0.6220964", "0.6127879", "0.6115104", "0.6075744", "0.60720927", "0.60720927", "0.5991516", "0.5933674", "0.59228086", "0.59151554", "0.5909184", "0.5900751", "0.5900751", "0.5900751", "0.5900751", "0.58921146...
0.5065838
99
Check initial states exists
public function hasInitial() { return !empty($this->initialStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isInitial();", "public function isInitialised();", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n ...
[ "0.6860986", "0.6655938", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", "0.65015686", ...
0.76447755
0
Check final states exists
public function hasFinal() { return !empty($this->finalStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasState(){\n return $this->_has(4);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n ...
[ "0.6827876", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "0.6805831", "...
0.7345255
0
Get all final states
public function getFinal() { return $this->hasFinal() ? array_values($this->finalStates) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStates() {\n return $this->state;\n }", "abstract public function states();", "public function getStates(): array\n {\n return $this->states;\n }", "public function getStates(): StateSet;", "public function getStates() {\n\t\treturn empty( $this->container['states'...
[ "0.67806", "0.6576226", "0.6572894", "0.65708417", "0.6479763", "0.6455002", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0.64391106", "0....
0.7338602
0
Check normal states exists
public function hasNormal() { return !empty($this->normalStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n return $this->_has(1);\n }", "public function hasState(){\n ...
[ "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "0.6515521", "...
0.69411725
0
Get all normal states
public function getNormal() { return $this->hasNormal() ? array_values($this->normalStates) : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStates(): array\n {\n return $this->states;\n }", "public function getStates() {\n return $this->state;\n }", "public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FUL...
[ "0.647964", "0.6424091", "0.63932616", "0.62895477", "0.6230935", "0.6228826", "0.62103736", "0.61879295", "0.6147332", "0.6135253", "0.61041045", "0.6073023", "0.605905", "0.5990167", "0.5959515", "0.59104687", "0.58974403", "0.5879883", "0.5875688", "0.58569294", "0.5841394...
0.70630133
0
Get state by name
public function get($name) { return $this->has($name) ? $this->allStates[$name] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStateByName($name) {\n\t\t// Build query, prep, and bind\n\t\t$sql = \"SELECT * FROM states WHERE name = :name \";\n\t\t$statement = $this->PDODB->prepare($sql);\n\t\t$statement->bindValue(\":name\", $name);\n\n\t\t// Execute the query\n\t\t$statement->execute();\n\n\t\t// Fetch object\n\t\t$sta...
[ "0.8233408", "0.80875856", "0.78540593", "0.7085229", "0.6869491", "0.6868137", "0.6864025", "0.67798454", "0.6711102", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", "0.6607135", ...
0.7701164
3
Count elements of an object
public function count() { return sizeof($this->allStates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function countObjects();", "public function count() {\r\n return count($this->objects);\r\n }", "public function count(): int {\n return count($this->toArray());\n }", "public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n...
[ "0.7844575", "0.7308457", "0.7274846", "0.72054976", "0.71488273", "0.70194924", "0.6937613", "0.6936243", "0.6926989", "0.6924251", "0.6924251", "0.6924251", "0.6924251", "0.69202334", "0.6894718", "0.68790454", "0.68629766", "0.683714", "0.6827706", "0.6827706", "0.6827706"...
0.0
-1
Run the database seeds.
public function run() { factory(Novus\Place::class)->create([ 'client_id' => '1', 'unit_number' => '1210', 'street_number' => '601', 'street_name' => 'LITTLE COLLINS', 'street_type_id' => '1', 'suburb' => 'MELBOURNE', 'state_id' => '6', 'postcode' => '3000', 'reference' => null, 'status' => true, 'verified' => true, 'latitude' => '-37.81787121', 'longitude' => '144.95484699', 'cleaner_id' => '1', 'no_jobs' => '2', 'created_at' => '2016-03-16 00:00:00', 'updated_at' => '2016-03-16 00:00:00', ]); factory(Novus\Place::class, 72)->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
New chilli settings for garden
private function walledGardenData() { $this->rowsUpdated += $this->DBF->setChilliConfigSingle('nousergardendata', true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function achilles_settings_init() {\n\t\n\t//create one option to store all of our values. \n register_setting( 'achilles-settings-group', 'achilles-settings' );\n add_settings_section( 'achilles-general-settings', 'General Settings', 'achilles_general_settings_callback', 'achilles' );\n add_settings_fiel...
[ "0.6567049", "0.6285446", "0.6172972", "0.61641395", "0.6163446", "0.6135065", "0.6126428", "0.6008154", "0.5960657", "0.59280443", "0.5913647", "0.589505", "0.58673805", "0.58556384", "0.584179", "0.58269554", "0.5792961", "0.579157", "0.5758998", "0.5751648", "0.5746197", ...
0.0
-1
Lists all role entities.
public function indexAction() { $em = $this->getDoctrine()->getManager(); $roles = $em->getRepository('ProjectBundle:Back\Roles')->findAll(); return $this->render('ProjectBundle:back\roles:index.html.twig', array( 'roles' => $roles, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r');\n\n return $qb->getQuery()->getResult();\n }", "public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doc...
[ "0.7624374", "0.7543802", "0.7403153", "0.7403153", "0.7244948", "0.72371787", "0.72035116", "0.7196548", "0.71649176", "0.709042", "0.70401084", "0.7024447", "0.7008381", "0.6912687", "0.6891454", "0.6871455", "0.68684846", "0.68483365", "0.6831343", "0.68022865", "0.6794529...
0.65661776
46
Creates a form to delete a role entity.
private function createDeleteForm(Roles $role) { return $this->createFormBuilder() ->setAction($this->generateUrl('back_roles_delete', array('id' => $role->getId()))) ->setMethod('DELETE') ->getForm() ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createDeleteForm(Role $role)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('role_delete', array('id' => $role->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }", "public function deleteRolesAction(){\n \n ...
[ "0.79986936", "0.69734687", "0.69086474", "0.6816056", "0.6799801", "0.6702436", "0.6464739", "0.64358765", "0.6387753", "0.6355804", "0.63335204", "0.63201606", "0.63201606", "0.63201606", "0.63067895", "0.6303177", "0.62701714", "0.62513304", "0.6242807", "0.62261164", "0.6...
0.80152273
0
/ Plugin Name: My Custom WP Functions Description: Custom Additionals Author: David Mchale Author URI: / Unregister default widgets.
function custom_unregister_default_widgets() { unregister_widget( 'WP_Widget_Archives' ); unregister_widget( 'WP_Widget_Calendar' ); unregister_widget( 'WP_Widget_Categories' ); unregister_widget( 'WP_Widget_Meta' ); unregister_widget( 'WP_Widget_Pages' ); unregister_widget( 'WP_Widget_Recent_Comments' ); unregister_widget( 'WP_Widget_Recent_Posts' ); unregister_widget( 'WP_Widget_RSS' ); unregister_widget( 'WP_Widget_Search' ); unregister_widget( 'WP_Nav_Menu_Widget' ); unregister_widget( 'WP_Widget_Tag_Cloud' ); unregister_widget( 'Akismet_Widget' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unregister_default_widgets() {\n\t\\add_action( 'widgets_init', 'WPS\\_unregister_default_widgets' );\n}", "function unregister_default_wp_widgets() {\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Calendar');\n unregister_widget('WP_Widget_Categories');\n unregist...
[ "0.8636281", "0.8197421", "0.81720716", "0.79573977", "0.7938502", "0.7928548", "0.79066247", "0.78764915", "0.7800305", "0.77646667", "0.7620833", "0.75784874", "0.7419697", "0.73724735", "0.7340547", "0.7312976", "0.72826034", "0.72666377", "0.72553134", "0.72380036", "0.72...
0.8350835
1
/ Hide dashboard widgets.
function custom_hide_dashboard_widgets() { global $wp_meta_boxes; // Today widget. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] ); // Last comments. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] ); // Incoming links. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] ); // Plugins. unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] ); // WordPress blog. unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] ); // WordPress news. unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mitlibnews_remove_dashboard_widgets() {\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quickpress widget\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // Wordpress news\n\tif (!current_user_can('add_users')) {\n\t\tremove_meta_box( 'dashboard_right_now', 'dashboar...
[ "0.76082855", "0.75985193", "0.75888413", "0.75827056", "0.7523026", "0.75071985", "0.750256", "0.7469566", "0.74597436", "0.74109954", "0.74072343", "0.7404851", "0.7344693", "0.730992", "0.7305711", "0.7291481", "0.7274372", "0.7229942", "0.7209446", "0.7188029", "0.7165178...
0.76435626
0
Read rows 1 to 7 and columns A to E only
public function readCell($columnAddress, $row, $worksheetName = '') { if ($row >= 1 && $row <= 170) { if (in_array($columnAddress,range('A', 'B'))) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read_data_coumn_by_column($data){\r\n\t$columns = array();\r\n\t$split_by_line = explode(\"\\n\", file_get_contents($data));\r\n\t\r\n\tfor ($i = 0; $i < count($split_by_line); $i++){\r\n\t\t$fromFile = explode(\",\",$split_by_line[$i]);\r\n\t\tforeach ($fromFile as $key => $sign) {\r\n\t\t\t$columns[$key...
[ "0.5599498", "0.55022216", "0.53067565", "0.5260162", "0.5223838", "0.5217719", "0.52151287", "0.5214832", "0.5192014", "0.5142241", "0.5138202", "0.5125811", "0.50662977", "0.50464356", "0.49780422", "0.49584723", "0.48258802", "0.48146376", "0.48094773", "0.48013446", "0.47...
0.0
-1
Add channel(s) to a connection
public function addChannels(\ElggEntity $entity, $channels) { $channels = (array)$channels; $this->useConnection($entity, function (Connection $connection) use ($channels) { foreach ($channels as $channel) { $connection->addChannel($channel); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAction() {\r\n\t\t$this->assign('channels', $this->channels);\r\n\t}", "public function channels()\n {\n $this->send(['command' => 'channels', 'seq'=>$this->getSequence()]);\n }", "private function registerChannels(): void\n {\n if (config('messenger.routing.channels.e...
[ "0.6548591", "0.6401784", "0.6070199", "0.6017868", "0.5936999", "0.59313107", "0.58899295", "0.581398", "0.581398", "0.57891506", "0.57510793", "0.5711035", "0.570597", "0.5705939", "0.5698206", "0.5596211", "0.5534703", "0.5471596", "0.5470638", "0.5460273", "0.5459061", ...
0.6341103
2
Create an empty connection (and file) if they don't exist
public function initConnection(\ElggEntity $entity) { $this->useConnection($entity, function (Connection $connection) { if (!$connection->getTimeModified()) { $connection->touch(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function init()\n {\n if(!file_exists($this->tempDB))\n {\n $data = @file_get_contents($this->remoteLink);\n\n if($data !== FALSE)\n {\n file_put_contents($this->tempDB, $data);\n }\n }\n }", "private function connect()...
[ "0.63064575", "0.6177372", "0.57874393", "0.5701852", "0.5665156", "0.5635077", "0.56233454", "0.56043047", "0.55897", "0.54844046", "0.5479853", "0.545222", "0.54411685", "0.54239804", "0.5378187", "0.5366132", "0.53523713", "0.53523713", "0.53523713", "0.53450865", "0.53197...
0.0
-1
Use a channel collection. This function will manage persisting the connection afterwards.
public function useConnection(\ElggEntity $entity, $func) { if (!$entity->guid) { throw new \InvalidArgumentException('$entity must be saved first.'); } $connection = $this->loadConnection($entity); $old_time = $connection->getTimeModified(); call_user_func($func, $connection); $new_time = $connection->getTimeModified(); if ($new_time !== $old_time) { // TODO under what conditions should we deleteConnection()? Problem is that until the // first ping, there won't be a connection for the client to listen to. $this->saveConnection($entity, $connection); $this->storage->write($entity->guid, $connection); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function channel()\n {\n }", "public function channels(): ChannelsService;", "public function persist()\n {\n Channel::from(auth()->user())\n ->contribute($this->all());\n }", "public function store()\n {\n $channel = Channel::create(\n request()->va...
[ "0.60037136", "0.5971471", "0.5754016", "0.57313764", "0.57145745", "0.56950116", "0.56305534", "0.5495263", "0.5466003", "0.54383004", "0.538336", "0.5378831", "0.5339357", "0.5323004", "0.5253004", "0.5248811", "0.52414966", "0.5200999", "0.51841176", "0.5177893", "0.517627...
0.0
-1
$smarty = new Smarty();
function int() { // $smarty->setTemplateDir(TPL_PATH); // $smarty->setCompileDir(COMPILE_PATH); // $smarty->setCacheDir(CACHE_PATH); // $smarty->display("admin/admin.html"); //$this->smarty->display("admin/admin.html"); $smarty=new smarty(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct(){\r\n $this->tpml_control = new \\Smarty();\r\n }", "private function loadSmarty()\n {\n }", "public function loadSmarty()\r\n {\r\n // Load the Smarty machine\r\n require_once APPLICATION_PATH . '/../library/Smarty/Smarty.class.php';\r\n $s...
[ "0.78689843", "0.7691577", "0.76217735", "0.7518243", "0.74755937", "0.7437718", "0.7406335", "0.73579586", "0.7308523", "0.7263248", "0.7244281", "0.7202315", "0.7171771", "0.7047289", "0.6930348", "0.69075847", "0.68440205", "0.6820868", "0.6751706", "0.6740089", "0.6727813...
0.7380051
7
Define the application's command schedule.
protected function schedule(Schedule $schedule) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->sendOutputTo('/Users/gumoon/Desktop/testcommand.txt', true)\n// ->everyMinute();\n $logFile = env('CRONTAB_LOG_DIR') . 'zoglo.txt';\n $schedule->command('news:fetc...
[ "0.67529404", "0.66640395", "0.66137487", "0.65509903", "0.651756", "0.6487023", "0.64777046", "0.6475713", "0.6472033", "0.6437954", "0.6431944", "0.64265746", "0.642389", "0.6404224", "0.6365451", "0.6330308", "0.6320412", "0.63142854", "0.6311569", "0.6302855", "0.63020927...
0.0
-1
route the request to the appropriate method
private function getRoute() { $path = $_SERVER['PATH_INFO']; $parts = explode('/', trim($path, '/')); $action = array_shift($parts); $this->uri_params = $parts; if (!$action) $action = 'index'; $action .= 'Action'; return array($this, $action); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function RouteRequest ();", "public function route(string $requestUri, string $requestMethod);", "public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->rout...
[ "0.7561115", "0.72517335", "0.7167338", "0.70777655", "0.696763", "0.6914456", "0.685075", "0.6837064", "0.6816163", "0.6807503", "0.6775166", "0.6763668", "0.67583287", "0.67337054", "0.67199594", "0.6716248", "0.6647058", "0.6645569", "0.661299", "0.65941894", "0.6560546", ...
0.0
-1
reset session (log out) action
public function resetAction() { $_SESSION = array(); session_destroy(); return self::redirect('index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetSession() {}", "abstract public function resetSession();", "public function logoff()\n\t{\n\t\t$this->session->sess_destroy();\n\t\tredirect(base_url());\n\t}", "public function logoff(){\n\t ServiceSession::destroy();\n\t Redirect::to(\"/login\")->do();\n\t }", "public function...
[ "0.8436078", "0.8138487", "0.7595557", "0.7541391", "0.75275934", "0.7521672", "0.746917", "0.7464098", "0.74593014", "0.74550754", "0.74246204", "0.7409395", "0.74082017", "0.73945606", "0.7342841", "0.73421925", "0.73063326", "0.7303848", "0.7299993", "0.7299411", "0.729892...
0.7501079
6
api login request Action
public function requestAction() { $this->api->login('request')->post()->loadTokenFromResponse(); $_SESSION['request_token'] = $this->api->getOAuthToken(); return $this->api->goRedirect('login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionLogin() {\n \n }", "private function login(){\n \n }", "public function actionLogin()\n {\n \\Yii::$app->response->format = Response::FORMAT_JSON;\n\n if(Yii::$app->request->isPost) {\n\n $model = new LoginForm();\n\n\n if ($model...
[ "0.7791463", "0.7539527", "0.7539106", "0.7516003", "0.7476335", "0.74516255", "0.7426282", "0.7426282", "0.74177617", "0.73615813", "0.7331206", "0.7329312", "0.7328016", "0.73096", "0.7296298", "0.7277744", "0.72151434", "0.7203514", "0.7198428", "0.7198428", "0.7145314", ...
0.71204513
24
api login access Action
public function accessAction() { if (!$_SESSION['request_token']) { return self::redirect('request'); } $tok = $_SESSION['request_token']; $this->api->setOAuthToken($tok->getKey(), $tok->getSecret()); $this->api->login('access')->post()->loadTokenFromResponse(); $_SESSION['access_token'] = $this->api->getOAuthToken(); $_SESSION['username'] = $this->api->getUsername(); $_SESSION['subdomain'] = $this->api->getSubdomain(); return self::redirect('index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionLogin() {\n \n }", "private function login(){\n \n }", "public function login();", "public function login();", "public function actionLogin()\n {\n \\Yii::$app->response->format = Response::FORMAT_JSON;\n\n if(Yii::$app->request->isPost) {\n\n ...
[ "0.7886775", "0.757184", "0.74900025", "0.74900025", "0.74177516", "0.7330938", "0.7297555", "0.7297508", "0.7281589", "0.7281589", "0.7256909", "0.7205186", "0.7197608", "0.717089", "0.71334064", "0.71181995", "0.7092613", "0.7089927", "0.70893985", "0.7084978", "0.70784456"...
0.73684627
5
Display a listing of the resource.
public function index() { $social = SocialMediaLink::all(); return view('welcome',compact('social')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.717...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0....
0.0
-1
Display the specified resource.
public function show($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.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6...
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.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", ...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Additional information that would be stored with a token. For example, could be creation timestamp.
protected function createTokenTimestamp(): int { return time(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNewTokenInfo()\n {\n return $this->new_token_info;\n }", "public function token()\n {\n return $this->metadata();\n }", "public function token()\n {\n if ($this->tokenExpiry !== null) {\n if (is_string($this->tokenKey)) {\n return...
[ "0.6753358", "0.6281433", "0.61711365", "0.60966843", "0.60966843", "0.6096669", "0.6096669", "0.6096669", "0.6096669", "0.609553", "0.609553", "0.609553", "0.6065574", "0.6056416", "0.6041053", "0.6004262", "0.57709867", "0.57644266", "0.5704258", "0.5689023", "0.5680332", ...
0.59024835
16
Replace whole token storage.
protected function setTokenStorage(array $tokenStorage): self { $this->getSessionStorage()->offsetSet($this->getTokenStorageKey(), $tokenStorage); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refreshToken()\n {\n $token = $this->getToken();\n }", "public function backupCurrentToken()\n {\n $stateStorage = $this->getClient()->getStateStorage();\n\n $token = $stateStorage->get($this->getStateStorageKeyName('token'));\n $stateStorage->set($this->getSt...
[ "0.64250547", "0.6379774", "0.6006075", "0.58832514", "0.57590187", "0.573869", "0.5721444", "0.56443036", "0.5590163", "0.55581474", "0.5450669", "0.5446025", "0.544447", "0.54341924", "0.5382238", "0.5372538", "0.5339488", "0.53336203", "0.52727395", "0.5266328", "0.5243889...
0.0
-1
Display a listing of the resource.
public function index(Request $request) { $keyword = $request->get('search'); $exam = $request->input('exam'); $subject = $request->input('subject'); $exams = Exam::pluck('name', 'id'); $subjects = Subject::pluck('name', 'id'); $shifts = Shift::with('exam') ->when($keyword, function ($query) use ($keyword) { $query->where('name', 'LIKE', "%$keyword%"); }) ->when($exam, function ($query) use ($exam) { $query->where('exam_id', $exam); }) ->when($subject, function ($query) use ($subject) { $query->where('subject_id', $subject); }) ->latest()->paginate(15); return view('admin.shifts.index', compact('shifts', 'exams', 'subjects')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446838", "0.7361646", "0.7299749", "0.7246801", "0.7163394", "0.7148201", "0.71318537", "0.7104601", "0.7101873", "0.709985", "0.70487136", "0.69936216", "0.6988242", "0.69347453", "0.68989795", "0.68988764", "0.68909055", "0.68874204", "0.68650436", "0.6848891", "0.68294...
0.0
-1
Show the form for creating a new resource.
public function create() { $exams = Exam::pluck('name', 'id'); $subjects = Subject::pluck('name', 'id'); return view('admin.shifts.create', compact('exams', 'subjects')); }
{ "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.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate($request, [ 'name' => 'required', 'exam_id' => 'required', 'date_exam' => 'required', 'start' => 'required', 'end' => 'required' ]); $requestData = $request->all(); Shift::create($requestData); return redirect('admin/shifts')->with('flash_message', 'Shift added!'); }
{ "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) { $shift = Shift::findOrFail($id); return view('admin.shifts.show', compact('shift')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $this->validate($request, [ 'name' => 'required', 'exam_id' => 'required', 'date_exam' => 'required', 'start' => 'required', 'end' => 'required' ]); $requestData = $request->all(); $shift = Shift::findOrFail($id); $shift->update($requestData); return redirect('admin/shifts')->with('flash_message', 'Shift updated!'); }
{ "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.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", ...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { Shift::destroy($id); return redirect('admin/shifts')->with('flash_message', 'Shift deleted!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.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
$zhangyi >addChildNode($xiaozhangyi); $zhanger >addChildNode($xiaozhanger); $zhangsan >addChildNode($xiaozhangsan); $zhangsi >addChildNode($xiaozhangsi); $zhangwu >addChildNode($xiaozhangwu); $zhangliu >addChildNode($xiaozhangliu); $zhangqi >addChildNode($xiaozhangqi);
function init(&$node){ if(!$node) return; foreach($node->getChildNode() as &$childNode){ $childNode->addParentNode($node); init($childNode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addChild( $ni )\n\t\t{\n\t\t$this->childs[] = $ni ;\n\t\t}", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){...
[ "0.62387073", "0.6082565", "0.5987675", "0.57243437", "0.5686778", "0.5622599", "0.5582614", "0.5543558", "0.5543558", "0.5467567", "0.54303724", "0.5416217", "0.54134095", "0.536993", "0.53471905", "0.53359646", "0.5274442", "0.5271964", "0.52492166", "0.5244974", "0.5240757...
0.0
-1
yes a user has many reply, but if we want to fetch a specific one, we use hasOne:
public function lastReply(){ return $this->hasOne(Reply::class)->latest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function latestReply()\n {\n return $this->hasOne('App\\Models\\Reply', 'id', 'latest_reply_id');\n }", "public function answer(){\n return $this->hasOne('App\\Answer','id','answer');\n }", "public function post(){\n // will go to post table and look for user_id automatical...
[ "0.6873374", "0.6754852", "0.6689379", "0.6652925", "0.66026425", "0.6572583", "0.6516197", "0.65140617", "0.6418095", "0.6346454", "0.6323339", "0.6313551", "0.63131636", "0.6306404", "0.6255864", "0.62308025", "0.6225554", "0.6221748", "0.620165", "0.6195941", "0.6186179", ...
0.66659284
3
when the user visits a thread, we are going to store a new key in the cache and make it equal to the current time
public function read($thread){ //which means, the user has visited this thread cache()->forever( $this->visitedThreadCacheKey($thread), \Carbon\Carbon::now() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveToCacheForever();", "public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}", "abstract public function cachedTime(string $key): ?int;", "public function runTimeCacheSet($key, $value)\n\t{\n\t\t$this->runTimeCache...
[ "0.64263767", "0.61657673", "0.61620885", "0.6128982", "0.6124924", "0.6076219", "0.6049976", "0.6024839", "0.5945673", "0.5925076", "0.5899857", "0.5877467", "0.5828909", "0.57743275", "0.57411045", "0.5733501", "0.56945467", "0.56720656", "0.56525826", "0.5646505", "0.56245...
0.60356975
7
Display a listing of the resource.
public function index(Request $request) { // 获取值 $num = $request -> input('num', 10); $keywords = $request -> input('keywords', ''); // return '用户列表'; // 查询值数据库 $data = \DB::table('coming') ->where('coming_name','like','%'.$keywords.'%') -> paginate($num); // (like 代表模糊查询 $num 代表一页的条数) // dd($data); // 发送数据过去 // 页面展示数据 return view('admin.coming.index',['title' => '即将上映列表','data' => $data,'request' => $request ->all()]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236"...
0.0
-1
Show the form for creating a new resource.
public function create() { // 页面展示数据 return view('admin.coming.add',['title' => '热映添加']); }
{ "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) { // dd($request -> all()); $this->validate($request, [ // 规则验证 'coming_name' => 'required|unique:coming', 'coming_price' => 'required', 'coming_img' => 'required|image' ],[ 'coming_name.required' => '电影名不能为空', 'coming_name.unique' => '该电影已经存在', 'coming_price.required' => '价格不能为空', 'coming_img.required' => '电影图片不能为空', 'coming_img.image' => '请上传图片' ]); // 获取数据 $data = $request -> except('_token'); // dd($data); // // 判断 if($data) { $data['status'] = 1; $data['pid'] = 0; // $data['coming_depict'] = '描述'; } // 处理图片 if($request -> hasFile('coming_img')) { if($request -> file('coming_img') -> isValid()) { // 获取扩展名 $ext = $request -> file('coming_img') -> extension(); // 随机文件名 $filename = time().mt_rand(1000000,9999999).'.'.$ext; // 移动 $request -> file('coming_img') -> move('./uploads/coming_img',$filename); // 添加 dada 数据 $data['coming_img'] = $filename; } } // 执行添加 $res = \DB::table('coming') -> insert($data); // dd($res); // 判断 if($res) { // with是存入session需要显示要在对应的模块获取session return redirect('/admin/coming') -> with(['info' => '添加成功']); }else { return back() -> with(['info' => '添加失败']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.7285922", "0.714503", "0.71324795", "0.6639801", "0.6620405", "0.6568167", "0.65257645", "0.650948", "0.64484984", "0.6375281", "0.6373189", "0.63650924", "0.63650924", "0.63650924", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731",...
0.0
-1
Display the specified resource.
public function show($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) { // 查询 $data = \DB::table('coming') -> where('id',$id) -> first(); // dd($data); // 发送数据 return view('admin.coming.edit',['title' => '热映编辑','data' => $data]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", ...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $data = $request -> except('_token','_method'); // dd($data); // 查询旧图片 $oldMovie_img = \DB::table('coming') -> where('id',$request -> id) -> first() -> coming_img; if($request -> hasFile('coming_img')) { if($request -> file('coming_img') -> isValid()) { // 获取扩展名 $ext = $request -> file('coming_img') -> extension(); // 随机文件名 $filename = time().mt_rand(1000000,9999999).'.'.$ext; // 移动 $request -> file('coming_img') -> move('./uploads/coming_img',$filename); // 删除旧图片 // 首先判断在不在 if(file_exists('./uploads/coming_img/'.$oldMovie_img) && $oldMovie_img != 'default.jpg') { unlink('./uploads/coming_img/'.$oldMovie_img); } // 添加 dada 数据 $data['coming_img'] = $filename; } } // 执行修改 $res = \DB::table('coming') -> where('id',$id) -> update($data); // 判断 if($res) { return redirect('/admin/coming') -> with(['info' => '修改成功']); }else { return back() -> with(['info' => '修改失败']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { //查询一条数据 $res = \DB::table('coming') -> where('id',$id) -> first(); // 执行删除 $res = \DB::table('coming') -> delete($id); // 判断 if($res) { return redirect('/admin/coming') -> with(['info' => '删除成功']); }else { return back() -> with(['info' => '删除失败']); } }
{ "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
Run the database seeds.
public function run() { Model::unguard(); DB::table('users')->delete(); $faker = Faker\Factory::create(); User::create([ 'name' => 'joel', 'email' => 'joelperry@me.com', 'password' => '$2y$10$JFVBJO/RWmSL1UVFsv1uPeolMjqFn/BcFJAiMWjXApCW9/Uq.6WCa' ]); for ($i = 0; $i < 20; $i++) { User::create([ 'name' => $faker->userName, 'email' => $faker->email, 'password' => $faker->word ]); } }
{ "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
Display a listing of the resource.
public function index() { $dataRif = $this->dataRiferimento->getDateList(); return view('candidati.index', compact("dataRif")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236"...
0.0
-1
Show the form for creating a new resource.
public function 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) { $tabella = ""; if (isset($request->c_soc) && isset($request->c_rif)) { $c_soc = $request->get('c_soc'); $c_rif = $request->get('c_rif'); $checkCandidatoPresente = $this->candidato->where('c_rif', '=', $c_rif)->where('c_soc', '=', $c_soc)->count(); $checkEsisteCandidato = $this->socio->where('c_soc', '=', $c_soc)->count(); if ($checkCandidatoPresente == 0 && $checkEsisteCandidato > 0) { $data = array( 'c_soc' => $c_soc, 'c_rif' => $c_rif ); $this->candidato->store($data); } $tabella = $this->generaTabellaCandidati($c_rif); } return json_encode($tabella); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.7285922", "0.714503", "0.71324795", "0.6639801", "0.6620405", "0.6568167", "0.65257645", "0.650948", "0.64484984", "0.6375281", "0.6373189", "0.63650924", "0.63650924", "0.63650924", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731",...
0.0
-1
Display the specified resource.
public function show($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.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", ...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $return = array(); $return['errore'] = false; $return['messaggio'] = "ok"; try { $candidato = $this->candidato->find($id); $voto = $this->voto->where('c_soc_vot', '=', $candidato->c_soc)->count(); if ($voto == 0) { $candidato->trash(); } else { throw new \Exception('Impossibile cancellare il candidato poichè presente un vincolo referenziale nel database voti.'); } } catch (Exception $err) { $return['errore'] = true; $return['messaggio'] = $err->getMessage(); } return json_encode($return); }
{ "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
constructor creates instance of memcache
private function __construct() { $this->memcache = new Memcache(); $connectResult = $this->memcache->connect('localhost','11211'); if ($connectResult === FALSE) { $this->memcache = NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\r\n $this->cache = new MemCacheInterface(self::$CACHE_HOST, self::$CACHE_PORT, self::$CACHE_PREFIX, self::$CACHE_GROUP);\r\n }", "function __construct() {\n $this->mem = new Memcache();\n //$this->mem->connect('118.178.182.224','18392'); //写入缓存地址,端口\n// ...
[ "0.8485556", "0.82063925", "0.8146454", "0.77532965", "0.7502203", "0.74911416", "0.7345019", "0.72991395", "0.72976136", "0.72864306", "0.72727036", "0.7269294", "0.7142562", "0.7134817", "0.7090104", "0.7024761", "0.7020724", "0.6997083", "0.6983579", "0.6954109", "0.692577...
0.8097731
3
gets value from memcache on key $key
public function get($key) { if ($this->useCache()) { $memcache = $this->memcache; if ($memcache) { $result = $this->memcache->get($key); $result = unserialize($result); return $result; } } return NULL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValFromCache($key);", "function get ($key) {\n return $this->memcached->get($key);\n }", "public function get($key){\n if( $value = $this->memcache->get($this->prefix.$key) ) {\n return $value;\n }\n }", "function get($key) {\n $memObj = self::ge...
[ "0.83850574", "0.8321924", "0.82541806", "0.8155784", "0.8155784", "0.8097395", "0.80079496", "0.78362066", "0.7819781", "0.7783606", "0.7716262", "0.76390773", "0.7557076", "0.7499946", "0.7451382", "0.7414627", "0.73418665", "0.7320326", "0.73181623", "0.7293121", "0.728653...
0.7351904
16
sets value $value to memcache to key $key
public function set($key, $value, $flags = NULL, $expire = 0) { if ($this->useCache()) { $memcache = $this->memcache; if ($memcache) { if (is_string($expire)) { // hadzalo to warning, takze treba nastavit toto date_default_timezone_set('Europe/Prague'); $expire = strtotime($expire); } $value = serialize($value); if (strlen($value) > 1048534) { return NULL; } else { $result = $memcache->set($key, $value, $flags, $expire); return $result; } } } return NULL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function set( $key, $value ) {\n\t\t// this method will raise an exception on invalid data\n\t\tself::validate( $key, $value );\n\t\t// set the value in the cache\n\t\tself::$_cache[$key] = $value;\n\t}", "public function set($key, $value) {\n $this->memcached->set($key, $value);\n }", "func...
[ "0.8131149", "0.80351365", "0.79133993", "0.789307", "0.7865871", "0.77983934", "0.7612786", "0.7510534", "0.7458868", "0.7304026", "0.7297271", "0.7266693", "0.7241873", "0.71833277", "0.7148287", "0.7148287", "0.706386", "0.7063618", "0.7063618", "0.7050795", "0.7040585", ...
0.0
-1
checks if can use cache
protected function useCache() { if (isset($_COOKIE['nc']) && $_COOKIE['nc'] == 1) { return FALSE; } if (isset($_GET['nc']) && $_GET['nc'] == 1) { return FALSE; } return TRUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _can_cache() {\n\t\treturn true;\n\t}", "public function can_cache() {\n return $this->valid;\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "public function isCached() {}", "public function isCache...
[ "0.8709578", "0.8019445", "0.79406255", "0.78004324", "0.7719923", "0.75900716", "0.7580681", "0.7441274", "0.7406719", "0.7405183", "0.7402097", "0.7395696", "0.7386218", "0.7384324", "0.7280078", "0.72717655", "0.72714436", "0.7210212", "0.7205476", "0.7205476", "0.7187241"...
0.7654792
5
Display a listing of the resource.
public function index() { $contacts = contacts::orderBy('id','desc')->get(); return view('backend.pages.contact.manage',compact('contacts')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446838", "0.7361646", "0.7299749", "0.7246801", "0.7163394", "0.7148201", "0.71318537", "0.7104601", "0.7101873", "0.709985", "0.70487136", "0.69936216", "0.6988242", "0.69347453", "0.68989795", "0.68988764", "0.68909055", "0.68874204", "0.68650436", "0.6848891", "0.68294...
0.0
-1
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.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $contact = new contacts(); $contact->address=$request->address; $contact->contact=$request->contact; $contact->email=$request->email; $contact->facebook=$request->facebook; $contact->instagram=$request->instagram; $contact->linkedin=$request->linkedin; $contact->github=$request->github; $contact->youtube=$request->youtube; $contact->save(); return redirect()->route('contactShow'); }
{ "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.78561044", "0.7695814", "0.72755414", "0.72429216", "0.71737534", "0.7064628", "0.7056257", "0.69859976", "0.6949863", "0.6948435", "0.6942811", "0.69298875", "0.69032556", "0.6900465", "0.6900465", "0.6880163", "0.6865618", "0.68620205", "0.6859499", "0.6847944", "0.68375...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, contacts $contact) { $contact->address=$request->address; $contact->contact=$request->contact; $contact->email=$request->email; $contact->facebook=$request->facebook; $contact->instagram=$request->instagram; $contact->linkedin=$request->linkedin; $contact->github=$request->github; $contact->youtube=$request->youtube; $contact->save(); return redirect()->route('contactShow'); }
{ "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(contacts $contact) { $contact->delete(); return redirect()->route('contactShow'); }
{ "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
Handle an authentication attempt.
public function authenticate(Request $request) { $email = $request->get('email'); $password = $request->get('password'); //if (Auth::attempt($credentials)) if (Auth::attempt(['email' => $email, 'password' => $password, 'register_token' => NULL])) { $request->session()->regenerate(); flash('Vitajte na palube '. Auth::user()->name .'.')->success(); return back(); } else if (User::where('email', $email)->whereNotNull('register_token')->first()) { return back()->with('showModal', 'loginModal')->withErrors([ 'email' => 'Váš email ešte nebol overený. Skontrolujte si prosím doručenú poštu.', ]); } return back()->with('showModal', 'loginModal')->withErrors([ 'email' => 'Nesprávny email, alebo heslo.', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function doAuthentication();", "public function __handleAuthentication() {\n $allowActions = array('adminLogin');\n\n if(strpos($this->action, 'admin') !== false && !in_array($this->action, $allowActions)) {\n $params = $this->getParams();\n\n if(empty($params['token'])...
[ "0.70770305", "0.6984939", "0.67482084", "0.67025375", "0.6639312", "0.6614268", "0.6594527", "0.65843356", "0.6497298", "0.6423162", "0.6367332", "0.6349103", "0.6349103", "0.6349103", "0.63462335", "0.6330897", "0.6258169", "0.6236489", "0.62282854", "0.620976", "0.6201045"...
0.0
-1
Log the user out of the application.
public function logout(Request $request) { Auth::logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); flash('Boli ste odhlásený.')->success(); return redirect('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logOut()\n {\n $auth = new AuthenticationService();\n\n if ($auth->hasIdentity()) {\n Session::getDefaultManager()->forgetMe();\n $auth->clearIdentity();\n }\n }", "public function logout(){\n $this->_user->logout();\n }", "public funct...
[ "0.81049", "0.8074714", "0.8000451", "0.79916364", "0.79474425", "0.79438", "0.79279417", "0.7914858", "0.7902356", "0.79012054", "0.7895511", "0.7884862", "0.78812855", "0.7878689", "0.78764", "0.78702843", "0.78655607", "0.7864975", "0.78607863", "0.7854684", "0.782418", ...
0.0
-1
Register the service provider.
public function workflows() { return [ \Litecms\Block\Models\Block::class => config('litecms.block.block.workflow', []) ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->a...
[ "0.71764797", "0.70536333", "0.6966888", "0.6966827", "0.6951471", "0.6930452", "0.69255674", "0.6917104", "0.68993205", "0.68943584", "0.68929476", "0.68900776", "0.68900776", "0.6882492", "0.6871932", "0.6864181", "0.68636024", "0.6861993", "0.68619204", "0.68481", "0.68222...
0.0
-1
Display a listing of the resource.
public function index() { $subjects = Subject::with(['chapters'])->get(); return response()->json([ 'success' => true, 'subjects' => $subjects ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Store a newly created resource in storage.
public function store(StoreSubject $request) { $subject = new Subject(['name' => $request->input('label')]); if ($subject->save()) { return response()->json([ 'success' => true, 'subject' => $subject->load(['chapters']) ]); } return response()->json([ 'success' => false, 'errors' => 'An error occured' ], 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.7285922", "0.714503", "0.71324795", "0.6639801", "0.6620405", "0.6568167", "0.65257645", "0.650948", "0.64484984", "0.6375281", "0.6373189", "0.63650924", "0.63650924", "0.63650924", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731",...
0.0
-1
Update the specified resource in storage.
public function update(UpdateSubject $request, Subject $subject) { $subject->name = $request->input('label'); if ($subject->save()) { return response()->json([ 'success' => true, 'subject' => $subject->load(['chapters']) ]); } return $this->jsonErrorRespond('Fail updating subject', 500); }
{ "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.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", ...
0.0
-1
Remove the specified resource from storage.
public function destroy(Subject $subject) { if ($subject->delete()) { return response()->json([ 'success' => true, 'subject' => $subject ]); } return $this->jsonErrorRespond('Failed to delete', 500); }
{ "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
Function for connection to MySql database
function connect() { $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die('Could not connect. ' . mysql_error()); mysql_select_db(DB_NAME) or die('Could not select database. ' . mysql_error()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mysql () {\n\t/* public: connection parameters */\n\t\t$this->connect();\n\t}", "function dbConnect () {\n\t$con = mysql_connect($this -> host, $this -> user, $this -> pass);\n mysql_select_db($this->dbname,$con);\n\t}", "function connectDB();", "public function db_connect(){\n $db_use...
[ "0.808048", "0.7900019", "0.785603", "0.7842892", "0.7842147", "0.77436674", "0.77349323", "0.77095956", "0.76915413", "0.76866984", "0.76859343", "0.76738703", "0.7672518", "0.76703376", "0.76504457", "0.7629188", "0.76205546", "0.7616366", "0.7612796", "0.7610927", "0.75784...
0.0
-1
Function to query the database and create a table of staff members for backend.
function showstaff() { $result = mysql_query("SELECT * FROM staff "); while($row = mysql_fetch_array($result)){ ?> <div id="staff"> <div id="staffpic"><span></span><img src="./images/staff/<?php echo $row['image']?>" alt="" style="display: inline; "height="400px" class="resizeme1" width="400px" onload="vertAlignOnFly(this)" onload=”$(this).aeImageResize({ height: 150, width: 150})" /></div> <div id="smalltab"><table style="border-collapse: collapse;"> <tr><td width="240px" style="padding-left: 5px; border-bottom: solid 1px #B47836;"><center><?php echo $row['name'] ?></center></td> <td width="280px" style="border-bottom: solid 1px #B47836;"><center><?php echo $row['title'] ?></center></td></tr> </table> </div> <div id="blurb"><?php echo $row['blurb'] ?></div> </div><br> <?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function createTeamMembersTable()\n\t{\n\t\t\n\t\treturn TDOTableManager::createGenericTable(\"CREATE TABLE tdo_team_members(teamid VARCHAR(36) NOT NULL, userid VARCHAR(36) NOT NULL, INDEX tdo_team_members_pk(teamid(10)), INDEX tdo_team_members_fullkey(teamid(10),userid(10)), INDEX tdo_team_members_u...
[ "0.6438781", "0.64212584", "0.62497455", "0.6189218", "0.6067082", "0.60098207", "0.5989596", "0.5952849", "0.59238124", "0.58939344", "0.5890981", "0.5862254", "0.5858094", "0.58286935", "0.5771951", "0.5761007", "0.5752918", "0.57454973", "0.5742661", "0.573824", "0.5734468...
0.0
-1
Function to query the database and create a table of staff members for backend.
function showstaffadmin() { ?> <table><tr><td width="140px"><h3>Staff Member</h3></td><td width="120px"><h3><center>Title</center></h3></td><td width="350px"><h3><center>Profile</center></h3></td><td width="75px"></td><td width="75px"></td></tr></table><br> <?php $result = mysql_query("SELECT * FROM staff "); while($row = mysql_fetch_array($result)){ ?> <div id="staffadmin"> <table> <tr><td width="120px"><?php echo $row['name'] ?></td> <td width="120px"><center><?php echo $row['title'] ?><center></td> <td width="320px"><?php echo substr($row['blurb'],0,30) ?>...</td> <td width="75px"><a class='inline' href="#inline_contentz" onclick="editstaff(<?php echo $row['id'] ?>)" >Edit<br> Profile</a></td> <td width="75px"><a class='inlinetest' href="#inline_contentpic" onclick="assignStaffPic(<?php echo $row['id'] ?>)">Assign Picture</a></td> <td width="50px"><a href="delete.php?id=<?php echo $row['id'] ?>&sort=staff" onclick="return confirm('Delete this profile?');">Delete Profile</a></td></tr> </table> </div> <br><?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function createTeamMembersTable()\n\t{\n\t\t\n\t\treturn TDOTableManager::createGenericTable(\"CREATE TABLE tdo_team_members(teamid VARCHAR(36) NOT NULL, userid VARCHAR(36) NOT NULL, INDEX tdo_team_members_pk(teamid(10)), INDEX tdo_team_members_fullkey(teamid(10),userid(10)), INDEX tdo_team_members_u...
[ "0.6437229", "0.6420625", "0.6248463", "0.61897796", "0.6066576", "0.6010789", "0.59898597", "0.5953361", "0.5923586", "0.58934605", "0.58903944", "0.5862575", "0.5856768", "0.58291876", "0.57726175", "0.57599753", "0.57524306", "0.5744931", "0.57436705", "0.5740466", "0.5734...
0.0
-1
Function to query the database and create a table of 6 random products for frontend.
function showprod1() { $result = mysql_query("SELECT * FROM products ORDER BY rand() LIMIT 6"); while($row = mysql_fetch_array($result)){ ?> <div id="prod"><table> <tr><td height="180px"><center><img src="./images/products/<?php echo $row['image']?>" alt="" height="400px" class="resizeme" width="400px" onload=”$(this).aeImageResize({ height: 190, width: 180})”/></center><td><tr> <tr><td height="15"><center><?php echo $row['name'] ?></center></td></tr> <tr><td height="15"><center>$<?php echo $row['price'] ?></center></td></tr> <tr><td valign="top"><center><?php echo $row['discrip'] ?></center></td></tr> </table> </div> <?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n { $productsTable=new Products();\n $products=[];\n for ($i=1; $i < 13; $i++) {\n\n $products[]=[\n\n 'id'=>$i,\n 'name'=>'pizza'.$i,\n 'ingreadiants'=>'ingreadiants'.$i,\n 'price'=>rand(0,...
[ "0.702458", "0.69916457", "0.68715626", "0.6807782", "0.67902476", "0.6789047", "0.6771998", "0.67683357", "0.66562253", "0.6644886", "0.66418976", "0.6639528", "0.6633951", "0.6624136", "0.6601741", "0.6601692", "0.6596081", "0.65777254", "0.65637016", "0.6560422", "0.654804...
0.0
-1
Function to query the database and create a table of products of the type parsed, for backend.
function showprodadmin($str) { ?> <table><tr><td><b>Product Name</b></td><td><b>Descrition</b></td><td><b><center>Price</center></b></td><td><b><center>Promotion Price</center></b></td></tr> <?php $result = mysql_query("SELECT * FROM products WHERE type='".$str."'"); while($row = mysql_fetch_array($result)){ ?> <tr><td width="230px"><?php echo $row['name'] ?></td> <td width="200px"><?php echo substr($row['discrip'], 0, 30) ?>.....</td> <td width="75px"><center>$<?php echo $row['price'] ?></center></td> <td width="75px"><center>$<?php echo $row['sprice'] ?></center></td> <td width="100px"><a class='inline' href="#inline_content" onclick="edittest(<?php echo $row['id'] ?>);" ><center>Edit</center></a></td> <td width="100px"><a class='inlinetest' href="#assignpic_content" onclick="assignPic(<?php echo $row['id'] ?>);" >Assign Image</a></td> <td width="100px"><a href="delete.php?id=<?php echo $row['id'] ?>" onclick="return confirm('Delete this product?');"><center>Delete</center></a></td></td> </tr><?php } echo "</table>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _fillTmpTable()\n {\n $sql = new SqlStatement();\n $sql->select()\n ->from(array('p' => 'product'), array('p.*'));\n \n if ($this->subCategory) \n {\n $sql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')...
[ "0.674364", "0.64382154", "0.6349352", "0.6146678", "0.6132873", "0.61271304", "0.61031526", "0.6102802", "0.60738236", "0.6066057", "0.60292304", "0.6013918", "0.5995464", "0.59646684", "0.5959095", "0.5958247", "0.5940509", "0.5920981", "0.5898699", "0.5859546", "0.5830018"...
0.0
-1
Displays datatables front end view
public function index() { return view('admin.product-managers.instock.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function datatableTables()\n {\n return view('pages.tables.tables_datatable');\n }", "public function index()\n {\n return view('admin.examples.datatables');\n }", "public function datatable() {\n $this -> datatables -> select(\"Id,AdvertisementTitle,AdvertisementImage,A...
[ "0.79420877", "0.76861024", "0.74932", "0.74666226", "0.7428042", "0.7382035", "0.73702496", "0.73332113", "0.7319794", "0.73177814", "0.7201767", "0.7179596", "0.71678597", "0.71508396", "0.71154803", "0.7099427", "0.709342", "0.7076389", "0.70533043", "0.7029751", "0.700592...
0.0
-1
Process datatables ajax request.
public function getProductData() { $product_instocks = Product::with('product_resolutions')->get(); foreach ($product_instocks as $key => $value) { foreach ($value->product_resolutions as $resolution_key => $resolution_value) { if ($value->product_resolutions[$resolution_key]["stock"] == 0) { $product_instocks->forget($key); //xóa phần từ cha có quan hệ con có trường ["stock"] = 0 đi } } } return Datatables::of($product_instocks) ->addColumn('action', function ($product) { if (Auth::guard('admin')->user()->permission == 0 || Auth::guard('admin')->user()->permission == 2) { return '<a href="#product_detail" class="btn_detail" data-url="'.route('admin.product.instock.detail',$product->id).'" style="margin-right: 5px;" data-toggle="modal" title="Detail"><button class="btn btn-warning" id="product-detail" title="Detail" data-toggle="tooltip"><i class="glyphicon glyphicon-eye-open"></i></button></a> <a href="#product_edit" class="btn_edit" style="margin-right: 5px;" data-url="'.route('admin.product.instock.edit',$product->id).'" data-update="'.route('admin.product.instock.update',$product->id).'" data-toggle="modal" title="Edit"><button class="btn btn-info" id="product-edit" title="Edit" data-toggle="tooltip"><i class="glyphicon glyphicon-edit"></i></button></a> <a href="#product_resolution_edit" class="btn_resolution_edit" style="margin-right: 5px;" data-url="'.route('admin.product.instock.resolutionedit',$product->id).'" data-update="'.route('admin.product.instock.resolutionupdate',$product->id).'" data-toggle="modal" title="Resolution_Edit"><button class="btn btn-success" id="product-resolution-edit" title="Resolution_Edit" data-toggle="tooltip"><i class="fa fa-window-restore"></i></button></a> <a href="#product_image_edit" class="btn_image_edit" style="margin-right: 5px;" data-url="'.route('admin.product.instock.productimageedit',$product->id).'" data-update="'.route('admin.product.instock.dbproductimageupdate',$product->id).'" data-image-update="'.route('admin.product.instock.productimageupdate',$product->id).'" data-toggle="modal" title="Image_Edit"><button class="btn btn-outline-primary" id="product-image-edit" title="Image_Edit" data-toggle="tooltip"><i class="fa fa-picture-o" aria-hidden="true"></i></button></a>'; } else { return '<a href="#product_detail" class="btn_detail" data-url="'.route('admin.product.instock.detail',$product->id).'" style="margin-right: 5px;" data-toggle="modal" title="Detail"><button class="btn btn-warning" id="product-detail" title="Detail" data-toggle="tooltip"><i class="glyphicon glyphicon-eye-open"></i></button></a> <a href="#product_edit" class="btn_edit" style="margin-right: 5px;" data-url="'.route('admin.product.instock.edit',$product->id).'" data-update="'.route('admin.product.instock.update',$product->id).'" data-toggle="modal" title="Edit"><button class="btn btn-info" id="product-edit" title="Edit" data-toggle="tooltip"><i class="glyphicon glyphicon-edit"></i></button></a> <a href="#product_image_edit" class="btn_image_edit" style="margin-right: 5px;" data-url="'.route('admin.product.instock.productimageedit',$product->id).'" data-update="'.route('admin.product.instock.dbproductimageupdate',$product->id).'" data-image-update="'.route('admin.product.instock.productimageupdate',$product->id).'" data-toggle="modal" title="Image_Edit"><button class="btn btn-outline-primary" id="product-image-edit" title="Image_Edit" data-toggle="tooltip"><i class="fa fa-picture-o" aria-hidden="true"></i></button></a>'; } }) ->editColumn('thumbnail', function(Product $product){ return '<img style="width: 100px;height: 100px;" src="http://computer-shop.projectlaravel15.zent/storage/'.$product->thumbnail.'"/>'; }) ->rawColumns(['thumbnail','action']) ->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this...
[ "0.66198105", "0.65847164", "0.64877564", "0.6322368", "0.6299838", "0.626932", "0.60672796", "0.6055399", "0.6043496", "0.5977112", "0.591175", "0.58924174", "0.5888511", "0.5881132", "0.5869681", "0.5818167", "0.580172", "0.57750076", "0.5750326", "0.5742228", "0.5734157", ...
0.0
-1
Process datatables ajax request.
public function getProductOutStockData() { $product_outstock = Product::whereHas('product_resolutions', function($query){ $query->whereStock(0); })->get(); return Datatables::of($product_outstock) ->addColumn('action', function ($product) { return '<a href="#product_resolution_edit" class="btn_edit" style="margin-right: 5px;" data-url="'.route('admin.product.outstock.edit',$product->id).'" data-update="'.route('admin.product.outstock.update',$product->id).'" data-toggle="modal" title="Resolution_Edit"><button class="btn btn-info" id="product-edit" title="Resolution_Edit" data-toggle="tooltip"><i class="fa fa-window-restore" aria-hidden="true"></i></button></a>'; }) ->editColumn('thumbnail', function(Product $product){ return '<img style="width: 100px;height: 100px;" src="http://computer-shop.projectlaravel15.zent/storage/'.$product->thumbnail.'"/>'; }) ->rawColumns(['thumbnail','action']) ->toJson(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this...
[ "0.66179144", "0.6586331", "0.6486504", "0.6323427", "0.62988657", "0.62709075", "0.60674554", "0.6054786", "0.6042364", "0.5978568", "0.5909063", "0.58930415", "0.5886247", "0.5878446", "0.5869168", "0.58173126", "0.5799434", "0.57751644", "0.57472456", "0.57398564", "0.5734...
0.0
-1
Set the file contents for an image.
protected function generateReference(MediaInterface $media) { if (!$media->getBinaryContent()) { return; } $file = $this->getFilesystem()->get(sprintf('%s/%s.jpg', $this->generatePath($media), $media->getProviderReference()), true); try { $file->delete(); } catch (FileNotFound $e) { } $file = $this->getFilesystem()->get(sprintf('%s/%s.jpg', $this->generatePath($media), $media->getProviderReference()), true); $content = file_get_contents($media->getProviderMetadata()['thumbnail_url']); if ($content) { $result = $file->setContent($content); return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function setContentFromFile($file);", "function setImage( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n \n if ( get_class( $value ) == \"ezimage\" )\n {\n $this->ImageID = $value->id();\n }\n elseif...
[ "0.6570227", "0.6227276", "0.6141901", "0.6139232", "0.60554266", "0.5953699", "0.5944012", "0.5939999", "0.593147", "0.58973014", "0.5882916", "0.5875715", "0.58631873", "0.5856276", "0.5834096", "0.5828766", "0.5819336", "0.58125", "0.5810347", "0.57919776", "0.577116", "...
0.0
-1
Throw error on object clone The whole idea of the singleton design pattern is that there is a single object therefore, we don't want the object to be cloned.
public function __clone() { // Cloning instances of the class is forbidden _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor' ), '1.0.0' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __clone() {\n throw new Exception('You tried to clone a singleton object');\n }", "protected function __clone() {\n trigger_error('Cannot clone instance of Singleton pattern ...', E_USER_ERROR);\n }", "public function __clone()\n\t{\n\t\tthrow new Exception(\"You are not per...
[ "0.8487283", "0.83380693", "0.8316978", "0.81307954", "0.8041979", "0.8041979", "0.8022157", "0.79964036", "0.7860578", "0.78142977", "0.7804657", "0.7786285", "0.7765369", "0.76874286", "0.7637544", "0.7620833", "0.7606104", "0.7606104", "0.7606104", "0.7604492", "0.7604492"...
0.69623184
59
Disable unserializing of the class
public function __wakeup() { // Unserializing instances of the class is forbidden _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor' ), '1.0.0' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}", "public function __wakeup() {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Unserializing is forbidden!', 'be-table-ship' ), '4.0' );\n\t\...
[ "0.75626236", "0.71855295", "0.70274055", "0.6883399", "0.6554164", "0.64022416", "0.63761264", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101", "0.6321101"...
0.64913976
5
Register the CPTs with our Editor support.
public function init() { $this->add_cpt_support(); $this->init_components(); do_action( 'elementor/init' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cws_register_cpt() {\n\n\t\tforeach ( $this->cpts as $key => $value ) {\n\n\t\t\tregister_post_type( $key, $value );\n\n\t\t}\n\n\t}", "public function register() {\n\t\tadd_filter( 'mce_external_plugins', array( $this, 'enqueue_plugin_scripts' ) );\n\t\tadd_filter( 'mce_buttons', array( $this, '...
[ "0.6723161", "0.6458804", "0.63151777", "0.6307474", "0.6216233", "0.62007016", "0.6090466", "0.6073934", "0.60359704", "0.6021656", "0.60099787", "0.60093224", "0.60046685", "0.59512424", "0.58909655", "0.5868063", "0.58634764", "0.58485466", "0.5822289", "0.5820506", "0.581...
0.0
-1
Check that the PM that'll install the app's dependencies is present.
public function manager();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function checkNeededModules()\n\t{\n\t\t$modulesGot\t= array_keys( $this->env->getModules()->getAll() );\t\t\t\t\t\t\t\t// get installed modules\n\t\t$missing\t= array_diff( self::$modulesNeeded, $modulesGot );\t\t\t\t\t\t\t\t// find missing modules\n\t\tif( $missing ){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\...
[ "0.7080477", "0.6905977", "0.68921274", "0.68736047", "0.6844585", "0.6813209", "0.670286", "0.66821545", "0.66230553", "0.65831846", "0.65558594", "0.6553395", "0.65496224", "0.6546286", "0.6539437", "0.6490502", "0.6490502", "0.6490459", "0.647548", "0.6448872", "0.64251184...
0.0
-1