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
/ postEditResources Checks to see if the user data is valid if so it will update the DB if the user data is invalid will reload the edit user page.
public function postEditResources() { $id = $this->_params['id']; $errors = validateEditResource($id); if(!($errors === true)) { $database = new Database(); $resource = $database->getResourceById($id); /*construct($resourceID = "0", $resourceName = "Resource", $description = "Info", $contactName ="",$contactEmail = "",$contactPhone = "",$link = "", $active = "1" )*/ $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['Active']); $this->_f3->set('Resource', $availableResource); $this->_f3->set('errors', $errors); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/edit-resources.php'); echo Template::instance()->render('view/include/footer.php'); } else { // fixme add routing $this->_f3->reroute('/Admin'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function post_edit() {\n //try to edit the user\n if (AuxUser::editUser()) {\n //if the edit process worked, redirect to the profile page\n echo '<script>alert(\"User data edited\");</script>';\n Response::redirect('/profile');\n } else {\n //if not, print the error message\n ...
[ "0.6944832", "0.6506544", "0.64835507", "0.6443123", "0.63922614", "0.637695", "0.63103336", "0.6148198", "0.61414236", "0.6123014", "0.6107582", "0.6100233", "0.6037071", "0.60338557", "0.6010923", "0.5978386", "0.59742177", "0.5962707", "0.5936845", "0.59142584", "0.5901627...
0.71640736
0
/ deleteResource Does not delete resource rather deactivates the resources
public function deleteResource() { $database = new Database(); $id = $this->_params['id']; $database->deleteResource($id); $this->_f3->reroute('/Admin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDeleteResource();", "protected function _postDelete()\n {\n $this->clearResources();\n }", "public function deleteAllResources() {\n\t\t$this->resources = array();\n\t}", "public function destroy(Resource $resource)\n {\n //\n }", "public function delete()\n {...
[ "0.7185629", "0.6980644", "0.66985935", "0.6495744", "0.64732426", "0.6464758", "0.6454451", "0.63758194", "0.63742036", "0.6359977", "0.62655574", "0.6264933", "0.6247014", "0.61904836", "0.61854434", "0.6162815", "0.61621654", "0.6136099", "0.61252105", "0.61252105", "0.612...
0.7421805
0
/ reactivateResource reactivates resources
public function reactivateResource() { $database = new Database(); $id = $this->_params['id']; $database->reactivateResource($id); $this->_f3->reroute('/Admin'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reactivateAction()\n {\n $this->reactivateParameters = $this->reactivateParameters + $this->_reactivateExtraParameters;\n\n parent::reactivateAction();\n }", "public function reactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->reque...
[ "0.64953566", "0.6302144", "0.60357034", "0.589782", "0.5866548", "0.58366936", "0.5817751", "0.5729667", "0.5701669", "0.5700907", "0.5700907", "0.5695641", "0.569047", "0.56877214", "0.5616308", "0.559881", "0.5586113", "0.55649954", "0.55649954", "0.554401", "0.55416965", ...
0.8236729
0
/ viewResources Loads from the db all active AND current events and renders the resources page
public function viewResources() { $database = new Database(); $resources = $database->getAllActiveResourcesNoLimit(); $resourceArray = array(); $i = 1; foreach ($resources as $resource) { $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description'] , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] , $resource['Link'], $resource['active']); array_push($resourceArray, $availableResource); $i += 1; } $resourceSize = sizeof($resourceArray); $this->_f3->set('resourcesByActive', $resourceArray); $this->_f3->set('resourcesSize', $resourceSize); echo Template::instance()->render('view/include/head.php'); echo Template::instance()->render('view/include/top-nav.php'); echo Template::instance()->render('view/resources.php'); echo Template::instance()->render('view/include/footer.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction() {\n $this->view->events = $this->_events->getEventsAdmin($this->_getParam('page'));\n }", "public function events()\n {\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC'),\n 'cond...
[ "0.68937624", "0.6832855", "0.6737387", "0.66969204", "0.6687211", "0.66647995", "0.6630551", "0.6605819", "0.65798235", "0.65522707", "0.6503299", "0.64920044", "0.64855295", "0.64187247", "0.6392682", "0.6380522", "0.6375011", "0.63708305", "0.6357326", "0.6346072", "0.6332...
0.7391225
0
/ WAS WRITTEN BY A TEAMMATE isLoggedIn Checks to see if a "user" is logged in and has access to resource loading edit/add resources page
public function isLoggedIn() { $database = new Database(); $loggedIn = $database->getAdminByUsername($_SESSION['user']); $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']); if(isset($_SESSION['user']) === true && strpos($admin->getAdminLevel(), Resources) !== false && $admin->getActive() == 1) { $testLogin = true; } else { $this->_f3->reroute('/Login'); } $this->_f3->set('login', $testLogin); $this->_f3->set('admin', $admin); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "static public function isLoggedIn(){\n \treturn (self::getInstance()->getId()>1);\n }", "function isLoggedIn() {\n\t\t\tif(!$this->params['requested']) $this->cakeError('error404');\n\t\t\treturn $this->User->isLoggedIn...
[ "0.6789557", "0.6789557", "0.6721296", "0.67202145", "0.6572017", "0.65710735", "0.6539391", "0.6513537", "0.6506057", "0.6506057", "0.64774925", "0.64721805", "0.63732624", "0.6345719", "0.6341831", "0.6336483", "0.631939", "0.6312657", "0.63074297", "0.6304597", "0.63012326...
0.68913954
0
/ WAS WRITTEN BY A TEAMMATE getAdmin Verifies that someone trying to access the admin page has logged in. If that someone is not login it will route them to the login page
public function getAdmin() { $database = new Database(); $loggedIn = $database->getAdminByUsername($_SESSION['user']); $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']); if(isset($_SESSION['user']) === true) { $this->_f3->set('admin', $admin); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requireAdmin(){\n if( ! Authentifiacation::isAdmin()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to have admin status to access this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "static function admin...
[ "0.8054244", "0.7777837", "0.75882095", "0.7552186", "0.75491756", "0.74565184", "0.74287605", "0.7409076", "0.73957515", "0.7315286", "0.7308447", "0.73029226", "0.7275708", "0.7266576", "0.725833", "0.72552234", "0.72370064", "0.72073543", "0.72037816", "0.71794915", "0.717...
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { $token = JWTAuth::getToken(); if(! $token){ return response()->json('token_not_provided'); } try{ $user = JWTAuth::toUser($token); if($user){ return $next($request); } return response()->json("user_not_found"); } catch (TokenInvalidException $e) { return response()->json("token_invalid"); } catch (TokenExpiredException $e) { return response()->json("token_expired"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $...
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", ...
0.0
-1
Define the the function that we are going to use
function url_for($script_path) { //add the leading '/' if not present if ($script_path[0] != '/') { $script_path = "/" . $script_path; } return WWW_ROOT . $script_path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function functions() {\n \n }", "public function getFunction(): string;", "protected function func_default() {}", "function do_sth_function_name(){\r\n }", "public function __construct($fun) {\n $this->f = $fun;\n }", "abstract protected function registerFunctions();", "private functio...
[ "0.7220153", "0.6702545", "0.6652616", "0.65621185", "0.6543064", "0.653418", "0.64811385", "0.6353948", "0.63446176", "0.63319826", "0.6330111", "0.63197434", "0.6288069", "0.6269719", "0.6260873", "0.623088", "0.61987364", "0.61956865", "0.61627936", "0.61627936", "0.616279...
0.0
-1
In order to return 404 error, need to use the header function and need to provide a string. Use $_SERVER Global to ask for current server protocol is because protocol often change $_SERVER['SERVER_PROTOCOL'] => HTTP/1.1
function error_404() { header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); exit(); //don't do any additional php, we are done }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error404() {\n\t$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n\t$code='404';\n\t$text='Not Found';\n\theader($protocol . ' ' . $code . ' ' . $text);\n\t//header(\"Status: 404 Not Found\");\n\t//http_response_code(404);\n\techo \"<h1>404 Page Does Not Exist</...
[ "0.69290465", "0.67394394", "0.66866505", "0.6655946", "0.659888", "0.6528775", "0.6462135", "0.63780314", "0.6366909", "0.63486725", "0.6317152", "0.6209743", "0.62046796", "0.61609083", "0.6158642", "0.6140819", "0.6124501", "0.61047065", "0.6102851", "0.60945535", "0.60460...
0.6535155
5
Verifica que este disponible la cartelera para una cierta fecha y duracion
function isAvailable($fromDate, $duration) { return AdvertisementQuery::create() ->filterByBillboard($this) ->filterByPublished($fromDate, $duration) ->count() == 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasCtime(){\n return $this->_has(4);\n }", "public function vacio() {\n if ($this->cantcartas == -1)\n return TRUE;\n return FALSE;\n }", "public function hasRelivetime(){\n return $this->_has(3);\n }", "public function hasBepro2Time(){\n return $this->_has(4)...
[ "0.6272819", "0.6208066", "0.6101925", "0.6073597", "0.60542446", "0.59865636", "0.5970212", "0.5947909", "0.592344", "0.5922953", "0.5882857", "0.58813214", "0.58015174", "0.58010405", "0.5785437", "0.57784307", "0.5777827", "0.57568896", "0.57428116", "0.5732177", "0.571969...
0.0
-1
Obtiene los avisos que estan en esa cartelera el dia de hoy
private function getTodayAdvertisements() { return AdvertisementQuery::create() ->filterByCurrent() ->filterByBillboard($this) ->find(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtener_asignaciones (){ //HAY QUE LLEVARLO AL DATOS_TABLA\n //tiene cierto sentido usar la fecha actual, dado que el uso de las aulas puede ser dinamico. \n //Necesitamos saber como es la asignacion de horarios en un momento determinado.\n $fecha= date('Y-m-d');\n ...
[ "0.62381876", "0.62025577", "0.6146904", "0.6017865", "0.59610283", "0.59038466", "0.58935773", "0.5884213", "0.58777297", "0.5850989", "0.58470315", "0.5841806", "0.5779973", "0.5778349", "0.5769302", "0.5763265", "0.5751557", "0.574577", "0.5717188", "0.5713526", "0.5712035...
0.0
-1
Devuelve el motivo que se encuentra el dia de hoy en la cartelera.
public function getCurrentTheme() { //No usamos el getTodayAdvertisements, así nos ahorramos la hidratacion de cosas innecesarias return ThemeQuery::create() ->filterByBillboard($this) ->filterByCurrent() ->findOne(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function calcula13o()\n {\n }", "public function calcula13o()\n {\n }", "public function puestaACero()\n {\n $this->hh = 0;\n $this->mm = 0;\n $this->ss = 0;\n }", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "public functi...
[ "0.5940471", "0.5940471", "0.5940115", "0.59382796", "0.5841226", "0.5750094", "0.5741675", "0.57195616", "0.5683898", "0.56126505", "0.5603662", "0.55857307", "0.5568", "0.5550611", "0.5538794", "0.55119693", "0.5465808", "0.54591477", "0.54332155", "0.5400728", "0.5398417",...
0.0
-1
Devuelve el ultimo motivo publicado en esa cartelera a la fecha de hoy.
public function getLastTheme() { $advert = AdvertisementQuery::create() ->filterByLast() ->filterByBillboard($this) ->orderByPublishdate('desc') ->findOne(); if (empty($advert)) return false; return $advert->getTheme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diasvenc($fechamov,$diascred){\n\t\t$a=ceil((time() - (strtotime($fechamov)))/(60* 60*24))-$diascred;\n\t\t//if($a>0){$amod=$a;}else{$amod=0;}\n\t\t$amod = ($a < 0 ? 0 : $a);\n\t\treturn $amod;\n\t}", "function mdatosPublicaciones(){\n\t\t$conexion = conexionbasedatos();\n\n\t\t$consulta = \"select * fr...
[ "0.5942499", "0.5820981", "0.5764836", "0.5708186", "0.5681197", "0.56598574", "0.56247187", "0.5605407", "0.55942017", "0.5584095", "0.5564409", "0.5555876", "0.5553257", "0.55393404", "0.5538733", "0.5521087", "0.55160105", "0.5508137", "0.5507089", "0.55034435", "0.5503362...
0.0
-1
Devuelve el ultimo motivo publicado en esa cartelera a la fecha.
public function getPreviousTheme($date) { if (empty($date)) $date = date('Y-m-d'); $adverts = AdvertisementQuery::create() ->filterByBillboard($this) ->filterByPublishDate(array('max'=>$date)) ->orderByPublishdate('desc') ->limit(2) ->find(); if (empty($adverts)) return false; $advert = $adverts[1]; if (empty($advert)) return false; return $advert->getTheme(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function limite_trazadora($fecha) {\r\n $fecha = strtotime(fecha_db($fecha));\r\n $actualm = date('m', $fecha);\r\n $actualy = $actualy2 = date('Y', $fecha);\r\n // $ano = date('Y', $fecha);\r\n $desdem1 = '01';\r\n $hastam1 = '04';\r\n $desdem2 = '05';\r\n $hastam2 = '08';\r\n $desdem3 ...
[ "0.5926407", "0.5907499", "0.57880217", "0.5761188", "0.5756349", "0.57389313", "0.57246476", "0.56818837", "0.56589484", "0.5628369", "0.55916005", "0.55737406", "0.5556375", "0.5555286", "0.55334634", "0.5532756", "0.5531798", "0.5523191", "0.55043286", "0.55030954", "0.550...
0.0
-1
This route is only valid for multi locale applications.
public function landing(Request $request, AccountManager $manager) { if ($manager->account()->locales->count() == 1) { return redirect()->to(store_route('store.home')); } if ($request->hasCookie('locale')) { return redirect()->to(store_route('store.home', [], [], $request->cookie('locale'))); } return $this->theme->render('home.landing'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function localeIndex();", "static function locale() {\n return strtolower(str_replace('controllers\\\\', '', Route::$controller) . '/' . Route::$action);\n }", "public function resolveLocale(Request $request);", "private function processLocale(): void\n {\n if ($this->request->has(...
[ "0.6297009", "0.6190423", "0.60642624", "0.6004546", "0.59710073", "0.5923558", "0.587926", "0.57957155", "0.5716554", "0.568837", "0.56763977", "0.5654062", "0.5647281", "0.5638102", "0.562977", "0.5603264", "0.55766624", "0.55453104", "0.55276614", "0.55271506", "0.54872084...
0.0
-1
Method returning the class name
public function __toString() { return __CLASS__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName();", "public function getClassName();", "public function getClassName() ;", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName()\n {\n ...
[ "0.87522393", "0.87522393", "0.8751158", "0.87397957", "0.87397957", "0.87397957", "0.87397957", "0.8731564", "0.8696754", "0.8673495", "0.8638432", "0.8615335", "0.8603119", "0.8566906", "0.8562364", "0.8555002", "0.85503733", "0.85503733", "0.85425884", "0.8533183", "0.8529...
0.0
-1
Run the database seeds.
public function run() { $regions = [ [ 'name' => 'Region 1', 'country_id' => 1 ], [ 'name' => 'Region 2', 'country_id' => 1 ], [ 'name' => 'Region 7', 'country_id' => 2 ], [ 'name' => 'Region 3', 'country_id' => 2 ] ]; Region::insert($regions); }
{ "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
Register any application services.
public function register() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n ...
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647",...
0.0
-1
Bootstrap any application services.
public function boot() { Route::bind('user_domain', function ($value) { return EventList::where('domain', $value)->firstOrFail(); }); Route::bind('event', function ($value, \Illuminate\Routing\Route $route) { return Event::where([ 'id' => $value, 'event_list_id' => $route->parameter('user_domain')->id, ])->firstOrFail(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public func...
[ "0.7344842", "0.7212776", "0.7207748", "0.7123287", "0.7109729", "0.70822036", "0.7076881", "0.70718396", "0.7051853", "0.7025475", "0.7011949", "0.70043486", "0.6955807", "0.69322443", "0.69319373", "0.69272774", "0.6911386", "0.69069713", "0.6898877", "0.6898432", "0.689659...
0.0
-1
Test to get the path
public function testGetStructure() { $expectedValue = array('structure'); $interface = $this->getMock( 'Shwager\IO\PathAdapterInterface' ); $interface->expects($this->exactly(1)) ->method('getPath') ->will($this->returnValue($expectedValue)); $adapter = new Filesystem($interface); $this->assertEquals( $expectedValue, $adapter->getStructure() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next ...
[ "0.731153", "0.7238162", "0.7201637", "0.719667", "0.7112976", "0.70449513", "0.7042499", "0.7033169", "0.6951757", "0.69472307", "0.69304365", "0.69269663", "0.6926702", "0.6926702", "0.6926702", "0.6926702", "0.6926468", "0.6877609", "0.6877609", "0.6860982", "0.6836426", ...
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n ...
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", ...
0.0
-1
Return new link position in list
protected function _getNewPosition($position = 0) { if (intval($position) > 0) { while (isset($this->_links[$position])) { $position++; } } else { $position = 0; foreach ($this->_links as $k=>$v) { $position = $k; } $position += 10; } return $position; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddLink()\n\t\t{\n\t\t\t$n=count($this->links)+1;\n\t\t\t$this->links[$n]=array(0,0);\n\t\t\treturn $n;\n\t\t}", "public function getSortNewItemsPosition()\n\t{\n\t\treturn $this->new_items_position;\n\t}", "public function getNextPosition(): Position;", "abstract function incrementPosition();", "...
[ "0.6248835", "0.6009544", "0.5550225", "0.54498684", "0.5420793", "0.5336731", "0.5322765", "0.53133106", "0.52839047", "0.52218425", "0.5215148", "0.52128255", "0.5184581", "0.517296", "0.5140279", "0.51061803", "0.51061803", "0.5105887", "0.50225216", "0.50225216", "0.50225...
0.67542017
0
Called after the check that all required registry values have been set correctly has run.
public function afterRegistry() { parent::afterRegistry(); $setOnSave = \MUtil_Model_ModelAbstract::SAVE_TRANSFORMER; $switches = $this->getTextSettings(); // Make sure the calculated name is saved if (! isset($switches['gaf_calc_name'], $switches['gaf_calc_name'][$setOnSave])) { $switches['gaf_calc_name'][$setOnSave] = array($this, 'calcultateAndCheckName'); } // Make sure the class name is always saved $className = $this->getFilterClass(); $switches['gaf_class'][$setOnSave] = $className; // Check all the fields for ($i = 1; $i <= $this->_fieldCount; $i++) { $field = 'gaf_filter_text' . $i; if (! isset($switches[$field])) { $switches[$field] = array('label' => null, 'elementClass' => 'Hidden'); } } $this->addSwitches(array($className => $switches)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterRegistry()\n {\n // parent::afterRegistry();\n }", "public function _postSetup()\n {\n }", "protected function _afterInit() {\n\t}", "protected function _afterLoad()\n {\n $value = $this->getValue();\n $value = $this->makeArrayFieldValue($value);\n ...
[ "0.68310964", "0.6183567", "0.6080569", "0.58820194", "0.5874268", "0.5823956", "0.57339865", "0.5690948", "0.56816816", "0.5657382", "0.56545395", "0.5621424", "0.56193453", "0.55444795", "0.55439675", "0.55289674", "0.55206746", "0.54871184", "0.5470702", "0.5470258", "0.54...
0.61463535
2
A ModelAbstract>setOnSave() function that returns the input date as a valid date.
public function calcultateAndCheckName($value, $isNew = false, $name = null, array $context = array()) { return substr($this->calcultateName($value, $isNew, $name, $context), 0, $this->_maxNameCalcLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\tif ( ! isset($this->object['date_created']))\n\t\t\t$this->date_created = time();\n\n\t\treturn parent::save();\n\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n ...
[ "0.63212705", "0.62854666", "0.6247112", "0.6004694", "0.5854927", "0.5808116", "0.57486296", "0.57179886", "0.57044554", "0.5703642", "0.56785107", "0.5657695", "0.562837", "0.56162703", "0.5582937", "0.55817187", "0.55817187", "0.55817187", "0.55817187", "0.55817187", "0.55...
0.0
-1
A ModelAbstract>setOnSave() function that returns the input date as a valid date.
abstract public function calcultateName($value, $isNew = false, $name = null, array $context = array());
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\tif ( ! isset($this->object['date_created']))\n\t\t\t$this->date_created = time();\n\n\t\treturn parent::save();\n\t}", "public function save()\n {\n if ( ! $start_date = $this->getData(\"start_date\"))\n {\n $start_date = time();\n }\n\n ...
[ "0.6323972", "0.6289273", "0.6249922", "0.6007786", "0.5855204", "0.5807395", "0.5749008", "0.57190585", "0.57075435", "0.57050157", "0.5679343", "0.5655015", "0.5628862", "0.5618347", "0.5585396", "0.5585396", "0.5585396", "0.5585396", "0.5585396", "0.5584679", "0.55816185",...
0.0
-1
Get the class name for the filters, the part after _Agenda_Filter_
abstract public function getFilterClass();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getFilterClassName($string);", "abstract public function getFilterName();", "public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }", "public function getFilterClass()\n {\n return 'XorAppointmentFilter';\n }", "protected func...
[ "0.76527405", "0.73842394", "0.72981423", "0.72673875", "0.70962036", "0.70402944", "0.6758032", "0.6728297", "0.65830535", "0.6531211", "0.6508014", "0.64513385", "0.6425756", "0.64106566", "0.6368361", "0.6333866", "0.632712", "0.6317778", "0.6281755", "0.62220657", "0.6213...
0.77549744
0
Get the name for this filter class
abstract public function getFilterName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function filterName(): string\n {\n return Str::snake(class_basename($this));\n }", "public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }", "function getName($filter=null)\n {\n return $this->factory->getName($filter);\n }", "publi...
[ "0.8418346", "0.8402424", "0.78485614", "0.75618035", "0.7304917", "0.72832954", "0.7238969", "0.7238969", "0.7219807", "0.71873677", "0.7166284", "0.71581054", "0.7144649", "0.7128745", "0.71146184", "0.7111811", "0.71107036", "0.7081323", "0.7078025", "0.70708716", "0.70251...
0.80865985
2
Get the settings for the gaf_filter_textN fields Fields not in this array are not shown in any way
abstract public function getTextSettings();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function advanced_settings_fields_filter1($fields) {\n $model_config = WYSIJA::get('config', 'model');\n if ($model_config->getValue('premium_key')) {\n unset($fields['bounce_email']);\n }\n return $fields;\n }", "private static function get_ignored_fields() {\n\n\t\t// ...
[ "0.65086347", "0.6114594", "0.61078006", "0.610134", "0.6061441", "0.58987826", "0.58746034", "0.58203727", "0.58059883", "0.57897055", "0.57860893", "0.5742404", "0.57175267", "0.5700774", "0.5685038", "0.56740046", "0.566802", "0.56651014", "0.5658513", "0.5651581", "0.5647...
0.5144086
89
Set the maximum length of the calculated name field
public function setMaximumCalcLength($length = 200) { $this->_maxNameCalcLength = $length; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaxLength($maxLength) {}", "function set_field_length($len) \n {\n $this->attribs['maxlength'] = $len;\n }", "public function setMaxLength($length);", "function setMaxLength($length) {\n\n $this->field['maxlength'] = $length;\n return $this;\n\n }", "public function s...
[ "0.74492687", "0.73886585", "0.7307014", "0.7132721", "0.6975488", "0.6970148", "0.68450147", "0.6787955", "0.67832434", "0.6746053", "0.6727918", "0.67233795", "0.66960144", "0.65862185", "0.6548397", "0.65476453", "0.6528528", "0.65157795", "0.6489467", "0.6470448", "0.6462...
0.7674192
0
Set response error status and message
public function error($message = '') { $this->success = false; $this->message($message); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setErrorHeader() {\n\t\tif ($this->response_code >= 400 && $this->response_code < 500) {\n\t\t\theader('HTTP/1.1 ' . $this->response_code . \" \" . SVException::g($this->response_code));\n\t\t\texit(0);\n\t\t}\n\t}", "private function reset_response() {\n // Defautl is server error beca...
[ "0.7454058", "0.72934115", "0.7241961", "0.71591866", "0.7121617", "0.6962635", "0.6898001", "0.68863374", "0.68378025", "0.68201274", "0.67206264", "0.6700685", "0.6657028", "0.66181225", "0.6586576", "0.65821564", "0.6556671", "0.6527565", "0.6524617", "0.651788", "0.650645...
0.0
-1
Get the instance as an array
public function toArray() { return [ 'success' => $this->success, 'error' => !$this->success, 'message' => $this->message, ] + $this->data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instanceToArray() : array{\n\n if(!method_exists(self::class,'instance')):\n return [];\n endif;\n\n return self::instance()->toArray();\n }", "public function toArray($instance): array;", "public function getAsArray();", "function asArray(){\n\t\t\t$...
[ "0.864675", "0.8238217", "0.8088638", "0.8003329", "0.7867979", "0.7858977", "0.78543174", "0.77583474", "0.774783", "0.77462906", "0.77462906", "0.77462906", "0.7745846", "0.7745846", "0.7745597", "0.7745597", "0.7745597", "0.7745597", "0.7745164", "0.7745164", "0.7745164", ...
0.0
-1
Convert the object to its JSON representation
public function toJson($options = JSON_UNESCAPED_UNICODE) { return json_encode($this->toArray(), $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toJson($object);", "public function json(){ return json_encode( $this->objectify() ); }", "public function toJson();", "public function toJson();", "public function to_json()\n {\n }", "public function to_json()\n {\n }", "public function to_json()\n {\n ...
[ "0.8347026", "0.79315275", "0.79295844", "0.79295844", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7759554", "0.7589829", "0.7587483", "0.7549625", "0.7536761", "0.752455", "0.75008", "0.7490271", "0.7486798", "...
0.0
-1
dodanie pozycji w menu plugins
function smartecruiters_config_page(){ if ( function_exists('add_submenu_page') ){ add_submenu_page('plugins.php', 'Job Manager by SmartRecruiters', 'Job Manager by SmartRecruiters', 'manage_options', 'smartrecruiters-config', 'smartrecruiters_config'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function menus()\n {\n\n }", "public function modMenu() {}", "public function modMenu() {}", "public function modMenu() {}", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }", "protected function getModuleMenu() {}", ...
[ "0.7531215", "0.743294", "0.74321884", "0.74321276", "0.7372637", "0.7372637", "0.7372637", "0.7358275", "0.7358275", "0.73567337", "0.7338884", "0.72976726", "0.7237124", "0.7204577", "0.7171672", "0.7157253", "0.7107988", "0.7106512", "0.70925164", "0.70593715", "0.7047111"...
0.0
-1
wyswietlanie strony z konfiguracja pluginu
function smartrecruiters_config(){ $is_connected = get_option('sr_connected'); if($is_connected){ //aplikacja juz polaczona, trzeba pokazac mozliwosc odlaczenia //jesli kliknieto disconnect if(isset($_POST['sr_disconnect']) && $_POST['sr_disconnect']){ //rozlaczyc i odswiezyc strone zeby pokazac formularz logowania update_option('sr_connected', 0); update_option('sr_company', null); $location = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; echo '<script>window.location = "'.$location.'";</script>'; } //pobieramy joby zeby meic departmenty i lokacje $company_name = get_option('srcompany'); $url = 'https://www.smartrecruiters.com/cgi-bin/WebObjects/share.woa/wa/careersite?wpp_company='.$company_name; //pobieramy joby $get_jobs = @file_get_contents($url); $xml = @simplexml_load_string($get_jobs, 'SimpleXMLElement', LIBXML_NOCDATA); $jobs = json_decode(json_encode($xml), true); if( isset($_POST['template']) ){ update_option('sr_jobDetailsPageTemplate', esc_attr($_POST['template']) ); } $available_templates = get_page_templates(); $active_template = get_option('sr_jobDetailsPageTemplate'); //widok konfigurancji i odlaczania include('configure.php'); }else{ if(!empty($_GET['srcompany']) && $_GET['srcompany']){ update_option('sr_connected', 1); update_option('srcompany', $_GET['srcompany']); $location = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; echo '<script>window.location = "'.$location.'";</script>'; } //widok laczenia/logowania include('connect.php'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPluginConfig()\n {\n $form = $this->Form();\n $parent = $this->Forms()->findOneBy(array('name' => 'Interface'));\n $form->setParent($parent);\n\n $form->setElement('checkbox', 'fontawesome_add', array(\n 'label' => 'Fontawesome Icons über CDN einbinden?',\n ...
[ "0.66924256", "0.66799957", "0.64847684", "0.6476168", "0.64138377", "0.63028073", "0.630192", "0.6287042", "0.6281437", "0.6254262", "0.6239765", "0.623923", "0.6230911", "0.62222046", "0.6203148", "0.61952436", "0.6190213", "0.6178388", "0.6139375", "0.6135726", "0.6133105"...
0.0
-1
Returns the static model of the specified AR class.
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model() {\n return parent::model(get_called_class());\n }", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($cl...
[ "0.74850124", "0.73803526", "0.7154113", "0.71401674", "0.70629025", "0.703232", "0.69285315", "0.69285315", "0.6925706", "0.6902751", "0.6894916", "0.6894916", "0.68900806", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0.68698424", "0....
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new CDbCriteria; $criteria->compare('stock_id',$this->stock_id); $criteria->compare('visibility',$this->visibility); $criteria->compare('menu_name',$this->menu_name,true); $criteria->compare('end_date',$this->end_date); $criteria->compare('end_time',$this->end_time); $criteria->compare('short_text',$this->short_text,true); $criteria->compare('img',$this->img,true); $criteria->compare('position',$this->position); $criteria->compare('date',$this->date); $criteria->compare('in_main',$this->in_main); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w...
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.597930...
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth', ['except' => ['welcome', 'index', 'botSkull', 'quemSomos']]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.687...
0.0
-1
Show the application dashboard.
public function home(Request $request) { // activity() // ->withProperties(['ip' => $request->ip(), 'ua' => $request->header('User-Agent')]) // ->log('Café com pão'); $user = Auth::user(); // var_dump($user->id); return view('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n ...
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", ...
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n ...
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", ...
0.0
-1
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { if (Auth::user()->cant('create', Coupon::class)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $view = view('admin.coupon_create'); $view->with('title', 'New coupon'); return $view; }
{ "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) { if (Auth::user()->cant('create', Coupon::class)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $rules = [ 'code' => 'required|unique:coupons', 'value' => 'required|numeric|min:0.01', 'expire' => 'date_format:"d.m.Y"|nullable', 'min_order_price' => 'numeric|nullable|min:0.01', 'max_usages' => 'integer|nullable|min:0', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->route('coupons.create')->withErrors($validator)->withInput(); } $coupon = new Coupon(); $coupon->code = $request->get('code'); $coupon->value = $request->get('value'); $coupon->type = $request->get('type'); $coupon->expire = $request->get('expire'); $coupon->min_order_price = $request->get('min_order_price'); $coupon->max_usages = $request->get('max_usages'); $coupon->save(); return redirect()->route('coupons.edit', ['id'=>$coupon->id]); }
{ "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(Coupon $coupon) { // }
{ "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(Request $request, Coupon $coupon) { if (Auth::user()->cant('view', $coupon)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $view = view('admin.coupon_edit'); $view->with('title', $coupon->code); $er = $request->session()->get('errors'); if (!empty($er)) { $coupon->code = $request->old('code'); $coupon->value = $request->old('value'); $coupon->type = $request->old('type'); $coupon->expire = $request->old('expire'); $coupon->min_order_price = $request->old('min_order_price'); $coupon->max_usages = $request->old('max_usages'); } $view->with('coupon', $coupon); return $view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Coupon $coupon) { if (Auth::user()->cant('update', $coupon)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } $rules = [ 'code' => 'required|unique:coupons,code,'.$coupon->id, 'value' => 'required|numeric|min:0.01', 'expire' => 'date_format:"d.m.Y"|nullable', 'min_order_price' => 'numeric|nullable|min:0.01', 'max_usages' => 'integer|nullable|min:0', ]; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return redirect()->route('coupons.edit', ['id'=>$coupon->id])->withErrors($validator)->withInput(); } $coupon->code = $request->get('code'); $coupon->value = $request->get('value'); $coupon->type = $request->get('type'); $coupon->expire = $request->get('expire'); $coupon->min_order_price = $request->get('min_order_price'); $coupon->max_usages = $request->get('max_usages'); $coupon->save(); return redirect()->route('coupons.edit', ['id'=>$coupon->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(Coupon $coupon) { if (Auth::user()->cant('delete', $coupon)) { return redirect()->route('admin.home')->with(['message'=>'You don\'t have permissions']); } Coupon::destroy($coupon->id); return redirect(url()->previous()); }
{ "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
Display a listing of the resource.
public function index() { $listAdministrativeRegions = AdministrativeRegion::paginate(5); return view('admin.administrative-regions.index', \compact('listAdministrativeRegions')); }
{ "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() { return view('admin.administrative-regions.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(StoreAdministrativeRegion $request) { AdministrativeRegion::create($request->all()); return redirect()->route('admin.administrative-regions.index'); }
{ "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(AdministrativeRegion $administrativeRegion) { return view('admin.administrative-regions.show', compact('administrativeRegion')); }
{ "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(AdministrativeRegion $administrativeRegion) { return view('admin.administrative-regions.edit', compact('administrativeRegion')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(UpdateAdministrativeRegion $request, AdministrativeRegion $administrativeRegion) { $administrativeRegion->fill($request->all()); $administrativeRegion->save(); return redirect()->route('admin.administrative-regions.index'); }
{ "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(AdministrativeRegion $administrativeRegion) { $administrativeRegion->delete(); return redirect()->route('admin.administrative-regions.index'); }
{ "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
Set the key for the page number parameter.
public function withPageParam(string $key): self { if (empty($key)) { throw new \InvalidArgumentException('Page parameter cannot be an empty string.'); } $this->pageParam = $key; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPageKey($key);", "public function setPageNum($num) {\n\t\t$this->pageNum = (int) $num;\t\n\t}", "public function setPageNumber($pageNumber);", "public function setPageNumber(int $pageNumber): void\n {\n $this->pageNumber = $pageNumber;\n }", "public function get_pagination_a...
[ "0.78210336", "0.68856734", "0.6654975", "0.63794965", "0.6336197", "0.627285", "0.60803854", "0.60276425", "0.600012", "0.5999961", "0.5940436", "0.593753", "0.58907956", "0.58324176", "0.5829354", "0.5825448", "0.58207023", "0.5815609", "0.5793507", "0.5774191", "0.57635015...
0.6386192
3
Set the key for the perpage parameter.
public function withPerPageParam(string $key): self { if (empty($key)) { throw new \InvalidArgumentException('Per-page parameter cannot be an empty string.'); } $this->perPageParam = $key; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPageKey($key);", "public function setPerPage($perPage);", "public function get_pagination_arg($key)\n {\n }", "public function withPageParam(string $key): self\n {\n if (empty($key)) {\n throw new \\InvalidArgumentException('Page parameter cannot be an em...
[ "0.73899084", "0.6549948", "0.62477964", "0.6237446", "0.6220721", "0.6081021", "0.6050613", "0.5877966", "0.58756673", "0.5864102", "0.5797858", "0.57243615", "0.56976736", "0.568367", "0.566052", "0.5654659", "0.5631701", "0.562285", "0.561116", "0.55858237", "0.5580219", ...
0.68039346
1
Key/value list of vatRate/vatPriceTotal
public function getVatPriceTotal(): array { return $this->vatPriceTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getFormattedVats(): array\n {\n $vats = $this->cart->getVats();\n\n foreach ($vats as $key => $vat) {\n $vats[$key]['total'] = TemplateModifiers::formatNumber($vat['total'], 2);\n }\n\n return $vats;\n }", "public function getTotalsWithVatFromPrices($...
[ "0.64281356", "0.61658955", "0.61197674", "0.59062016", "0.5806182", "0.5791746", "0.5759514", "0.56852436", "0.55438447", "0.55372775", "0.5531466", "0.5474502", "0.54507136", "0.5446054", "0.53707105", "0.53259575", "0.5318655", "0.5294964", "0.5284472", "0.5279797", "0.527...
0.68363667
0
Display a listing of the resource.
public function index(Request $request) { $filter = $request->only([ 'name', 'code' ]); return view('department.index', [ 'table' => Department::table(), 'departments' => Department::list($filter), 'filter' => $filter, ]); }
{ "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() { return view('department.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(StoreDepartment $request) { $data = $request->validated(); current_user()->createDepartment($data); return response()->json([ 'message' => 'Tạo khoa mới thành công.', 'redirect_to' => route('departments.index'), ]); }
{ "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
Show the form for editing the specified resource.
public function edit($id) { $department = Department::findOrFail($id); return view('department.edit', [ 'department' => $department ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(UpdateDepartment $request, $id) { $data = $request->validated(); current_user()->updateDepartment($id, $data); return response()->json([ 'message' => 'Sửa khoa thành công.', 'redirect_to' => 'RELOAD', ]); }
{ "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(Request $request, $id) { Department::findOrFail($id); current_user()->destroyDepartment($id); return response()->json([ 'message' => 'Đã xóa khoa.', 'redirect_to' => $request->redirect_to ?? 'RELOAD' ]); }
{ "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
Remove the resource list from storage.
public function destroyList(Request $request) { Department::findOrFail($request->ids); current_user()->destroyListDepartment($request->ids); return response()->json([ 'message' => 'Đã xóa các khoa.', 'redirect_to' => 'RELOAD' ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy()\n {\n $this->items = array();\n }", "public function destroy() {\n unset($this->items);\n $this->items = false;\n }", "public function clearStorage(): void\n {\n// foreach ($this->remoteFilesystems as $filesystem) {\n// $contents = $f...
[ "0.6390973", "0.6346092", "0.6188612", "0.6170873", "0.6170873", "0.6170873", "0.6170873", "0.6146227", "0.61462194", "0.60913384", "0.6053139", "0.6026833", "0.59767526", "0.5941312", "0.5903771", "0.58983904", "0.58888906", "0.5884768", "0.58525175", "0.5850606", "0.5843922...
0.0
-1
/ Plugin Name: Post asssignment Description: Displays posts. Plugin URI: Author: Rama Chaudhry Author URI: / As stated in the wordpress codex, the following code ; the first register post type function will display labels, which are written below. Next, the second part of the argument will ensure that it shows on the front part of the website for the user this code below will allow for the enqueue of a stylesheet for the plugin.
function plugin_enqueue_scripts (){ wp_enqueue_style ('postplugin', plugins_url ('plugin/css/pluginstyle.css')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive...
[ "0.73344046", "0.701116", "0.69997287", "0.69871527", "0.6980512", "0.68633753", "0.6851531", "0.68435717", "0.68285596", "0.68285596", "0.68080693", "0.68026465", "0.6798774", "0.6787967", "0.6778411", "0.67749137", "0.6774757", "0.6764531", "0.6760168", "0.67575055", "0.675...
0.0
-1
/ This following code below will register the post type for the lable goals.
function custom_post_type () { // These labels below will create the necessary variables and items required for the goals post type. $labels = array ( 'name' => 'goals', 'singular_name' => 'goals', 'add_new' => 'Weekly goals', 'all_items' => 'All Items', 'edit_item' => 'Edit Item', 'new_item' => 'New Item', 'search_iterm' => 'Search goals', 'not_found' => 'No Item Found', 'not_found_in_trash' => 'No Item Found in Trash', 'parent_item_colon' => 'Parent Item' ); /*this following array will allow the plugin post type to display on wordpress, along with added a custom menu icon to the goals menu option, as seen on the wordpress backend. 'menu_icon' => 'dashicons-thumbs-up' is the line of code responsible for the changing of icons, using dash icons. */ $args = array( 'labels' => $labels, 'public' => true, 'has_archive' => true, 'menu_icon' => 'dashicons-thumbs-up', 'publicly_queryable' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => true, /*the supports function below will allow for there to be an array of a title,editor and feature a thumbnail for the posts created in the goals section of wordpress.*/ 'supports' => array( 'title', 'editor', 'thumbnail' ), /*Taxonomies have been created below to allow for categories to be displayed in the */ 'taxonomies' => array ('category', 'post_tag'), 'exclude_from_search' => false, ); register_post_type('goals', $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "public function register_post(): void\n {\n $args = $this->register_post_type_args();\n register_post_type($this->post...
[ "0.7652043", "0.7373033", "0.7366022", "0.729813", "0.7241988", "0.72414076", "0.72075504", "0.7206499", "0.71905524", "0.7181688", "0.71801776", "0.7170963", "0.7161476", "0.7099544", "0.7098865", "0.70391744", "0.703729", "0.703729", "0.70089895", "0.70007676", "0.69947815"...
0.718849
9
/ With this function, it will allow for the user end of the widget to be created.
public function widget( $args, $instance ) { extract($args); $title = apply_filters('widget_title', $instance['title']); $rama = $instance['rama']; echo $before_widget; if($title) { echo $before_title . $title . $after_title; } $this->get_my_events($rama); echo $after_widget; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWidget()\r\n {\r\n }", "public function widget( $args, $instance ){}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "protected function makeJqWidget()\n {\n parent...
[ "0.69187385", "0.62519264", "0.6249595", "0.6249595", "0.61652976", "0.6151104", "0.61351955", "0.6130932", "0.6126627", "0.6088478", "0.60428894", "0.60367996", "0.60367996", "0.5971482", "0.5961715", "0.5961715", "0.5961715", "0.5961715", "0.5955849", "0.5955159", "0.591439...
0.0
-1
/ A custom query that returns the post's title and Learn More text as links to the rest of the content. The query also returns a thumbnail and the excerpt. There will be only 3 posts returned, they will be from the custom 'Portfolio' post type and they will appear in descending order.
function get_my_events($rama) { global $post; $events = new WP_Query(); $events->query('post_type=Rama&showposts=5&order=desc' . $rama); if($events->found_posts>0) { echo '<ul class="rama_widget">'; while($events->have_posts()) { $events->the_post(); $image = (has_post_thumbnail($post->ID)) ? get_the_post_thumbnail($post->ID) : '<div class="missingthumbnail"></div>'; $eventItem = '<li>' . $image; $eventItem .= '<a href="' . get_permalink() . '">'; $eventItem .= get_the_title() . '</a>'; $eventItem .= '<span>' . get_the_excerpt() . ''; $eventItem .= '<a class="widgetmore" href="' . get_permalink() . '">'; $eventItem .= '<p>Read More... </p>' . '</a></span></li>'; echo $eventItem; } echo '</ul>'; wp_reset_postdata(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accouk_homepage_latest_posts() {\n\n $args = array('post_type' => 'post', 'category_name' => 'blog', 'posts_per_page' => 4, 'orderby' => 'date', 'order' => 'DESC');\n $query = new WP_Query( $args );\n\n if ( $query->have_posts() ) {\n\n echo '<ul class=\"post-list homepage-post-list\">';\n\n \twhil...
[ "0.64511055", "0.63517827", "0.6329098", "0.6320667", "0.6284656", "0.6250807", "0.61685264", "0.6159238", "0.6129849", "0.60873276", "0.60358024", "0.6032005", "0.60119677", "0.60119534", "0.6008413", "0.60030293", "0.59892267", "0.59686154", "0.59680957", "0.59212637", "0.5...
0.0
-1
/ the below function will allow for a form to be created on the WordPress backend for the
public function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = strip_tags($instance['title']); ?> <!-- Creates a 'Title' label and an input for the user to enter a custom widget title. --> <p> <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /> </p> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createForm();", "public function createForm();", "function create_form(){\n\t\n\t$table =\"<html>\";\n\t$table.=\"<head>\";\n\t$table.=\"\t<title>New Article Entry Page</title>\";\n\t$table.=\"</head>\";\n\t\n\t// URL for the wordpress post handling page\n\t$link_admin_post = admin_url('admin-p...
[ "0.7294936", "0.7294936", "0.72829443", "0.7278019", "0.727152", "0.72694236", "0.70235556", "0.7021878", "0.69762367", "0.69762367", "0.6962989", "0.69510466", "0.6927564", "0.6916286", "0.68897873", "0.6839091", "0.6811371", "0.68060887", "0.67589176", "0.671441", "0.67018"...
0.0
-1
/ This will save new instances created by the users and updated the title sections
public function update( $new_instance, $old_instance ) { $instance = $old_instance; $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '' ) ); $instance['title'] = strip_tags($new_instance['title']); return $instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n Title::create(['title'=>'Mr','title_description'=>'Mr']);\n Title::create(['title'=>'Mrs','title_description'=>'Mrs']);\n Title::create(['title'=>'Ms','title_description'=>'Ms']);\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$...
[ "0.6061349", "0.5964308", "0.5899348", "0.5862726", "0.5855971", "0.58386457", "0.5832941", "0.5831341", "0.5764068", "0.5760554", "0.575881", "0.5749963", "0.57385254", "0.5720199", "0.5710476", "0.56875086", "0.56846267", "0.56706953", "0.56700563", "0.5668401", "0.56479895...
0.0
-1
$sql = "SELECT COUNT(DISTINCT p.product_id) AS total FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id)";
public function getTotalParts($data = array()) { $sql = "SELECT COUNT(DISTINCT parts_id) AS total FROM " . DB_PREFIX . "parts WHERE status = 1"; if (!empty($data['filter_name'])) { $sql .= " AND title LIKE '" . $this->db->escape($data['filter_name']) . "%'"; } // if (!empty($data['filter_model'])) { // $sql .= " AND p.model LIKE '" . $this->db->escape($data['filter_model']) . "%'"; // } if (isset($data['filter_price']) && !is_null($data['filter_price'])) { $sql .= " AND price LIKE '" . $this->db->escape($data['filter_price']) . "%'"; } if (isset($data['filter_quantity']) && !is_null($data['filter_quantity'])) { $sql .= " AND quantity = '" . (int)$data['filter_quantity'] . "'"; } if (isset($data['filter_status']) && !is_null($data['filter_status'])) { $sql .= " AND status = '" . (int)$data['filter_status'] . "'"; } $query = $this->db->query($sql); return $query->row['total']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productst...
[ "0.6860065", "0.64586604", "0.6401342", "0.6273664", "0.6234657", "0.6221779", "0.618001", "0.61699814", "0.6071429", "0.6009098", "0.59950674", "0.59825134", "0.59689444", "0.5936221", "0.5932146", "0.5905799", "0.58970314", "0.58534", "0.58518595", "0.581405", "0.5784323", ...
0.0
-1
$sql= "SELECT ep.parent_product_id,p.model FROM `".DB_PREFIX."extend_to_product` ep left join product p on p.product_id = ep.parent_product_id WHERE ep.product_id = '" . (int)$product_id . "'";
public function getProductParent($product_id = 0){ $sql = "SELECT product_id as parent_product_id, model FROM `".DB_PREFIX."product` where product_id = '" . (int)$product_id . "'"; $query = $this->db->query($sql); return $query->rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_i...
[ "0.66640514", "0.6497889", "0.64591616", "0.6380273", "0.63108003", "0.60890007", "0.60820985", "0.6040566", "0.6034275", "0.59665245", "0.5910264", "0.5884655", "0.58806074", "0.5864363", "0.5824354", "0.57905424", "0.5744224", "0.5731357", "0.57016665", "0.57014763", "0.570...
0.65871334
1
Adds a link tag, with the various attributes set as specified
public function render($rel, $href, $hreflang = '', $media = '', $sizes = '', $type = '') { $attributes = array(); $attributes['rel'] = $rel; $attributes['href'] = $href; if($hreflang) { $attributes['hreflang'] = $hreflang; } if($media) { $attributes['media'] = $media; } if($sizes){ $attributes['sizes'] = $sizes; } if($type) { $attributes['type'] = $type; } $tagAttributes = ''; foreach($attributes as $attribute => $value) { $tagAttributes .= " $attribute=\"$value\""; } $linkTag = "<link" . $tagAttributes . " >"; $this->addPageHeader($linkTag, md5($rel . ':' . $href )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addLink(string $name, array $attributes);", "public function add_link($rel, $href, $attributes = array())\n {\n }", "public function testLinkWithAribtraryAttributes() {\n\t\t$this->_useMock();\n\n\t\t$options = array('id' => 'something', 'htmlAttributes' => array('arbitrary' => 'v...
[ "0.78147113", "0.73676896", "0.70746964", "0.6600127", "0.653899", "0.65304023", "0.64074624", "0.63698447", "0.63344836", "0.6329779", "0.63083506", "0.63038796", "0.6288869", "0.6260752", "0.62083524", "0.6161715", "0.61461914", "0.6123604", "0.6086899", "0.6024088", "0.602...
0.0
-1
/ SELECT tc.nome, tv.valor_final, tp.nome FROM `tb_venda` tv INNER JOIN tb_itens_vendas ti ON (ti.id_venda = tv.id_venda) INNER JOIN tb_cliente tc ON (tv.cliente = tc.id_cliente) INNER JOIN tb_produto tp ON (ti.id_produto = tp.id_produto)
public function transformaDadosDoBancoEmObjeto($dadosDoBanco) { $venda = new Venda(); $venda->setIdVenda($dadosDoBanco['id_venda']); $venda->setCliente($dadosDoBanco['cliente']); $venda->setValorFinal($dadosDoBanco['valor_final']); $venda->setValorTotal($dadosDoBanco['valor_total']); $venda->setDesconto($dadosDoBanco['desconto']); $venda->setQuantVendida($dadosDoBanco['quantidade']); $venda->setProduto($dadosDoBanco['produto']); //$venda = new Venda(); return $venda; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatosVotante($idactual){\n $sql=\"SELECT correovotante,nombrevotante,apellidovotante FROM votante WHERE idvotante=$idactual;\";\n\t\t\treturn $sql;\n }", "public function get_datos_pac_rec_ini($sucursal,$id_usuario){\n\n $conectar= parent::conexion();\n\t \n\t $sql= \"select v.i...
[ "0.6492791", "0.6489875", "0.6387158", "0.63345945", "0.6314662", "0.6298463", "0.62964994", "0.6282677", "0.6266095", "0.6251939", "0.6221606", "0.6220676", "0.62037873", "0.61875707", "0.61774224", "0.61552066", "0.6142549", "0.6139748", "0.6133056", "0.61275464", "0.611909...
0.0
-1
Set up DB data
public function setUp(): void { parent::setUp(); $this->setUpComputop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setupDBData()\n {\n /**\n * IMPORTANT NOTE : these functions must be executed sequentially in order for the command to work.\n */\n $this->setupProducts();\n $this->setupServerTypes();\n $this->setupServers();\n $this->setupUsers();\n }", ...
[ "0.85319763", "0.73220855", "0.7273695", "0.7214558", "0.71278703", "0.710581", "0.7091359", "0.70344174", "0.7015831", "0.6977156", "0.69509304", "0.6931439", "0.69308466", "0.6930586", "0.69107413", "0.68808347", "0.68684167", "0.68590796", "0.67982405", "0.67741096", "0.67...
0.0
-1
Sanitize key, removing spaces and replace them to underscore
protected function sanitize($key) { return strtolower(str_replace(' ', '_', $key)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanitize_key( $key ) {\n\t$raw_key = $key;\n\t$key = strtolower( $key );\n\t$key = preg_replace( '/[^a-z0-9_\\-]/', '', $key );\n\n\t/**\n\t * Filter a sanitized key string.\n\t *\n\t * @since 3.0.0\n\t *\n\t * @param string $key Sanitized key.\n\t * @param string $raw_key The key prior to sanitizatio...
[ "0.78319865", "0.763481", "0.7522966", "0.75154793", "0.7513388", "0.74508363", "0.7443278", "0.73540926", "0.7339959", "0.72198635", "0.7205389", "0.71277475", "0.708133", "0.7064286", "0.69064254", "0.6821983", "0.677941", "0.6736304", "0.67110133", "0.66038823", "0.6601618...
0.830038
0
Determine if we have sort kind of language in our repository
public function hasLanguage($lang) { return isset($this->langList[$lang]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasLanguage() : bool;", "protected function _getSortType() {}", "protected function _getSortType() {}", "public function hasLang() {\n return $this->_has(1);\n }", "abstract protected function _getSortType();", "public function hasLanguages() {\n return $this->_has(2);\n }...
[ "0.6430444", "0.6182204", "0.6182204", "0.61541563", "0.611528", "0.61069113", "0.60801303", "0.6009279", "0.5887657", "0.5882257", "0.5844884", "0.57931894", "0.57559663", "0.5735195", "0.5690353", "0.56764334", "0.56691086", "0.56581265", "0.5637068", "0.5600742", "0.559860...
0.0
-1
Find out if we are running in debug mode
protected function isDebugMode() { return ($this->config['debug'] === true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isDebug();", "public function isDebug();", "public function get_test_is_in_debug_mode()\n {\n }", "public function isDebug()\n {\n }", "public static function isDebug(): bool\n {\n return !empty(getenv('DEBUG'));\n }", "public final function isDebugEnabled...
[ "0.87121755", "0.87121755", "0.85191625", "0.84699345", "0.8452304", "0.83404374", "0.8243965", "0.82243276", "0.8188247", "0.81654274", "0.8165049", "0.8157259", "0.814772", "0.8131445", "0.8123993", "0.8076107", "0.8076107", "0.80701536", "0.8030901", "0.80272955", "0.80133...
0.8123166
15
Get line in dot notation
protected function arrayGet($key, $default = null) { if (isset($this->list[$key])) { return $this->list[$key]; } foreach (explode('.', $key) as $segment) { if (! is_array($this->list) || ! array_key_exists($segment, $this->list)) { return value($default); } $this->list = $this->list[$segment]; } return $this->list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLine()\n {\n return $this->get(self::_LINE);\n }", "public function getLine() {\n return $this->parse()['line'];\n }", "public function getLine() {\n return $this->line;\n }", "public function getDot($key) {\n\t\treturn self::_getDot($key, $this); \n\t}", "public fun...
[ "0.669564", "0.6590595", "0.6538726", "0.63994133", "0.6368601", "0.6368601", "0.6368601", "0.6368601", "0.6368601", "0.6368601", "0.632044", "0.628324", "0.62468445", "0.6224897", "0.62218463", "0.6153756", "0.6116666", "0.61078566", "0.6103376", "0.60859734", "0.60598874", ...
0.0
-1
Replace word from parameters
protected function replaceParam($line, array $param) { foreach ($param as $key => $value) { $line = str_replace(':'.$key, $value, $line); } return $line; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate_replace($params){\n $string = array_shift($params);\n foreach ($params as $value){\n $replace[] = $value;\n }\n return XT::translate_replace($string, $replace);\n}", "private static function replaceParameters(string &$text, array $parameters) : string\n {\n foreach...
[ "0.68283665", "0.6319737", "0.62181383", "0.6196162", "0.60961545", "0.6081606", "0.6008544", "0.587056", "0.5867038", "0.5838908", "0.5763723", "0.5757055", "0.5752817", "0.5727823", "0.5664337", "0.5655024", "0.56505275", "0.5650103", "0.5604259", "0.5590376", "0.55881417",...
0.57284814
13
Creates a repository manager.
public function __construct(ProjectEnvironment $environment, EditableRepository $repo, PackageCollection $packages, PackageFileStorage $packageFileStorage) { $this->environment = $environment; $this->dispatcher = $environment->getEventDispatcher(); $this->repo = $repo; $this->config = $environment->getConfig(); $this->rootDir = $environment->getRootDirectory(); $this->rootPackage = $packages->getRootPackage(); $this->rootPackageFile = $environment->getRootPackageFile(); $this->packages = $packages; $this->packageFileStorage = $packageFileStorage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n ...
[ "0.7590872", "0.663245", "0.6438831", "0.6384132", "0.63506365", "0.6331685", "0.6193475", "0.61866355", "0.6169705", "0.6022134", "0.59838897", "0.5978751", "0.59387434", "0.58946335", "0.58865243", "0.57438046", "0.57409316", "0.5739539", "0.57221764", "0.56862164", "0.5672...
0.0
-1
Run the database seeds.
public function run() { DB::table('vines')->insert([ 'channel_id' => 3, 'channel_name' => 'lucaszera', 'title' => str_random(10), 'link' => 'watch?v=Ea3-Pcejfio', 'server' => 'Impera', 'playmode' => 'PvP', 'pvptype' => 'Open PvP', 'description' => 'Rei lucas teste tst', ]); }
{ "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
Prepend PHP code before the output (but after the namespace statement if present).
public function prependCode($code) { return $this->prependOutput($this->closePhpCode($this->openPhpCode($code))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prependOutput($code)\n {\n $this->setOutput(\n $this->hasNamespaceStatement($namespaceStatement, $output)\n ? $this->concatCode(\n $this->closePhpCode($namespaceStatement),\n $code,\n $this->openPhpCode($ou...
[ "0.73207927", "0.6238934", "0.564552", "0.5590064", "0.55206805", "0.53966177", "0.5306035", "0.528575", "0.52251965", "0.52210873", "0.5152387", "0.5130917", "0.511452", "0.5095901", "0.5091888", "0.50676155", "0.50452393", "0.5009362", "0.49934798", "0.49457768", "0.4940651...
0.61591214
2
Prepend output (HTML code or PHP code with tags) before the output (but after the namespace statement if present).
public function prependOutput($code) { $this->setOutput( $this->hasNamespaceStatement($namespaceStatement, $output) ? $this->concatCode( $this->closePhpCode($namespaceStatement), $code, $this->openPhpCode($output) ) : $this->concatCode($code, $this->output) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prependCode($code)\n {\n return $this->prependOutput($this->closePhpCode($this->openPhpCode($code)));\n }", "protected function transpileEndPrepend(): string\n {\n return '<?php $__env->stopPrepend(); ?>';\n }", "public function prependNamespace($namespace, $hints);", ...
[ "0.58757246", "0.5805363", "0.58006907", "0.5750906", "0.56097054", "0.554297", "0.54619336", "0.5320644", "0.52834266", "0.52182925", "0.5192875", "0.5177417", "0.51601654", "0.5148874", "0.51479465", "0.5146182", "0.5137702", "0.512527", "0.51183283", "0.5111244", "0.510777...
0.73823994
0
Check if the output contains a namespace statement at the beginning.
public function hasNamespaceStatement(&$namespaceStatement = '', &$afterCode = '') { if (preg_match('/^(<\?(?:php)?\s+namespace\s\S.*)(((?:;|\n|\?>)[\s\S]*)?)$/U', $this->output, $matches)) { if (substr($matches[2], 0, 1) === ';') { $matches[1] .= ';'; $matches[2] = substr($matches[2], 1); } $namespaceStatement = $matches[1]; $afterCode = $matches[2]; return true; } $afterCode = $this->output; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasNamespace() {\n return $this->_has(1);\n }", "public function hasNamespace() {\n return ($this->namespace !== '');\n }", "public function inNamespace()\n\t{\n\t\treturn false !== strrpos($this->name, '\\\\');\n\t}", "public function isNamespace($in)\n {\n $elt =...
[ "0.6916824", "0.6832139", "0.6678534", "0.58095455", "0.5740581", "0.571218", "0.5710529", "0.56909853", "0.56116325", "0.54563093", "0.5415549", "0.5394336", "0.53494585", "0.5325554", "0.53163046", "0.53065044", "0.5304125", "0.53023636", "0.5142671", "0.5140365", "0.511377...
0.68481815
1
prepare a connection with a paypal app
public function __construct() { $this->_handle = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paypal_class() {\n \n // initialization constructor. Called when class is created.\n \n $this->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';\n //$this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';\n \n $this->last_error = '';\n \n $th...
[ "0.65956295", "0.64738125", "0.63749576", "0.63374555", "0.6289728", "0.62746257", "0.6235353", "0.61924744", "0.6148227", "0.6088291", "0.60764647", "0.5979528", "0.5969788", "0.59593517", "0.5957", "0.5949696", "0.5925887", "0.5916817", "0.59025186", "0.5896135", "0.5893855...
0.0
-1
prepere & execute the payment
public function createPayment() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processPayment();", "public function execute(){\n $paymentId = $_GET['paymentId'];\n $payment = Payment::get($paymentId, $this->_apiContext);\n $payerId = $_GET['PayerID'];\n\n // Execute payment with payer ID\n $execution = new PaymentExecution();\n $exe...
[ "0.8028149", "0.7617755", "0.76160115", "0.75935125", "0.7412469", "0.7320548", "0.726806", "0.72476226", "0.7215258", "0.717494", "0.7134929", "0.70741564", "0.7068019", "0.7021653", "0.69979405", "0.6994987", "0.69875354", "0.69802296", "0.69729173", "0.6933608", "0.6919886...
0.67537826
37
Retrieves the wanted Store, or null
public static function getStore ($name) { if (isset(self::$stores[$name])) { return self::$stores[$name]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStore(): Store|null;", "public static function get_store($store_name = 'default')\n {\n }", "public static function get_store($store_name)\n {\n }", "private function getStore()\n {\n return $this->storeManager->getStore($this->retrieveSharedCatalogSto...
[ "0.8281435", "0.76348305", "0.7601396", "0.75326484", "0.7511196", "0.7511196", "0.75028163", "0.7502539", "0.7502539", "0.7502539", "0.7502539", "0.7501464", "0.74843216", "0.74612355", "0.74096334", "0.7360648", "0.7314811", "0.7299975", "0.7284738", "0.72655016", "0.723378...
0.7194292
22
Run the database seeds.
public function run() { DB::statement('SET FOREIGN_KEY_CHECKS=0;'); App\VisibilityType::truncate(); DB::statement('SET FOREIGN_KEY_CHECKS=1;'); App\VisibilityType::create([ 'type' => 'Prywatny' ]); App\VisibilityType::create([ 'type' => 'Publiczny' ]); }
{ "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
Test Case: Validate that the project has a title.
public function shouldHaveTitle() { // Arrange $attributes = factory(Project::class)->raw([ 'title' => '', ]); // Action $response = $this->post('/projects', $attributes); // Assert $response->assertSessionHasErrors('title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProjectTitle();", "public function testGettingTheTitle()\n {\n $this->assertEquals('title', $this->revision->getTitle());\n }", "public function testAssignTitle()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",...
[ "0.71535224", "0.70882756", "0.6800982", "0.6733853", "0.66882277", "0.66729856", "0.66538966", "0.663283", "0.65382916", "0.6493532", "0.6470231", "0.64035076", "0.640006", "0.63973784", "0.6364185", "0.63316715", "0.62585", "0.62511885", "0.62008727", "0.61617523", "0.61182...
0.7968348
0
Test Case: Validate that the project has a description.
public function shouldHaveDescription() { // Arrange $attributes = factory(Project::class)->raw([ 'description' => '' ]); // Action $response = $this->post('/projects', $attributes); // Assert $response->assertSessionHasErrors('description'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }"...
[ "0.83257455", "0.6658854", "0.6538204", "0.64926475", "0.6483126", "0.6443382", "0.6401218", "0.6279939", "0.62030315", "0.6143676", "0.6071989", "0.60656685", "0.59975594", "0.5943932", "0.5922573", "0.592254", "0.5910526", "0.5910526", "0.5910526", "0.5910526", "0.5910526",...
0.8085601
1
give environment variables a higher priority
public function __construct($debug = false) { $this->prestaUrl = $this->getEnv('prestaUrl'); $this->prestaApiKey = $this->getEnv('prestaApiKey'); parent::__construct($this->prestaUrl, $this->prestaApiKey, $debug); $this->mappingsFile = __DIR__ . '/../tmp/mappings.json'; $this->mappings = json_decode(@file_get_contents($this->mappingsFile), true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apache_getenv($variable, $walk_to_top = false)\n{\n}", "protected function paratestEnvironmentVariables()\n {\n if ($this->option('custom-argument')) {\n return array_merge(\n parent::paratestEnvironmentVariables(),\n [\n 'CUSTOM_ENV_...
[ "0.6446064", "0.63381577", "0.6332615", "0.63169616", "0.6309473", "0.62992597", "0.62803286", "0.6188701", "0.6170047", "0.6166518", "0.6152993", "0.6069307", "0.6005989", "0.5962708", "0.5951506", "0.5927225", "0.59139544", "0.5908165", "0.5903127", "0.5843926", "0.58379847...
0.0
-1
replace non letter or digits by
private function getRewrite($text, $limit = 75) { $text = preg_replace('/~[^\\pL\d]+~u/i', '-', $text); // trim $text = trim($text, '-'); // lowercase $text = strtolower($text); // remove unwanted characters $text = preg_replace('~[^-\w]+~', '', $text); if (strlen($text) > $limit) { $text = substr($text, 0, 70); } if (empty($text)) { //return 'n-a'; return time(); } return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter_alphanum($input) {\n return preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $input);\n}", "function doMkAlpha ($string)\n{\n return preg_replace ('/[^a-z0-9]/i', '', $string);\n}", "function justAlphanumeric($var)\n{\n return preg_replace('/[^0-9A-Za-z]/', '', $var);\n}", "function saniti...
[ "0.7106634", "0.7039931", "0.70295006", "0.6957319", "0.6880171", "0.67487717", "0.6607642", "0.65846974", "0.65801954", "0.65528286", "0.65431625", "0.65157133", "0.64260733", "0.6413073", "0.63880396", "0.6225351", "0.62044257", "0.61709744", "0.6161432", "0.613514", "0.607...
0.0
-1
The toggle for this layer in HTML.
public function toggle_as_html () { if ($this->context->dhtml_allowed ()) { if ($this->visible) { $icon = $this->context->resolve_icon_as_html ('{icons}tree/collapse', '', '[-]', 'inline-icon', "{$this->name}_image"); } else { $icon = $this->context->resolve_icon_as_html ('{icons}tree/expand', '', '[+]', 'vertical-align: middle', "{$this->name}_image"); } return '<a href="#" onclick="toggle_visibility(\'' . $this->name . '\'); return false;">' . $icon . '</a>'; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function draw_toggle ()\n {\n echo $this->toggle_as_html ();\n }", "private function renderToggleButton(): string\n {\n return\n Html::beginTag('a', $this->toggleOptions) .\n $this->renderToggleIcon() .\n\n Html::endTag('a');\n }", "protected functi...
[ "0.7799865", "0.701386", "0.6736401", "0.63979524", "0.61496985", "0.59494877", "0.581592", "0.56546515", "0.5612806", "0.5563398", "0.5487965", "0.546014", "0.5458506", "0.5439127", "0.535185", "0.5339095", "0.52415764", "0.52250385", "0.52193403", "0.519983", "0.51991874", ...
0.6839889
2
Draw a control to show/hide this layer.
public function draw_toggle () { echo $this->toggle_as_html (); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_control($buffer, $ct)\r\n{\r\n\tcall_user_func(\"draw_\" . strtolower($ct->cclass), $buffer, $ct->caption, $ct->left, $ct->top, $ct->width, $ct->height, $ct->style, $ct->value);\r\n}", "public function draw() {\r\n $g = $this->chart->getGraphics3D();\r\n $e = $g->getGraphics();\r\n\r\...
[ "0.5348689", "0.5283098", "0.5161275", "0.49148992", "0.47804546", "0.4765552", "0.47641298", "0.47641298", "0.47612262", "0.4706103", "0.46131423", "0.4598237", "0.44832623", "0.44379333", "0.44325125", "0.4385947", "0.43674254", "0.43544593", "0.43535206", "0.43508768", "0....
0.5656325
0
Set MySQL system variables for PDO.
public function assign(array $values) { return $values ? $this->withEmulatedStatement(Grammar::assignmentStatement($values), $values) : $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setConn() {\n try {\n // Connect and create the PDO object\n self::$conn = new PDO(\"mysql:host=\".DBHOST.\"; dbname=\".DBNAME, DBUSER, DBPASS);\n\n // Sets to handle the errors in the ERRMODE_EXCEPTION mode\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEP...
[ "0.6339185", "0.62660956", "0.61411184", "0.61064327", "0.6074038", "0.6069871", "0.605351", "0.60397893", "0.6036598", "0.6008178", "0.600707", "0.5962889", "0.59206903", "0.5898009", "0.5880606", "0.5869525", "0.5850233", "0.58329177", "0.58129895", "0.58055055", "0.5785754...
0.0
-1
Configure PDO using query and parameters temporarily enabling PDO::ATTR_EMULATE_PREPARES.
protected function withEmulatedStatement(string $query, array $values = []) { foreach ($this->pdos as &$pdo) { $pdo = ValueEffector::withCallback( $pdo, Closure::fromCallable([$this, 'withEmulatedStatementFor']), $query, $values ); } unset($pdo); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function prepareAndExecute (PDO $connection, string $query, array $params = []);", "protected function setupPdoQueries()\n {\n $this->conf['select-user'] = sprintf('\n\t\t\tSELECT username as user, name, email as mail, password as hash, id as uid\n\t\t\tFROM %s WHERE username = :user',\n ...
[ "0.68551886", "0.64356315", "0.60026425", "0.59926766", "0.59843546", "0.59297", "0.59137404", "0.5899574", "0.5803749", "0.5793655", "0.57882404", "0.5778093", "0.574878", "0.57376504", "0.5734955", "0.5726615", "0.5655387", "0.56238925", "0.5612174", "0.5595123", "0.5593096...
0.0
-1
Run the database seeds.
public function run() { DB::table('address')->insert([ 'address' => 'Silk St, London EC2Y ,BDS UK', 'city' => 'London', 'contact_no' => '+442076384141', 'created_at'=>\Carbon\Carbon::now() ]); }
{ "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
Check if there is no user in system before run install
private function checkinstallrequirement() { $userCount = Core_User::getUsers(array(), '', '', '', true); if($userCount > 0) return false; else return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function check_user_installed()\n {\n if ($this->uid == 0) {\n return true;\n }\n\n $exists = $this->STOR->get_folder_id_from_path('waste');\n if (empty($exists)) {\n $this->create_user();\n }\n }", "public static function isInstalled(){\n\t\t...
[ "0.7581932", "0.715836", "0.7073247", "0.6882467", "0.6655213", "0.66145295", "0.64996564", "0.6467071", "0.6458869", "0.6385002", "0.63844544", "0.6367339", "0.63509744", "0.6332938", "0.6308024", "0.6225235", "0.62100196", "0.6204143", "0.6195796", "0.61802447", "0.61358196...
0.76897407
0
Run the database seeds.
public function run() { //roles $rol_admin = Role::create([ 'name' => 'ROOT' ]); Role::create([ 'name' => 'OPER' ]); Role::create([ 'name' => 'TEACHER' ]); //admin user factory(\App\User::class)->create([ 'name' => 'admin', 'email' => 'admin@admin.com', 'password' => bcrypt('admin'), 'id_role' => 1 ]); //docentes factory(\App\User::class, 30)->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
returnAbsoluteRouteString() need constValuse WROOT
static function convertStringToLinuxOrWindow_Route($str){ $route=''; if(preg_match("[/]",$str)&&(DS!='/')){ //DS是当前系统的斜杠形式 $array=explode('/',$str); $route=Tool::convertArray($array); return $route; }else if(preg_match("[\]",$str)&&(DS!='\\')){ $array=explode('\\',$str); $route=Tool::convertArray($array); return $route; }else{ return $str; } return 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteRootDir(): string;", "public function getFullRoute();", "public function getBaseRouteName(): string;", "function route_uri(): string\n{\n return RouteController::getCurrentRoute()['uri'] ?? '';\n}", "private function getRoute(){\n\t}", "function getCurrentUrlFromRoutes()\n {...
[ "0.7007699", "0.6855958", "0.6532399", "0.6509346", "0.64936024", "0.63947684", "0.63732266", "0.6317642", "0.62871677", "0.6281022", "0.62451243", "0.62363774", "0.62305754", "0.6173212", "0.6155162", "0.6149151", "0.6096062", "0.6095663", "0.6093593", "0.6082234", "0.607254...
0.5722843
69