query
stringlengths 7
5.25k
| document
stringlengths 15
1.06M
| metadata
dict | negatives
listlengths 3
101
| negative_scores
listlengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Store a newly created resource in storage. | public function store()
{
$input = Input::all();
$validation = Validator::make($input, Patient::$rules);
if ($validation->passes())
{
$this->patient->create($input);
return Redirect::route('patients.index');
}
return Redirect::route('patients.create')
->withInput()
->withErrors($validation)
->with('message', 'There were validation errors.');
} | {
"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());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"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.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
]
| 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$patient = $this->patient->findOrFail($id);
return View::make('patients.show', compact('patient'));
} | {
"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);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
]
| [
"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.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
]
| 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
$patient = $this->patient->find($id);
$genders = Gender::all()->lists("name","id");
$countries = Country::all()->lists("name","id");
if (is_null($patient))
{
return Redirect::route('patients.index');
}
return View::make('patients.edit', compact('patient'))->with("genders", $genders)->with("countries", $countries);
} | {
"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 $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }"
]
| [
"0.78557473",
"0.76946205",
"0.72731614",
"0.7241571",
"0.71700776",
"0.70650244",
"0.7052897",
"0.698311",
"0.69465625",
"0.6944826",
"0.69399333",
"0.69286525",
"0.69031185",
"0.68969506",
"0.68969506",
"0.6878258",
"0.6862812",
"0.6859171",
"0.68560475",
"0.68436426",
"0.6834711",
"0.6810601",
"0.680613",
"0.6804975",
"0.68015367",
"0.6795471",
"0.6791821",
"0.6791821",
"0.6787303",
"0.6783644",
"0.67790574",
"0.67766285",
"0.6767741",
"0.67610145",
"0.67455536",
"0.67455536",
"0.6744367",
"0.6743159",
"0.6739656",
"0.67351145",
"0.67246765",
"0.67128825",
"0.6692859",
"0.66916454",
"0.6687554",
"0.66875297",
"0.6687494",
"0.6684443",
"0.668203",
"0.66689324",
"0.66680384",
"0.6664605",
"0.6664605",
"0.66621166",
"0.66604865",
"0.66589504",
"0.6655767",
"0.66542184",
"0.665213",
"0.66422516",
"0.6631665",
"0.663077",
"0.6627607",
"0.6627607",
"0.66193914",
"0.6618503",
"0.66160196",
"0.66146857",
"0.6609641",
"0.6608315",
"0.6605284",
"0.6595882",
"0.65947276",
"0.6594626",
"0.65895563",
"0.6589339",
"0.6587281",
"0.65805006",
"0.6579201",
"0.6579166",
"0.657641",
"0.6576111",
"0.65740323",
"0.65692765",
"0.6568046",
"0.6567221",
"0.6565346",
"0.6560687",
"0.6560687",
"0.6560384",
"0.65577257",
"0.65569293",
"0.65558636",
"0.6555392",
"0.65553015",
"0.65542984",
"0.655418",
"0.6554106",
"0.6547678",
"0.65473104",
"0.6543329"
]
| 0.0 | -1 |
Update the specified resource in storage. | public function update($id)
{
$input = array_except(Input::all(), '_method');
$validation = Validator::make($input, Patient::$rules);
if ($validation->passes())
{
$patient = $this->patient->find($id);
$patient->update($input);
return Redirect::route('patients.show', $id);
}
return Redirect::route('patients.edit', $id)
->withInput()
->withErrors($validation)
->with('message', 'There were validation errors.');
} | {
"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 ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update($request, $id);",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"abstract public function put($data);",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public abstract function update($object);",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update($id, $input);",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
]
| [
"0.74238616",
"0.7062842",
"0.7057816",
"0.6897868",
"0.65820867",
"0.64505464",
"0.6347915",
"0.62114644",
"0.6145006",
"0.61231726",
"0.6115922",
"0.6100021",
"0.6089019",
"0.60542375",
"0.60187906",
"0.6008231",
"0.5974106",
"0.5944986",
"0.59397626",
"0.59393746",
"0.58937186",
"0.58607864",
"0.5853811",
"0.5853811",
"0.58521867",
"0.5815276",
"0.58061725",
"0.57518756",
"0.57518756",
"0.5736318",
"0.57246256",
"0.5715636",
"0.5696208",
"0.5691033",
"0.5687788",
"0.56692934",
"0.56556624",
"0.5652178",
"0.56494987",
"0.5636202",
"0.56355816",
"0.5632871",
"0.563206",
"0.56291884",
"0.5621382",
"0.56087434",
"0.5602465",
"0.55928403",
"0.55825645",
"0.55821884",
"0.5581833",
"0.5576869",
"0.55712104",
"0.5568173",
"0.55648434",
"0.5562885",
"0.5560537",
"0.5560537",
"0.5560537",
"0.5560537",
"0.5560537",
"0.55592597",
"0.5556131",
"0.5555849",
"0.5555397",
"0.5553912",
"0.55530137",
"0.5543831",
"0.55430055",
"0.5540152",
"0.5539437",
"0.55359006",
"0.5535772",
"0.5534487",
"0.552458",
"0.5518245",
"0.5515452",
"0.55145514",
"0.5509227",
"0.55079365",
"0.55065364",
"0.55039924",
"0.5501616",
"0.5500345",
"0.5499738",
"0.54980725",
"0.5496017",
"0.5496017",
"0.5494488",
"0.5494334",
"0.54936594",
"0.54934716",
"0.5491019",
"0.54835314",
"0.54795796",
"0.5479442",
"0.5478275",
"0.54646415",
"0.54637444",
"0.5461914",
"0.54562414"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$this->patient->find($id)->delete();
return Redirect::route('patients.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 $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\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.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
]
| 0.0 | -1 |
Test with purchase object. | public function testPaymentAttemptResponse()
{
$methodExtraData = [
'VK_LANG' => 'ENG',
'VK_MSG' => 'Test LIT',
'VK_REC_ACC' => 'LT10000000000000001',
'VK_REC_NAME' => 'SWEDBANK, AB',
'VK_SND_ACC' => 'LT20000000000000002',
'VK_SND_ID' => 'HP',
'VK_SND_NAME' => 'John Doe',
'VK_T_DATE' => '27.04.2015',
];
$purchase = new Purchase(
new Method(PaymentMethod::swedbank(), 392, 1101, 'APPROVED', ServiceType::litBank(), $methodExtraData),
new RiskResult(100, 'No Risk'),
'244580',
'ordernumber/01',
new Amount(1, 2, 978),
'Your transaction has been processed successfully.',
ResponseStatus::accepted()
);
$queryTxn = new QueryTxnResult(
new APMTxn('10001', $purchase),
'3700900010241729',
'ordernumber/01',
'ACCEPTED',
PurchaseStatus::accepted(),
new \DateTime('2015-04-27 12:51:15')
);
$expectedPAResponse = new PaymentAttemptResponse(
$queryTxn,
MerchantMode::live(),
'ACCEPTED',
PurchaseStatus::accepted(),
1437055617
);
$xml = file_get_contents(__DIR__ . '/../../data/hps_payment_attemp_response_docs_sample.xml');
$this->assertEquals($expectedPAResponse, $this->serializer->getObject($xml, PaymentAttemptResponse::class));
$this->assertEquals($xml, $this->serializer->getXml($expectedPAResponse));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function purchaseTest()\n {\n\t $this->json('POST','/compraproducto', [\n 'user_id' => '15',\n 'product_id' => '31',\n 'quantity' => '9',\n 'payment'=>'2878.29',\n ]);\n\t $this->assertDatabaseHas('purchases', ['user_id' => '15']);\n }",
"public function testCreatePurchase()\n {\n print \"testPurchase()\\n\";\n\n // TODO: Impl\n\n $this->fail();\n }",
"public function testPurchaseFlow()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testPass');\n\n\t\tShop::checkout();\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->isCompleted);\n\n\t\t$user->delete();\n\t}",
"public function testPurchasesIsShown()\n {\n // Create a user\n $user = User::create([\n 'password' => Hash::make('password'),\n 'email' => 'example@example.org',\n 'name' => 'John Doe',\n ]);\n\n // Create room\n $room = Room::create([\n 'id' => 1,\n 'name' => 'Test room',\n ]);\n\n // Create sample product\n $product = Product::create([\n 'name' => 'Test product',\n 'color' => 'fff',\n 'quantity' => '1,2,5',\n 'price' => '1232.00',\n ]);\n\n $quantity = 2;\n\n // Buy something\n $beer = new Beer();\n $beer->room = $room->id;\n $beer->quantity = $quantity;\n $beer->product = $product->id;\n $beer->ipAddress = request()->ip();\n $beer->amount = -($product->price * $quantity);\n $beer->save();\n\n // Login that user in\n Auth::login($user);\n\n // Get the page\n $response = $this->get('/rooms/1');\n\n // Asser user is logged in\n $this->assertAuthenticatedAs($user);\n\n // And that we get the expected 200 OK\n $response->assertStatus(200);\n\n // And the purchase shows up, we only check if the price is shown\n $response->assertSee('-'.($product->price * 2).'.00');\n }",
"public function purchase(): PurchaseReceiptInterface;",
"function xtestLive(){\n $this->clearAll();\n \n $seller = $this->createUser('seller');\n $evt = $this->createEvent('Quebec CES' , $seller->id, $this->createLocation()->id, date('Y-m-d', strtotime(\"+1 day\")) );\n $this->setEventId($evt, 'aaa');\n $cat = $this->createCategory('Verde', $evt->id, 10.00);\n \n \n \n //Transaction setup\n $foo = $this->createUser('foo');\n \n //let's buy\n $buyer = new \\WebUser($this->db);\n $buyer->login($foo->username);\n\n //let's pay\n Utils::clearLog();\n \n $buyer->addToCart($cat->id, 3); //cart in session\n \n $data = $this->getCCPurchaseData();\n //$data['street'] = 'N ' . $data['street']; //fail avs\n $data['cc_cvd'] = '666'; //fail cvd \n \n $payer = $this->createInstance('foo');\n $payer->setData($data);\n $payer->setCart($buyer->getCart());\n //$payer->amount_override = '0.25'; //hardcoded fail\n $payer->process();\n \n $this->assertFalse($payer->success()); \n }",
"public function finishPurchase() {}",
"public function __construct(Purchase $purchase)\n {\n $this->purchase = $purchase;\n }",
"public function __construct(Purchase $purchase)\n {\n $this->purchase = $purchase;\n }",
"public function __construct(Purchase $purchase)\n {\n $this->purchase = $purchase;\n }",
"public function show(Purchase $purchase)\n {\n //\n }",
"public function show(Purchase $purchase)\n {\n //\n }",
"public function show(Purchase $purchase)\n {\n //\n }",
"public function show(Purchase $purchase)\n {\n //\n }",
"public function testCreatePayItem()\n {\n }",
"public function show(Purchase $purchase)\n {\n //\n \n }",
"public function testPurchaseSuccess()\n {\n // $this->setMockHttpResponse('WebservicePurchaseSuccess.txt');\n $data = file_get_contents(__DIR__ . '/Mock/WebservicePurchaseSuccess.txt');\n\n $purchase = $this->gateway->purchase($this->options);\n $response = $purchase->createResponse($data);\n\n // echo \"Response data =\\n\";\n // print_r($response->getData());\n // echo \"\\nEnd Response data\\n\";\n\n $this->assertTrue($response->isSuccessful());\n $this->assertFalse($response->isRedirect());\n $this->assertEquals('259611::1452486844', $response->getTransactionReference());\n $this->assertNull($response->getMessage());\n $this->assertEquals('APPROVED', $response->getCode());\n }",
"public function test_ShouldStorePurchaseOrder()\n {\n $response = $this->storePurchaseOrder();\n dump( json_decode($response->content(), JSON_PRETTY_PRINT) );\n $response->assertStatus(201)\n ->assertJson([\n 'status' => 'success',\n 'http_status_code' => 201,\n ])\n ->assertJsonStructure([\n 'status',\n 'http_status_code',\n 'purchase_order_id',\n ]);\n $obj = json_decode( $response->content() );\n\n return $obj->purchase_order_id;\n }",
"public function testBillingDownloadInvoice()\n {\n }",
"public function testBillingInvoices()\n {\n }",
"public function testBuy()\n {\n VCR::insertCassette('orders/buy.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::uspsService(),\n ]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"public function testSuccess(){ \n\n $buyableProduct = Product::where('price', '<', 70)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($buyableProduct, $this->testVisaPan);\n $response->assertSee(\"Payment successful\");\n\n\n //test card 2\n $response = $this->checkoutAction($buyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Payment successful\"); \n \n }",
"public function testBuyRateObject()\n {\n VCR::insertCassette('orders/buyRateObject.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy($order->rates[0]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"public function testFailPurchase()\n\t{\n\t\t// Prepare\n\n\t\t$user = factory('App\\User')->create(['password' => Hash::make('laravel-shop')]);\n\n\t\t$bool = Auth::attempt(['email' => $user->email, 'password' => 'laravel-shop']);\n\n\t\t$cart = App\\Cart::current()\n\t\t\t->add(['sku' => '0001', 'price' => 1.99])\n\t\t\t->add(['sku' => '0002', 'price' => 2.99]);\n\n\t\tShop::setGateway('testFail');\n\n\t\t$this->assertFalse(Shop::checkout());\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Checkout failed.');\n\n\t\t$order = Shop::placeOrder();\n\n\t\t$this->assertNotNull($order);\n\n\t\t$this->assertNotEmpty($order->id);\n\n\t\t$this->assertTrue($order->hasFailed);\n\n\t\t$this->assertEquals(Shop::exception()->getMessage(), 'Payment failed.');\n\n\t\t$user->delete();\n\t}",
"public function payWayPurchase()\n\t{\n\t}",
"public function testDeletePurchase()\n {\n $headers = $this->authenticate();\n\n $response = $this->json('DELETE', '/api/user/products/battery-4', [], $headers);\n $response->assertStatus(200);\n }",
"public function created(IncentivePurchase $purchase)\r\n {\r\n Mail::send(new IncentivePurchased($purchase));\r\n }",
"public function setUp()\n {\n $this->purchase = new Purchase();\n }",
"public function purchase($options);",
"public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"abstract function has_purchased_before();",
"public function testGetUnitBillingMethods()\n {\n }",
"public function testGetPayItems()\n {\n }",
"public function testAuthorizedTransaction()\n {\n $precondition = Factory::instance('AuthorizedTransaction');\n\n $testdata = $precondition->getData();\n\n $this->assertTrue($testdata['amount'] == 100);\n }",
"public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }",
"public function seachItemPurchase(Request $request){\n return m_item::seachItemPurchase($request);\n }",
"public function __construct(\n PurchaseInterface $purchase\n ) {\n $this->purchase = $purchase;\n }",
"public function makePurchase() {;\n $this->setTotalPurchases($this->getTotalPurchases()+1);\n $this->setTotalAllAccess($this->getTotalAllAccess()+$this->getTotalAccess());\n $this->setTotalAccess(0);\n }",
"private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }",
"function purchase($id = null) {\n\t\tif(!empty($this->data)) { //Credit card is submitted\n\t\t\t$travelerID = $this->Session->read('Traveler.id'); //Check that they are logged in\n\t\t\tif(is_null($travelerID)) {\n\t\t\t\t$this->Session->setFlash(__('Please log in or create an account to make a purchase.', true));\n\t\t\t}\n\t\t\telse {//They are logged in. \n\t\t\t\t//Validate the CC and make the purchase.\n\t\t\t\t//debug($this->Deal->DealPurchase->find('count', array('conditions' => array('DealPurchase.deal_id' => $id))));\n\t\t\t\t$this->loadModel('Traveler');\n\t\t\t\t$traveler = $this->Traveler->read(null, $travelerID);\n\t\t\t\t$this->loadModel('Transaction');\n\t\t\t\t$this->data['Transaction']['cost'] = $this->Session->read('Trip.cost');\n\t\t\t\t$this->Transaction->set($this->data);\n\t\t\t\t//Billing info was entered. Now process the credit card\n\t\t\t\tif($this->Transaction->validates()) { //If CC info entered correctly\n\t\t\t\t\t$result = $this->Transaction->MakeBTTransaction($this->data, $traveler);\n\t\t\t\t\t//$result = Braintree_Transaction::sale($this->Transaction->buildBrainTreeTransaction($this->data, $traveler));\n\t\t\t\t\tif ($result->success) { //Braintree validation Success\n\t\t\t\t\t\t$purchase['DealPurchase']['deal_id'] = $id;\n\t\t\t\t\t\t$random_hash = substr(md5(uniqid(rand(), true)), -10, 10);\n\t\t\t\t\t\t$purchase['DealPurchase']['confirmation_code'] = $random_hash;\n\t\t\t\t\t\t$purchase['DealPurchase']['traveler_id'] = $travelerID;\n\t\t\t\t\t\t$purchase['DealPurchase']['start_date'] = $this->Session->read('Trip.start_date');\n\t\t\t\t\t\t$purchase['DealPurchase']['end_date'] = $this->Session->read('Trip.end_date');\n\t\t\t\t\t\t$purchase['DealPurchase']['purchase_amount'] = $this->Session->read('Trip.cost');\n\t\t\t\t\t\t$transaction = $result->transaction;\n\t\t\t\t\t\t$purchase['DealPurchase']['braintree_id'] = $transaction->id;\n\t\t\t\t\t\t$reservationType = $this->Deal->GetReservationType($id);\n\t\t\t\t\t\t//Save record for DealType 1 & 2\n\t\t\t\t\t\tif($reservationType == Configure::read('ReservationType.Fixed') || $reservationType == Configure::read('ReservationType.Variable')) {\n\t\t\t\t\t\t\t$this->loadModel('DealPurchase');\n\t\t\t\t\t\t\tif ($this->DealPurchase->save($purchase)) {\n\t\t\t\t\t\t\t\t$this->sendPurchaseMail($id, $travelerID, $this->DealPurchase->id, 'dealConfirmation');\n\t\t\t\t\t\t\t\t$this->redirect(array('controller' => 'deals', 'action'=>'confirmation',$id));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Insert Passenger records for DealType 3\n\t\t\t\t\t\telseif($reservationType == Configure::read('ReservationType.Set')) {\n\t\t\t\t\t\t\t$this->loadModel('Passenger');\n\t\t\t\t\t\t\t$purchase['Passenger']['first_name'] = $traveler['Traveler']['first_name'];\n\t\t\t\t\t\t\t$purchase['Passenger']['last_name'] = $traveler['Traveler']['last_name'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//use $this->Passenger so that the deal_purchase_id is inserted correctly\n\t\t\t\t\t\t\tif ($this->Passenger->saveAll($purchase)) {\n\t\t\t\t\t\t\t\t$this->redirect(array('controller' => 'deals', 'action'=>'confirmation',$id));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->Session->setFlash(__('The deal purchase could not be saved. Please, try again.', true),'error_flash');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\telse { //Braintree validation failed\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->Session->setFlash(__('Unable to process your transaction. Please check your billing information and try again', true),'error_flash');\n\t\t\t\t\t\t/* Debugging code\n\t\t\t\t\t\tprint_r(\"\\n message: \" . $result->message);\n\t\t\t\t\t\tprint_r(\"\\nValidation errors: \\n\");\n\t\t\t\t\t\tprint_r($result->errors->deepAll());\n\t\t\t\t\t\tprint_r($expirationDate);\n\t\t\t\t\t\t*/\n\t\t\t\t\t} \n\t\t\t\t\n\t\t\t\t} else {//CC info not entered correctly\n\t\t\t\t\t$this->Session->setFlash(__('Billing information missing or formatted incorrectly. Please fix the errors and try again', true), 'error_flash');\n\t\t\t\t}\t\n\t\t\t}\n\t\t}//No data submitted. Load the page.\n\t//If you haven't been redirected yet, load the page\n\t$deal = $this->Deal->read(null, $id);\n\t$deal['Deal']['trip_start_date'] = $this->Session->read('Trip.start_date');\n\t$deal['Deal']['trip_end_date'] = $this->Session->read('Trip.end_date');\n\t$deal['Deal']['days'] = $this->Session->read('Trip.days');\n\t$deal['Deal']['cost'] = $this->Session->read('Trip.cost');\n\t$this->set(compact('deal')); \n\n\t}",
"public function purchase($request) {\n $error_messages = [];\n $results = [];\n $data = $request->all();\n\n $data['entity'] = 'lives';\n\n try {\n // Find Logged in user Customer ID\n $customer_id = $this->serviceAccount->getCustomerId();\n\n if($customer_id) {\n $request['customer_id'] = $customer_id;\n\n // Find Live detail\n $live_obj = $this->repObj->find($data['entity_id']);\n if($live_obj) {\n $request['coins'] = isset($live_obj->coins) ? $live_obj->coins : 0;\n\n // Purchase Live Event Only When Live Event Coins is greater than zero\n if($request['coins']) {\n // Paid Live Event\n $purchase = $this->servicePassbook->purchaselive($request);\n\n if($purchase) {\n $results = isset($purchase['results']) ? apply_cloudfront_url($purchase['results']) : [];\n $error_messages = isset($purchase['error_messages']) ? $purchase['error_messages'] : '';\n }\n }\n else {\n $customer_coins = null;\n // Get Customer Info\n // $customer = \\App\\Models\\Customer::where('_id', $customer_id)->first();\n // if($customer) {\n // $customer_coins = isset($customer->coins) ? $customer->coins : 0;\n // }\n\n // Free Live Event\n // In case Live Event Coins are zero mean that this live event is Free Live Event\n // Create dummy purchase response\n $results['purchase'] = [\n // '_id' => '',\n // 'entity' => 'lives',\n // 'entity_id' => '',\n // 'customer_id' => $customer_id,\n // 'artist_id' => '',\n // 'platform' => '',\n // 'platform_version' => '',\n // 'xp' => 0,\n // 'coins' => 0,\n // 'total_coins' => 0,\n // 'quantity' => 1,\n // 'amount' => 0,\n 'coins_before_txn' => $customer_coins,\n 'coins_after_txn' => $customer_coins,\n // 'txn_type' => 'paid',\n // 'status' => 'success',\n // 'txn_meta_info' => [],\n // 'reference_id' => 'NOT_EXIST',\n // 'passbook_applied' => 'true',\n // 'updated_at' => '',\n // 'created_at' => '',\n ];\n }\n }\n else {\n $error_messages[] = 'Event not find';\n }\n }\n else {\n $error_messages[] = 'Customer not found';\n }\n }\n catch (\\Exception $e) {\n $error_messages[] = $e->getMessage();\n }\n\n if($error_messages) {\n $results['status_code'] = 200;\n }\n\n return ['error_messages' => $error_messages, 'results' => $results];\n }",
"function check_if_product_was_bought($product_id,$purchase_id)\n\t{\n\t\t\n\t\t$sql = \"SELECT p_details_id FROM cane_purchase_details WHERE purchase_id = ? AND p_product_id= ? \";\n\t\t\n \t\t$query = $this->db->query($sql,array( $purchase_id, $product_id ));\t\t\n\n\t\tif ($query->num_rows() > 0)\n\t\t{ \n\t\t\treturn true;\n\t\t} \n\t\telse \n\t\t{ \n\t\t\techo false; \n\t\t}\n\n\n\t}",
"public function test_ShouldAuthorizePurchaseOrder($id)\n {\n $response = $this->authorizePurchaseOrder($id);\n dump( json_decode($response->content(), JSON_PRETTY_PRINT) );\n $response->assertStatus(200)\n ->assertJson([\n 'status' => 'success',\n 'http_status_code' => 200,\n ])\n ->assertJsonStructure([\n 'status',\n 'http_status_code'\n ]);\n }",
"public function testPaid()\n {\n $this->browse(function (Browser $browser) {\n $balance = Balance::factory()->create([\n 'tenant_id' => $this->tenant->id,\n 'type' => Balance::TYPE_DEBIT,\n 'status' => Balance::STATUS_DONE,\n 'amount' => 9000\n ]);\n\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Оплатить')\n ->assertSee('Оплачен')\n ->visit('/tenants/'.$this->tenant->id.'?tab=balances#tab')\n ->assertSee('Кредит');\n });\n }",
"public function testBuy()\n {\n VCR::insertCassette('pickups/buy.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n $boughtPickup = $pickup->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::pickupService(),\n ]);\n\n $this->assertInstanceOf('\\EasyPost\\Pickup', $boughtPickup);\n $this->assertStringMatchesFormat('pickup_%s', $boughtPickup->id);\n $this->assertNotNull($boughtPickup->confirmation);\n $this->assertEquals('scheduled', $boughtPickup->status);\n }",
"abstract public function test( Payment $payment );",
"public function update_purchase($data){\n \n $query = \"SELECT * \n FROM \" . $this->db_table_prefix . \"purchases\n WHERE user_id = '\" . $data['user_id'] . \"' AND payment_status = 'Initiated'\n ORDER BY `id` DESC \n LIMIT 0 , 1 \";\n \n $result = $this->commonDatabaseAction($query);\n $Purchase = $this->resultArray($result);\n \n if ($this->rowCount > 0)\n {\n $query = \"UPDATE\n \" . $this->db_table_prefix . \"purchases\n SET payment_status = '\" . $data['status'] . \"'\n WHERE id = \" . $Purchase[0]['id'];\n \n $result = $this->commonDatabaseAction($query);\n \n if ($this->sqlAffected > 0)\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n return FALSE;\n \n }",
"function testCreateDailyReprtSingleMerchant()\n {\n \t$this->assertTrue(true);\n }",
"public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}",
"function releasePurchase() {\n\n \t$this->output->enable_profiler(FALSE);\n \n \t$this->load->model('accounts_model');\n \t\n \t// ensure we have a purchase id (opm_products_accounts.id)\n \t$postdata['id'] = intval($this->input->post('id'));\n\n\t\theader(\"Content-type: application/json\");\n\t\t\n \tif(!isset($postdata['id']) || empty($postdata['id']) || !is_int($postdata['id'])) {\n\n \t\t// we don't need to provide any detailed error messages. just don't update the row if\n \t\t// things aren't right.\n \t\t$for_json['release_response']['type'] = 'error';\n \t\t$for_json['release_response']['message'] = 'Purchase ID required.';\n \t\texit(json_encode($for_json));\n \t}\n \t\n \t// open this purchase\n \t$purchase = $this->accounts_model->fetchPurchase($postdata);\n\n \tif(!isset($purchase) || !$purchase || empty($purchase)) {\n \t\t\n \t\t$for_json['release_response']['type'] = 'error';\n \t\t$for_json['release_response']['message'] = 'Invalid purchase ID.';\n \t\texit(json_encode($for_json));\n \t}\n \t\n \t// try releasing. this, as tim writes, should just set the enddate timestamp to the current time\n \t\n \tif ($enddate = $this->accounts_model->releasePurchase($postdata)) {\n\n \t\t// releasePurchase returned true\n\n \t\t// form message about the release for the product's history\n \t\t\n \t\tif ($purchase->purchasetypeid != 0) {\n \t \t\t\n \t\t\t$pt = $this->accounts_model->fetchPurchaseType($purchase->purchasetypeid);\n \t \t\t\t$pt_type = $pt->purchasetype;\n \t\t\n \t\t} else {\n \t\t\n \t\t\t$pt_type = \"hold/purchase/re-order\";\n \t\t\n \t\t}\n\t \t\n \t\t$account = $this->accounts_model->fetchAccount($purchase->account_id); \t\t\n \t\t$message = \"$pt_type by $account->account released by \" . $this->userinfo->username;\n \t\t\n \t\t// add the history message\n \t\t\n \t\t$this->opm->addHistoryItem($purchase->opm_productid, $message);\n\n \t\t// let the UI know that the release was successful and to update the purchase row\n \t\t\n \t\t$for_json['release_response']['type'] = 'success';\n \t\t$for_json['release_response']['message'] = date('m-d-Y', $enddate);\n \t\t\n \t\texit(json_encode($for_json));\n \t\n \t} else {\n\n \t\t// let the UI know there was an error with the release. no row removal.\n \t\t$for_json['release_response']['type'] = 'error';\n \t\t$for_json['release_response']['message'] = 'There was an error releasing this purchase.';\n \t\texit(json_encode($for_json));\n \t\n \t}\n \n }",
"public function testRetrive()\n {\n $json = <<<JSON\n{\n \"order_id\": \"f3392f8b-6116-4073-ab96-e330819e2c07\",\n \"order_amount\": 50000,\n \"order_tax_amount\": 5000\n}\nJSON;\n\n $this->mock->append(\n new Response(\n 200,\n ['Content-Type' => 'application/json'],\n $json\n )\n );\n\n $order = new Orders($this->connector, 'auth-token-123456');\n $this->assertEquals('auth-token-123456', $order->getId());\n\n $order->retrieve();\n\n $this->assertEquals('f3392f8b-6116-4073-ab96-e330819e2c07', $order['order_id']);\n $this->assertEquals(50000, $order['order_amount']);\n\n $request = $this->mock->getLastRequest();\n $this->assertEquals(Method::GET, $request->getMethod());\n $this->assertEquals(\n '/instantshopping/v1/authorizations/auth-token-123456',\n $request->getUri()->getPath()\n );\n\n $this->assertAuthorization($request);\n }",
"public function testProperTranslatedPurchasedEntityAdded() {\n $url = Url::fromUri('base:fr/jsonapi/cart/add');\n $request_options = $this->getAuthenticationRequestOptions();\n $request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';\n $request_options[RequestOptions::HEADERS]['Content-Type'] = 'application/vnd.api+json';\n\n // Add item when no cart exists.\n $request_options[RequestOptions::BODY] = Json::encode([\n 'data' => [\n [\n 'type' => 'product-variation--default',\n 'id' => $this->variation->uuid(),\n 'meta' => [\n 'quantity' => 1,\n ],\n ],\n ],\n ]);\n\n $response = $this->request('POST', $url, $request_options);\n $this->assertResponseCode(200, $response);\n\n $response_body = Json::decode((string) $response->getBody());\n $this->assertEquals(count($response_body['data']), 1);\n $this->assertEquals($this->variation->uuid(), $response_body['data'][0]['relationships']['purchased_entity']['data']['id']);\n $this->assertEquals('Mon super produit', $response_body['data'][0]['attributes']['title']);\n $this->assertEquals(1, $response_body['data'][0]['attributes']['quantity']);\n $this->assertEquals(1000, $response_body['data'][0]['attributes']['unit_price']['number']);\n $this->assertEquals('USD', $response_body['data'][0]['attributes']['unit_price']['currency_code']);\n $this->assertEquals(1000, $response_body['data'][0]['attributes']['total_price']['number']);\n $this->assertEquals('USD', $response_body['data'][0]['attributes']['total_price']['currency_code']);\n }",
"function Purchase($uid, $item, $status = \"Completed\", $date = -1, $count = -1, $txnId = \"Unknown\", $duplicate = false) {\r\n if (substr($uid, 0, 2) == \"GU\")\r\n return false;\r\n \r\n if (file_exists(\"App/db\")) {\r\n $dir = \"App/db/purchases\";\r\n $fileName = \"$dir/$uid.txt\";\r\n\t}\r\n else {\r\n \t$dir = \"db/purchases\";\r\n $fileName = \"$dir/$uid.txt\";\r\n\t}\r\n \r\n if (!file_exists($dir))\r\n \tmkdir($dir, 0777, true); \r\n \r\n class Ud {};\r\n \r\n if (file_exists($fileName))\r\n {\r\n $json = file_get_contents($fileName);\r\n\r\n if ($json === false)\r\n {\r\n error_log(\"Error opening file $fileName\");\r\n return false;\r\n }\r\n \r\n $ud = json_decode($json);\r\n }\r\n\r\n if (empty($ud))\r\n $ud = new Ud();\r\n \r\n if (empty($ud->purchases))\r\n $ud->purchases = new Ud();\r\n\r\n if (empty($ud->purchases->$item))\r\n $ud->purchases->$item = new Ud();\r\n\r\n if ($count >= 0)\r\n $cnt = $count;\r\n else\r\n {\r\n $cnt = empty($ud->purchases->$item->count) ? 0 : $ud->purchases->$item->count;\r\n if ($cnt < 0) $cnt = 0;\r\n $cnt = $cnt + 1;\r\n }\r\n $ud->purchases->$item->count = $cnt;\r\n \r\n if ($date >= 0)\r\n $ud->purchases->$item->date = $date;\r\n else\r\n $ud->purchases->$item->date = time() * 1000;\r\n\r\n $ud->purchases->$item->status = $status;\r\n $ud->purchases->$item->txnId = $txnId;\r\n if ($duplicate === true)\r\n $ud->purchases->$item->duplicate = true;\r\n \r\n $result = @file_put_contents($fileName, json_encode($ud));\r\n if ($result === false)\r\n {\r\n error_log(\"Error writing to file $fileName\");\r\n return false;\r\n }\r\n return true;\r\n}",
"public function __construct(\n $purchase_uuid = \"\",\n $product_uuid = \"\",\n $quantity = \"\",\n $comment = \"\",\n $price = \"\",\n $subtotal = \"\",\n $taxes = \"\",\n $grand_total = \"\",\n $firstname = \"\",\n $lastname = \"\",\n $city = \"\"\n ) {\n if ($purchase_uuid != \"\") {\n #fill all the object properties\n $this->purchase_uuid = $purchase_uuid;\n $this->product_uuid = $product_uuid;\n $this->quantity = $quantity;\n $this->comment = $comment;\n $this->price = $price;\n $this->subtotal = $subtotal;\n $this->taxes = $taxes;\n $this->grandtotal = $grand_total;\n $this->firstname = $firstname;\n $this->lastname = $lastname;\n $this->city = $city;\n }\n }",
"public function completePurchase($options);",
"public function testBillingSources()\n {\n }",
"public function testRefundPurchase() {\n\t\t$this->key_pairs = array(\n\t\t\t'tag' => $this->process_tag,\n\t\t\t'status' => 'completed',\n\t\t);\n\t\t$this->process_transactions = CrudTable\\read_rows( 'transactions', $this->key_pairs, false );\n\n\t\tif ( ! empty( $this->process_transactions ) ) {\n\t\t\t$request = TestHelpers::refundPurchaseRequest( $this->tag, $this->process_tag );\n\t\t\t$this->transactions = TestHelpers::refundPurchase( $this->http_client, $request );\n\n\t\t\t$this->assertIsArray( $this->transactions );\n\t\t\t$this->assertArrayHasKey( '0', $this->transactions );\n\n\t\t\t$this->assertEquals( $this->transactions[0]['alias'], $this->process_transactions[0]['alias'] );\n\t\t\t$this->assertEquals( $this->transactions[0]['user'], $this->process_transactions[0]['user'] );\n\t\t\t$this->assertEquals( $this->transactions[0]['cart'], $this->process_transactions[0]['cart'] );\n\t\t\t$this->assertEquals( $this->transactions[0]['transactionid'], $this->process_transactions[0]['transactionid'] );\n\t\t\t$this->assertEquals( abs( $this->transactions[0]['saleid'] ), abs( $this->process_transactions[0]['saleid'] ) );\n\t\t\t$this->assertEquals( $this->transactions[0]['currency'], $this->process_transactions[0]['currency'] );\n\t\t\t$this->assertEquals( $this->transactions[0]['status'], $this->process_transactions[0]['status'] );\n\t\t\t$this->assertEquals( $this->transactions[0]['saleid'], $this->process_transactions[0]['saleid'] );\n\n\t\t\t$this->assertEquals( 'refund', $this->transactions[0]['type'] );\n\t\t\t$this->assertEmpty( $this->transactions[0]['tokenid'] );\n\t\t\t$this->assertNotEmpty( $this->transactions[0]['refundid'] );\n\t\t\t$this->assertEmpty( $this->transactions[0]['redirect_url'] );\n\n\t\t} else {\n\t\t\t$request = TestHelpers::createPurchaseRequest( $this->process_tag );\n\t\t\t$transactions = TestHelpers::createPurchase( $this->http_client, $request );\n\t\t\t$this->assertIsArray( $transactions );\n\t\t\t$this->assertArrayHasKey( '0', $transactions );\n\t\t\t$this->assertNotEmpty( $transactions[0]['redirect_url'] );\n\t\t\t$this->assertEquals( 'created', $transactions[0]['status'] );\n\n\t\t\techo 'For complete REFUND PURCHASE test, you must pay and restart this tests.' . PHP_EOL;\n\t\t\techo 'Link for pay - ' . $transactions[0]['redirect_url'] . PHP_EOL;\n\t\t}\n\t}",
"public function testCheckProduct()\n {\n $response = $this->get('product');\n\n $response->assertStatus(200);\n }",
"public function test(Order $order);",
"function __construct($purchase_Id = \"\", \n $customer_Id =\"\", \n $product_Id =\"\",\n $purchaseQuantitySold =\"\",\n $purchaseProdPrice =\"\",\n $purchaseComments =\"\",\n $purchaseSubtotal = \"\",\n $purchaseTaxes =\"\",\n $purchaseGrandtotal = \"\") {\n $this->purchase_Id =$product_Id;\n $this->customer_Id=$customer_Id;\n $this->product_Id =$product_Id;\n $this->purchaseQuantitySold = $purchaseQuantitySold;\n $this->purchaseProdPrice=$purchaseProdPrice;\n $this->purchaseComments = $purchaseComments;\n $this->purchaseSubtotal = $purchaseSubtotal;\n $this->purchaseTaxes = $purchaseTaxes;\n $this->purchaseGrandtotal = $purchaseGrandtotal;\n }",
"public function test_para_generar_una_venta()\n {\n $saleUseCase = new SaleUseCase(new SaleRepository());\n\n $entity = new SaleEntity(\n 3,\n 200,\n 'exito en la compra',\n 1\n );\n\n $success = $saleUseCase->generateSale($entity);\n\n $this->assertTrue($success, true);\n }",
"public function edit(Purchase $purchase)\n {\n //\n }",
"public function edit(Purchase $purchase)\n {\n //\n }",
"public function edit(Purchase $purchase)\n {\n //\n }",
"public function destroy(Purchase $purchase)\n {\n //\n }",
"public function destroy(Purchase $purchase)\n {\n //\n }",
"public function destroy(Purchase $purchase)\n {\n //\n }",
"public function destroy(Purchase $purchase)\n {\n //\n }",
"public function __construct($purchaseItems, $purchase, $validated)\n {\n $this->purchaseItems = $purchaseItems;\n $this->purchase = $purchase;\n $this->validated = $validated;\n }",
"public function testGetCurrentPricingDataUsingPOST()\n {\n }",
"public function testGetSku()\n {\n $data_from_collection = $this->data['annual_collection'];\n $this->assertEquals(\n $data_from_collection['attributes']['plan_sku'],\n $this->makePlan($data_from_collection)->getSku()\n );\n\n $data_from_site = $this->data['annual_site'];\n $this->assertEquals($data_from_site['sku'], $this->makePlan($data_from_site)->getSku());\n }",
"function test_crud() {\n\t\t// Save revenue.\n\t\t$revenue_id = $this->revenue->add_revenue( 'task', 1, 1000, [\n\t\t\t'deducting' => 100,\n\t\t] );\n\t\tif ( is_wp_error( $revenue_id ) ) {\n\t\t\tthrow new \\Exception( $revenue_id->get_error_message() );\n\t\t}\n\t\t$revenue_id_2 = $this->revenue->add_revenue( 'task', 1, 1000, [\n\t\t\t'deducting' => 0,\n\t\t] );\n\t\t$this->assertTrue( is_numeric( $revenue_id ) && 0 < $revenue_id, 'Revenue 1 is added.' );\n\t\t$this->assertTrue( is_numeric( $revenue_id_2 ) && 0 < $revenue_id_2, 'Revenue 2 is added.' );\n\t\t// Get revenue\n\t\t$revenue = $this->revenue->get( $revenue_id );\n\t\t$this->assertObjectHasAttribute( 'revenue_id', $revenue );\n\t\t// Update revenue;\n\t\t$updated = $this->revenue->fix_billing( [1] );\n\t\t$this->assertEquals( 2, $updated, 'All revenue is fixed.' );\n\t\t// Really updated?\n\t\t$revenue = $this->revenue->get( $revenue_id );\n\t\t$this->assertEquals( '1', $revenue->status );\n\t\t// Get fixed billings.\n\t\t$fixed_deducting = $this->revenue->get_fixed_billing( date_i18n( 'Y' ), 0, [], false );\n\t\t$fixed_with_deducting = $this->revenue->get_fixed_billing( date_i18n( 'Y' ), 0, [], true );\n\t\t$this->assertEquals( 2000, (int) $fixed_deducting[0]->total, 'Extract all billing.' );\n\t\t$this->assertEquals( 1000, (int) $fixed_with_deducting[0]->total, 'Extract billing with deducting.' );\n\t\t// Check log.\n\t\t$this->revenue->update_status( $revenue_id, -1 );\n\t\t$log = $this->revenue->revenue_meta->get_logs( $revenue_id );\n\t\t$this->assertEquals( 1, count( $log ), 'Log found.' );\n\t\t// Delete revenue.\n\t\t$this->revenue->delete( [\n\t\t\t'revenue_id' => $revenue_id,\n\t\t] );\n\t\t$this->revenue->delete( [\n\t\t\t'revenue_id' => $revenue_id_2,\n\t\t] );\n\t\t$revenue = $this->revenue->get( $revenue_id );\n\t\t$this->assertNull( $revenue, 'Revenue is removed.' );\n\t}",
"public function testPurchasedEntityAdded() {\n $url = Url::fromRoute('commerce_api.carts.add');\n $request_options = $this->getAuthenticationRequestOptions();\n $request_options[RequestOptions::HEADERS]['Accept'] = 'application/vnd.api+json';\n $request_options[RequestOptions::HEADERS]['Content-Type'] = 'application/vnd.api+json';\n\n // Add item when no cart exists.\n $request_options[RequestOptions::BODY] = Json::encode([\n 'data' => [\n [\n 'type' => 'product-variation--default',\n 'id' => $this->variation->uuid(),\n 'meta' => [\n 'quantity' => 1,\n ],\n ],\n ],\n ]);\n\n $response = $this->request('POST', $url, $request_options);\n $this->assertResponseCode(200, $response);\n $response_body = Json::decode((string) $response->getBody());\n $this->assertEquals(count($response_body['data']), 1);\n $this->assertEquals($this->variation->uuid(), $response_body['data'][0]['relationships']['purchased_entity']['data']['id']);\n $this->assertEquals('My Super Product', $response_body['data'][0]['attributes']['title']);\n $this->assertEquals(1, $response_body['data'][0]['attributes']['quantity']);\n $this->assertEquals(1000, $response_body['data'][0]['attributes']['unit_price']['number']);\n $this->assertEquals('USD', $response_body['data'][0]['attributes']['unit_price']['currency_code']);\n $this->assertEquals(1000, $response_body['data'][0]['attributes']['total_price']['number']);\n $this->assertEquals('USD', $response_body['data'][0]['attributes']['total_price']['currency_code']);\n }",
"public function testCreatePayrun()\n {\n }",
"public function testeditTrade() {\n $user = 1;\n $product = 1;\n $price = 999;\n $newprice = 500;\n $desc = 'test';\n $newdesc = 'uusi testi';\n R::exec('UPDATE collection set products = \"{\"\"1\"\": 1}\" WHERE id = :id', [':id' => $user]);\n R::exec('DELETE FROM trades WHERE seller_id = :id', [':id' => $user]);\n addNewTrade($user, $product, $price, $desc);\n $trades = getOpenTrades($user);\n editTrade($user, $trades[0]['id'], $newprice, $newdesc);\n $trades = getOpenTrades($user);\n $this->assertEquals($newprice, $trades[0]['price']);\n $this->assertEquals($newdesc, $trades[0]['description']);\n R::exec('DELETE FROM trades WHERE seller_id = :id', [':id' => $user]);\n }",
"public function purchases()\n\t{\n\t\t$EE =& get_instance();\n\n\t\tif(!$member_id = $EE->TMPL->fetch_param(\"member_id\"))\n\t\t\t$member_id = $EE->session->userdata['member_id'];\n\n\t\t$query = $EE->db->query(\"SELECT p.purchase_id as purchase_id,\n\t\t\tp.member_id as member_id,\n\t\t\tp.purchase_id as purchase_id,\n\t\t\tp.item_id as item_id,\n\t\t\tp.txn_id as txn_id,\n\t\t\tp.purchase_date as purchase_date,\n\t\t\tp.note as purchase_note,\n\t\t\tp.item_cost as item_cost,\n\t\t\tt.title as title,\n\t\t\tt.url_title as url_title,\n\t\t\tt.entry_id as entry_id\n\t\tFROM `exp_simple_commerce_purchases` as p\n\t\tLEFT JOIN `exp_simple_commerce_items` as i ON p.item_id = i.item_id\n\t\tLEFT JOIN `exp_channel_titles` as t ON i.entry_id = t.entry_id\n\t\tLEFT JOIN `exp_members` as m ON p.member_id = m.member_id\n\t\tLEFT JOIN `exp_channel_data` as d ON i.entry_id = d.entry_id\n\t\tWHERE p.member_id = '{$member_id}'\n\t\tORDER BY p.purchase_id DESC\");\n\n\t\tif($query->num_rows == 0)\n\t\t{\n\t\t\treturn $EE->TMPL->parse_variables_row($EE->TMPL->tagdata, array(\"no_purchases\" => TRUE));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $query->result_array();\n\t\t\tforeach ($result as $key => $value)\n\t\t\t{\n\t\t\t\t$result[$key][\"license_key\"] = sprintf('%03d', $value[\"item_id\"])\n\t\t\t\t\t. sprintf('%05d', $value[\"member_id\"])\n\t\t\t\t\t. sprintf('%05d', $value[\"purchase_id\"])\n\t\t\t\t\t. sprintf('%02d', 1)\n\t\t\t\t\t. $value[\"purchase_date\"];\n\t\t\t}\n\t\t\treturn $EE->TMPL->parse_variables($EE->TMPL->tagdata, $result);\n\t\t}\n\t}",
"public function testGetSuperfundProducts()\n {\n }",
"public function testCustomerPaymentMethodGetCustomerPaymentMethods()\n {\n }",
"public function testGetItem()\n {\n $item = $this->addItem();\n $this->assertEquals($item, $this->laracart->getItem($item->getHash()));\n }",
"public function testCatalogGetProduct()\n {\n\n }",
"function test_sample()\n\t{\n\t\t// $post_id = $this->factory->post->create();\n\t\t// add_post_meta($post_id, 'unit_code', '1996-96482');\n\t\t//\n\t\t// $unit = Client::get('units/1996-96482');\n\t\t// var_dump($unit);\n\t\t//\n // $post = new VacationRental($post, $unit);\n\t\t//\n\t\t// // Replace this with some actual testing code.\n\t\t// $this->assertTrue( true );\n\t}",
"public function testGetPayrun()\n {\n }",
"public function testPayersPayerTypeCommissionAmountGet()\n {\n }",
"function setOrderPaid($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}",
"public function testRemovesOneUnitOfItemFromCart()\n {\n }",
"public function testExample()\n {\n\n $order = \\App\\Order::orderByRaw(\"RAND()\")->with('products')->first();\n\n $orders = \\App\\Order::getByState('complite')->paginate(10);\n\n// print_r($orders);\n $this->assertNotEmpty($order->amount);\n\n }",
"public function testPayersPayerTypeGet()\n {\n }",
"public function testStore()\n {\n $cart = $this -> fakeUser -> carts() -> create();\n $product = Product::create([\n 'title' => 'test',\n 'content' => 'try',\n 'price' => 30,\n 'quantity' => 10\n ]);\n //ˇˇˇ結構 ˇˇˇ method, route, data\n $response = $this->call(\n 'POST',\n 'cart-items',\n ['cart_id' => $cart -> id,'product_id' => $product->id, 'quantity' => 3]\n );\n $response -> assertOk();\n\n }",
"public function testCanMakeInvestment() : void\n {\n $this->tranche->makeInvestment(100);\n\n $this->assertEquals(49900, $this->tranche-> getRemainingInvestment());\n }",
"public function testCustomerPaymentMethodCreateCustomerPaymentMethod()\n {\n }",
"public function store()\n\t{\n\t\tif(!Input::has('purchase'))\n\t\t{\n\t\t\treturn new JSend('error', (array)Input::all(), 'Tidak ada data purchase.');\n\t\t}\n\n\t\t$errors = new MessageBag();\n\n\t\tDB::beginTransaction();\n\n\t\t//1. Validate Purchase Parameter\n\t\t\n\t\t$purchase = Input::get('purchase');\n\n\t\tif(is_null($purchase['id']))\n\t\t{\n\t\t\t$is_new = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$is_new = false;\n\t\t}\n\n\t\t$purchase_rules = [\n\t\t\t\t\t\t\t\t\t\t\t'supplier_id' => 'required|exists:suppliers,id'\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t//1a. Get original data\n\t\t$purchase_data = \\App\\Models\\Purchase::findornew($purchase['id']);\n\n\t\t//1b. Validate Basic Purchase Parameter\n\t\t$validator = Validator::make($purchase, $purchase_rules);\n\n\t\tif (!$validator->passes())\n\t\t{\n\t\t\t$errors->add('Purchase', $validator->errors());\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//if validator passed, save purchase\n\t\t\t$purchase_data = $purchase_data->fill(['supplier_id' => $purchase['supplier_id'], 'type' => 'buy', 'transact_at' => isset($purchase['transact_at']) ? $purchase['transact_at'] : '']);\n\n\t\t\tif(!$purchase_data->save())\n\t\t\t{\n\t\t\t\t$errors->add('Purchase', $purchase_data->getError());\n\t\t\t}\n\t\t}\n\n\t\t//2. Validate Purchase Detail Parameter\n\t\tif(!$errors->count() && isset($purchase['transactiondetails']) && is_array($purchase['transactiondetails']))\n\t\t{\n\t\t\t$detail_current_ids = [];\n\t\t\tforeach ($purchase['transactiondetails'] as $key => $value) \n\t\t\t{\n\t\t\t\tif(!$errors->count())\n\t\t\t\t{\n\t\t\t\t\t$detail_data = \\App\\Models\\TransactionDetail::findornew($value['id']);\n\n\t\t\t\t\t$detail_rules \t= [\n\t\t\t\t\t\t\t\t\t\t\t\t'transaction_id' => 'exists:transactions,id|'.($is_new ? '' : 'in:'.$purchase_data['id']),\n\t\t\t\t\t\t\t\t\t\t\t\t'varian_id' => 'required|exists:varians,id',\n\t\t\t\t\t\t\t\t\t\t\t\t'quantity' => 'required|numeric',\n\t\t\t\t\t\t\t\t\t\t\t\t'price' => 'required|numeric',\n\t\t\t\t\t\t\t\t\t\t\t\t'discount' => 'numeric',\n\t\t\t\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t$validator\t\t\t= Validator::make($value, $detail_rules);\n\n\t\t\t\t\t//if there was detail and validator false\n\t\t\t\t\tif (!$validator->passes())\n\t\t\t\t\t{\n\t\t\t\t\t\t$errors->add('Detail', $validator->errors());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$value['transaction_id'] = $purchase_data['id'];\n\n\t\t\t\t\t\t$detail_data = $detail_data->fill($value);\n\n\t\t\t\t\t\tif(!$detail_data->save())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errors->add('Detail', $detail_data->getError());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$detail_current_ids[] = $detail_data['id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if there was no error, check if there were things need to be delete\n\t\t\tif(!$errors->count())\n\t\t\t{\n\t\t\t\t$details = \\App\\Models\\TransactionDetail::transactionid($purchase['id'])->get(['id'])->toArray();\n\t\t\t\t\n\t\t\t\t$detail_should_be_ids = [];\n\t\t\t\tforeach ($details as $key => $value) \n\t\t\t\t{\n\t\t\t\t\t$detail_should_be_ids[] = $value['id'];\n\t\t\t\t}\n\n\t\t\t\t$difference_detail_ids = array_diff($detail_should_be_ids, $detail_current_ids);\n\n\t\t\t\tif($difference_detail_ids)\n\t\t\t\t{\n\t\t\t\t\tforeach ($difference_detail_ids as $key => $value) \n\t\t\t\t\t{\n\t\t\t\t\t\t$detail_data = \\App\\Models\\TransactionDetail::find($value);\n\n\t\t\t\t\t\tif(!$detail_data->delete())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errors->add('Detail', $detail_data->getError());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//3. Validate Purchase Status Parameter\n\t\tif(!$errors->count() && isset($purchase['transactionlogs']) && is_array($purchase['transactionlogs']))\n\t\t{\n\t\t\t$log_current_ids = [];\n\t\t\tforeach ($purchase['transactionlogs'] as $key => $value) \n\t\t\t{\n\t\t\t\tif(!$errors->count())\n\t\t\t\t{\n\t\t\t\t\t$log_data\t\t= \\App\\Models\\TransactionLog::findornew($value['id']);\n\n\t\t\t\t\t$log_rules\t\t= [\n\t\t\t\t\t\t\t\t\t\t\t'transaction_id' => 'exists:transactions,id|'.($is_new ? '' : 'in:'.$purchase_data['id']),\n\t\t\t\t\t\t\t\t\t\t\t'status' => 'required|max:255|in:cart,wait,paid,packed,shipping,delivered,canceled,abandoned',\n\t\t\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t$validator\t\t= Validator::make($value, $log_rules);\n\n\t\t\t\t\t//if there was log and validator false\n\t\t\t\t\tif (!$validator->passes())\n\t\t\t\t\t{\n\t\t\t\t\t\t$errors->add('Log', $validator->errors());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$value['transaction_id']\t= $purchase_data['id'];\n\n\t\t\t\t\t\t$log_data\t\t\t\t\t= $log_data->fill($value);\n\n\t\t\t\t\t\tif(!$log_data->save())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errors->add('Log', $log_data->getError());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$log_current_ids[]\t\t= $log_data['id'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//if there was no error, check if there were things need to be delete\n\t\t\tif(!$errors->count())\n\t\t\t{\n\t\t\t\t$logs = \\App\\Models\\TransactionLog::transactionid($purchase['id'])->get(['id'])->toArray();\n\t\t\t\t\n\t\t\t\t$log_should_be_ids = [];\n\t\t\t\tforeach ($logs as $key => $value) \n\t\t\t\t{\n\t\t\t\t\t$log_should_be_ids[] = $value['id'];\n\t\t\t\t}\n\n\t\t\t\t$difference_log_ids = array_diff($log_should_be_ids, $log_current_ids);\n\n\t\t\t\tif($difference_log_ids)\n\t\t\t\t{\n\t\t\t\t\tforeach ($difference_log_ids as $key => $value) \n\t\t\t\t\t{\n\t\t\t\t\t\t$log_data = \\App\\Models\\TransactionLog::find($value);\n\n\t\t\t\t\t\tif(!$log_data->delete())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errors->add('Log', $log_data->getError());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//4. Compare status\n\t\tif(isset($purchase['status']) && $purchase_data['status']!=$purchase['status'])\n\t\t{\n\t\t\t$log_rules = [\n\t\t\t\t\t\t\t\t\t'transaction_id' => 'exists:transactions,id|'.($is_new ? '' : 'in:'.$purchase_data['id']),\n\t\t\t\t\t\t\t\t\t'status' => 'required|max:255|in:cart,wait,paid,packed,shipping,delivered,canceled,abandoned',\n\t\t\t\t\t\t\t\t];\n\n\t\t\t$validator = Validator::make($purchase, $log_rules);\n\n\t\t\t//if there was log and validator false\n\t\t\tif (!$validator->passes())\n\t\t\t{\n\t\t\t\t$errors->add('Log', 'Status Tidak Valid.');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$log_data = new \\App\\Models\\TransactionLog;\n\n\t\t\t\t$log_data = $log_data->fill(['status' => $purchase['status'], 'transaction_id' => $purchase_data['id']]);\n\n\t\t\t\tif(!$log_data->save())\n\t\t\t\t{\n\t\t\t\t\t$errors->add('Log', $log_data->getError());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($errors->count())\n\t\t{\n\t\t\tDB::rollback();\n\n\t\t\treturn new JSend('error', (array)Input::all(), $errors);\n\t\t}\n\n\t\tDB::commit();\n\t\t\n\t\t$final_purchase = \\App\\Models\\Purchase::id($purchase_data['id'])->with(['transactionlogs', 'supplier', 'transactiondetails', 'transactiondetails.varian', 'transactiondetails.varian.product'])->first()->toArray();\n\n\t\treturn new JSend('success', (array)$final_purchase);\n\t}",
"public function testSuccessOrder()\n {\n $user = User::factory()->create([\n 'email' => 'backend@multisyscorp.com',\n 'email_verified_at' => now(),\n 'password' => 'asdqwe123'\n ]);\n $orderData = [\n 'product_id' => 1,\n 'quantity' => 1\n ];\n $this->actingAs($user,'api_user');\n\n $this->json('POST', 'api/order',$orderData, ['Accept' => 'application/json'])\n ->assertStatus(201)\n ->assertJson([\n 'message' => 'You have successfully ordered this product'\n ]);\n }",
"public function testGetOrderDetailByTransactionIdValid(){\n \n \tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n \tPayU::$apiKey = PayUTestUtil::API_KEY;\n \tEnvironment::setReportsCustomUrl(PayUTestUtil::REPORTS_CUSTOM_URL);\n\n \t$authorizationResponse = PayUTestUtil::processTransaction(TransactionType::AUTHORIZATION_AND_CAPTURE, '*');\n \t \n \t$parameters = array(\n \t\t\tPayUParameters::TRANSACTION_ID => $authorizationResponse->transactionResponse->transactionId,\n \t);\n \t \n \t$response = PayUReports::getTransactionResponse($parameters);\n }",
"public function test_updateBillingCodeType() {\n\n }",
"public function retornoTeste()\r\n {\r\n $orderId = Mage::getSingleton(\"core/session\")->getPayOrderId();\r\n $this->log('orderId: '.$orderId);\r\n //$this->_order = Mage::getModel('sales/order')->loadByIncrementId($orderId);\r\n $this->_order = Mage::getModel('sales/order')->load($orderId);\r\n \r\n //$this->log('_order_: '. var_dump($this->_order));\r\n $this->processEvo(Mage::getSingleton(\"core/session\")->getPayEvoOrderId());\r\n }",
"public function test_getByCustomerNo() {\n\n }",
"public function test_updateCartonActivity() {\n\n }",
"public function testCashInCommission(): void\n {\n $user = new User(1, 'natural');\n $transaction = new Transaction();\n\n $transaction->date = '2019-02-23';\n $transaction->type = 'cash_in';\n $transaction->amount = 1000;\n $transaction->currency = 'EUR';\n $transaction->user = $user;\n\n $this->assertSame($this->app['managers']['commission']->calculateCommission($transaction), '0.30');\n }",
"public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}",
"function purchase_product ($product_id, $quantity) {\n if ($quantity <= 0) {\n throw new InvalidOperationException(\"Cannot purchase {$quantity} of {$product->title} (Min: 1)\");\n }\n $db = getDb();\n\n $product = fetch_product($product_id);\n if ($product->inventory_count < $quantity) {\n throw new InvalidOperationException(\"Cannot purchase {$quantity} of {$product->title} (Max: {$product->inventory_count})\");\n }\n\n //We update where inventory_count >= quantity\n //because the inventory_count could have changed before executing this\n //We could have also used a transaction\n $statement = $db->prepare(\"\n UPDATE\n product\n SET\n inventory_count = inventory_count - :quantity\n WHERE\n product_id = :product_id AND\n inventory_count >= :quantity2\n \");\n $executed = $statement->execute([\n \"product_id\"=>$product_id,\n \"quantity\"=>$quantity,\n \"quantity2\"=>$quantity,\n ]);\n if (!$executed) {\n throw new Exception(\"An unexpected error occurred; could not purchase product\");\n }\n if ($statement->rowCount() == 0) {\n throw new InvalidOperationException(\"Coult not purchase {$quantity} of {$product->title}\");\n }\n}",
"public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}"
]
| [
"0.7999961",
"0.78617",
"0.7173359",
"0.6867749",
"0.6750338",
"0.6723917",
"0.6712769",
"0.6616111",
"0.6616111",
"0.6616111",
"0.658661",
"0.658661",
"0.658661",
"0.658661",
"0.6585211",
"0.65488344",
"0.65023476",
"0.64844507",
"0.64696765",
"0.64496434",
"0.6415415",
"0.64055437",
"0.63620263",
"0.6347746",
"0.6307486",
"0.6303867",
"0.63008845",
"0.629719",
"0.6290665",
"0.62798876",
"0.6227436",
"0.6214809",
"0.6152465",
"0.6083232",
"0.60752827",
"0.60652816",
"0.60585105",
"0.6014578",
"0.59796005",
"0.59419066",
"0.5938345",
"0.5913005",
"0.59008247",
"0.5881924",
"0.5881454",
"0.58770806",
"0.5874035",
"0.5871801",
"0.5867616",
"0.58658355",
"0.58552235",
"0.58513504",
"0.58385956",
"0.58242023",
"0.5824167",
"0.58191013",
"0.5813875",
"0.57777387",
"0.5777535",
"0.57749563",
"0.5752984",
"0.57492447",
"0.57492447",
"0.57492447",
"0.5738495",
"0.5738495",
"0.5738495",
"0.5738495",
"0.57371604",
"0.5729231",
"0.5724813",
"0.5721239",
"0.5720069",
"0.57095665",
"0.57085156",
"0.5702229",
"0.56986284",
"0.5692478",
"0.56907123",
"0.56885725",
"0.56868017",
"0.5671348",
"0.5668828",
"0.5665979",
"0.5655445",
"0.56528074",
"0.5646866",
"0.56429887",
"0.56360036",
"0.5619588",
"0.56118846",
"0.5609641",
"0.56065416",
"0.5590844",
"0.5578209",
"0.5577861",
"0.5569248",
"0.55671024",
"0.55645883",
"0.5562631",
"0.556214"
]
| 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('city')->insert([ 'name' => 'Sydney', 'latitude' => '-33.79', 'longitude' => '151.27', ]);
DB::table('city')->insert([ 'name' => 'Melbourne', 'latitude' => '-37.81', 'longitude' => '144.97', ]);
DB::table('city')->insert([ 'name' => 'Brisbane', 'latitude' => '-27.47', 'longitude' => '153.03', ]);
DB::table('city')->insert([ 'name' => 'Perth', 'latitude' => '-31.92', 'longitude' => '115.91', ]);
DB::table('city')->insert([ 'name' => 'Adelaide', 'latitude' => '-34.93', 'longitude' => '138.6', ]);
DB::table('city')->insert([ 'name' => 'Newcastle', 'latitude' => '-32.94', 'longitude' => '151.77', ]);
DB::table('city')->insert([ 'name' => 'Canberra', 'latitude' => '-35.31', 'longitude' => '149.14', ]);
DB::table('city')->insert([ 'name' => 'Wollongong', 'latitude' => '-34.44', 'longitude' => '150.89', ]);
DB::table('city')->insert([ 'name' => 'Geelong', 'latitude' => '-38.18', 'longitude' => '145.11', ]);
DB::table('city')->insert([ 'name' => 'Townsville', 'latitude' => '-19.25', 'longitude' => '146.8', ]);
DB::table('city')->insert([ 'name' => 'Cairns', 'latitude' => '-16.88', 'longitude' => '145.75', ]);
DB::table('city')->insert([ 'name' => 'Toowoomba', 'latitude' => '-27.62', 'longitude' => '151.77', ]);
DB::table('city')->insert([ 'name' => 'Darwin', 'latitude' => '-12.8', 'longitude' => '130.96', ]);
DB::table('city')->insert([ 'name' => 'Launceston', 'latitude' => '-41.46', 'longitude' => '147.08', ]);
DB::table('city')->insert([ 'name' => 'Ballarat', 'latitude' => '-37.56', 'longitude' => '143.82', ]);
DB::table('city')->insert([ 'name' => 'Bendigo', 'latitude' => '-36.76', 'longitude' => '144.28', ]);
DB::table('city')->insert([ 'name' => 'Mackay', 'latitude' => '-21.16', 'longitude' => '149.1', ]);
DB::table('city')->insert([ 'name' => 'Mandurah', 'latitude' => '-32.55', 'longitude' => '115.75', ]);
DB::table('city')->insert([ 'name' => 'Rockhampton', 'latitude' => '-23.39', 'longitude' => '150.5', ]);
DB::table('city')->insert([ 'name' => 'Bundaberg', 'latitude' => '-24.84', 'longitude' => '152.02', ]);
DB::table('city')->insert([ 'name' => 'Bunbury', 'latitude' => '-36.24', 'longitude' => '139.97', ]);
DB::table('city')->insert([ 'name' => 'Wagga Wagga', 'latitude' => '-35.16', 'longitude' => '147.51', ]);
DB::table('city')->insert([ 'name' => 'Hervey Bay', 'latitude' => '-25.35', 'longitude' => '152.89', ]);
DB::table('city')->insert([ 'name' => 'Coffs Harbour', 'latitude' => '-30.34', 'longitude' => '153.07', ]);
DB::table('city')->insert([ 'name' => 'Mildura', 'latitude' => '-34.18', 'longitude' => '142.16', ]);
DB::table('city')->insert([ 'name' => 'Gladstone', 'latitude' => '-31.06', 'longitude' => '152.77', ]);
DB::table('city')->insert([ 'name' => 'Shepparton', 'latitude' => '-36.36', 'longitude' => '145.4', ]);
DB::table('city')->insert([ 'name' => 'Tamworth', 'latitude' => '-30.96', 'longitude' => '150.83', ]);
DB::table('city')->insert([ 'name' => 'Port Macquarie', 'latitude' => '-31.4', 'longitude' => '152.85', ]);
DB::table('city')->insert([ 'name' => 'Orange', 'latitude' => '-33.12', 'longitude' => '149.03', ]);
DB::table('city')->insert([ 'name' => 'Dubbo', 'latitude' => '-32.2', 'longitude' => '148.9', ]);
DB::table('city')->insert([ 'name' => 'Geraldton', 'latitude' => '-28.79', 'longitude' => '114.6', ]);
DB::table('city')->insert([ 'name' => 'Bathurst', 'latitude' => '-33.91', 'longitude' => '149.33', ]);
DB::table('city')->insert([ 'name' => 'Warrnambool', 'latitude' => '-38.36', 'longitude' => '142.44', ]);
DB::table('city')->insert([ 'name' => 'Lismore', 'latitude' => '-28.61', 'longitude' => '153.04', ]);
} | {
"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 factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }",
"public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }",
"public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }",
"public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }",
"public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }",
"public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }",
"public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}",
"public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }",
"public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }",
"public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }",
"public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }",
"public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }",
"public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }",
"public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}",
"public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }",
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }",
"public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }",
"public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }",
"public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }",
"public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }",
"public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }",
"public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }",
"public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }",
"public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }",
"public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }",
"public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }",
"public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}",
"public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }",
"public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }",
"public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }"
]
| [
"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.7841468",
"0.7834583",
"0.7827792",
"0.7819104",
"0.78088796",
"0.7802872",
"0.7802348",
"0.78006834",
"0.77989215",
"0.7795819",
"0.77903426",
"0.77884805",
"0.77862066",
"0.7778816",
"0.7777486",
"0.7765202",
"0.7762492",
"0.77623445",
"0.77621746",
"0.7761383",
"0.77606887",
"0.77596676",
"0.7757001",
"0.7753607",
"0.7749522",
"0.7749292",
"0.77466977",
"0.7729947",
"0.77289546",
"0.772796",
"0.77167094",
"0.7714503",
"0.77140456",
"0.77132195",
"0.771243",
"0.77122366",
"0.7711113",
"0.77109736",
"0.7710777",
"0.7710086",
"0.7705484",
"0.770464",
"0.7704354",
"0.7704061",
"0.77027386",
"0.77020216",
"0.77008796",
"0.7698617",
"0.76985973",
"0.76973504",
"0.7696405",
"0.7694293",
"0.7692694",
"0.7691264",
"0.7690576",
"0.76882726",
"0.7687433",
"0.7686844",
"0.7686498",
"0.7685065",
"0.7683827",
"0.7679184",
"0.7678287",
"0.76776296",
"0.76767945",
"0.76726556",
"0.76708084",
"0.76690495",
"0.766872",
"0.76686716",
"0.7666299",
"0.76625943",
"0.7662227",
"0.76613766",
"0.7659881",
"0.7656644",
"0.76539344",
"0.76535016",
"0.7652375",
"0.7652313",
"0.7652022"
]
| 0.0 | -1 |
Subcall of wrapper editable() from RenderableMaterializeTrait | public function _editable($value, Field $field, HTMLNode $previous): HTMLNode
{
$format = $field->getRenderable(HTMLRenderable_enum::FORMAT_CHOOSER, HTMLRenderable_enum::FORMAT_CHOOSER_SELECT);
if ($format == HTMLRenderable_enum::FORMAT_CHOOSER_RADIO) {
$labels = [];
// add extra classes
foreach ($previous->get('.formularium-radio-item') as $container) {
$label = $container->get('label')[0];
$input = $container->get('input')[0];
$labels[] = $label->prependContent($input)->addAttribute('class', 'radio');
}
$previous->get('.formularium-radio-group')[0]->setContent($labels);
} else {
// create a div around the old select
$oldSelect = $previous->get('select')[0];
$newSelect = clone $oldSelect;
$oldSelect->setTag('div')->setAttribute('class', 'select')->setContent($newSelect);
}
foreach ($previous->getContent() as $e) {
if ($e->getAttribute('class') === ['formularium-comment']) {
$e->setTag('p')->setAttributes([
'class' => 'help',
]);
}
}
return $previous;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isEditable() {}",
"abstract protected function renderEdit();",
"public function isEditable();",
"public function isEditable();",
"public function canBeEdited() {}",
"public function is_editable() {\n\t\treturn false;\n\t}",
"public function setEditable(bool $editable=true): self;",
"protected function canEdit() {}",
"public function setEditable($value);",
"public function canBeEdited()\n {\n return false;\n }",
"public function isEditable()\n {\n return $this->_editable;\n }",
"public function renderQuickEdit() {}",
"public function setEditable($editable = true, $setDefaultValue = true) {}",
"public function isSwitchToEditEnabled();",
"public function isEditOnlyMode();",
"public function can_edit() {\n return true;\n }",
"abstract function allowEditAction();",
"public function edit() {\r\n\t\treturn $this->_edit(false);\r\n\t}",
"public function editable()\n {\n if ($this->getMode() == \"only_external\") {\n return false;\n }\n if ($this->hasScript()) {\n // can't edit calculated fields\n return false;\n }\n if (!isset($this->data[\"editable\"])) {\n return true;\n }\n return (true == $this->data[\"editable\"]);\n }",
"function &show_edit($item, $usehtmleditor = false) {\n }",
"public function getEditableText() {}",
"public function canEdit()\n {\n return true;\n }",
"public function editable($value) {\n return $this->setProperty('editable', $value);\n }",
"public function inline_edit()\n {\n }",
"public function inline_edit()\n {\n }",
"public function getEdit()\n\t{\n\t}",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"function isEditable(Eloquent $model);",
"public function getEditInput();",
"public function edit()\n {\n \n }",
"public function edit() {\n\t\t\t\n\t\t}",
"public function editable($editable)\n {\n $this->editable = $editable;\n\n return $this;\n }",
"protected function renderControlNonEditable()\n {\n throw new NotSupportedException();\n }",
"public function MetaEditable() {\n\t\t\treturn true;\n\t\t}",
"public function edit()\n\t{\n\t\t\n\t}",
"public function edit() {\n }",
"public function edit()\n {\n \n \n }",
"function OnBeforeEdit(){\n }",
"public function edit()\n\t{\n\t\t//\n\t}",
"public function edit() {\n\n }",
"function dhl_parcel_textbox($reference_field_data, $is_editable) {\n if($is_editable ){\n ?>\n <input id=\"order_dhl_reference_field\" name='dhl_reference_field' type='text' maxlength=\"35\" value='<?php echo esc_attr($reference_field_data) ?>'>\n <button class=\"button wc-reload\"><span>Apply</span></button>\n <?php\n } else {\n ?>\n <input id=\"order_dhl_reference_field\" name='dhl_reference_field' style=\"width:100%\" type='text' value='<?php echo esc_attr($reference_field_data) ?>' readonly>\n <?php\n }\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"function canEdit() {\n\t\t\treturn true;\n\t\t}",
"public function enabledInEditMode()\n\t{\n\t\treturn false;\n\t}",
"public function edit()\n { }",
"public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"function render_edit($user)\n {\n }",
"public function getEditRaw();",
"public function edit()\n { \n }",
"public function edit( )\r\n {\r\n //\r\n }",
"public function edit()\n {\n\n }",
"public function edit()\n {\n\n }",
"public function edit()\n {\n\n }",
"public function edit()\n {\n\n }",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function editorAction() {\n \n }",
"public function showEdit()\n {\n\n }",
"public function edit()\n {\n //\n }",
"public function setEditableInColumn(bool $editableInColumn=true): self;",
"function OnAfterEdit(){\n }",
"public function isEditable($operation = OperationTypes::OP_UPDATE, $ignore_op = FALSE);",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function edit()\n\t{\n\t\treturn $this;\n\t}",
"private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }",
"private function _applyEditableParam()\n {\n if ($this->editable) {\n // Limit the query to only the global sets the user has permission to edit\n $editableSetIds = Craft::$app->getGlobals()->getEditableSetIds();\n $this->subQuery->andWhere(['elements.id' => $editableSetIds]);\n }\n }",
"public function isEditable($id)\n\t{\n\t\t// TODO: Implement isEditable() method.\n\t}",
"public function getEditor();",
"public static function setEditable($bool) {\n\t\tself::$editable = $bool;\n\t}",
"public function edit()\r\n {\r\n return null;\r\n }",
"public function edit_toko(){\n\t}",
"public function Edit()\n\t{\n\t\t\n\t}",
"public function editable(bool $value = true)\n {\n $this->editable = $value;\n return $this;\n }",
"public function editAction()\n {\n return $this->editor($isEditAction=true);\n }",
"public function _editField() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$field_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$field_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->get ( ( int ) $field_id );\n\t\t\n\t\t$this->loadPluginModel ( 'fields' );\n\t\t\n\t\t$this->setView ( 'edit_field' );\n\t\n\t}",
"public function isEditAction() {}",
"public function getEditingAttribute()\n {\n return false;\n }",
"static function renderEditableField($name, $value = null, $label = null, $attributes = null, $editOptions = null) {\n echo '<li>';\n if ($label)\n echo '<label>'.textH8($label).'</label>';\n if (!is_array($attributes))\n $attributes = array();\n $attributes['name'] = $name;\n if (!isset($attributes['id']))\n $attributes['id'] = $name;\n \n echo self::renderOpenTag('textarea', $attributes);\n echo textH8($value);\n echo '</textarea>';\n echo '</li>';\n \n // MBUL : for google translation plugin\n echo '<input type=\"hidden\" id=\"sLang\" value=\"en\"><input type=\"hidden\" id=\"dLang\" value=\"fr\">';\n \n // Set default options for tinyMCE editor\n $options = array();\n $options['plugins'] = 'spellchecker,style,table,searchreplace,print,paste,google_translations';\n //\t\t$options['setup'] = 'function(ed){ed.onPreProcess.add(function(ed, o){alert(\"toto\");});}';\n $options['auto_reset_designmode'] = true;\n $options['elements'] = $attributes['id'];\n $options['entities'] = '160,nbsp';\n $options['entity_encoding'] = 'named';\n $options['language'] = $_SESSION['wcmSession']->getSite()->language;\n $options['valid_elements'] = 'hr,p,br,a[href|target:_blank],img[alt|src],strong/b,em/i,sub,sup,table[width|cellpadding|cellspacing|border|rules|style],thead,tbody,tfoot,tr[style],td[colspan|rowspan|width|align|valign|style],th[colspan|rowspan|style],h1,h2,h3,ul,ol,li,div[style]';\n $options['cleanup_on_startup'] = true;\n $options['paste_auto_cleanup_on_paste'] = true;\n $options['invalid_elements'] = 'xml,w:WordDocument,!-,!--';\n $options['mode'] = 'exact';\n $options['theme'] = 'advanced';\n $options['apply_source_formatting'] = true;\n // $options['debug '] = true;\n $options['theme_advanced_buttons1'] = 'cut,copy,pasteword,selectall,undo,redo,|,search,replace,|,cleanup,code';\n $options['theme_advanced_buttons2'] = 'bold,italic,underline,|,hr,|,bullist,numlist,|,link,anchor,|,spellchecker,|,google_translations';\n $options['theme_advanced_buttons3'] = 'tablecontrols';\n $options['theme_advanced_layout_manager'] = 'SimpleLayout';\n $options['theme_advanced_path'] = false;\n $options['theme_advanced_resize_horizontal'] = false;\n $options['theme_advanced_resizing'] = true;\n $options['theme_advanced_statusbar_location'] = 'bottom';\n $options['theme_advanced_toolbar_location'] = 'top';\n $options['theme_advanced_toolbar_align'] = 'left';\n $options['theme_advanced_font_sizes'] = '7';\n $options['width'] = 564;\n $options['height'] = 400;\n \n /*$myLG = $options['language'];\n echo '<script type=\"text/javascript\">';\n echo \"alert(' OK - $myLG');\";\n echo '</script>';\n exit();*/\n \n // Override editor options\n if (is_array($editOptions)) {\n foreach ($editOptions as $option=>$val) {\n $options[$option] = $val;\n }\n }\n \n $options = self::getJavascriptOptions($options);\n \n //print_r($options);\n //exit();\n \n echo '<script type=\"text/javascript\">';\n echo 'tinyMCE.init('.substr($options, 0, strlen($options) - 1).',';\n echo 'theme_advanced_path : false,\n \t\t\tsetup : function(ed) {\n \t\t\ted.onKeyUp.add(function(ed, e) { \n \t\tvar strip = (tinyMCE.activeEditor.getContent()).replace(/<([^>]+)>/ig,\"\");\n\t\t\t\t\tstrip = strip.replace(/ /ig,\"\");\n\t\t\t\t\tstrip = strip.replace(/\\n/ig,\"\");\n\t\t\t\t\tstrip = strip.replace(/\\r/ig,\"\");\n\t\t\t\t\tvar charsCount = strip.length;\n\t\t\t\t\tvar text = charsCount + \" Characters\"\n \t\t\ttinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + \\'_path_row\\'), text);\n\t\t\t\t\tdocument.getElementById(tinyMCE.activeEditor.id + \\'_signCounter\\').value = charsCount;\n \t\t\t});}\n\t\n \t\t});';\n echo '</script>';\n }",
"public function isFrontendEditingActive() {}",
"public function setEditOnlyMode($value);",
"public function canBeEdited()\n {\n return true; ///< Every client sees only it's own information\n }",
"public function isLabelEditable() {}",
"public function updateEditableFields() {\n\t\t$allowedFields = $this->config()->allowed_field_types;\n\t\tif ($allowedFields) {\n\t\t\t$fieldClasses = singleton('EditableFormField')->getEditableFieldClasses();\n\t\t\tforeach($fieldClasses as $fieldClass => $fieldTitle) {\n\t\t\t\tif (!in_array($fieldClass, $allowedFields)) {\n\t\t\t\t\tConfig::inst()->update($fieldClass, 'hidden', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Explicitely allow fields, so subclasses show up\n\t\t\tforeach($allowedFields as $fieldClass) {\n\t\t\t\tConfig::inst()->update($fieldClass, 'hidden', false);\n\t\t\t}\n\t\t}\n\t}",
"function _set_editable_fields()\n\t{\n\t\tif (empty($this->fields))\n\t\t{\n\t\t\t// pull the fields dynamically from the database\n\t\t\t$this->db->cache_on();\n\t\t\t$this->fields = $this->db->list_fields($this->primary_table);\n\t\t\t$this->db->cache_off();\n\t\t}\n\t}",
"public function editable(bool $value = true)\n {\n $this->editable = $value;\n\n return $this;\n }"
]
| [
"0.7159514",
"0.70030457",
"0.6751758",
"0.6751758",
"0.6606803",
"0.65191364",
"0.64929277",
"0.6427764",
"0.6338705",
"0.6298977",
"0.6256402",
"0.6139252",
"0.6121358",
"0.6058719",
"0.59991485",
"0.5979905",
"0.59779155",
"0.5975666",
"0.5965648",
"0.5959274",
"0.59503996",
"0.5926387",
"0.5922736",
"0.59111387",
"0.5910925",
"0.5909393",
"0.58521837",
"0.58521837",
"0.58521837",
"0.5843202",
"0.5840837",
"0.5831727",
"0.5827713",
"0.5819464",
"0.5794669",
"0.57888955",
"0.57807636",
"0.5768741",
"0.57569504",
"0.573542",
"0.57223463",
"0.5713922",
"0.5711105",
"0.5710935",
"0.5710935",
"0.5710935",
"0.5695808",
"0.5690387",
"0.5686846",
"0.5685403",
"0.56555045",
"0.5647821",
"0.56383246",
"0.56318843",
"0.5630887",
"0.5630887",
"0.5630887",
"0.5630887",
"0.5615177",
"0.5615177",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.55914265",
"0.5589641",
"0.55879444",
"0.55490255",
"0.55331707",
"0.55256754",
"0.5517723",
"0.55153614",
"0.5507944",
"0.5501636",
"0.5501636",
"0.54902154",
"0.5486494",
"0.54758227",
"0.54431444",
"0.5442279",
"0.5442173",
"0.5425788",
"0.54251087",
"0.5409622",
"0.5407665",
"0.5404224",
"0.5379185",
"0.5378139",
"0.53689075",
"0.53644997",
"0.53545624",
"0.53466517",
"0.53390473",
"0.5338771"
]
| 0.0 | -1 |
Get the route key for the model. | public function getRouteKeyName()
{
return 'slug';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRouteKey();",
"public function getRouteKey();",
"public function getRouteKey()\n {\n return $this->getAttribute($this->getRouteKeyName());\n }",
"public function getRouteKey()\n {\n $slug = $this->slugField();\n\n return $this->$slug;\n }",
"public function getRouteKey()\n {\n return Hasher::encode($this->getKey());\n }",
"public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }",
"public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }",
"public function getRouteKey()\n {\n return $this->getTranslation('url', app()->getLocale());\n }",
"public function getRouteKeyName()\n {\n return $this->getKeyName();\n }",
"public function getRouteKey() {\n return $this->slug;\n }",
"public function getRouteKeyName();",
"public function getRouteKeyName();",
"public function getRouteKey()\n {\n return $this->slug;\n }",
"public function getRoutingKey();",
"public function getRoutingKey();",
"public function id(): string\n {\n return $this->model->getRouteKey();\n }",
"protected function getModelPrimaryKey(): string\n {\n $model = $this->option('model');\n $model = new $model;\n\n return $model->getRouteKeyName();\n }",
"public function getRouteKeyName()\n {\n return 'key';\n }",
"public function getRouteKeyValue(): string\n {\n if (!empty($this->slug)) {\n return 'slug';\n }\n return 'id';\n }",
"public function getRouteKeyName()\n {\n return 'id';\n }",
"public function getRouteKeyName()\n {\n return 'id';\n }",
"public function getRouteKeyName()\n {\n return 'id';\n }",
"public function getRouteKeyName()\n\t{\n\t return 'id';\n\t}",
"public function getRouteKeyName()\n {\n return 'hash_id';\n }",
"public function getRouteKey()\n {\n \t$this->slug;\n }",
"public function getRoutingKey() {\n return $this->routing_key;\n }",
"public function getRouteKeyName() {\n\t\treturn 'user_id';\n\t}",
"public function getRouteKeyName(): string\n {\n if (request()->expectsJson()) {\n return 'id';\n }\n return 'slug';\n }",
"public function getRouteKeyName(){\n\t\treturn '';\n\t}",
"public function getRouteKeyName()\n {\n return request()->segment(1) === 'admin' ? 'id' : 'account_code';\n }",
"public function getModelKey()\n {\n if (isset($this->modelKey) == false) {\n $reflectionClass = new ReflectionClass($this->owner);\n $this->modelKey = $reflectionClass->getShortName();\n }\n\n return $this->modelKey;\n }",
"public function getRouteKeyName() {\n\t\t\t\n\t\t\treturn 'reference';\n\t\t}",
"public function getRouteKeyName()\n {\n /* используется для того чтобы можно было в маршруте \n * например таком: Route::get('products/{category}/{product}', 'ProductsController@index');\n * получить \n * нужную категорию не по колонке id, а по колонке slug\n */\n return 'slug';\n }",
"public function getRouteKeyName() {\n return 'url';\n }",
"public function getRouteKeyName()\n {\n return 'url';\n }",
"public function getRouteKeyName()\n {\n return 'device_info_id';\n }",
"public function getRouteKeyName(): string\n {\n return 'token';\n }",
"public function getRouteKeyName(): string\n {\n return 'name';\n }",
"public function getRoutingKey():string { return $this->routing_key; }",
"public function getRouteKeyName()\n {\n return 'uuid';\n }",
"public function getRouteKeyName()\n {\n return 'uuid';\n }",
"public function getRouteKeyName()\n {\n return 'uuid';\n }",
"public function getRouteKeyName()\n {\n return 'uuid';\n }",
"public function getRouteKeyName()\n {\n return 'uuid';\n }",
"public function getRouteKeyName()\n {\n // get the category where the name column is equal to user input\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'hash';\n }",
"public function routingKey()\n {\n return $this->message->delivery_info['routing_key'];\n }",
"protected function detectObjectKeyFromRoute()\n {\n $request = $this->requestStack->getCurrentRequest();\n Return $request ? Objects::normalizeObjectKey($request->attributes->get('_jarves_object')) : '';\n }",
"public function getRouteKeyName(): string {\n\t\t\treturn 'slug';\n\t\t}",
"protected function getModelKey($model)\n\t{\n\t\ttry {\n\t\t\treturn $model->getKey();\n\t\t} catch (\\Illuminate\\Database\\Eloquent\\MissingAttributeException $e) {}\n\t}",
"public function getRouteKeyName()\n\t{\n\t\treturn 'ID_RequeCli';\n\t}",
"public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}",
"public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}",
"public function getRouteKeyName()\n\t{\n\t return 'token';\n\t}",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"protected function getI18nKey()\n {\n return str_replace('/', '.', self::services()->get('inflector')->underscore(get_class($this->model)));\n }",
"public function getRouteKeyName()\n {\n return 'stripe_id';\n }",
"public function getRouteKeyName()\n\t{\n\t return request()->segment(1) === 'admin' ? 'id' : 'startdatetime';\n\t}",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"public function getRouteKeyName(): string\n {\n return 'slug';\n }",
"public function getRouteKeyName(): string\n {\n return 'slug';\n }",
"public function getModelKeyName()\n {\n // Create an instance of the model to get primary key name\n // I couldn't find a better solution \n $model = $this->getModel();\n $model = new $model;\n return $model->getKeyName();\n }",
"public function key()\n {\n return key($this->_models);\n }",
"public function moduleKeyForModel($model);",
"public function getRouteId()\n {\n return $this->routeId;\n }",
"public function get_key() {\n\t\treturn array_get($this->attributes, static::$key);\n\t}",
"public function getRouteKeyName(): string\n {\n return 'username';\n }",
"public function getRouteKeyName()\n {\n return 'name_ascii';\n }",
"public function getRouteKeyName()\n {\n \treturn 'slug';\n }",
"public function getKey()\n {\n return $this->id;\n }",
"public function getRouteKeyName() {\n return 'slug';\n }",
"public function getRouteKeyName() {\n return 'slug';\n }",
"public function getRouteKeyName() {\n return 'slug';\n }",
"public function getRouteKeyName()\n\t{\n\t\treturn 'slug';\n\t}",
"public function getRouteKeyName()\n\t{\n\t\treturn 'slug';\n\t}",
"public function getKey()\n {\n return $this->__get(\"key\");\n }",
"public static function uriKey()\n {\n return Str::singular(Str::snake(class_basename(get_called_class()), '-'));\n }",
"public function getKey()\n {\n return $this->getId();\n }"
]
| [
"0.8337987",
"0.8337987",
"0.83334595",
"0.8222846",
"0.81179494",
"0.8051136",
"0.8051136",
"0.78780574",
"0.7855956",
"0.7827925",
"0.7806142",
"0.7806142",
"0.776334",
"0.7720968",
"0.7720968",
"0.76632315",
"0.76015264",
"0.7569464",
"0.7546984",
"0.75191367",
"0.75191367",
"0.75191367",
"0.74451184",
"0.7389608",
"0.73479545",
"0.73419607",
"0.73206043",
"0.7309723",
"0.72626406",
"0.7229511",
"0.7207034",
"0.7189533",
"0.7168937",
"0.71325886",
"0.7105363",
"0.70719826",
"0.70106405",
"0.7003203",
"0.697755",
"0.6931887",
"0.6931887",
"0.6931887",
"0.6931887",
"0.6931887",
"0.6929794",
"0.68936664",
"0.68905205",
"0.68858474",
"0.6811888",
"0.6811863",
"0.6810408",
"0.6799046",
"0.6799046",
"0.6782494",
"0.67788255",
"0.67788255",
"0.67788255",
"0.6755311",
"0.6750218",
"0.6737525",
"0.6720238",
"0.6689515",
"0.6689515",
"0.66310006",
"0.66310006",
"0.65935624",
"0.6590597",
"0.6574548",
"0.65220773",
"0.65218127",
"0.6520239",
"0.65092856",
"0.64802617",
"0.64797515",
"0.6463684",
"0.6463684",
"0.6463684",
"0.6454061",
"0.6454061",
"0.64494216",
"0.64484096",
"0.64397734"
]
| 0.0 | -1 |
Get the user that owns the article. | public function user()
{
return $this->belongsTo(User::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOwner() {\n // no need to check whether exist because of database constrain\n return User::getUserById($this->owner_id);\n }",
"private function getAuthor()\n {\n $tokenStorage = $this->getOption('token_storage');\n\n return $tokenStorage->getToken()->getUser();\n }",
"public function user()\n {\n if (!is_null($this->user)) {\n return $this->user;\n }\n $user = null;\n try {\n $resourceId = Authorizer::getResourceOwnerId();\n $resourceType = Authorizer::getResourceOwnerType();\n } catch (\\Exception $e) {\n $resourceId = null;\n $resourceType = null;\n // throw $e;\n }\n if ($resourceType !== $this->id) {\n return null;\n }\n if (!empty($resourceId)) {\n $user = $this->getProvider()->retrieveById($resourceId);\n }\n return $this->user = $user;\n\n }",
"function getOwner() {\n $user =& Element_Factory::makeElement( 'Bm_Users' );\n $user->get( $this->author );\n\n return $user->login;\n }",
"public function getOwner(): User\n {\n return $this->user;\n }",
"public function getOwner(): User\n {\n return $this->owner;\n }",
"public function getOwner()\n\t{\n\t\treturn $this->getObject('owner', null, 'user');\n\t}",
"public function getOwner()\n {\n return $this->hasOne(User::className(), ['id' => 'owner_id']);\n }",
"public function getAuthorizedUser()\n {\n if (empty($this->currentUser)) {\n $this->authorize();\n }\n return $this->currentUser;\n }",
"public function getPostUser() {\n\n // Match and map the id of the author ($userId) to a user object\n return UserManager::getUserById($this->userId);\n }",
"public function getAuthor()\n {\n return $this->hasOne(User::className(), ['id' => 'author_id']);\n }",
"public function getOppoUserid()\n {\n return $this->get(self::_OPPO_USERID);\n }",
"private function getUser() {\n\t\t$account = $this->authenticationManager->getSecurityContext()->getAccount();\n\t\t$user = $account->getParty();\n\t\treturn $user;\n\t}",
"public function getAuthor()\n\t\t{\n\t\t\treturn $this->hasOne(Users::className(), ['id' => 'author_id']);\n\t\t}",
"public function getOwnerId()\n {\n return $this->user_id;\n }",
"protected function getUserId()\n {\n return object_get($this->getUser(), 'profile_id', $this->getDefaultProfileId() );\n }",
"public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'author']);\n }",
"public function getAuthor() {\n\t\treturn UserManager::getFromBlid($this->blid);\n\t}",
"public function getLoggedInUser() {\n\t\treturn elgg_get_logged_in_user_entity();\n\t}",
"public function getAuthorOfArticle() {\n // Because it infers from the METHOD NAME!\n\n return $this->belongsTo('App\\Models\\User', 'user_id');\n }",
"public function getAuthor(): ?User\r\n {\r\n return $this->author;\r\n }",
"public function getAuthor(): ?User\r\n {\r\n return $this->author;\r\n }",
"public function getAuthor()\n {\n return $this->author = get_userdata($this->get()->post_author);\n }",
"function get_author_ID() {\n\t\treturn $this->get_data( 'user_id' );\n\t}",
"public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}",
"public function get_user() {\n\t\treturn $this->user;\n\t}",
"public function getAuthor(): ?User\n {\n return $this->author;\n }",
"function get_user () {\n\t\treturn $this->user_id;\n\t}",
"public function getUserId() {\n\t\treturn (string) $this->photo->owner['nsid'];\n\t}",
"public function author()\n\t{\n\t\treturn $this->belongs_to('User', 'uid');\n\t}",
"function user()\n {\n return eZUser::fetch( $this->UserID );\n }",
"public function getEnteredBy()\n {\n return $this->hasOne(User::className(), ['id' => 'EnteredBy']);\n }",
"public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }",
"public function getAuthenticatedUser()\n {\n return $this->getUnsplashClient()->sendRequest('GET', 'me');\n }",
"public function author()\n {\n return $this->hasOne('App\\User', 'id', 'user_id')->first();\n }",
"public function getAuthor0()\n {\n return $this->hasOne(User::className(), ['id' => 'author_id']);\n }",
"public function topicUser()\n {\n if (!$this->user)\n {\n $this->user = eZUser::fetch($this->attribute('user_id'));\n }\n return $this->user;\n }",
"public function owner()\n {\n return $this->hasOne(User::class);\n }",
"public function getOwnerusername() {}",
"public function author()\n {\n return $this->hasOne(User::class, 'id', 'author_id');\n }",
"public function author()\n {\n return $this->hasOne(User::class, 'id', 'author_id');\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getOwner()\n {\n return $this->data['owner'];\n }",
"protected function get_owner_id()\n {\n return $this->owner_id;\n }",
"public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }",
"public function getOrganizationUser()\n {\n return $this->organizationUser;\n }",
"public function getAuthor() {\n return $this->hasOne(User::class, ['id' => 'author_id']);\n }",
"function getOwner() {\n \n return $this->principalInfo['uri'];\n \n }",
"public function getLoggedInUser() {\n return $this->_user->getLoggedInUser();\n }",
"function getApprover() {\n return user_load($this->approver_uid);\n }",
"public function owner()\n\t{\n\t\treturn $this->oneToOne('Hubzero\\User\\User', 'id', 'owned_by_user');\n\t}",
"public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getOwner() : ?UserInterface\n {\n if ($this->userid) {\n if ($this->owner === null) {\n $this->owner = userRepository()->getUserById($this->userid);\n }\n return $this->owner;\n }\n return null;\n }",
"public function getowner_id()\n {\n return $this->owner_id;\n }",
"public function getAuthor() \n {\n return $this->hasOne(User::className(), ['id' => 'user_id']); \n }",
"public function getUser()\n {\n if (!$membership = $this->getMembership()) {\n return false;\n }\n \n return $membership->getUser();\n }",
"public function oOwner(){\n\t\tif(is_null($this->__oOwner)){\n $this->__oOwner = CUser::oGetUser($this->__iOwnerNo);\n }\n return $this->__oOwner;\n\t}",
"public function getOwnerId()\n {\n return $this->owner_id;\n }",
"public function getOwnerId()\n {\n return $this->owner_id;\n }",
"public function getCreatedBy() {\n\t\treturn $this->hasOne ( User::className (), [ \n\t\t\t\t'id' => 'created_by_id' \n\t\t] );\n\t}",
"public function getUserO()\n {\n return $this->userO;\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }",
"public function getOwnerEntity() {\n\t\treturn get_entity($this->owner_guid);\n\t}",
"public function getResponsibleUserAttribute()\n {\n $model = Config::get(\"auth.model\");\n return $model::find($this->user_id);\n }",
"public function get_author() {\n\t\treturn $this->author();\n\t}",
"public function get_user_id()\n {\n return self::getUser();\n }",
"public function author()\n {\n if ($this->user_id) {\n $field = config(\"binshopsblog.comments.user_field_for_author_name\",\"name\");\n return optional($this->user)->$field;\n }\n\n return $this->author_name;\n }",
"public function GetUserProfile() {\n\t\treturn $this->session->GetAuthenticatedUser();\n\t}",
"public function getAuthorUsername()\n {\n return $this->AUTHOR_USERNAME;\n }",
"public function getOwnerID() {\n\t\treturn $this->owner_id;\n\t}",
"public function user() {\n if ($this->User === null)\n $this->User = $this->getEntity(\"User\", $this->get(\"user_id\"));\n return $this->User;\n }",
"public function owns($article)\n {\n return $this->id == $article->user_id;\n }",
"public function getUserId()\n {\n return $this->accessToken->user_id;\n }",
"public function user()\n {\n // Eloquent query for sql: select * from user where article_id = <this article's id>\n return $this->belongsTo(User::class);\n }",
"public function user()\n {\n return $this->user;\n }",
"public function user()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function payee()\n {\n return $this->getSubject()->user;\n }",
"public function getConnectedUser()\n {\n $user = $this->container->get('security.context')->getToken()->getUser();\n\n if (!is_object($user)) {\n throw new AccessDeniedException('You are not logged in.');\n }\n\n return $user;\n }",
"public function getConnectedUser()\n {\n $user = $this->container->get('security.context')->getToken()->getUser();\n\n if (!is_object($user)) {\n throw new AccessDeniedException('You are not logged in.');\n }\n\n return $user;\n }",
"function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }",
"function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }",
"public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}",
"public function GetCurrentUser()\n {\n return $this->userManager->getCurrent();\n }",
"public function getUserId()\n {\n return $this->id;\n }",
"public function getPostedUser() {\n\t\treturn $this->postedUser;\n\t}",
"public function getAuthor()\n {\n return $this->hasOne($this->userClassName, ['id' => 'author_id'])->from(['author' => $this->userTableName]);\n }",
"public function getLoggedUser() {\n\t\t$session = $this->getUserSession();\n\t\treturn ($this->isAdmin()) ? $session->getUser() : $session->getCustomer();\n\t}",
"public static function user()\n {\n if (isset($_SESSION['LOGGED_IN_USER'])){\n return $username;\n }\n }",
"public function getOwner()\n {\n return isset($this->owner) ? $this->owner : null;\n }",
"public function getOwner()\n {\n return $this->get(self::_OWNER);\n }"
]
| [
"0.73390764",
"0.72521216",
"0.70885235",
"0.6950416",
"0.69344664",
"0.69159645",
"0.6821635",
"0.6735718",
"0.67227584",
"0.668818",
"0.6677387",
"0.66556937",
"0.6649331",
"0.6645887",
"0.664587",
"0.6617267",
"0.6593275",
"0.65765023",
"0.6556637",
"0.6546162",
"0.65188175",
"0.65188175",
"0.65127295",
"0.6511311",
"0.64910984",
"0.6480553",
"0.64597905",
"0.6456363",
"0.6441895",
"0.6441653",
"0.6429322",
"0.6422671",
"0.64186287",
"0.6398861",
"0.63795763",
"0.63767433",
"0.6362027",
"0.6359864",
"0.6357822",
"0.63440293",
"0.63440293",
"0.63434553",
"0.63434553",
"0.63434553",
"0.63434553",
"0.6328708",
"0.6314946",
"0.6308965",
"0.63067",
"0.630578",
"0.6304802",
"0.63034964",
"0.630348",
"0.6288127",
"0.628736",
"0.62786454",
"0.62786454",
"0.62786454",
"0.6278182",
"0.6273884",
"0.6264502",
"0.62630504",
"0.6258551",
"0.6248337",
"0.62401694",
"0.62401694",
"0.62309295",
"0.6230641",
"0.62283707",
"0.62263536",
"0.62253964",
"0.6222098",
"0.62188184",
"0.6211851",
"0.62116003",
"0.620991",
"0.6203972",
"0.6200801",
"0.61993074",
"0.6196616",
"0.6189015",
"0.6186576",
"0.6186576",
"0.61771536",
"0.61771536",
"0.61771536",
"0.61771536",
"0.61655325",
"0.6164493",
"0.6164493",
"0.6159617",
"0.6159617",
"0.61588037",
"0.61539423",
"0.61487556",
"0.6147281",
"0.614699",
"0.61415607",
"0.61370295",
"0.61352915",
"0.61335534"
]
| 0.0 | -1 |
Get the category that owns the article. | public function category()
{
return $this->belongsTo(Category::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"public function category()\n {\n // check if user is already loaded, if not, we fetch it from database\n if (!$this->_category) {\n $categories = new Application_Model_DbTable_Categories();\n try {\n $this->_category = $categories->findById($this->_category_id);\n } catch (Exception $e) {\n $this->_category = null;\n }\n }\n return $this->_category;\n }",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }",
"public function getCategory()\n {\n\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->_category;\n }",
"function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function getCategory()\n\t\t{\n\t\t\treturn $this->hasOne(Categories::className(), ['id' => 'category_id']);\n\t\t}",
"public function get_category()\n {\n return $this->primary_category();\n }",
"public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}",
"public static function getCategory()\n {\n return self::$category;\n }",
"public function getCategory() {\n\t\treturn $this->category;\n\t}",
"function getCategory() \n {\n return $this->instance->getCategory();\n }",
"public function getCategory()\n {\n return $this->hasOne(NewsCategory::className(), ['id' => 'category_id']);\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function get_category(){\n\t\treturn $this->category;\n\t}",
"function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }",
"public function getCat()\n {\n return $this->cat = get_the_category($this->id);\n }",
"function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"public function getCategory();",
"public function getCategory();",
"public function getCurrentCategory()\n {\n return $this->category;\n }",
"public function getCategorie()\n {\n $oCategorie = CCategorie::getById($this->categorie_id);\n return $oCategorie;\n }",
"public function getCategory()\n {\n if (!$this->_category) {\n $this->_category = Mage::registry('current_category');\n }\n return $this->_category;\n }",
"public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }",
"public function getCategorie()\n {\n return $this->categorie;\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']);\n }",
"public function getCategory(){\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }",
"public function getCategory()\n {\n return $this->hasOne(Category::className(), ['category_id' => 'category_id']);\n }",
"public function getCategory() {}",
"public function category()\n {\n return $this->hasOne(Category::class, 'id', 'category_id');\n }",
"function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }",
"public function getCategoria()\n {\n return $this->categoria;\n }",
"public function getCategoria()\n {\n return $this->categoria;\n }",
"public function getCategory()\n {\n if ($this->_oCategory === null) {\n $this->_oCategory = $this->getProduct()->getCategory();\n }\n\n return $this->_oCategory;\n }",
"public function getCategory()\n {\n return $this->hasOne(MgfSelectionCategory::className(), ['id' => 'category_id']);\n }",
"public function category()\n {\n\n return $this->hasOne(Category::class, 'id', 'categories_id');\n }",
"public function getActCategory()\n {\n // if active category is not set yet - trying to load it from request params\n // this may be usefull when category component was unable to load active category\n // and we still need some object to mount navigation info\n if ($this->_oClickCat === null) {\n\n $this->_oClickCat = false;\n $oCategory = oxNew('oxcategory');\n if ($oCategory->load($this->getCategoryId())) {\n $this->_oClickCat = $oCategory;\n }\n }\n\n return $this->_oClickCat;\n }",
"public function getCategory()\n {\n }",
"public function getCategoria()\n {\n return $this->categoria;\n }",
"public function category()\n {\n return $this->hasOne('fooCart\\src\\Category', 'category_id', 'category_id');\n }",
"public function getActiveCategory()\n {\n return $this->_activeCategory;\n }",
"public function getCategory() {\n return $this->hasOne(Category::class, ['id' => 'category_id']);\n }",
"private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }",
"public function getCategory()\r\n\t{\r\n\t\tif (!empty($this->category))\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t}\r\n\r\n\t\t$pk = $this->getState('category.id');\r\n\r\n\t\t$this->category = JTable::getInstance('Category');\r\n\t\t$this->category->load($pk);\r\n\r\n\t\treturn $this->category;\r\n\t}",
"public function getCategory()\n {\n return $this->readOneof(2);\n }",
"function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}",
"public function category() {\n return $this->hasOne('App\\Models\\Category', 'id');\n }",
"public function getCategory() {\n return $this->randomQuote->category_name;\n }",
"public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }",
"public function getCategoryId()\n {\n return $this->categoryId;\n }",
"public function category()\n\t{\n\t\treturn $this->belongsTo('App\\Model\\Content\\Category');\n\t}",
"protected function _getCategory()\n {\n if (!$this->_category) {\n $this->_category = $this->_objectManager->create(\\Magento\\Catalog\\Model\\Category::class);\n $categoryId = (int)$this->getRequest()->getParam('category', 0);\n $urlRewrite = $this->_getUrlRewrite();\n if (!$categoryId && $urlRewrite->getId()) {\n $metaData = $urlRewrite->getMetadata();\n if ($urlRewrite->getEntityType() === self::ENTITY_TYPE_CATEGORY) {\n $categoryId = $urlRewrite->getEntityId();\n } elseif (!empty($metaData['category_id'])) {\n $categoryId = $metaData['category_id'];\n }\n }\n if ($categoryId) {\n $this->_category->load($categoryId);\n }\n }\n return $this->_category;\n }",
"public function getSouscategorie()\n {\n $oSouscategorie = CSouscategorie::getById($this->souscategorie_id);\n return $oSouscategorie;\n }",
"public function Category()\n {\n return $this->hasOne('App\\Models\\Category', 'category_id', 'category_id');\n }",
"public function getCurrentCategory()\n {\n return $this->registry->registry('current_category');\n }",
"function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}",
"public function getObjectCategory()\n {\n return $this->objectCategory;\n }",
"public function getCategoriaPrincipal(){\n return $this->categoriaPrincipal;\n }",
"public function getCategoryId();",
"public function category()\n {\n return $this->hasOne('Antares\\Customfields\\Model\\FieldCategory', 'id', 'category_id');\n }",
"public function getCategoryId() { return $this->categoryId; }",
"public function getCategoria_id()\n {\n return $this->categoria_id;\n }",
"public function getCategory_id()\n {\n return $this->category_id;\n }",
"public function getCategory_id()\n {\n return $this->category_id;\n }",
"public function getCategory_id()\n {\n return $this->category_id;\n }",
"public function getCategory(){\r\n return Mage::registry('current_category');\r\n }",
"public function category()\n {\n return $this->hasOne(Category::class, 'id','category_id');\n }",
"public function category() {\n # Define an inverse one-to-many relationship.\n \treturn $this->belongsTo('Category');\n }",
"public function get_categorieId()\n {\n return $this->_categorieId;\n }",
"public function getCategory() \n {\n return $this->hasOne(Category::className(), ['id' => 'category_id']); \n }",
"public function getContentCategory()\n {\n if ($this->_oContentCat === null) {\n // setting default status ..\n $this->_oContentCat = false;\n if (($oContent = $this->getContent()) && $oContent->oxcontents__oxtype->value == 2) {\n $this->_oContentCat = $oContent;\n }\n }\n\n return $this->_oContentCat;\n }",
"public function category()\n {\n return $this->belongsTo('TypiCMS\\Modules\\Categories\\Models\\Category');\n }"
]
| [
"0.72556484",
"0.7106988",
"0.70365214",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.6994218",
"0.69930214",
"0.69759893",
"0.6971014",
"0.69412726",
"0.69180954",
"0.69084287",
"0.69084287",
"0.69016933",
"0.6900755",
"0.68981266",
"0.6897176",
"0.68896383",
"0.68593955",
"0.6858073",
"0.6836161",
"0.68306375",
"0.6791298",
"0.67721397",
"0.6747738",
"0.6743102",
"0.6738982",
"0.67317635",
"0.6706562",
"0.6706562",
"0.6706562",
"0.67041343",
"0.67041343",
"0.66950613",
"0.6693884",
"0.66771233",
"0.66566277",
"0.6638359",
"0.6603537",
"0.6603537",
"0.6603537",
"0.65628934",
"0.6544202",
"0.6544202",
"0.651306",
"0.6505476",
"0.64994115",
"0.64825755",
"0.64825755",
"0.6466065",
"0.6452113",
"0.6440381",
"0.6440068",
"0.6386817",
"0.6360964",
"0.63548714",
"0.63466287",
"0.63008523",
"0.6288183",
"0.62803334",
"0.6278845",
"0.6277982",
"0.62701523",
"0.6262667",
"0.6258159",
"0.62522084",
"0.6220389",
"0.6209194",
"0.61958194",
"0.61893815",
"0.6183913",
"0.61770564",
"0.6176346",
"0.61742073",
"0.6114964",
"0.6071845",
"0.6055471",
"0.6050719",
"0.6043438",
"0.6043438",
"0.6043438",
"0.60427684",
"0.60376054",
"0.60346943",
"0.60250723",
"0.5981222",
"0.59800696",
"0.5954262"
]
| 0.0 | -1 |
Scope a query to filter by title | public function scopeTitle($query, $title)
{
return $query->where('title', 'LIKE', $title);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeByTitle($query, $title)\n {\n return $query->where('title', 'LIKE' ,'%'.$title.'%');\n }",
"public function scopeTitle($query, $title) {\n return $query->where('events.title_de', 'LIKE', '%' . $title . '%');\n }",
"public function scopeOfTitle($query, $title)\n {\n if (!empty($title)) {\n return $query->where('title', 'like', '%' . $title . '%');\n }\n return $query;\n }",
"public function scopeTitle($query, $input)\n {\n return $query->with('movie')->where('title', 'LIKE', '%'.$input.'%');\n /*$result = $query->with('movie')->where('title', 'LIKE', '%' . $input . '%')\n ->join('movie_tag', 'torrents.movie_id', '=', 'movie_tag.movie_id')\n ->join('tags', 'movie_tag.tag_id', '=', 'tags.id')->get();*/\n }",
"public function scopeFindByTitle($query, $title)\n {\n return $query->where('title', $title);\n }",
"public function scopeByTitle($query, $titel)\n {\n return $query->where('titel', $titel);\n }",
"public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }",
"public function scopeSearch($query,$search){\n if($search){\n return $query->where ('title','LIKE',\"%$search%\")\n ->orWhere('description','LIKE',\"%$search%\");\n }\n }",
"public function scopeLikeTitle($query, $text)\n {\n if (empty($text)) {\n return $query;\n }\n\n return $query->where('title', 'like', \"%$text%\");\n }",
"public function scopeTitulo($query, $titulo)\n {\n if ($titulo) {\n return $query->where('titulo', 'LIKE', \"%$titulo%\");\n }\n }",
"protected function getTitleQuery()\n {\n return $this->titleQuery;\n }",
"public function query()\n {\n $locale = app()->getLocale();\n $query = app($this->model)->query()->orderBy('sort_order', 'ASC')->orderBy(\"title->\\${$locale}\", 'ASC');\n\n return $this->applyScopes($query);\n }",
"public function byTitle($title)\n {\n return $this->andWhere(['category.title' => $title]);\n }",
"public function scopeSearch($query, $q)\n {\n return $query->where('title', 'LIKE', $q)\n ->select('id', 'imdb_id', 'tmdb_id', 'title', 'poster', 'type')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->groupBy('title')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->get();\n }",
"function searchByTitle($title){\n $name = $title['search'];\n return db()->QUERY(\"SELECT * FROM posts WHERE title LIKE '%$name%' ORDER BY title\");\n }",
"public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }",
"public function scopeNombre($query,$name){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",NULL);\n\n // }\n }",
"public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }",
"public function scopeSearch($query, $term);",
"public function getByTitle()\n {\n }",
"public function scopeSearchByTitle(Builder $query, array $titles)\n {\n $query->join('episode_descriptions', 'episode_descriptions.episode_id', '=', 'episodes.id');\n\n foreach ($titles as $languageCode => $title) {\n $query->orWhere(function ($q) use ($title, $languageCode) {\n $q->where('episode_descriptions.language_code', $languageCode)\n ->where('episode_descriptions.title', $title);\n });\n }\n }",
"function title_query() {\n $names = array();\n\n $result = db_select('fooaggregator_feed', 'f')\n ->fields('f', array('title'))\n ->condition('f.fid', $this->value, 'IN')\n ->execute();\n foreach ($result as $o) {\n $names[] = check_plain($o->title);\n }\n\n return $names;\n }",
"public function scopeSearch(Builder $query, string $name): Builder\n {\n return $query->where('title', 'ILIKE', \"%$name%\")\n ->orWhere('description', 'ILIKE', \"%$name%\");\n }",
"function title_query() {\n $titles = array();\n\n $result = db_query(\"SELECT f.title FROM {aggregator_feed} f WHERE f.fid IN (:fids)\", array(':fids' => $this->value));\n foreach ($result as $term) {\n $titles[] = check_plain($term->title);\n }\n return $titles;\n }",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"public function scopeSearch($query, $term)\n {\n if($term)\n {\n $query->where(function ($q) use ($term){\n $q->where('title', 'LIKE', \"%{$term}%\");\n\n $q->orwhereHas('author', function ($qr) use ($term){\n $qr->where('name', 'LIKE', \"%{$term}%\");\n });\n });\n }\n }",
"public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }",
"public function scopeName($query, $name)\n {\n if($name)\n return $query->where('IAP_DESC', 'LIKE', \"%$name%\");\n }",
"public function scopeSearchFilter($query, $q)\n {\n if(!empty($q)){\n return $query->where(DB::raw('LOWER(text)'), 'LIKE', '%' . strtolower($q) . '%');\n }\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }",
"public function scopeWithKeyword($query, $keyword)\n {\n return $query->where('name', 'like', '%'.$keyword.'%');\n }",
"public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }",
"public function searchItem($title) {\n \n //Create Database conexion\n }",
"public function searchTitle(Request $request)\n {\n // $posts = Post::where('title', 'LIKE', '%'. $request->get('title') . '%')->get(); \n $posts = Post::where('title', 'LIKE', '%'. $request->get('title') . '%')->paginate(3);\n \n $data = array('posts'=>$posts);\n return view('posts.search', $data);\n }",
"public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}",
"public function scopeSearch($query, string $q): Builder\n {\n return $query\n ->where('title', 'LIKE', \"%{$q}%\")\n ->orWhere('desc', 'LIKE', \"%{$q}%\");\n }",
"public function search($title)\n {\n return Posts::where('title', 'LIKE', '%' . $title . '%')->get();\n }",
"public function scopeQuery($query)\n {\n // $query->where();\n }",
"public function scopeListFrontEnd($query, $options)\n {\n /*\n * Default options\n */\n extract(array_merge([\n 'page' => 1,\n 'perPage' => 30,\n 'sort' => 'title desc',\n 'search' => '',\n 'categories' => null,\n 'brand' => null,\n 'stores' => null,\n ], $options));\n\n $obj = $query;\n $obj = $obj->whereIsPublished(1);\n\n /*\n * Sorting\n */\n\n if (!is_array($sort)) {\n $sort = [$sort];\n }\n\n if (!$search) {\n foreach ($sort as $_sort) {\n\n if (in_array($_sort, array_keys(self::$allowedSortingOptions))) {\n $parts = explode(' ', $_sort);\n if (count($parts) < 2) {\n array_push($parts, 'desc');\n }\n list($sortField, $sortDirection) = $parts;\n if ($sortField == 'random') {\n $sortField = DB::raw('RAND()');\n }\n $obj->orderBy($sortField, $sortDirection);\n }\n\n }\n } else {\n $obj->orderBy('relevance', 'desc');\n\n }\n\n /*\n * Categories\n */\n if ($categories !== null) {\n if (!is_array($categories)) {\n $categories = [$categories];\n }\n $obj = $obj->whereHas('categories', function ($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }\n\n /*\n * Brand\n */\n if ($brand !== null) {\n if (!is_array($brand)) {\n $brand = [$brand];\n }\n $obj = $obj->whereHas('brand', function ($q) use ($brand) {\n $q->whereIn('id', $brand);\n });\n }\n\n /*\n * Stores\n */\n if ($stores !== null) {\n if (!is_array($stores)) {\n $stores = [$stores];\n }\n $obj = $obj->whereHas('stores', function ($q) use ($stores) {\n $q->whereIn('id', $stores);\n });\n }\n\n if ($search) {\n $obj->search($search);\n }\n\n return $obj->paginate($perPage, $page);\n }",
"function sanitize_title_for_query($title)\n {\n }",
"public function scopeFilterBySearchWord( $query )\n {\n $word = request() -> get( 'search' );\n $word = strtolower($word);\n\n if( $word )\n {\n $query \n -> where( 'id', 'like', '%'. $word .'%' )\n -> orWhereHas( 'charger_connector_type.charger', function( $q ) use( $word ) {\n $q \n -> where( 'code', 'like', '%'. $word .'%')\n -> orWhereRaw(\"lower(location->>'$.ka') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.en') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.ru') like '%{$word}%'\");\n })\n -> orWhereHas( 'user', function( $q ) use( $word ) {\n $q \n -> whereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\");\n });\n\n }\n }",
"public function Filter_title($title, $negate = false) {\r\n\t\t$title\t\t= trim($title);\r\n\t\t$queryParts\t= false;\r\n\r\n\t\tif( $title !== '' ) {\r\n\t\t\t$titleParts\t= explode(' ', $title);\r\n\r\n\t\t\t$where\t= TodoyuSql::buildLikeQueryPart($titleParts, array(self::TABLE . '.title'), $negate);\r\n\r\n\t\t\t$queryParts = array(\r\n\t\t\t\t'where'\t=> $where\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn $queryParts;\r\n\t}",
"public function set_searchtitle($param)\n\t{\n\t\t$this->searchtitle = (string)$param;\n\t\treturn $this;\n\t}",
"public function scopeName($query, $name)\n {\n return $query->orWhere('name', 'LIKE', '%'.$name.'%');\n }",
"public function searchRecipesTitle($query) {\n $query = '%'.$query.'%';\n $this->db->query('SELECT * FROM recipes WHERE ( title LIKE ? )');\n $this->db->bind(1, $query);\n return $this->db->resultSet();\n }",
"function searchByTitle($title, $groupId=null, $parentId=null) {\n if(is_array($title)) {\n $where = ' i.title IN (\"'.implode('\", \"', array_map('db_es', $title)).'\")';\n } else {\n $where = ' i.title = '.$this->da->quoteSmart($title);\n }\n if($groupId !== null) {\n $where .= ' AND i.group_id = '.$this->da->escapeInt($groupId);\n }\n if($parentId !== null) {\n $where .= ' AND i.parent_id = '.$this->da->escapeInt($parentId);\n }\n\n $order = ' ORDER BY version_date DESC';\n return $this->_searchWithCurrentVersion($where, '', $order);\n }",
"public function scopeSearch($query)\n {\n $keyword = request('q');\n if ($keyword) {\n $model = $query->getModel();\n $searchable = $model->searchable;\n\n $local = Arr::where($searchable, function ($value, $key) {\n return is_numeric($key);\n });\n\n foreach ($local ?? [] as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query = $query->{$where}($field, 'like', \"%$keyword%\");\n }\n\n $relations = Arr::where($searchable, function ($value, $key) {\n return is_string($key);\n });\n\n foreach ($relations ?? [] as $key => $field) {\n $fields = Arr::wrap($field);\n $whereHas = empty($local) && $key == 0 ? 'whereHas' : 'orWhereHas';\n $query = $query->{$whereHas}($key, function ($query) use ($fields, $keyword) {\n foreach ($fields as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query->{$where}($field, 'like', \"%$keyword%\");\n }\n });\n }\n\n return $query;\n }\n }",
"public function search($title=null)\n {\n\n // $products = QueryBuilder::for(Product::class)->allowedFilters(['title'])->get();\n\n $products = Product::where([\"title\"=>$title])->orWhere([\"description\"=>$title])->orWhere([\"type\"=>$title])->get();\n return view('show_products',['products'=>$products]);\n }",
"public function scopeMostlySearched($query, $count=5, $category=\"\"){\n if($category) {\n return $query->whereHas('categories', function($query) use ($category){\n $query->where('categories.id',$category);\n })->take($count);\n }\n\n return $query->take($count);\n }",
"public function scopePublished($query)\n {\n return $query->where('status', '=', 'approved');\n }",
"public function scopeNaturalPerson($query) {\n\t\treturn $query->where('type', 1);\n\t}",
"public function scopeName($query, $name)\n {\n if($name)\n return $query->where('NOMBRE_COMPLETO', 'LIKE', \"%$name%\");\n }",
"public function getQueryScope()\n {\n return $this->getQuery();\n }",
"public function scopePublished($query)\n {\n return $query->where('status', '=', '1')\n ->whereDate('published_at', '<=', Carbon::today()->toDateString());\n }",
"public function scopeSearch($query, $input) {\n \n if (isset($input['s'])) {\n $query->whereRaw('customer_name LIKE \"%'. array_get($input, 's', '') .'%\"');\n }\n\n return $query;\n }",
"public function scopePublished($query)\n {\n if (PreviewMode::fromRequest()->check()) {\n return;\n }\n\n $query->where('published', 1);\n }",
"function scopeActiveWithPlacesRelated($query)\n {\n return $query\n ->select('name', 'image', 'slug', 'anons', 'publish_date')\n ->where('status', 1)\n ->orderBy('created_at', 'desc')\n ->limit(8)\n ->get();\n }",
"public function titleQuery() {\n $titles = [];\n\n $results = $this->database->query('SELECT cr.vid, cr.nid, cr.title FROM {catalog_item_revision} cr WHERE cr.vid IN ( :vids[] )', [':vids[]' => $this->value])->fetchAllAssoc('vid', PDO::FETCH_ASSOC);\n $nids = [];\n foreach ($results as $result) {\n $nids[] = $result['nid'];\n }\n\n $catalog_items = $this->catalog_itemStorage->loadMultiple(array_unique($nids));\n\n foreach ($results as $result) {\n $catalog_items[$result['nid']]->set('title', $result['title']);\n $titles[] = $catalog_items[$result['nid']]->label();\n }\n\n return $titles;\n }",
"public function scopeAgrupacion1($query, $agrupacion1)\n {\n if(trim($agrupacion1 != \"\")){\n $query->where(\\DB::raw('agrupacion1', $agrupacion1), \"like\",\"%$agrupacion1%\");\n }\n }",
"public function scopeOrder ($query){\n return $query->orderBy('descripcion','like','%$nombre%');\n }",
"public static function search($title)\n {\n\n self::dbConnect();\n\n $query = \"select * from \" . self::$table . \" where title like :title\";\n\n $stmt = self::$dbc->prepare($query);\n\n\t\t$title = \"%\" . $title . \"%\";\n\n $stmt->bindValue(':title', $title, PDO::PARAM_STR);\n $stmt->execute();\n\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\n return $results;\n\n\n }",
"public function filterByTitle($title = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($title)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $title)) {\n\t\t\t\t$title = str_replace('*', '%', $title);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(QuizPeer::TITLE, $title, $comparison);\n\t}",
"public function scopeFilter($query, $term)\n {\n return $query\n ->where('name', 'like', '%' . $term . '%')\n ->orWhere('email', 'like', '%' . $term . '%');\n }",
"public function scopePublished($query)\n {\n return $query->where('published', 1);\n }",
"public function search(Request $request, $title)\n {\n $task = Task::where('title', 'LIKE', '%'.$title.'%')->get();\n\n return $this->render($task);\n }",
"public function scopeOnlyPublished($query)\n {\n return $query->where('published', 1);\n }",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function scopePublished($query)\n {\n return $query->where('status_id', Status::getPublished()->id);\n }",
"public function scopeOfSearch($query, $keyword)\n {\n return $query->where('name','like','%'.$keyword.'%');\n }",
"public function search(Request $request)\n {\n // the search function for getting a title based on query\n $key = trim($request->get('q'));\n $titles = Title::query()\n ->where('title', 'like', \"%{$key}%\")\n ->orderBy('created_at', 'desc')\n ->get(); //paginate(10)->onBothSides(1);\n\n\n //get the recent 5 titles\n $recent_titles = Title::query()\n ->orderBy('created_at', 'desc')\n ->take(5)\n ->get();\n\n return view('search', [\n 'key' => $key,\n 'titles' => $titles,\n 'recent_titles' => $recent_titles\n ]);\n }",
"public function scopeSearch($query, $key)\n {\n return $query->where('transaction_code', 'like', '%'.$key.'%')\n ->orWhere('description', 'like', '%'.$key.'%')\n ->orWhere('total', 'like', '%'.$key.'%');\n }",
"public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }",
"public function scopePublished($query)\n {\n \n $query->with(['category','tags','owner','photos'])\n ->whereNotNull('published_at')\n ->where('published_at','<=',Carbon::now())\n ->latest('published_at');\n }",
"public function scopeSearch($query, $search) {\n $searchAlt = str_replace(' ', '_', $search);\n\n if(empty($search)) {\n return $query;\n } else {\n return $query\n ->where('filename', 'like', '%' . $search . '%')\n ->Orwhere('filename', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $search . '%');\n }\n }",
"public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }",
"public function scopeNombre($query, $nombre)\n {\n if ($nombre) {\n return $query->orWhere('nombre', 'LIKE', \"%$nombre%\");\n }\n }",
"public function scopeNombre($query, $nombre)\n {\n if ($nombre) {\n return $query->orWhere('nombre', 'LIKE', \"%$nombre%\");\n }\n }",
"public function scopePublished($query)\n {\n return $query->where('status', 'published');\n }",
"public function scopeHome($query)\n {\n $query->where('type','=','Home');\n }",
"public function searchByName($query);",
"public function searchTitle($title) {\n try {\n // escape quotes\n $checkTitle = str_replace(\"'\", \"''\", $title);\n // search the database, using wildcards\n $sql = \"SELECT * FROM books WHERE title LIKE '%$checkTitle%' ORDER BY author\";\n $stmt = $this->conn->query($sql);\n \n // fetch results as numeric array\n $result = $stmt->setFetchMode(PDO::FETCH_NUM);\n // show results in a list of update forms\n echo \"<br /><div id='searchResult'><h3>Title: -$title-</h3><ul>\";\n while ($row = $stmt->fetch()) {\n // call result form function\n $this->echoResultForm($row);\n }\n echo \"</ul></div>\";\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }",
"public function searchTitleActionGet()\n {\n $title = \"Search for a movie by title\";\n $searchTitle = $this->app->request->getGet(\"searchTitle\");\n\n $this->app->db->connect();\n\n if ($searchTitle) {\n $sql = \"SELECT * FROM movie WHERE title LIKE ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$searchTitle]);\n }\n\n $this->app->page->add(\"movie/search-title\", [\n \"searchTitle\" => $searchTitle,\n ]);\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"public function search(){\n\n $title = $_GET['searchinput'];\n \n\n $posts = News::where([ \n ['title', 'LIKE', '%' . $title . '%'],\n \n ])->get();\n\n return view('pages.Search', compact('posts'));\n\n }",
"public function scopeSearch($query, $search)\n\t{\n\t\treturn $query->where('address', 'like', '%' . $search . '%')\n\t\t\t->orWhere('city', 'like', '%' . $search . '%')\n\t\t\t->orWhere('zip', 'like', '%' . $search . '%')\n\t\t\t->orWhere('title', 'like', '%' . $search . '%')\n\t\t\t->orWhere('description', 'like', '%' . $search . '%')\n\t\t\t->get();\n\t}",
"public function scopePublished($query)\n {\n return $query->where('status', 'PUBLISHED');\n }",
"public function scopeFilter($query, $term)\n {\n $term = '%' . $term . '%';\n\n return $query->where('first_name', 'LIKE', $term)\n ->orWhere('last_name', 'LIKE', $term)\n ->orWhere('email', 'LIKE', $term);\n }",
"public function scopePage($query)\n {\n $query->with('author')->where('type', '=', self::PAGE);\n }",
"public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }",
"public function scopeUrgent($query)\n {\n $query->where('urgent', true);\n }",
"public function scopeSearch(Builder $query, ?string $search)\n { \n\n if( $search )\n {\n return $query\n ->where('casestudies.title', 'like', '%'.$search.'%')\n ->orWhere('casestudies.description', 'like', '%'.$search.'%')\n ->orWhere('casestudies.content', 'like', '%'.$search.'%')\n ->orWhere('casestudies.casestudy_by', 'like', '%'.$search.'%')\n ->orWhere('casestudies.company', 'like', '%'.$search.'%')\n ->orWhere('casestudies.seo_title', 'like', '%'.$search.'%')\n ->orWhere('casestudies.seo_description', 'like', '%'.$search.'%')\n ->orwhereHas('category', \n function ($query) use ($search) {\n $query->Where('categories.title','like', '%'.$search.'%');\n })\n ->orwhereHas('createdBy', \n function ($query) use ($search) {\n $query->Where('users.name','like', '%'.$search.'%');\n });\n }\n return;\n }",
"public function kerko($title)\n {\n // return DB::select(\"Select * from books where title like '%\".$title.\"%'\");\n return Book::where('title','like','%'.$title.'%')->get();\n }",
"public function scopeRamSearch($query, $search)\n {\n \t$brand = strtoupper($search);\n return $query = DB::table('rams')\n ->join('brands', 'rams.brand_id', '=', 'brands.id')\n ->select('rams.*', 'rams.type as Rtype', 'rams.id AS Rid', 'brands.id AS Bid', 'brands.name AS brand', 'rams.registered')\n ->where([ ['rams.type', 'LIKE', \"%$search%\"], ['rams.deleted_at', '=', null] ])\n ->orWhere([ ['brands.name', 'LIKE', \"%$brand%\"], ['rams.deleted_at', '=', null] ])\n ->orderBy('id', 'desc')\n ->paginate(25);\n }",
"public function scopeSearch($query, $term): mixed\n {\n if (!is_null($term)) {\n return $query->where('name', 'ILIKE', \"%$term%\")\n ->orWhere('description', 'ILIKE', \"%$term%\");\n }\n\n return $query;\n }",
"public function scopeContent($query, $content)\n {\n return $query->where('content', 'LIKE', $content);\n }",
"public function scopeSearchProveedores($query, $nombre)\n {\n return $query->where(\"nombre\", \"LIKE\", \"%$nombre%\");\n }",
"public function titleDetailsFilteredOpds($books);",
"public function filter_post_title_atom( $title )\n\t{\n\t\treturn $this->filter( $title );\n\t}",
"public function scopeActive($query)\n {\n $query->where('status', static::PUBLISHED);\n }",
"public function scopeSlug($query, $variable)\n\t{\n\t\treturn \t$query->where('slug', $variable);\n\t}"
]
| [
"0.79162616",
"0.7905472",
"0.77698416",
"0.74539167",
"0.7371058",
"0.70785743",
"0.7063338",
"0.6841272",
"0.6695972",
"0.65938103",
"0.6536617",
"0.6505489",
"0.6502078",
"0.64545536",
"0.64368767",
"0.62068003",
"0.61496884",
"0.61336356",
"0.61172897",
"0.6027421",
"0.60056806",
"0.59827834",
"0.59690535",
"0.5960878",
"0.59423923",
"0.59319174",
"0.5930077",
"0.59222645",
"0.5903383",
"0.59030926",
"0.5893729",
"0.5889001",
"0.58470315",
"0.5799622",
"0.57992625",
"0.57875115",
"0.57651186",
"0.57590765",
"0.5759021",
"0.5752578",
"0.57310677",
"0.5727749",
"0.571505",
"0.56494105",
"0.56364226",
"0.56355864",
"0.55833405",
"0.5577101",
"0.55708426",
"0.5565364",
"0.55638945",
"0.5559037",
"0.5555392",
"0.5544967",
"0.5542816",
"0.5542523",
"0.5535132",
"0.55313903",
"0.5529772",
"0.5528802",
"0.5527443",
"0.5526831",
"0.55260754",
"0.55201215",
"0.55166674",
"0.5512838",
"0.55115527",
"0.55034745",
"0.549451",
"0.5494484",
"0.54936177",
"0.5487915",
"0.5484595",
"0.5478023",
"0.54749286",
"0.54727954",
"0.54712135",
"0.54712135",
"0.54686797",
"0.5465451",
"0.54514796",
"0.54369736",
"0.54305494",
"0.54186046",
"0.54184735",
"0.54168016",
"0.54074746",
"0.5402832",
"0.53913355",
"0.5387825",
"0.53865486",
"0.5386287",
"0.5378161",
"0.5376786",
"0.53677666",
"0.5366288",
"0.5358246",
"0.53558695",
"0.5354164",
"0.5352277"
]
| 0.78292835 | 2 |
Scope a query to filter by content | public function scopeContent($query, $content)
{
return $query->where('content', 'LIKE', $content);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }",
"public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }",
"public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }",
"public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }",
"public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }",
"public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}",
"public function scopeQuery($query)\n {\n // $query->where();\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter first_name\n if ($request->has('first_name')) {\n $query->where('first_name', 'like', \"%{$request->get('first_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('first_name')}%\");\n }\n // filter first_name\n if ($request->has('last_name')) {\n $query->where('first_name', 'like', \"%{$request->get('last_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('last_name')}%\");\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_active',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopeSearch($query,$search){\n if($search){\n return $query->where ('title','LIKE',\"%$search%\")\n ->orWhere('description','LIKE',\"%$search%\");\n }\n }",
"public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }",
"public function scopePublished($query)\n {\n if (PreviewMode::fromRequest()->check()) {\n return;\n }\n\n $query->where('published', 1);\n }",
"public function query()\n {\n $locale = app()->getLocale();\n $query = app($this->model)->query()->orderBy('sort_order', 'ASC')->orderBy(\"title->\\${$locale}\", 'ASC');\n\n return $this->applyScopes($query);\n }",
"public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }",
"public function scopeSupportingDocs($query)\n {\n return $query->where('type', 3);\n }",
"public function getQueryScope()\n {\n return $this->getQuery();\n }",
"public function scopeSearch($query, $q)\n {\n return $query->where('title', 'LIKE', $q)\n ->select('id', 'imdb_id', 'tmdb_id', 'title', 'poster', 'type')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->groupBy('title')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->get();\n }",
"public function scopePublished($query)\n {\n return $query->where('status', '=', 'approved');\n }",
"public function scopePublished($query)\n {\n return $query->where('status', '=', '1')\n ->whereDate('published_at', '<=', Carbon::today()->toDateString());\n }",
"public function scopeSearchFilter($query, $q)\n {\n if(!empty($q)){\n return $query->where(DB::raw('LOWER(text)'), 'LIKE', '%' . strtolower($q) . '%');\n }\n }",
"public function scopePublished($query)\n {\n return $query->where('status_id', Status::getPublished()->id);\n }",
"public function scopePage($query)\n {\n $query->with('author')->where('type', '=', self::PAGE);\n }",
"public function scopeOnlyPublished($query)\n {\n return $query->where('published', 1);\n }",
"public function scopePublished($query)\n {\n return $query->where('status', 'PUBLISHED');\n }",
"public function scopePublished($query)\n {\n return $query->where('status', 'published');\n }",
"public function scopePublished($query) {\n return $query->where('published_at', '<=', now());\n }",
"public function scopePublished($query)\n {\n return $query->where('published', 1);\n }",
"public function scopeFiltered(Builder $query, \\Illuminate\\Http\\Request $request): Builder\n {\n if ($request->has('status') && $status = $request->get('status'))\n $query->where('status', $status);\n\n if ($request->has('search') && $search = $request->get('search'))\n $query->search($search);\n\n return $query/*->where('user_id', '<>', $request->user('api')->id)*/;\n }",
"public function scopeFilterBySearchWord( $query )\n {\n $word = request() -> get( 'search' );\n $word = strtolower($word);\n\n if( $word )\n {\n $query \n -> where( 'id', 'like', '%'. $word .'%' )\n -> orWhereHas( 'charger_connector_type.charger', function( $q ) use( $word ) {\n $q \n -> where( 'code', 'like', '%'. $word .'%')\n -> orWhereRaw(\"lower(location->>'$.ka') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.en') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.ru') like '%{$word}%'\");\n })\n -> orWhereHas( 'user', function( $q ) use( $word ) {\n $q \n -> whereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\");\n });\n\n }\n }",
"public function scopePublished($query)\n {\n \n $query->with(['category','tags','owner','photos'])\n ->whereNotNull('published_at')\n ->where('published_at','<=',Carbon::now())\n ->latest('published_at');\n }",
"public function scopeSearch($query, $key)\n {\n return $query->where('transaction_code', 'like', '%'.$key.'%')\n ->orWhere('description', 'like', '%'.$key.'%')\n ->orWhere('total', 'like', '%'.$key.'%');\n }",
"public function scopePublished($query)\n {\n return $query->where('status', SpaceStatus::PUBLISHED());\n }",
"public function scopeTenderDocs($query)\n {\n return $query->where('type', 0);\n }",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['term']) && trim($params['term']) !== '' )\n {\n // $query->search( trim($params['term']) ); // Original\n\n $query->search( trim($params['term']), null, true, false );\n }\n\n\n\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $reference = $params['reference'];\n $query->where( function($query) use ($reference) { \n $query->where('reference', 'LIKE', '%' . $reference . '%');\n $query->orWhere('ean13', 'LIKE', '%' . $reference . '%');\n } );\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n\n /*\n // Moved from controller\n $query->orWhereHas('combinations', function($q) use ($reference)\n {\n // http://stackoverflow.com/questions/20801859/laravel-eloquent-filter-by-column-of-relationship\n $q->where('reference', 'LIKE', '%' . $reference . '%');\n }\n ); // ToDo: if name is supplied, shows records that match reference but do not match name (due to orWhere condition)\n */\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n\n if ( Auth::user()->language->iso_code == 'en' )\n {\n $query->orWhere('name_en', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['stock_control']) )\n {\n if ( $params['stock_control'] == 0 )\n $query->where('stock_control', '<=', 0);\n if ( $params['stock_control'] == 1 )\n $query->where('stock_control', '>', 0);\n }\n\n if ( isset($params['main_supplier_id']) )\n {\n if ( $params['main_supplier_id'] > 0 )\n $query->where('main_supplier_id', $params['main_supplier_id']);\n if ( $params['main_supplier_id'] < 0 )\n $query->where('main_supplier_id', 0)->orWhere('main_supplier_id', null);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id'])\n ->orderBy('position', 'asc');\n }\n\n if ( isset($params['work_center_id']) && $params['work_center_id'] > 0 )\n {\n $query->where('work_center_id', '=', $params['work_center_id']);\n }\n\n if ( isset($params['manufacturer_id']) && $params['manufacturer_id'] > 0 && 0)\n {\n $query->where('manufacturer_id', '=', $params['manufacturer_id']);\n }\n\n if ( isset($params['procurement_type']) && $params['procurement_type'] != '' )\n {\n $query->where('procurement_type', '=', $params['procurement_type']);\n }\n\n if ( isset($params['mrp_type']) && $params['mrp_type'] != '' )\n {\n $query->where('mrp_type', '=', $params['mrp_type']);\n }\n\n if ( isset($params['active']) )\n {\n if ( Configuration::isTrue('SHOW_PRODUCTS_ACTIVE_ONLY') )\n {\n if ( $params['active'] == 1 )\n {\n // Show active products, same as global scope ShowOnlyActiveScope\n // Do nothing\n ;\n\n } else {\n // Show not active products (0) or all (-1)\n // Remove global scope\n $query->withoutGlobalScope(ShowOnlyActiveScope::class);\n\n // https://www.manifest.uk.com/blog/overriding-eloquent-global-scopes\n\n // Show not active products (0)\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n }\n\n } else {\n\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n \n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n }\n\n return $query;\n }",
"public function scopeActive($query)\n {\n $query->where('status', static::PUBLISHED);\n }",
"public function scopeSearch($query)\n {\n $keyword = request('q');\n if ($keyword) {\n $model = $query->getModel();\n $searchable = $model->searchable;\n\n $local = Arr::where($searchable, function ($value, $key) {\n return is_numeric($key);\n });\n\n foreach ($local ?? [] as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query = $query->{$where}($field, 'like', \"%$keyword%\");\n }\n\n $relations = Arr::where($searchable, function ($value, $key) {\n return is_string($key);\n });\n\n foreach ($relations ?? [] as $key => $field) {\n $fields = Arr::wrap($field);\n $whereHas = empty($local) && $key == 0 ? 'whereHas' : 'orWhereHas';\n $query = $query->{$whereHas}($key, function ($query) use ($fields, $keyword) {\n foreach ($fields as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query->{$where}($field, 'like', \"%$keyword%\");\n }\n });\n }\n\n return $query;\n }\n }",
"public function applyFilter(Query $query);",
"public function scopeNombre($query,$name){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",NULL);\n\n // }\n }",
"public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }",
"public function scopeTitle($query, $input)\n {\n return $query->with('movie')->where('title', 'LIKE', '%'.$input.'%');\n /*$result = $query->with('movie')->where('title', 'LIKE', '%' . $input . '%')\n ->join('movie_tag', 'torrents.movie_id', '=', 'movie_tag.movie_id')\n ->join('tags', 'movie_tag.tag_id', '=', 'tags.id')->get();*/\n }",
"public function scopeClients($query)\n {\n return $query->where('type', 1);\n }",
"public function scopeIsPublished($query)\n {\n return $query->where('status', 'Published');\n }",
"public function scopeLive($query)\n {\n $qu = $query->where('status', '=', Content::LIVE_STATUS);\n return($qu);\n }",
"public function scopeTitulo($query, $titulo)\n {\n if ($titulo) {\n return $query->where('titulo', 'LIKE', \"%$titulo%\");\n }\n }",
"public function scopeActive($query)\n\t{\n\t\t$query->where('display', (int) true);\n\t}",
"public function scopePublished($query)\n {\n return $query->where('published_at', '!=', null);\n }",
"public function scopeSearch($query, $term);",
"public function findByFilter($filter) {\n $query = $this->createQuery();\n //$query->getQuerySettings()->setRespectEnableFields(false);\n $query->getQuerySettings()->setEnableFieldsToBeIgnored(array());\n $query->getQuerySettings()->setIncludeDeleted(false);\n $query->getQuerySettings()->setRespectStoragePage(false);\n \n\n $constraints = array();\n if($filter->keyword) {\n $keywordConstraints = array();\n $keywordConstraints[] = $query->like('title', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('abstract', '%'.$filter->keyword.'%');\n $keywordConstraints[] = $query->like('bodytext', '%'.$filter->keyword.'%');\n $constraints[] = $query->logicalOr($keywordConstraints);\n }\n if($filter->area) {\n $constraints[] = $query->contains('areas', $filter->area);\n }\n if($filter->industry) {\n $constraints[] = $query->contains('industries', $filter->industry);\n }\n if($filter->technology) {\n $constraints[] = $query->contains('technologies', $filter->technology);\n }\n if($filter->theme) {\n $constraints[] = $query->contains('themes', $filter->theme);\n }\n if($filter->year) {\n $minDate = mktime(0, 0, 0, 1, 1, $filter->year);\n $maxDate = mktime(23, 59, 59, 12, 31, $filter->year);\n $constraints[] = $query->greaterThanOrEqual('article_date', $minDate);\n $constraints[] = $query->lessThanOrEqual('article_date', $maxDate);\n }\n\n if(count($constraints)) {\n \n $query->matching(\n $query->logicalAnd($constraints)\n );\n \n \n \n//$queryParser = $this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Storage\\Typo3DbQueryParser::class);\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getSQL());\n//\n//\\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump($queryParser->convertQueryToDoctrineQueryBuilder($query)->getParameters());\n\n\n\n return $query->matching(\n $query->logicalAnd($constraints)\n )\n ->execute();\n \n }\n else {\n return $this->findAll();\n }\n }",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function query()\n {\n $query = xpsFoldsheet::select([\n\t\t'foldsheet_id as id',\n\t\t'foldsheet_id',\n\t\t'foldcat',\n\t\t'stand',\n\t\t'pag',\n\t\t'strook',\n\t\t'descr',\n\t\t'pag_in_breedte',\n\t\t'pag_in_hoogte',\n\t\t'afloop_l',\n\t\t'afloop_r',\n\t\t'afloop_b',\n\t\t'afloop_o',\n\t\t'kopwit_breed',\n\t\t'kopwit_hoog',\n\t\t'kruiswit_breed',\n\t\t'kruiswit_hoog',\n\t\t'freeswit_breed',\n\t\t'freeswit_hoog',\n\t\t'overslag_breed',\n\t\t'overslag_hoog'\n ]);\n\n return $this->applyScopes($query);\n }",
"public function scopeMyselections($query)\n {\n $user = auth()->user();\n if($user->is_admin){\n return $query->orderBy('created_at', 'desc');\n } else {\n return $query->where('user_id', $user->id)->orderBy('created_at', 'desc');\n }\n }",
"public function scopeVisible($query)\n {\n return $query->whereVisible('1');\n }",
"public function scopeAtivos($query)\n {\n return $query->where('ativo_listagem', true);\n }",
"public function scopeViewable($query)\n {\n return $query->where('is_closed', 0)->orWhere('is_pinned', 1)->orWhere(function ($query) {\n $query->archival();\n });\n }",
"public function scopePart($query)\n\t{\n\t\treturn $query->where('type', 'part');\n\t}",
"public function scopeOfType($query, $type)\n {\n return $query->where('type', $type);\n }",
"function filter($request) {\n\t\t//$model = singleton($this->modelClass);\n\t\t$context = $this->dataObject->getDefaultSearchContext();\n\t\t$value = $request->getVar('q');\n\t\t$results = $context->getResults(array(\"Name\"=>$value));\n\t\theader(\"Content-Type: text/plain\");\n\t\tforeach($results as $result) {\n\t\t\techo $result->Name . \"\\n\";\n\t\t}\t\t\n\t}",
"function scopeActiveWithPlacesRelated($query)\n {\n return $query\n ->select('name', 'image', 'slug', 'anons', 'publish_date')\n ->where('status', 1)\n ->orderBy('created_at', 'desc')\n ->limit(8)\n ->get();\n }",
"public function scopeByType($query, $type)\n {\n return $query->where('type', $type);\n }",
"public function scopeMine($query)\n {\n //return $query->where('shop_id', Auth::user()->merchantId());\n }",
"public function scopeList($query){\n return $query->Join('permissao_sistema', 'cao_usuario.co_usuario', '=', 'permissao_sistema.co_usuario')\n ->Where('co_sistema',1)\n ->Where('in_ativo','S')\n ->WhereIn('co_tipo_usuario',[0, 1, 2])\n ->get(['cao_usuario.co_usuario', 'no_usuario']);\n }",
"public function scopeVisible($query)\n {\n return $query->where('is_visible', 1);\n }",
"public function scopeWithKeyword($query, $keyword)\n {\n return $query->where('name', 'like', '%'.$keyword.'%');\n }",
"public function scopeByTitle($query, $title)\n {\n return $query->where('title', 'LIKE' ,'%'.$title.'%');\n }",
"public function scopeSearched($query)\n {\n $search = request()->query('search');\n\n if (!$search && $search != 0) {\n return $query;\n }\n\n return $query->where('number', 'LIKE', \"%{$search}\");\n }",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $query->where('reference', 'LIKE', '%' . trim($params['reference']) . '%');\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id']);\n }\n\n if ( isset($params['active']) )\n {\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n\n return $query;\n }",
"public function setContentQuery($val)\n {\n $this->_propDict[\"contentQuery\"] = $val;\n return $this;\n }",
"public function scopeFilter($query, $inputs)\n {\n if($tmp = @$inputs['EstNombre'])\n $query->where('EstNombre', 'like', '%'.$tmp.'%');\n\n if($tmp = @$inputs['EstDescripcion'])\n $query->where('EstDescripcion', 'like', '%'.$tmp.'%');\n \n if ($tmp=@$inputs[\"EstIdTipoObjeto\"] && is_array($inputs[\"EstIdTipoObjeto\"]) ){\n $query->whereIn('EstIdTipoObjeto',$inputs[\"EstIdTipoObjeto\"]);\n \n }\n // if ($tmp=@$inputs[\"EstIdTipoObjeto\"] && !is_array($inputs[\"EstIdTipoObjeto\"]) ){\n // $query->where('EstIdTipoObjeto',\"=\",$inputs[\"EstIdTipoObjeto\"]);\n // }\n\n }",
"public function getQueryScope()\n {\n return $this->query_scope;\n }",
"public function scopeOrder ($query){\n return $query->orderBy('descripcion','like','%$nombre%');\n }",
"public function scopeDisponible($query)\n {\n $fieldEnabled = $this->getField('ENABLED');\n if ($this->existsAttribute($fieldEnabled))\n return $query->where($fieldEnabled,1);\n return $query;\n }",
"public function scopeBidDocs($query)\n {\n return $query->where('type', 2);\n }",
"public function scopeMovimientos($query, $condicion)\n {\n //de esta manera se obtienen como tipo json para llenar los registros con jquery\n return $query->whereRaw($condicion)->orderBy('id', 'asc')->get();\n }",
"public function scopePublic($query)\n {\n return $query->where('is_public', true);\n }",
"public function scopePost($query)\n {\n $query->with('author')->where('type', '=', self::POST);\n }",
"public function scopeOnline($query)\n {\n $fet = $query->whereNotNull('video')\n ->where('video','<>','')\n ->whereNotNull('poster')\n ->where('poster','<>','')\n ->whereNotNull('background')\n ->where('background','<>','');\n\n return $fet; \n }",
"public function scopePublic($query)\n {\n return $this->where('is_public', true);\n }",
"public function scopeRead($query){\n return $query->where('read',true)->where('active',false);\n }",
"public function scopeVisible($query)\n {\n $query = $query->agents();\n\n if (auth()->user()->panichd_admin) {\n return $query->orderBy('name', 'ASC');\n } elseif (auth()->user()->panichd_agent) {\n return $query->VisibleForAgent(auth()->user()->id);\n } else {\n return $query->where('1', '=', '0');\n }\n }",
"public function scopePublish($query)\n {\n $query->where('status', '=', self::STATUS_PUBLISH);\n }",
"public function scopeUser($query)\n\t{\n\t\treturn $query->where('user_id', 'LIKE', Auth::user()->id);\n\t}",
"public function scopeInventories($query)\n {\n return $query\n ->where('type', 1)\n ->where('sub_type', 8)\n ->where('is_accountable', 1);\n }",
"public function scopeByTitle($query, $titel)\n {\n return $query->where('titel', $titel);\n }",
"public function scopeSearch(Builder $query, string $name): Builder\n {\n return $query->where('title', 'ILIKE', \"%$name%\")\n ->orWhere('description', 'ILIKE', \"%$name%\");\n }",
"public function scopeSearch($query, $input) {\n \n if (isset($input['s'])) {\n $query->whereRaw('customer_name LIKE \"%'. array_get($input, 's', '') .'%\"');\n }\n\n return $query;\n }",
"public function scopeListFrontEnd($query, $options)\n {\n /*\n * Default options\n */\n extract(array_merge([\n 'page' => 1,\n 'perPage' => 20,\n 'sort' => 'created_at',\n 'channels' => null,\n 'search' => '',\n 'sticky' => true,\n ], $options));\n\n /*\n * Sorting\n */\n $allowedSortingOptions = ['created_at', 'updated_at', 'subject'];\n if (!in_array($sort, $allowedSortingOptions)) {\n $sort = $allowedSortingOptions[0];\n }\n\n if ($sticky) {\n $query->orderBy('is_sticky', 'desc');\n }\n\n $query->orderBy($sort, in_array($sort, ['created_at', 'updated_at']) ? 'desc' : 'asc');\n\n /*\n * Search\n */\n $search = trim($search);\n if (strlen($search)) {\n $query->where(function($query) use ($search) {\n $query->whereHas('posts', function($query) use ($search) {\n $query->searchWhere($search, ['subject', 'content']);\n });\n\n $query->orSearchWhere($search, 'subject');\n });\n }\n\n /*\n * Channels\n */\n if ($channels !== null) {\n if (!is_array($channels)) {\n $channels = [$channels];\n }\n\n $query->whereIn('channel_id', $channels);\n }\n\n return $query->paginate($perPage, $page);\n }",
"public function scopeAllPosts($query)\n\t{\n\t\treturn $query->where('page', '=', 0);\n\t}",
"public function scopeFilter($query, $term)\n {\n return $query\n ->where('name', 'like', '%' . $term . '%')\n ->orWhere('email', 'like', '%' . $term . '%');\n }",
"public function scopeKnown($query){\n\n return $query->where('known', 1);\n\n }",
"function simplenews_build_issue_filter_query(EntityFieldQuery $query) {\n if (isset($_SESSION['simplenews_issue_filter'])) {\n foreach ($_SESSION['simplenews_issue_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n case 'newsletter':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->fieldCondition(variable_get('simplenews_newsletter_field', 'simplenews_newsletter'), 'target_id', $value);\n }\n break;\n }\n }\n }\n}",
"public function queryAll($campos=\"*\",$criterio=\"\");",
"public function scopeListFrontEnd($query, $options)\n {\n /*\n * Default options\n */\n extract(array_merge([\n 'page' => 1,\n 'perPage' => 30,\n 'sort' => 'title desc',\n 'search' => '',\n 'categories' => null,\n 'brand' => null,\n 'stores' => null,\n ], $options));\n\n $obj = $query;\n $obj = $obj->whereIsPublished(1);\n\n /*\n * Sorting\n */\n\n if (!is_array($sort)) {\n $sort = [$sort];\n }\n\n if (!$search) {\n foreach ($sort as $_sort) {\n\n if (in_array($_sort, array_keys(self::$allowedSortingOptions))) {\n $parts = explode(' ', $_sort);\n if (count($parts) < 2) {\n array_push($parts, 'desc');\n }\n list($sortField, $sortDirection) = $parts;\n if ($sortField == 'random') {\n $sortField = DB::raw('RAND()');\n }\n $obj->orderBy($sortField, $sortDirection);\n }\n\n }\n } else {\n $obj->orderBy('relevance', 'desc');\n\n }\n\n /*\n * Categories\n */\n if ($categories !== null) {\n if (!is_array($categories)) {\n $categories = [$categories];\n }\n $obj = $obj->whereHas('categories', function ($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }\n\n /*\n * Brand\n */\n if ($brand !== null) {\n if (!is_array($brand)) {\n $brand = [$brand];\n }\n $obj = $obj->whereHas('brand', function ($q) use ($brand) {\n $q->whereIn('id', $brand);\n });\n }\n\n /*\n * Stores\n */\n if ($stores !== null) {\n if (!is_array($stores)) {\n $stores = [$stores];\n }\n $obj = $obj->whereHas('stores', function ($q) use ($stores) {\n $q->whereIn('id', $stores);\n });\n }\n\n if ($search) {\n $obj->search($search);\n }\n\n return $obj->paginate($perPage, $page);\n }",
"public function scopeIncludes( $query, $search )\n { \n return $query->where( 'namespace', 'like', '%' . $search );\n }",
"abstract function query( $p_filter_input );",
"public function scopeBusca($query, $busqueda){\n\t\tif($busqueda){\n\t\t\treturn $query->where(\\DB::raw(\"CONCAT(name,' ',email,' ',tipo,' ',estado)\"),\"LIKE\",\"%$busqueda%\");\n\t\t}\n }",
"public function scopeName($query, $name)\n {\n if($name)\n return $query->where('IAP_DESC', 'LIKE', \"%$name%\");\n }",
"public function scopeOfSearch($query, $keyword)\n {\n return $query->where('name','like','%'.$keyword.'%');\n }",
"public function scopeSearch($query, $search)\n\t{\n\t\treturn $query->where('address', 'like', '%' . $search . '%')\n\t\t\t->orWhere('city', 'like', '%' . $search . '%')\n\t\t\t->orWhere('zip', 'like', '%' . $search . '%')\n\t\t\t->orWhere('title', 'like', '%' . $search . '%')\n\t\t\t->orWhere('description', 'like', '%' . $search . '%')\n\t\t\t->get();\n\t}"
]
| [
"0.66410756",
"0.6591297",
"0.65886676",
"0.6367863",
"0.626207",
"0.6204624",
"0.6200226",
"0.61801165",
"0.6151024",
"0.61231035",
"0.6104927",
"0.6089196",
"0.6025959",
"0.60000944",
"0.5999823",
"0.5998024",
"0.5983203",
"0.5977893",
"0.59764",
"0.59648895",
"0.5942708",
"0.592632",
"0.5904663",
"0.5879027",
"0.586582",
"0.585387",
"0.584992",
"0.5840936",
"0.5828676",
"0.58276707",
"0.5774332",
"0.57723457",
"0.57591105",
"0.5754504",
"0.5746899",
"0.5745502",
"0.57368803",
"0.5732489",
"0.5716101",
"0.57132304",
"0.56991833",
"0.5689877",
"0.5677733",
"0.5673136",
"0.56692195",
"0.56657076",
"0.5660392",
"0.5657858",
"0.5652445",
"0.56490976",
"0.5645225",
"0.5628157",
"0.5620246",
"0.5619504",
"0.5618661",
"0.5605066",
"0.55993026",
"0.55987674",
"0.5595775",
"0.55776465",
"0.55751014",
"0.5566801",
"0.5554406",
"0.5551377",
"0.5539759",
"0.5536313",
"0.5531951",
"0.55300045",
"0.5528838",
"0.55124706",
"0.5507955",
"0.55064934",
"0.5501053",
"0.550065",
"0.549595",
"0.548927",
"0.54874706",
"0.54846555",
"0.5477905",
"0.5457191",
"0.54499966",
"0.5446566",
"0.54366034",
"0.541796",
"0.54077387",
"0.54030234",
"0.540092",
"0.53982466",
"0.53963643",
"0.53883547",
"0.5383805",
"0.5383433",
"0.5380549",
"0.53803927",
"0.53769916",
"0.5365212",
"0.53558594",
"0.5354843",
"0.535345",
"0.53505063"
]
| 0.72592276 | 0 |
Scope a query to filter by year | public function scopeYear($query, $year)
{
return $query->whereYear('created_at', $year);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }",
"function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }",
"public function scopeYearsRange($query, $id, $yearFrom, $yearTo)\n {\n $fet = $query;\n if ($yearFrom && $yearTo)\n $fet = $fet->whereBetween('year', array($yearFrom, $yearTo))->whereNotNull('video')->where('video','<>','');\n\n if ($this->options->getDataProvider() == 'db' || ! $this->options->autoUpdateData())\n {\n return $fet;\n }\n\n if ($fet->isEmpty() || $fet->first()->updated_at->addDay() <= Carbon::now())\n {\n $fet = $this->updateFeatured();\n }\n\n return $fet; \n }",
"public function scopeYearlyPost($query)\n {\n return $query->selectRaw('year(created_at)')->groupBy('year(created_at)')->orderByDesc('year(created_at)');\n }",
"public function searchActiveCelebritiesWorldYear($year = 2015)\n {\n $intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }",
"public function searchActiveContinentYear($continent = false, $year = 2015)\n {\t\t\n\t\t$intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\n\n\t\t// artist plans sorted by artist order\t\n\t\t$query = ArtistPlan::find()->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->where('artistplan.show_status = :status') \n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime]);\n\t\t\n\t\t$query->addParams([':status' => 1]); \n\t\t\n\t\tif ($continent) {\n\t\t\t$query->andWhere(\"continent = :continent\");\n\t\t\t$query->addParams([':continent' => $this->getContinentName($continent)]); \n\t\t}\n\t\t\n\t\t$query->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n\t\t$dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }",
"public function scopeMonth($query,$filters){\n if($month = $filters['month']){\n $query->whereMonth('created_at', Carbon::parse($month)->month);\n }\n\n if($year = $filters['year']){\n $query->whereYear('created_at',$year);\n }\n\n }",
"protected function whereYear(Builder $query, $where)\n {\n return $this->dateBasedWhere('year', $query, $where);\n }",
"function cucina_year_query( $query ){\n\tif ( $query->is_main_query() && is_year() ) {\n\t\t$query->set( 'posts_per_archive_page', 110 );\n\t}\n}",
"function get_all_by_key_by_year() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_g_and_o\n\t\t\t\tWHERE sfg_pos_id = ? AND sfg_pay_id = ?\";\n\t\t$query = $this->db->query($sql, array($this->sfg_pos_id, $this->sfg_pay_id));\n\t\treturn $query;\n\t}",
"public function searchYear(Request $request){\n $result = Order::with('customer')->where('order_year',$request->search_year)->latest()->get();\n return response()->json($result);\n\n }",
"public function modelYear();",
"protected function getLastYearScope($src_bu) {\n $currentTime = date('Y-m', time());\n //get Arr of last year but same month\n $lastYearArr = array();\n $lastYearFinal = array();\n for ($i = 0; $i < 12; $i++) {\n $lastYearArr[$i] = date('Y-m', strtotime('-1 year, +' . $i . ' month', strtotime($currentTime)));\n }\n foreach ($lastYearArr as $key => $ly) {\n $daysOfMonth = date('t', strtotime($ly));\n $lastYearFinal[$key] = $ly . '-' . $daysOfMonth;\n }\n\n $em = $this->getDoctrine()->getManager();\n $qb = $em->createQueryBuilder();\n $qb->select('date')\n ->from('AlbatrossDailyBundle:Date', 'date')\n ->leftJoin('date.bu', 'bu');\n if ($src_bu == null) {\n $qb->where('bu.id is null');\n } else {\n $qb->where('bu.id = :bid');\n $qb->setParameter('bid', $src_bu->getId());\n }\n $qb->andWhere('date.dailydate IN (:dayArr)')\n ->setParameter('dayArr', $lastYearFinal);\n $query = $qb->getQuery();\n $result = $query->getArrayResult();\n\n $dateIdArr = array();\n foreach ($result as $re) {\n $dateIdArr[] = $re['id'];\n }\n $scopeQb = $em->createQueryBuilder();\n $scopeQb->select('number', 'date2')\n ->from('AlbatrossDailyBundle:Number', 'number')\n ->leftJoin('number.date', 'date2')\n ->leftJoin('number.status', 'status')\n ->where('date2.id IN (:dateId)')\n ->setParameter('dateId', $dateIdArr)\n ->andWhere('status.id = 1');\n $scopeQuery = $scopeQb->getQuery();\n $scopeResult = $scopeQuery->getArrayResult();\n $temp = array_flip($lastYearFinal);\n foreach ($scopeResult as $s) {\n $temp[$s['date']['dailydate']->format('Y-m-d')] = $s['number'];\n }\n $final = array();\n foreach ($temp as $key => $f) {\n if (is_int($f)) {\n $temp[$key] = '0';\n }\n $final[] = $temp[$key];\n }\n\n return $final;\n }",
"public function yearType($year = null, $type = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->where('type', $type)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function findYearsByFilter($filter) {\n $filter2 = clone $filter;\n $filter2->year = null;\n $articles = $this->findByFilter($filter2);\n $yearArray = array();\n foreach($articles as $article) {\n $date = $article->getArticleDate();\n $year = $date->format('Y');\n if(!isset($yearArray[$year])) {\n $yearArray[$year] = array('count' => 0);\n }\n if(!isset($yearArray[$year]['value'])) {\n $yearFilter = clone $filter2;\n $yearFilter->year = $year;\n $yearArray[$year]['value'] = intval($year);\n $yearArray[$year]['searchFilter'] = $yearFilter;\n }\n $yearArray[$year]['count']++;\n }\n return $yearArray;\n }",
"public function findCRTForAYear($user,$year)\n {\n $yearp1=$year+1;\n $qb = $this->createQueryBuilder('crt');\n $qb->where('crt.user = :user')\n ->andWhere($qb->expr()->orX(\n $qb->expr()->andX(\n $qb->expr()->eq('YEAR(crt.date )', $year),\n $qb->expr()->gt('MONTH(crt.date )', '5')\n ),\n $qb->expr()->andX(\n $qb->expr()->eq('YEAR(crt.date )', $yearp1),\n $qb->expr()->lte('MONTH(crt.date )', '5')\n )\n )\n \n )\n ->setParameter('user', $user)\n ;\n \n return $qb->getQuery()->getResult();\n }",
"function this_year()\n{\n global $db; // golbalize db variable:\n $thisYear = date('Y') . '-01-01';\n $nextYear = ((int) date('Y') + 1) . '-01-01';\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisYear,\n 'dates.date' => $nextYear,\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n if ($db->count > 0) {\n return $datesIds;\n }\n}",
"public function search($query, $year = null, $language = null);",
"public function scopeFilter($query, $filters) {\n if( $month = $filters['month'] ) {\n\n // Carbon::parse($month)->month --> converts to month number. \n $query->whereMonth('created_at', Carbon::parse($month)->month );\n }\n\n if( $year = $filters['year'] ) {\n \n $query->whereYear('created_at', $year );\n }\n\n }",
"public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }",
"function lib4ridora_construct_year_filter($form_state) {\n // Get the values out of the form.\n $year_type = $form_state['values']['year']['select'];\n $to = empty($form_state['values']['year']['to']) ? \"*\" : $form_state['values']['year']['to'];\n $from = empty($form_state['values']['year']['from']) ? \"*\" : $form_state['values']['year']['from'];\n // If nothing was entered in the date fields, exit early.\n if ($to == \"*\" && $from == \"*\") {\n return \"\";\n }\n\n // Convert to proper format for solr.\n if ($to != '*') {\n $to_date = new DateTime();\n $to = date_format($to_date->createFromFormat('Y/m/d/G:i:s', \"$to/12/31/23:59:59\"), 'Y-m-d\\TH:i:s\\Z');\n }\n if ($from != '*') {\n $from_date = new DateTime();\n $from = date_format($from_date->createFromFormat('Y/m/d/G:i:s', \"$from/01/01/0:00:00\"), 'Y-m-d\\TH:i:s\\Z');\n }\n\n // Return fq string.\n module_load_include(\"inc\", \"islandora_solr\", \"includes/utilities\");\n switch ($year_type) {\n case \"publication year\":\n $publication_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_publication_year', 'mods_originInfo_encoding_w3cdtf_keyDate_yes_dateIssued_dt'));\n return \"$publication_year_field:[$from TO $to]\";\n\n case \"reporting year\":\n $reporting_year_field = islandora_solr_lesser_escape(variable_get('lib4ridora_solr_field_reporting_year', 'mods_originInfo_encoding_w3cdtf_type_reporting year_dateOther_dt'));\n return \"$reporting_year_field:[$from TO $to]\";\n\n default:\n return \"\";\n }\n}",
"public function list_client_select($current_year,$next_year){\n\n$this->db->where(\"year BETWEEN '$next_year' and '$current_year'\", NULL, FALSE); \n$this->db->order_by(\"year\", \"desc\");\n\t\n$result\t= $this->db->get('client');\n\n\t\treturn $result->result();\t\n}",
"function get_all_by_key_by_year(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_attitude\n\t\t\t\tWHERE sft_pos_id = ? AND sft_pay_id = ?\";\n $query = $this->db->query($sql, array($this->sft_pos_id, $this->sft_pay_id));\n\t\treturn $query;\n\n\t}",
"public function searchYearActionGet()\n {\n $title = \"Search by year\";\n\n $this->app->db->connect();\n\n $fromYear = $this->app->request->getGet(\"fromYear\");\n $toYear = $this->app->request->getGet(\"toYear\");\n\n if ($fromYear && $toYear) {\n $sql = \"SELECT * FROM movie WHERE year >= ? AND year <= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$fromYear, $toYear]);\n } elseif ($fromYear) {\n $sql = \"SELECT * FROM movie WHERE year >= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$fromYear]);\n } elseif ($toYear) {\n $sql = \"SELECT * FROM movie WHERE year <= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$toYear]);\n }\n\n $this->app->page->add(\"movie/search-year\", [\n \"fromYear\" => $fromYear,\n \"toYear\" => $toYear,\n ]);\n\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"public function filterOrgs(ModelContest $contest, YearCalculator $yearCalculator) {\n $orgs = $this->servicePerson->getTable()->where([\n 'org:contest_id' => $contest->contest_id\n ]);\n\n $currentYear = $yearCalculator->getCurrentYear($contest);\n $orgs->where('org:since <= ?', $currentYear);\n $orgs->where('org:until IS NULL OR org:until <= ?', $currentYear);\n $this->searchTable = $orgs;\n }",
"public function getStudentClassYear($class,$year){\n\n// find the age of student \n$age =$this->findAge($class);\n$year = $year.\"-01-01\"; \n// find the born year using age \n$birthdayYear = Carbon::parse($year)->subYears($age)->year;\n\n// \n\n $result = Student::whereYear('dob' ,$birthdayYear)->get();\n return $result;\n\n\n\n\n\n }",
"public function findOneByYear(\\DateTime $date);",
"function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}",
"public function setYear($year);",
"public function query()\n {\n $query = AcademicYear::query();\n\n if ($this->isOrderedWithDefaultOrder()) {\n $query->orderByDesc('from');\n }\n\n $query->where('site_id', site()->id);\n\n return $query;\n }",
"public function receipt_year() {\n $this->db->select('YEAR(receipt_master.date_transfer) AS year_pay');\n $this->db->where('receipt_master.type_receipt_id', 5);\n $this->db->where('receipt_master.status_receipt_id', 1);\n $this->db->where('receipt_master.status_transfer_id', 3);\n $this->db->where('receipt_master.shop_id_pri', $this->session->userdata('shop_id_pri'));\n $this->db->where('receipt_master.date_transfer !=', '');\n $this->db->group_by('YEAR(receipt_master.date_transfer)');\n return $this->db->get('receipt_master');\n }",
"protected function getYearDependenceForQuery($addTableName = false) {\n\t\t$Query = '';\n\t\t$time = $addTableName ? '`'.PREFIX.'training`.`time`' : '`time`';\n\n\t\tif ($this->showsLast6Months()) {\n\t\t\t$Query .= ' AND '.$time.' > '.LocalTime::fromString('first day of -5 months 00:00')->getTimestamp();\n\t\t} elseif ($this->showsLast12Months()) {\n\t\t\t$Query .= ' AND '.$time.' > '.LocalTime::fromString('first day of -11 months 00:00')->getTimestamp();\n\t\t} elseif (!$this->showsAllYears()) {\n\t\t\t$Query .= ' AND '.$time.' BETWEEN UNIX_TIMESTAMP(\\''.(int)$this->year.'-01-01\\') AND UNIX_TIMESTAMP(\\''.((int)$this->year+1).'-01-01\\')-1 ';\n\t\t}\n\n\t\treturn $Query;\n\t}",
"public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }",
"public function yearState($year = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }",
"public function scopeStats($query, $month=false, $year=false){\n\n\t\t$query = $query->select( DB::raw('libraries.code as library,holdings.state as state , count(*) as count, sum(holdings.size) as size') )\n ->from('holdings')\n\t\t\t\t\t\t\t->join('states', function($join){ $join->on('holdings.id','=','states.holding_id')->on('states.state','=','holdings.state'); })\n\t\t\t\t\t\t\t->join('libraries','holdings.library_id','=','libraries.id')\n\t\t\t\t\t\t\t->groupBy('libraries.code', 'holdings.state');\n\n\t\tif ($month && $month!='*') $query = $query->where(DB::raw('extract(month from states.created_at)'),$month);\n\t\tif ($year && $year!='*') \t$query = $query->where(DB::raw('extract(year from states.created_at)'),$year);\n\n\t\treturn $query;\n }",
"public function year($column, $year, $boolean = 'and', $not = false)\r\n {\r\n return $this->where_assoc(array('year('.$column.')' => $year), $boolean, $not);\r\n }",
"function get_years_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('Y')] = $fecha->format('Y');\n }\n return $result;\n}",
"public function getYear() {}",
"public function list_invoice_select($current_year,$next_year){\n\n$this->db->where(\"year BETWEEN '$next_year' and '$current_year'\", NULL, FALSE); \n$this->db->order_by(\"year\", \"desc\");\n\t\n$result\t= $this->db->get('invoice');\n\n\t\treturn $result->result();\t\n}",
"public function whereYear($column, $operator, $value, $boolean = 'and')\n {\n return $this->addDateBasedWhere('Year', $column, $operator, $value, $boolean);\n }",
"public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }",
"function getMediaYears($date)\n{\n $sql = \"SELECT media_year,media_year_start,media_year_end from media_calendar where media_year <= YEAR('\" . $date . \"') GROUP by media_year ORDER BY media_year DESC\";\n $result = getResult($sql);\n return $result;\n}",
"public function list_client_unique($current_year,$next_year){\n\t\n$this->db->distinct();\n$this->db->group_by('year');\n$this->db->where(\"year BETWEEN '$next_year' and '$current_year'\", NULL, FALSE); \n$this->db->order_by(\"year\", \"desc\");\n$result\t= $this->db->get('client');\nreturn $result->result();\t\n}",
"public function get_yeardata($table, $field)\n\t{\t\n\t\t$this->db->select('*');\n\t\t$this->db->join('pengguna', 'pengguna.kode_daftar = laporan.kode_daftar');\n\t\t$this->db->where(\"DATE_FORMAT(tanggal, '%Y') = \", $field);\n\t\treturn $this->db->get($table);\n\t}",
"public function filterByYear($year = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($year)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $year)) {\n $year = str_replace('*', '%', $year);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(UserPeer::YEAR, $year, $comparison);\n }",
"public function getYearListAppTr() \n {\t\t\n $this->db->select('to_char(th_date_from,\\'yyyy\\') as \"CM_YEAR\"');\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"th_date_from\");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result();\n }",
"public function filterAction(Request $request) {\n $year = $request->query->get('year');\n $month = $request->query->get('month');\n\n $em = $this->getDoctrine()->getManager();\n $repo = $em->getRepository('AppBundle:Data');\n if(!empty($month)){ \n $datas = $repo->findBy(array('year' => $year, 'month' => $month));\n \n } else {\n $datas = $repo->findBy(array('year' => $year));\n }\n\n return compact('datas','year', 'month');\n\n }",
"public function getQueryArchive($filter_year = null)\n {\n try {\n // Conditions\n\n $conditions_year = \"\";\n if (isset($filter_year) && !empty($filter_year)) {\n $conditions_year = \"AND SUBSTRING( n.date , 1, 4) LIKE :date\";\n }\n\n // Query result\n $dql = \"SELECT n\n FROM AciliaCmsBundle:Newsletter AS n\n WHERE 1 = 1\n {$conditions_year}\n ORDER BY n.date DESC\";\n\n $query = $this->_em->createQuery($dql);\n if (!is_null($filter_year)) {\n $query->setParameter('date', \"%{$filter_year}%\");\n }\n } catch (\\Exception $ex) {\n $query = '';\n }\n\n return $query;\n }",
"function get_entries_records_for_year($entries, $year, $boundle)\n{\n $dates = get_year_dates($year);\n // Setting the start date is the first day of the selected year.\n $start_date = $dates['start_date'];\n // Setting the end date is the last day of the selected year.\n $end_date = $dates['end_date'];\n\n $entries_records = [];\n if (isset($entries)) {\n foreach ($entries as $entry) {\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'entry_month_record')\n ->entityCondition('bundle', $boundle)\n ->fieldCondition('field_entry', 'target_id', $entry, '=')\n ->fieldCondition('field_entry_date', 'value', $start_date, '>=')\n ->fieldCondition('field_entry_date', 'value', $end_date, '<=')\n ->fieldOrderBy('field_entry_date', 'value')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n\n if (!empty($records)) {\n $records_ids = array_keys($records['entry_month_record']);\n\n // Adding each records for an entry in the array of entry id.\n $entries_records[$entry] = $records_ids;\n }\n }\n }\n\n return $entries_records;\n}",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"public function findSumByYear(\\DateTime $date);",
"public function scopegetholiday($query, $shop_id = 0, $payroll_holiday_archived = 0)\n {\n \t$query->where('shop_id', $shop_id)->where('payroll_holiday_archived', $payroll_holiday_archived);\n\n \treturn $query;\n }",
"public function getYearList() \n {\t\t\n $this->db->select(\"to_char(cm_date, 'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.calendar_main\");\n $this->db->where(\"to_char(cm_date, 'yyyy')::numeric >= to_char(current_date, 'yyyy')::numeric - 15\");\n $this->db->group_by(\"to_char(cm_date, 'YYYY')\");\n $this->db->order_by(\"to_char(cm_date, 'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }",
"public function getYearListAppTr2() \n {\t\t\n $this->db->select(\"to_char(th_date_from,'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_status = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"TO_CHAR(th_date_from,'YYYY'), th_date_from\");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }",
"public function fetchYears()\n\t{\n\t\treturn $this->dibi->fetchAll('\n\t\t\tSELECT\n\t\t\t\tyear\n\t\t\tFROM\n\t\t\t\tjournal\n\t\t\tGROUP BY\n\t\t\t\tyear\n\t\t\tORDER BY\n\t\t\t\tyear\t\t\n\t\t');\n\t\t\t\n\t}",
"public function getDollsFiltered($year = '', $type = '')\n\t{\n\t\t$dolls = $this->doll->where(function($query) use ($type, $year) {\n\n\t\t\tif ( ($year) && ($year !== 'all') ){\n\t\t\t\t$query->where('release_year', $year);\n\t\t\t}\n\n\t\t\t$query->whereHas('dolltypes', function($q) use ($type) {\n\t\t\t\t$q->where('slug', $type);\n\t\t\t});\n\n\t\t})->get();\n\n\t\treturn $dolls;\n\t}",
"public function testScopeByDate()\n {\n $this->assertInstanceOf(\n ProjectRepository::class,\n $this->getRepoWithQB()->scopeByDate('date')\n );\n }",
"protected function whereYear(Builder $builder, $where): string\n {\n return $this->dateBasedWhere('year', $builder, $where);\n }",
"function get_all_financial_year(){\n $str_query=\"select financial_year_id, year_name, date_start, date_end from financial_year order by date_end desc\";\n\tif (!$this->sql_query($str_query)){\n return false;\n\t}\n\telse{\n return true;\n\t}\n }",
"public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }",
"public function filterGradYear($gradYears)\n {\n $programsid = Auth::user()->programs_id;\n //filter alumni by gradYear\n $alumni = Alumni::where('programs_id', '=', $programsid)->where('gradYear', '=', $gradYears)->orderBy('gradYear', 'asc')->get();\n \n $industry = Alumni::whereNotNull('industry')->orderBy('industry', 'asc')->pluck('industry')->unique();\n $gradYear = Alumni::whereNotNull('gradYear')->orderBy('gradYear', 'asc')->pluck('gradYear')->unique();\n $company = Alumni::whereNotNull('company')->orderBy('company', 'asc')->pluck('company')->unique();\n \n return view('Coach/alumSearch', compact('alumni', 'industry', 'gradYear', 'company'));\n }",
"public function sum_allappli_bymonthyear($year = null) {\n $current_date = new \\DateTime();\n if (!isset($year)) {\n $year = $current_date->format('Y');\n }\n $query = $this->createQueryBuilder('a')\n //->select('MONTH(a.dateDebut) as mois,sum(b.nomprojet) as projet,count(a.id) as nb')\n ->select('MONTH(a.dateDebut) as mois,count(a.id) as nb')\n //->select('count(a.id) as nb,a.dateDebut,b.nomprojet,MONTH(a.dateDebut) as mois')\n ->leftJoin('a.idProjet', 'b')\n ->andWhere('a.dateDebut LIKE :date')\n ->groupby('mois');\n $parameters['date'] = '%' . $year . '-%';\n $query->setParameters($parameters);\n //return $query->getQuery();\n return $query->getQuery();\n }",
"public function GetAllFacturesVentesByYear() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n \n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data'][\"idSociete\"];\n $filterYear = $_REQUEST['data'][\"filterYear\"];\n // Input validations\n if (!empty($idSociete) && !empty($filterYear)) {\n try {\n $sql = $this->db->prepare(\"SELECT idFacture,date as dateCre,total,YEAR(date) AS factYear FROM facturevente WHERE idEtat != 5 and YEAR(date) = :filterYear AND idSociete = :idSociete\");\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n $sql->bindParam('filterYear', $filterYear, PDO::PARAM_STR);\n $sql->execute();\n\n if ($sql->rowCount() > 0) {\n $result = array();\n while ($rlt = $sql->fetchAll()) {\n $result[] = $rlt;\n }\n // If success everythig is good send header as \"OK\" and return list of users in JSON format\n $this->response($this->json($result[0]), 200);\n }\n $this->response('', 204); // If no records \"No Content\" status\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage());\n }\n }\n }\n \n }",
"public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }",
"public function findAllYears()\n {\n $query = 'SELECT DISTINCT t.year FROM ApiTracklistBundle:Track t ORDER BY t.year DESC';\n\n return $this->getEntityManager()\n ->createQuery($query)\n ->getResult();\n }",
"public static function findByYear($year, $fields = \"*\", $retarray = false) {\r\n $dq = Doctrine_Query::create ()\r\n ->select ( $fields )\r\n ->from ( 'InvoicesSettings is' )\r\n ->where ( 'is.year = ?'.$year )\r\n ->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n ->limit ( 1 );\r\n \r\n $retarray = $retarray ? Doctrine_Core::HYDRATE_ARRAY : null;\r\n $record = $dq->execute ( array (), $retarray );\r\n return $record;\r\n }",
"public function getAnnualSales() {\n\t\t// Query\n\t\t$sql = '\n\t\t\tSELECT \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\") AS year, \n\t\t\t\tSUM(amount) AS amount\n\t\t\tFROM \n\t\t\t\ttransactions\n\t\t\tGROUP BY \n\t\t\t\tDATE_FORMAT(transactionDate, \"%Y\")\n\t\t';\n\n\t\t// Return\n\t\treturn DB::select($sql);\n\t}",
"public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }",
"public function list_invoice_unique($current_year,$next_year){\n\t\n$this->db->distinct();\n$this->db->group_by('year');\n$this->db->where(\"year BETWEEN '$next_year' and '$current_year'\", NULL, FALSE); \n$this->db->order_by(\"year\", \"desc\");\n$result\t= $this->db->get('invoice');\nreturn $result->result();\t\n}",
"function get_current_finacial_year(){\n $str_query=\"select financial_year_id, year_name, date_start, date_end from financial_year \n where CURDATE() between date_start and date_end\";\n\tif (!$this->sql_query($str_query)){\n return false;\n\t}\n\t\n return $this->fetch();\n }",
"public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}",
"public function getYearListEdtAppTr() \n {\t\t\n $this->db->select(\"to_char(th_date_from,'yyyy') as cm_year\");\n $this->db->from(\"ims_hris.training_head\");\n $this->db->where(\"th_status = 'APPROVE'\");\n $this->db->where(\"th_internal_external = 'EXTERNAL_AGENCY'\");\n $this->db->group_by(\"TO_CHAR(th_date_from,'YYYY'),th_date_from \");\n $this->db->order_by(\"TO_CHAR(th_date_from,'YYYY') desc\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }",
"public function scopeFilterByEndDate( $query )\n {\n $date = request() -> get( 'end_date' );\n\n if( $date )\n {\n try \n {\n $date = Carbon :: parse($date);\n $query -> whereDate( 'created_at', '<=', $date );\n }\n catch ( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function getYear() : string;",
"public function setYear(int $year)\n {\n $this->year = $year;\n\n return $this;\n }",
"function get_years () {\n global $db;\n $query = 'SELECT DISTINCT year FROM CalcBatting\n ORDER BY year ASC';\n $statement = $db->prepare($query);\n $statement->execute();\n $years = $statement->fetchAll();\n $statement->closeCursor();\n return $years;\n}",
"public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Calendar_Calendar_Model::getCleanInstance();\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}",
"function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }",
"public function showCurrentYearAction()\r\n {\r\n\t\t$startDate = date('Y-01-01');\r\n\t\t$endDate = date('Y-m-d');\r\n\t\t\r\n\t\t$period = ' - bieżący rok';\r\n\t\t\r\n\t\tstatic::show($startDate, $endDate, $period);\r\n }",
"public function filterByYear($year = null, $comparison = null)\n {\n if (is_array($year)) {\n $useMinMax = false;\n if (isset($year['min'])) {\n $this->addUsingAlias(MigrationPeer::YEAR, $year['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($year['max'])) {\n $this->addUsingAlias(MigrationPeer::YEAR, $year['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MigrationPeer::YEAR, $year, $comparison);\n }",
"public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}",
"function form_select_year($name, $year, $id='') {\n\n\tglobal $cache2;\n\n\t// are we dealing with timestamp\n\tif ($year > 10000) {\n\t\t$year = fetch_year($year);\n\t}\n\n\t$id = ifr($id, $name);\n\n\treturn form_select($name, $cache2->getCalendarData('years'), '', $year, '', '', '', '', '', $id);\n\n}",
"function find_dob_yr($year)\n {\n $this->db->_protect_identifiers = FALSE;\n\n return $this->db->select('name, nat, cat, dob_md')\n ->from('authors')\n ->join('nats', 'nats.id = authors.nat_id')\n ->join('cats', 'cats.id = authors.cat_id')\n ->where('dob_yr', $year)\n ->order_by(\"str_to_date(dob_md, '%M %E')\")\n ->get()->result();\n }",
"public function findPoids(){\n // $year=2013;\n $qb = $this->createQueryBuilder('p');\n //$qb->select('COUNT(p)')\n // $qb->select('p.id,p.publicationDateStart');\n // ->where('YEAR(p.publicationDateStart) = :year');\n // $qb->setParameter('year', $year);\n $arr=array();\n // ->getSingleScalarResult();\n//print_r($qb->getQuery()->getResult());\n // $arr[\"$year\"]=0;\n \nforeach ($qb->getQuery()->getResult() as $d){\n \n // echo $d['publicationDateStart']->format('Y-m-d H:i:s') . \"<br>\";\n // echo $d['publicationDateStart']->format('Y') . \"<br>\";\n $year=$d['publicationDateStart']->format('Y');\n if (!(isset($arr[\"$year\"]))) $arr[\"$year\"]=0;\n $arr[\"$year\"]=$arr[\"$year\"]+1;\n \n}\n//print_r($arr);\n//exit(1);\nreturn ($arr);\n// return $query->getResult();\n\n }",
"private function get_year_for_tables() {\n if (empty($this->courseid)) {\n return \\local_ousearch\\year_tables::get_year_for_tables(null);\n } else {\n return \\local_ousearch\\year_tables::get_year_for_tables(get_course($this->courseid));\n }\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"protected function setYearParameter($key, $value)\n {\n // normalize year to four digits\n if (null === $value || '' === $value) {\n $value = null;\n } else {\n $value = (int) gmdate('Y', gmmktime(0, 0, 0, 1, 1, (int) $value));\n }\n\n return $this->setParameter($key, $value);\n }",
"protected function getYears()\n {\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( $kinst )\n\t{\n\t $kinst = mysql_real_escape_string( trim( $kinst ) ) ;\n\t}\n\n\t$params = $_REQUEST['params'] ;\n\tif( $params )\n\t{\n\t $params = mysql_real_escape_string( trim( $params ) ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT d.YEAR\" ;\n\tif( $kinst && !$params )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t}\n\telse if( $params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( $params && $kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( !$params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t}\n\n\t$query .= \" ORDER BY d.YEAR ASC\" ;\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }",
"public function filterPublishDate(int $year, ?int $month): self;",
"public function getEventsYear(App\\Request $request)\n\t{\n\t\t$record = Vtiger_Calendar_Model::getInstance($request->getModule());\n\t\t$record->set('user', $request->getArray('user', 'Alnum'));\n\t\t$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));\n\t\tif ($request->has('start') && $request->has('end')) {\n\t\t\t$record->set('start', $request->getByType('start', 'DateInUserFormat'));\n\t\t\t$record->set('end', $request->getByType('end', 'DateInUserFormat'));\n\t\t}\n\t\tif ($request->has('filters')) {\n\t\t\t$record->set('filters', $request->getByType('filters', 'Alnum'));\n\t\t}\n\t\tif ($request->has('cvid')) {\n\t\t\t$record->set('customFilter', $request->getInteger('cvid'));\n\t\t}\n\t\t$entity = array_merge($record->getEntityYearCount(), $record->getPublicHolidays());\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult($entity);\n\t\t$response->emit();\n\t}",
"public function setScopeFilter($scope);",
"public function is_year()\n {\n }",
"public function scopeQuery($query)\n {\n // $query->where();\n }",
"protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }",
"public function index($year)\n\t{\n\t\t/**\n\t\t* get all places that have sowings in a specific year \n\t\t*/\n\t\t$places = Place :: whereHas('sowings', function($query) use ($year){\n\t\t\t$query->where('year','=',$year);\n\t\t})->get();\n\n\t\t$places->each(function($item) use($year){\n\t\t\t// var_dump($item);\n\t\t\t$item->sowings = $item->sowings->filter(function($item) use ($year){\n\t\t\t\treturn $item->year == $year;\n\t\t\t})->all();\n\t\t\t\n\t\t});\n\n\t\t$years = Sowing :: distinct('year')->pluck('year');\n\n\t\treturn view('sowings.index', compact('years','places'));\n\t}",
"public function getMinYearBuilt();",
"public function years()\n {\n // ->paginate();\n\n // $users = User::all()\n // ->paginate();\n $users = User::where('active','=','1')->where('yearofLeaving','=','%1969')->take(12)->get();\n\n return view('public.welcome', compact('users'));\n }",
"public function setYear($year = null): object\n {\n if (null !== $year && !($year instanceof FHIRString)) {\n $year = new FHIRString($year);\n }\n $this->_trackValueSet($this->year, $year);\n $this->year = $year;\n return $this;\n }",
"public function scopeCompany($query)\n {\n $query->where('company_id', auth()->user()->companyId());\n\n return $query;\n }"
]
| [
"0.6717753",
"0.66204214",
"0.65689147",
"0.6515127",
"0.6223272",
"0.60834014",
"0.6078936",
"0.59818345",
"0.59806234",
"0.5969172",
"0.5943821",
"0.59225196",
"0.5909758",
"0.58799654",
"0.58740884",
"0.58700824",
"0.5869165",
"0.58646554",
"0.5859319",
"0.58341163",
"0.5832598",
"0.5806387",
"0.5790443",
"0.578575",
"0.57666886",
"0.57492393",
"0.57095355",
"0.5695937",
"0.5691012",
"0.56774354",
"0.5632416",
"0.56237316",
"0.5616141",
"0.56108046",
"0.56032485",
"0.55825156",
"0.55810773",
"0.555945",
"0.5558488",
"0.5544712",
"0.5503166",
"0.5493103",
"0.5472901",
"0.54490596",
"0.5445612",
"0.5428323",
"0.5423543",
"0.5421381",
"0.5420908",
"0.54186434",
"0.5408151",
"0.5406266",
"0.5396342",
"0.539264",
"0.5371559",
"0.5363122",
"0.53609085",
"0.5351713",
"0.5348649",
"0.53405327",
"0.53321034",
"0.5313372",
"0.5311643",
"0.53097475",
"0.5309661",
"0.5309122",
"0.5307276",
"0.530529",
"0.5299511",
"0.5291046",
"0.5276053",
"0.52667785",
"0.52614653",
"0.52521557",
"0.5252086",
"0.52509606",
"0.52493674",
"0.52466995",
"0.523947",
"0.5231829",
"0.523166",
"0.523072",
"0.52276105",
"0.52176625",
"0.52163863",
"0.5208289",
"0.5200616",
"0.5197809",
"0.5193791",
"0.5192116",
"0.51908886",
"0.51680034",
"0.5166275",
"0.5162422",
"0.5144313",
"0.5143439",
"0.5143426",
"0.5140648",
"0.5132078",
"0.5127233"
]
| 0.79174125 | 0 |
Scope a query to filter by month | public function scopeMonth($query, $month)
{
return $query->whereMonth('created_at', $month);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeMonth($query,$filters){\n if($month = $filters['month']){\n $query->whereMonth('created_at', Carbon::parse($month)->month);\n }\n\n if($year = $filters['year']){\n $query->whereYear('created_at',$year);\n }\n\n }",
"public function scopeByMonth($query, $month)\n {\n $month = now()->month((Integer) $month);\n \n return $query\n ->whereDate('issue_date', '>=', $month->firstOfMonth())\n ->whereDate('issue_date', '<=', $month->endOfMonth());\n }",
"public function scopeOnCurrentMonth($query)\n {\n return $query->whereBetween('created_at', [\n Carbon::now()->startOfMonth(),\n Carbon::now()->endOfMonth(),\n ]);\n }",
"public function scopeThisMonth($query)\n {\n $now = Carbon::now();\n $thisMonth = strtoupper($now->format('M')); // JUN\n\n return $query->where([\n ['year', '=', $now->year],\n ['month_ABC', '=', $thisMonth],\n ])->get();\n\n //return $query->where('year', '=', $now->year)->where('month', '=', $now->month);\n }",
"public function scopeMonths($query) {\n\t\treturn $query->select(DB::raw('DISTINCT MONTH(user_log_timestamp) AS month'))\n ->orderBy('user_log_timestamp', 'asc');\n\t}",
"public function scopeFilter($query, $filters) {\n if( $month = $filters['month'] ) {\n\n // Carbon::parse($month)->month --> converts to month number. \n $query->whereMonth('created_at', Carbon::parse($month)->month );\n }\n\n if( $year = $filters['year'] ) {\n \n $query->whereYear('created_at', $year );\n }\n\n }",
"public function scopeEventsOfMonth(Builder $query, int $year, int $month) : Builder\n {\n return $query->whereMonth('starts_at', '=', $month)\n ->whereYear('starts_at', '=', $year)\n ->orderBy('starts_at', 'DESC');\n }",
"public function scopeStats($query, $month=false, $year=false){\n\n\t\t$query = $query->select( DB::raw('libraries.code as library,holdings.state as state , count(*) as count, sum(holdings.size) as size') )\n ->from('holdings')\n\t\t\t\t\t\t\t->join('states', function($join){ $join->on('holdings.id','=','states.holding_id')->on('states.state','=','holdings.state'); })\n\t\t\t\t\t\t\t->join('libraries','holdings.library_id','=','libraries.id')\n\t\t\t\t\t\t\t->groupBy('libraries.code', 'holdings.state');\n\n\t\tif ($month && $month!='*') $query = $query->where(DB::raw('extract(month from states.created_at)'),$month);\n\t\tif ($year && $year!='*') \t$query = $query->where(DB::raw('extract(year from states.created_at)'),$year);\n\n\t\treturn $query;\n }",
"public function filterPublishDate(int $year, ?int $month): self;",
"public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }",
"public function scopeMonthDailyPost($query)\n {\n return $query->selectRaw('DATE(created_at) AS date')\n ->selectRaw('COUNT(id) AS count')\n ->selectRaw('Count(CASE WHEN active = 1 THEN id END) AS CountActive')\n ->selectRaw('Count(CASE WHEN active = 2 THEN id END) AS CountInActive')\n ->selectRaw('Count(CASE WHEN active = 3 THEN id END) AS CountDraft')\n //->where('active', 1)\n //->whereBetween('created_at', [Carbon::now()->subDays(7)->format('Y-m-d'), Carbon::now()->format('Y-m-d')])\n ->where(DB::raw('DATE(created_at)'), '>=', Carbon::now()->subDays(7)->format('Y-m-d'))\n ->where(DB::raw('DATE(created_at)'), '<=', Carbon::now()->format('Y-m-d'))\n ->groupBy('date')\n ->orderBy('date', 'ASC');\n }",
"public function filterAction(Request $request) {\n $year = $request->query->get('year');\n $month = $request->query->get('month');\n\n $em = $this->getDoctrine()->getManager();\n $repo = $em->getRepository('AppBundle:Data');\n if(!empty($month)){ \n $datas = $repo->findBy(array('year' => $year, 'month' => $month));\n \n } else {\n $datas = $repo->findBy(array('year' => $year));\n }\n\n return compact('datas','year', 'month');\n\n }",
"function get_transaction_by_month($conds = array())\n\t{\n\t\t//print_r(\"asdfasd\" .$conds);die;\n\t\t$this->db->select('rt_transactions_counts.*'); \n \t\t$this->db->from('rt_transactions_counts');\n \t\t$this->db->where('month(added_date)',$conds['added_date']);\n \t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n\t\treturn $this->db->get();\n\t\t // print_r($this->db->last_query());die;\n\t}",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }",
"public static function select_count_by_current_month(){\n return DB::table('tb_order')\n ->whereRaw('month(datetime) = month(now()) and year(datetime) = year(now())', [])\n //->where('month(datetime)', 'month(now())')\n //->where('year(datetime)', 'year(now())')\n ->count();\n\t}",
"public function scopeBirthdays($query)\n { // 1st parameter is the database field name and the second parameter is the current month (formatted using carbon)\n return $query->whereMonth('birthday', now()->format('m'));\n }",
"function get_month_to_search() {\n global $DB;\n $sql = \"SELECT date AS fecha FROM {report_user_statistics};\";\n $dates = $DB->get_records_sql($sql);\n $result = array();\n foreach ($dates as $date) {\n $fecha = new DateTime(\"@$date->fecha\");\n $result[$fecha->format('m')] = month_converter($fecha->format('m'));\n }\n return $result;\n}",
"public function searchMonth(Request $request){\n $result = Order::with('customer')->where('order_month',$request->order_month)->where('order_year',$request->order_year)->latest()->get();\n return response()->json($result);\n\n }",
"protected function whereMonth(Builder $query, $where)\n {\n return $this->dateBasedWhere('month', $query, $where);\n }",
"public function searchActiveCelebritiesWorldMonth($year = 2015, $month = 1)\n {\t\n\t\t\n\t\t$intervalStart = $year .'-' . sprintf(\"%02d\", $month) . '-01 00:00:00';\n\t\t$intervalEnd = $year .'-' . sprintf(\"%02d\", $month) . '-31 23:59:59';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n\t\t$dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }",
"public function yearMonth($year = null, $month = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }",
"function this_month()\n{\n global $db; // golbalize db variable:\n $thisMonth = array(\n \"start\" => date('Y-m-d', strtotime('first day of this month', strtotime(date('Y-m-d')))),\n \"end\" => date('Y-m-d', strtotime('last day of this month', strtotime(date('Y-m-d'))))\n );\n $datesIds = $db->getMany(DATES, [\n 'date' => $thisMonth['start'],\n 'dates.date' => $thisMonth['end']\n ], ['id', 'date'], ['date' => '>=', 'dates.date' => '<=']);\n\n if ($db->count > 0) {\n return $datesIds;\n }\n}",
"public function filterByMonth($month = null, $comparison = null)\n {\n if (is_array($month)) {\n $useMinMax = false;\n if (isset($month['min'])) {\n $this->addUsingAlias(MigrationPeer::MONTH, $month['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($month['max'])) {\n $this->addUsingAlias(MigrationPeer::MONTH, $month['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MigrationPeer::MONTH, $month, $comparison);\n }",
"public function scopeYearlyPost($query)\n {\n return $query->selectRaw('year(created_at)')->groupBy('year(created_at)')->orderByDesc('year(created_at)');\n }",
"function index(){\n\n\n $where = \"MONTH( reservation_startdate ) = MONTH( NOW() ) AND reservation_status = 'Approved'\";\n\n $reservation = where( 'reservations', $where );\n\n return view( 'admin/reservation/reservation', compact( 'reservation' ));\n}",
"public function searchActiveContinentMonth($continent = false, $year = 2015, $month = 1)\n {\n\n\t\t$intervalStart = $year .'-' . sprintf(\"%02d\", $month) . '-01 00:00:00';\n\t\t$intervalEnd = $year .'-' . sprintf(\"%02d\", $month) . '-31 23:59:59';\n\t\t\n\t\t$query = ArtistPlan::find()->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->where('artistplan.show_status = :status') \n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime]);\n\t\t\n\t\t$query->addParams([':status' => 1]); \n\t\t\n\t\tif ($continent) {\n\t\t\t$query->andWhere(\"continent = :continent\");\n\t\t\t$query->addParams([':continent' => $this->getContinentName($continent)]); \n\t\t}\n\t\t\n\t\t$query->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }",
"public function month($column, $month, $boolean = 'and', $not = false)\r\n {\r\n return $this->where_assoc(array('month('.$column.')' => $month), $boolean, $not);\r\n }",
"public function scopePreviousMonth($query)\n {\n return $query\n ->whereDate('issue_date', '>=', now()->subMonth()->firstOfMonth())\n ->whereDate('issue_date', '<', now()->firstOfMonth());\n }",
"public function get_transaction_by_month($date){\n $this->load->database();\n\n $query = $this->db->select('date,type,is_of,amount')\n ->get_where('tbl_transactions',array('left(date,7)' => $date));\n return $query->result_array();\n }",
"public function getMomentsByMonth() {\n\t\ttry {\n\t\t\t$timezone = \\Auth::User()->station->getStationTimezone();\n\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$date = Carbon::now($timezone);\n\n\t\t\t$year_start = $date->copy()->startOfMonth()->subMonths(12);\n\n\t\t\t//If station is Nova we want to start at March 11 since this is when we launched with them\n\t\t\tif(\\Auth::User()->station->id == 8 && $year_start->lt(Carbon::parse('2016-03-11'))) {\n\t\t\t\t$year_start = Carbon::parse('2016-03-11');\n\t\t\t}\n\t\t\t$year_end = $date;\n\n\t\t\t$moments = \\DB::table('airshr_events')\n\t\t\t\t->select(\\DB::raw('MONTH(FROM_UNIXTIME(record_timestamp)) AS month, \n\t\t\t\tYEAR(FROM_UNIXTIME(record_timestamp)) AS year,\n\t\t\t\tWEEK(FROM_UNIXTIME(record_timestamp)) as week, \n\t\t\t\tCOUNT(*) as count'))\n\t\t\t\t->where('station_id', '=', \\Auth::User()->station->id)\n//\t\t\t\t->where('event_data_status', '=', 1)\n\t\t\t\t->where('record_timestamp', '>=', $year_start->timestamp)\n\t\t\t\t->where('record_timestamp', '<=', $year_end->timestamp)\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets seconds since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\") // We then compare the hours from midnight to check if it is between the hours we want\n\t\t\t\t->groupBy('week')\n\t\t\t\t->orderBy('year')\n\t\t\t\t->orderBy('month')\n\t\t\t\t->orderBy('week')\n\t\t\t\t->get();\n\n\t\t\t$total_moments = 0;\n\t\t\t$moments_this_month = 0;\n\n\t\t\tforeach($moments as $moment) {\n\t\t\t\t$total_moments += $moment->count;\n\t\t\t\tif($moment->month == $date->month && $moment->year == $date->year) {\n\t\t\t\t\t$moments_this_month += $moment->count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0,\n\t\t\t\t'moments' => $moments,\n\t\t\t\t'moments_this_month' => $moments_this_month,\n\t\t\t\t'total_moments' => $total_moments\n\t\t\t\t));\n\t\t\t\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"public function scopeLastMonth($query, $limit = 5)\n {\n return $query->whereBetween('posted_at', [Carbon::now()->subMonth(), Carbon::now()])\n ->latest()\n ->limit($limit);\n }",
"public function scopeMun($query,$name,$idMun){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",\"$idMun\");\n\n // }\n }",
"function thismonth(){\n\n $where = \"MONTH( reservation_startdate ) = MONTH( NOW() )\";\n\n $reservation = where( 'reservations', $where );\n\n echo json_encode( $reservation );\n exit;\n}",
"public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}",
"public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }",
"public function ajax_get_reports_by_month() {\n $month = $this->input->post('month');\n $month = (!empty($month))? $month: date('Y-m');\n\n $data['month'] = (!empty($month))? date('F', strtotime($month)): date('F');\n $data['month_digit'] = (!empty($month))? date('Y-m', strtotime($month)): date('Y-m');\n\n $data['result'] = $this->Report_Model->get_membership_payments($month . '-%');\n\n echo json_encode($data);\n }",
"public function scopeFilterByEndDate( $query )\n {\n $date = request() -> get( 'end_date' );\n\n if( $date )\n {\n try \n {\n $date = Carbon :: parse($date);\n $query -> whereDate( 'created_at', '<=', $date );\n }\n catch ( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public static function getMonth() {\n\n return Model\\Event::whereMonth('start_date', '=', date('n'))\n ->orderBy('start_date', 'desc')\n\t\t\t\t\t\t ->take(3)\n ->get();\n\n }",
"function searchmonthresultnow($mon)\n {\n $this->db->select('order.*,users.*,order.id as oid,file.*,package.*,cities.*,order.amount as am,guest.firstname as fr,guest.lastname as lr');\n $this->db->from('order');\n $this->db->join('package', 'package.id = order.package', 'left');\n $this->db->join('orderguest', 'orderguest.orderid = order.id', 'left');\n $this->db->join('guest', 'guest.id = orderguest.guest', 'left');\n $this->db->join('users', 'order.bookedby = users.id', 'left');\n $this->db->join('userprofile', 'userprofile.useid = users.id', 'left');\n $this->db->join('cities', 'cities.c_id = package.location', 'left');\n $this->db->join('file', 'file.id = userprofile. profilepic', 'left');\n $this->db->where('MONTH(order.orderplacedate)', $mon);\n // $this->db->order_by(\"order.orderplacedate\", \"desc\");\n $this->db->where('order.user_cancel', null); $this->db->where('order.admin_cancel', null);\n $query = $this->db->get();\n $row = $query->result_array();\n return $row;\n }",
"function Monthly_Requests($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year, DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }",
"public function findOneByMonth(\\DateTime $date);",
"public function scopeYear($query, $year)\n {\n return $query->whereYear('created_at', $year);\n }",
"public function scopeListaMun($query,$name,$idMun){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",\"$idMun\");\n\n // }\n }",
"public function scopeWithinPeriod(Builder $query, Period $period);",
"public function actionPostedInMonth()\n {\n $criteria=new CDbCriteria;\n $criteria->condition='status='.Post::STATUS_PUBLISHED.' AND t.publishTime<'.time();// MFM 1.1 migration Post to t.publishTime\n $criteria->order='createTime DESC';\n\n $criteria->condition.=' AND createTime > :time1 AND createTime < :time2';\n\n\tif (isset($_GET['month']))\n\t{\n\t\t$month = intval($_GET['month']);\n\t\t$year = intval($_GET['year']);//\tvar_dump($_GET); echo $month.\"#\".$year.\"<br/>\";\n\t}\n\tif (isset($_GET['time']))\n\t{\n\t\t$month = date('n', $_GET['time']);\n\t\t$year = date('Y', $_GET['time']);\t//\tvar_dump($_GET); echo $month.\"#\".$year.\"<br/>\";\n\t}\n\n if ($_GET['pnc'] == 'n') $month++;\n if ($_GET['pnc'] == 'p') $month--;\n $criteria->params[':time1']= $firstDay = mktime(0,0,0,$month,1,$year);\n $criteria->params[':time2']= mktime(0,0,0,$month+1,1,$year);\n\n $pages=new CPagination(Post::model()->count($criteria));\n $pages->pageSize=Yii::app()->params['postsPerPage'];\n $pages->applyLimit($criteria);\n\n $models=Post::model()->findAll($criteria);\n// $models=Post::model()->with('author')->findAll($criteria);\n\n $this->pageTitle=Yii::t('lan','Posts Issued on').' \"'.Yii::t('lan',date('F',$firstDay)).date(', Y',$firstDay).'\"';\n $this->render('month',array(\n 'posts'=>$models,\n 'pages'=>$pages,\n 'firstDay'=> $firstDay,\n ));\n }",
"public function scopeBuscarMedicamento($query, $medicamento)\n {\n \tif (trim($medicamento) != \"\") {\n \t\t $query->where(\\DB::raw(\"CONCAT(nombre_comercial, ' ', nombre_compuesto, ' ', num_etiqueta, ' ', num_folio, ' ', anio_caducidad, ' ', mes_caducidad, ' ', dosis, ' ', solucion_tableta, ' ', tipo_contenido)\"), 'LIKE', \"%$medicamento%\");\n \t}\n }",
"function Monthly_Requests_Pending($year) {\r\n $query2 = $this->db->query(\"SELECT MONTHNAME(designation_date) as month, YEAR(designation_date) as year,DATE_FORMAT(designation_date, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM request\r\n WHERE DATE_FORMAT(designation_date, '%Y') = '$year' AND assign_status = '0'\r\n GROUP BY MONTHNAME(designation_date)\r\n ORDER BY MONTH(designation_date) ASC\");\r\n\r\n return $result = $query2->result();\r\n }",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopePublishedAfter($query, $date)\n {\n $query->where('created_at', '>=', $date);\n }",
"public function actionPostedInMonth()\n {\n\n $month = date('n', $_GET['time']); // 1 through 12\n $year = date('Y', $_GET['time']); // 2011\n if (isset($_GET['pnc'] ) && $_GET['pnc'] == 'n') $month++;\n if (isset($_GET['pnc'] ) && $_GET['pnc'] == 'p') $month--;\n\n $query=Article::find()->where(['status' =>Article::STATUS_ENABLED ])\n ->andWhere(['>','created_at',($firstDay = mktime(0,0,0,$month,1,$year))])\n ->andWhere(['<','created_at',(mktime(0,0,0,$month+1,1,$year))])\n ->orderBy('updated_at DESC');\n\n $pages = new Pagination(['totalCount' => $query->count()]);\n\n $pages->pageSize = \\Yii::$app->params['monthlyArchivesCount'];\n\n $materials = $query->offset($pages->offset)\n ->limit($pages->limit)\n ->all();\n\n return $this->render('month',array(\n 'materials' => $materials,\n 'pages' => $pages,\n 'firstDay' => $firstDay,\n ));\n }",
"function sales_report_month($month){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('MONTH(sales.SALES_DATE)', $month['MONTH']);\n \t\t$this->db->where('YEAR(sales.SALES_DATE)', $month['YEAR']);\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}",
"public function scopeStarted($query) {\n $query->where('start_date', '<=', Carbon::now());\n }",
"public function scopePublished($query)\n {\n return $query->where('status', '=', '1')\n ->whereDate('published_at', '<=', Carbon::today()->toDateString());\n }",
"function\nquery_for_month($language, $target_area, $season, $start_date, $stop_date, $freeze_date, $status)\n{\n $obs_query = \"SELECT ob.frequency, ob.\\\"date\\\", ob.\\\"time\\\", ob.o\"\n .\" FROM parsed_observations ob JOIN ms_use ms USING (stn)\"\n .\" WHERE status='$status'\"\n .\" AND ob.\\\"date\\\" BETWEEN '$start_date' AND '$stop_date'\"\n \t .\" AND ob.\\\"language\\\" = '$language' AND ms.\\\"language\\\" = '$language'\";\n if($freeze_date != \"\")\n $obs_query .= \" AND ob.row_timestamp <= TIMESTAMP '$freeze_date'\";\n\n // this sub query returns the sla targets for the ta, language and month\n $sla_query =\n \"SELECT start_time, min(target) AS target, primary_frequency, secondary_frequency FROM sla\"\n .\" WHERE season = '$season'\".\" AND target_area = '$target_area'\"\n .\" AND valid_from <= '$stop_date'\"\n .\" AND(valid_to IS NULL OR valid_to >= '$start_date')\"\n .\" AND \\\"language\\\" = '$language'\"\n .\" GROUP BY start_time, primary_frequency, secondary_frequency\";\n\n // this sub query collects the obervations into the sla bins and finds the max score for each bin\n return\n \" SELECT s.start_time, target, o.\\\"date\\\", max(o.o) AS o\"\n .\" FROM($sla_query) AS s LEFT JOIN($obs_query) AS o\"\n .\" ON o.\\\"time\\\" BETWEEN s.start_time AND(s.start_time + '00:30:00'::interval)\"\n .\" WHERE (o.frequency = ANY(s.primary_frequency) OR o.frequency = ANY(s.secondary_frequency))\"\n .\" GROUP BY s.start_time, s.target, o.\\\"date\\\"\";\n}",
"public function scopebyDate($query, Array $dateRange)\n {\n if (count($dateRange) != 2) {\n return $query;\n }\n\n $dateStart = $dateRange[0];\n $dateEnd = $dateRange[1];\n \n return $query\n ->whereDate('issue_date', '>=', $dateStart)\n ->whereDate('issue_date', '<=', $dateEnd);\n }",
"public function scopeQuery($query)\n {\n // $query->where();\n }",
"function searchmonthresult($mon, $loc)\n {\n $this->db->select('order.*,users.*,order.id as oid,file.*,package.*,cities.*,order.amount as am,guest.firstname as fr,guest.lastname as lr');\n $this->db->from('order');\n $this->db->join('package', 'package.id = order.package', 'left');\n \n\t\n $this->db->join('orderguest', 'orderguest.orderid = order.id', 'left');\n $this->db->join('guest', 'guest.id = orderguest.guest', 'left');\n $this->db->join('users', 'order.bookedby = users.id', 'left');\n\t\t\n\t\t\n $this->db->join('userprofile', 'userprofile.useid = users.id', 'left');\n $this->db->join('cities', 'cities.c_id = package.location', 'left');\n $this->db->join('file', 'file.id = userprofile. profilepic', 'left');\n $this->db->where('package.location', $loc);\n $this->db->where('MONTH(order.orderplacedate)', $mon);\n // $this->db->order_by(\"order.orderplacedate\", \"desc\");\n $this->db->where('order.admin_cancel', null);\n\t\t $this->db->where('order.user_cancel', null);\n $query = $this->db->get();\n $row = $query->result_array();\n return $row;\n }",
"public function scopeGetReportOrganisationBreakDown($query, $request){\n $is_org_stat = true;\n $from = \"\";\n $to = \"\";\n $now = \"\";\n $inc_raw = \"\";\n $stat_array = [\n 'is_org_stat' => false\n ];\n\n $is_org_stat = ( isset( $request['type'] ) && $request['type'] == 'org_stat' ) ? true : false;\n\n /* if ( isset( $request['type'] ) && $request['type'] == 'org_stat' ) {\n $is_org_stat = true;\n\n if ( ! empty( $request['from'] ) && ! empty( $request['to'] ) ) {\n $from = Carbon::parse( $request['from'] )->toDateString();\n $to = Carbon::parse( $request['to'] )->toDateString();\n\n $inc_raw = \" AND lead_escalations.created_at BETWEEN '$from 00:00:01' AND '$to 23:59:59'\";\n\n $stat_array = [\n 'from' => $from,\n 'to' => $to,\n 'where_type' => 'between',\n 'is_org_stat' => true\n ];\n\n } else if ( isset( $request['days'] ) && $request['days'] !== NULL ) {\n $days = $request['days'];\n $now = Carbon::now()->subDays( intval( $days ) )->toDateString();\n\n $inc_raw = \" AND lead_escalations.created_at >= '$now 00:00:01'\";\n\n $stat_array = [\n 'now' => $now,\n 'where_type' => 'days',\n 'is_org_stat' => true\n ];\n }\n } */\n\n $months = [ Carbon::now(), Carbon::now()->subMonths( 1 ), Carbon::now()->subMonths( 2 ), Carbon::now()->subMonths( 6 ) ];\n $months_format = [\n 'month_' . strtolower( Carbon::now()->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 1 )->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 2 )->format( 'M' ) ),\n 'month_' . strtolower( Carbon::now()->subMonths( 6 )->format( 'M' ) ),\n ];\n $_months = [];\n\n foreach( $months as $_index => $month ) {\n if ( $_index + 1 == 4 ) {\n\n $from = $month->firstOfMonth()->toDateString() . ' 00:00:01';\n $to = $months[0]->endOfMonth()->toDateString() . ' 23:59:59';\n\n } else {\n\n $from = $month->firstOfMonth()->toDateString() . ' 00:00:01';\n $to = $month->endOfMonth()->toDateString() . ' 23:59:59';\n\n }\n\n $new_inc_raw = \" AND lead_escalations.created_at BETWEEN '$from' AND '$to'\";\n array_push( $_months, $new_inc_raw );\n }\n\n $query\n ->leftJoin('leads', function($join) use($request){\n $join->on('lead_escalations.lead_id', '=', 'leads.id');\n })\n ->leftJoin('organisations', function($join) use($stat_array){\n $join->on('lead_escalations.organisation_id', '=', 'organisations.id')\n ->whereNull('lead_escalations.deleted_at');\n // ->where('lead_escalations.is_active', 1);\n })\n ->leftJoin('addresses', function($join){\n $join->on('organisations.address_id', '=', 'addresses.id');\n })\n ->leftJoin('users', function($join){\n $join->on('organisations.user_id', '=', 'users.id');\n })\n ->select('lead_escalations.organisation_id', 'organisations.name', 'organisations.metadata', 'organisations.priority','addresses.state', 'organisations.org_code', 'organisations.contact_number', 'users.email',\n // \\DB::raw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // GROUP BY lead_escalations.organisation_id) as lead_count\n // \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n GROUP BY lead_escalations.organisation_id) as lead_count\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[0]\n GROUP BY lead_escalations.organisation_id) as {$months_format[0]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[1]\n GROUP BY lead_escalations.organisation_id) as {$months_format[1]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[2]\n GROUP BY lead_escalations.organisation_id) as {$months_format[2]}\n \"),\n \\DB::raw(\"\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.deleted_at IS NULL\n $_months[3]\n GROUP BY lead_escalations.organisation_id) as month_six\n \"),\n )\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level = 'Won'\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as won_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level = 'Won'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as won_count\n \")\n ->selectRaw(\"\n (SELECT ( SUM(IFNULL(lead_escalations.gutter_edge_meters, 0)) + SUM(IFNULL(lead_escalations.valley_meters, 0)) ) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1\n AND lead_escalations.escalation_level = 'Won' AND deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id) as installed_meters\n \")\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level = 'Lost'\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as lost_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level = 'Lost' AND lead_escalations.escalation_status = 'Lost'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as lost_count\n \")\n // ->selectRaw(\"\n // (SELECT COUNT(*) FROM lead_escalations\n // WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n // AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n // $inc_raw\n // GROUP BY lead_escalations.organisation_id) as unallocated_count\n // \")\n ->selectRaw(\"\n (SELECT COUNT(*) FROM lead_escalations inner join\n leads on leads.id = lead_escalations.lead_id\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and leads.deleted_at IS NULL and leads.customer_type = 'Supply & Install'\n AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n $inc_raw\n GROUP BY lead_escalations.organisation_id) as unallocated_count\n \")\n ->selectRaw(\"\n CASE\n WHEN lead_escalations.escalation_level = 'Won' THEN 'Won'\n WHEN lead_escalations.escalation_level = 'Lost' THEN 'Lost'\n ELSE 'Unresolved'\n END AS status\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((count(organisations.id)\n /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id) * 100)),2),'%') as percent\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Won'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_won\n\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Lost'\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_lost\n\n \")\n ->selectRaw(\"\n CONCAT(FORMAT(((SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level NOT IN ('Lost', 'Won')\n $inc_raw\n GROUP BY lead_escalations.organisation_id) /\n (SELECT COUNT(*) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n GROUP BY lead_escalations.organisation_id)*100),2),'%') as percent_unallocated\n\n \")\n ->selectRaw(\"\n (SELECT ( SUM(IFNULL(lead_escalations.gutter_edge_meters, 0)) + SUM(IFNULL(lead_escalations.valley_meters, 0)) ) FROM lead_escalations\n WHERE lead_escalations.organisation_id = organisations.id AND lead_escalations.is_active = 1 and deleted_at IS NULL\n AND lead_escalations.escalation_level = 'Won'\n GROUP BY lead_escalations.organisation_id) as installed_metersff\n \")\n ->whereIn('addresses.state', ['ACT', 'NSW', 'NT', 'QLD', 'SA', 'TAS', 'VIC', 'WA', ''])\n //->orWhereNull('addresses.state')\n ->where(function($q) use($request, $is_org_stat){\n\n if ( ! $is_org_stat ) {\n $q->where('is_active', 1);\n if (isset($request['state'])) {\n $state = $request['state'];\n //if all state dont query address state\n if ($request['state'] != 'All States') {\n $q->where('addresses.state', $state);\n }\n }\n\n if (isset($request['keyword'])) {\n $q->orWhere('name', 'like', '%' . $request['keyword'] . '%');\n $q->orWhere('addresses.state', 'like', '%' . $request['keyword'] . '%');\n }\n\n //query date between from and to\n if (isset($request['from']) && isset($request['to'])) {\n $from = date('Y-m-d', strtotime($request['from']));\n $to = date('Y-m-d', strtotime($request['to']));\n\n $q->whereBetween(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), [$from, $to]);\n }\n //query date by from to greater\n else if (isset($request['from'])) {\n $from = date('Y-m-d', strtotime($request['from']));\n $q->where(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), '>=', $from);\n }\n //query date by to less than\n else if (isset($request['to'])) {\n $to = date('Y-m-d', strtotime($request['to']));\n $q->where(\\DB::raw('DATE_FORMAT(lead_escalations.created_at, \"%Y-%m-%d\")'), '<=', $to);\n }\n\n } else {\n $q->whereIn( 'organisations.id', $request['ids'] );\n }\n })\n ->whereNotNull('name')\n // ->where('lead_escalations.is_active', 1)\n ->groupBy('status')\n ->groupBy('organisations.id')\n ->orderBy('organisations.name', 'asc');\n\n return $query;\n }",
"public function view_ambassador_single_month_runs($id,$month,Request $request){\n $ambassador = User::find($id);\n if($ambassador && ((Auth::user()->ambassadors->count() && Auth::user()->ambassadors->where('ambassador_user_id',$ambassador->id)->first()) || $ambassador->id == Auth::id())){\n $start_date = isset($request->start_date) && $request->start_date ? $request->start_date : date('Y-m-01',strtotime('01-'.$month));\n $end_date = isset($request->end_date) && $request->end_date ? $request->end_date : date('Y-m-t',strtotime('01-'.$month));\n $ambassador_runs = AmbassadorRun::where('user_id',$id)\n ->when(($start_date), function($query) use ($start_date) {\n if($start_date){\n $query->whereDate('date','>=',$start_date);\n }\n })->when(($end_date), function($query) use ($end_date) {\n if($end_date){\n $query->whereDate('date','<=',$end_date);\n }\n })->when(($request->range_start), function($query) use ($request) {\n if($request->range_start){\n $query->where('distance','>=',$request->range_start);\n }\n })->when(($request->range_end), function($query) use ($request) {\n if($request->range_end){\n $query->where('distance','<=',$request->range_end);\n }\n })->orderBy('date','DESC')->get();\n\n return view('ambassadors.view-ambassador-single-month-detail',compact('ambassador','ambassador_runs','month'));\n\n }else{\n abort(404);\n }\n\n }",
"public function search($currentMonth = false)\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n $criteria->order = 'Fecha DESC';\n\t\t$criteria->compare('Gid',$this->Gid);\n\t\t$criteria->compare('Fecha',$this->Fecha,true);\n\t\t$criteria->compare('t.Descripcion',$this->Descripcion,true);\n\t\t$criteria->compare('Monto',$this->Monto,true);\n $criteria->compare('IdUsuario', Yii::app()->user->getId());\n if ($currentMonth) {\n //we want just the list of the current month in the index action\n $now = New DateTime();\n $current_date_first_day_of_month = $now->format('Y-m') . '-01';\n $db_compare_date = new CDbExpression(\"'$current_date_first_day_of_month'\");\n $criteria->addCondition(\"Fecha >= $db_compare_date\");\n \n //and we add the filter by category\n $cat_table = Categoria::model()->tableName();\n $criteria->join = \"LEFT JOIN $cat_table c ON t.IdCategoria = c.Cid\";\n $criteria->compare('c.Descripcion',$this->_categoryDescription, true);\n }\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 20),\n\t\t));\n\t}",
"public function scopeMovimientos($query, $condicion)\n {\n //de esta manera se obtienen como tipo json para llenar los registros con jquery\n return $query->whereRaw($condicion)->orderBy('id', 'asc')->get();\n }",
"function obtain_invested_means_first_period_month($acc_number)\n\t{\n\t return $this->db->select()\n\t\t ->from('pamm_clients_statement') \n\t\t ->where(\"pamm_clients_stat_acc_number\",$acc_number)\n\t\t ->where(\"pamm_clients_stat_date < date_sub(curdate(),INTERVAL 30 DAY)\")\n\t\t ->get()->result();\n\t}",
"public function scopeFilterPaid($query)\n {\n return $query->where('pay_cycle_id', null);\n }",
"public function getSalesByMonth()\n {\n\n $dataPoints = DB::select('SELECT date_format(created_at, \\'%Y\\') as year, date_format(created_at, \\'%m\\') as month, count(id) as pocount, sum(total) as monthtotal from purchase_orders group by date_format(created_at, \\'%Y-%m\\')');\n\n\n return response()->json($dataPoints);\n\n }",
"public function takePostBaseOnMonth();",
"public function getTotalMonthPaginate()\n {\n $today = Carbon::now()->toDateString();\n $timezone = new Carbon();\n $last_thirty_days = $timezone->subDays(30);\n\n return $this->appUser->whereBetween('date_created', array($last_thirty_days, $today))->orderByRaw(\"FIELD(status , 'Approved', 'Disabled', 'Blocked') ASC\")->paginate(10);\n }",
"public function scopeBetweenDates($query, $from, $to)\n {\n return $query->whereBetween('date', [$from, $to]);\n }",
"public function monthly_sales_report()\n\t{\n\t\t$query1 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tdate,\n\t\t\t\tEXTRACT(MONTH FROM date) as month, \n\t\t\t\tCOUNT(invoice_id) as total\n\t\t\tFROM \n\t\t\t\tinvoice\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\t$query2 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tpurchase_date,\n\t\t\t\tEXTRACT(MONTH FROM purchase_date) as month, \n\t\t\t\tCOUNT(purchase_id) as total_month\n\t\t\tFROM \n\t\t\t\tproduct_purchase\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM purchase_date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM purchase_date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\treturn [$query1,$query2];\n\t}",
"public function get_month_choices()\n {\n }",
"function Monthly_Requests_Assignment($year) {\r\n $query2 = $this->db->query(\"SELECT DISTINCT(labref), MONTHNAME(date_issued) as month, YEAR(date_issued) as year,DATE_FORMAT(date_issued, '%m') as m,\r\n COUNT(id) as 'total'\r\n FROM sample_details\r\n WHERE DATE_FORMAT(date_issued, '%Y') = '$year' \r\n AND activity='Analysis'\r\n GROUP BY MONTHNAME(date_issued)\r\n ORDER BY MONTH(date_issued) ASC\");\r\n\r\n return $result = $query2->result();\r\n }",
"public function scopeByLocale($query, $locale)\n {\n return $query->where('locale', $locale);\n }",
"function reportOpenedResultsPerMonth($ReportCondition = '1')\r\n{\r\n return reportPerDBColoumn('ResultInfo', \"DATE_FORMAT(OpenedDate, '%y-%m')\", $ReportCondition, '', 'OpenedDate ASC');\r\n}",
"public function scopePublished($query) {\n return $query->where('published_at', '<=', now());\n }",
"public function scopeOndate($query, $variable)\n\t{\n\t\tif(!is_array($variable))\n\t\t{\n\t\t\treturn $query->where('created_at', '<=', date('Y-m-d H:i:s', strtotime($variable)))->orderBy('created_at', 'desc');\n\t\t}\n\n\t\tif(!strtotime($variable[1]) && strtotime($variable[0]))\n\t\t{\n\t\t\treturn $query->where('created_at', '<=',date('Y-m-d H:i:s', strtotime($variable[0])));\n\t\t}\n\n\t\treturn $query->where('created_at', '>=', date('Y-m-d H:i:s', strtotime($variable[0])))->where('created_at', '<=', date('Y-m-d H:i:s', strtotime($variable[1])))->orderBy('created_at', 'asc');\n\t}",
"public static function get_events_by_month($date, $limit = NULL, $offset = NULL)\n\t{\n\t\t//$month = ($month % 12 != -1) ? $month % 12 : 12;\n\t\n\t\t//$date = mktime(12, 0, 0, $month, 1, date('Y') + $year);\n\n\t\t$query = Jelly::select('event')\n\t\t ->where('status', '=', 'active')\n\t\t ->where('deleted', '=', NULL)\n\t\t ->where(DB::expr('MONTH(start_date)'), '=', date('m', $date))\n\t\t ->where(DB::expr('YEAR(start_date)'), '=', date('Y', $date))\n\t\t ->or_where(DB::expr('MONTH(end_date)'), '=', date('m', $date))\n\t\t ->where(DB::expr('YEAR(end_date)'), '=', date('Y', $date))\n\t\t ->order_by('start_date', 'ASC');\n\t\t\n\t\tif ($limit)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\t\t\n\t\tif ($offset)\n\t\t{\n\t\t\t$query->offset($offset);\n\t\t}\t\t\n\t\n\t\treturn $query->execute();\n\t}",
"public function yearMonthState($year = null, $month = null, $state = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereHas('venue.city.states', function ($query) use ($state) {\n $query->where('abbr', strtoupper($state));\n })\n ->whereYear('start_date', $year)\n ->whereMonth('start_date', $month)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }",
"public function scopeInFuture($query){\n return $query->where('end','>=', date('Y-m-d H:i:s'));\n }",
"public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }",
"public function filteredByDate(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->whereBetween('created_at',[Date(\"Y-m-d\", $request->start/1000).\" 00:00:00\", Date(\"Y-m-d\", $request->end/1000).\" 23:59:59\"])\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }",
"function getResultForMonthlyRegistered(){\n global $mysqli;\n\n $sql = \"SELECT DATE_FORMAT(u.register_date, '%M') as \\\"month\\\",\n EXTRACT(YEAR from u.register_date) as \\\"year\\\" ,\n count(*) as \\\"registered users\\\" \n FROM users u \n group by month, year \n HAVING year = 2020\n order by FIELD(month,'January','February','March','April','May','June','July','August','September','October','November','December')\";\n\n $result = $mysqli->query($sql);\n return $result->fetch_all(MYSQLI_ASSOC);\n}",
"public function onMonth($month)\n {\n $this->month = $month;\n return $this;\n }",
"public function scopeWithinRange($query, $start, $end)\n {\n return $query->whereDate('metadata_order.value', '>=', $start)\n ->whereDate('metadata_order.value', '<=', $end);\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter first_name\n if ($request->has('first_name')) {\n $query->where('first_name', 'like', \"%{$request->get('first_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('first_name')}%\");\n }\n // filter first_name\n if ($request->has('last_name')) {\n $query->where('first_name', 'like', \"%{$request->get('last_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('last_name')}%\");\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_active',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function getDataMonth()\n {\n return $this->model()->where('created_at', '>=', Carbon::now()->startOfMonth())->get();\n }",
"function query($group_by = FALSE) {\n\n // @TODO Not doing anything with $group_by yet, need to figure out what has to be done.\n\n if ($this->date_forbid()) {\n return;\n }\n\n // See if we need to reset granularity based on an argument value.\n // Make sure we don't try to reset to some bogus value if someone has typed in an unexpected argument.\n $granularity = $this->date_handler->arg_granularity($this->argument);\n if (!empty($granularity)) {\n $this->date_handler->granularity = $granularity;\n $this->format = $this->date_handler->views_formats($this->date_handler->granularity, 'display');\n $this->sql_format = $this->date_handler->views_formats($this->date_handler->granularity, 'sql');\n }\n $this->granularity = $this->date_handler->granularity;\n $this->ensure_my_table();\n $group = !empty($this->options['date_group']) ? $this->options['date_group'] : 0;\n\n // If requested, add the delta field to the view so we can later find the value that matched our query.\n if (!empty($this->options['add_delta']) && (substr($this->real_field, -6) == '_value' || substr($this->real_field, -7) == '_value2')) {\n $this->query->add_field($this->table_alias, 'delta');\n $real_field_name = str_replace(array('_value', '_value2'), '', $this->real_field);\n $this->query->add_field($this->table_alias, 'entity_id', 'date_id_' . $real_field_name);\n $this->query->add_field($this->table_alias, 'delta', 'date_delta_' . $real_field_name);\n }\n\n $format = $this->date_handler->granularity == 'week' ? DATE_FORMAT_DATETIME : $this->sql_format;\n $view_min = date_format($this->min_date, $format);\n $view_max = date_format($this->max_date, $format);\n $view_min_placeholder = $this->placeholder();\n $view_max_placeholder = $this->placeholder();\n $this->date_handler->placeholders = array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max);\n\n // Are we comparing this field only or the Start/End date range to the view criteria?\n if (!empty($this->options['use_fromto'])) {\n\n // The simple case, match the field to the view range.\n $field = $this->date_handler->sql_field($this->table_alias . '.' . $this->real_field, NULL, $this->min_date);\n $field = $this->date_handler->sql_format($format, $field);\n $this->query->add_where_expression($group, \"$field >= $view_min_placeholder AND $field <= $view_max_placeholder\", array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max));\n\n }\n else {\n\n // Look for the intersection of the range of the date field with the range of the view.\n // Get the Start/End values for this field. Retrieve using the original table name.\n // Swap the current table name (adjusted for relationships) into the query.\n // @TODO We may be able to use Views substitutions here, investigate that later.\n $fields = date_views_fields($this->base_table);\n $fields = $fields['name'];\n $fromto = $fields[$this->original_table . '.' . $this->real_field]['fromto'];\n\n $value_min = str_replace($this->original_table, $this->table_alias, $fromto[0]);\n $value_max = str_replace($this->original_table, $this->table_alias, $fromto[1]);\n $field_min = $this->date_handler->sql_field($value_min, NULL, $this->min_date);\n $field_min = $this->date_handler->sql_format($format, $field_min);\n $field_max = $this->date_handler->sql_field($value_max, NULL, $this->max_date);\n $field_max = $this->date_handler->sql_format($format, $field_max);\n $this->query->add_where_expression($group, \"$field_max >= $view_min_placeholder AND $field_min <= $view_max_placeholder\", array($view_min_placeholder => $view_min, $view_max_placeholder => $view_max));\n }\n }",
"protected function getMonths()\n {\n\t$year = $_REQUEST['year'] ;\n\tif( !$year )\n\t{\n\t print( \"Month query failed: no year has been specified\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\t$year = trim( $year ) ;\n\n\t// need to connect to the database here in order to run the\n\t// function mysql_real_escape_string\n\t$isconnected = $this->cedarconnect() ;\n\tif( $isconnected != \"good\" )\n\t{\n\t print( \"$isconnected\\n\" ) ;\n\t exit( 0 ) ;\n\t}\n\n\tif( $year )\n\t{\n\t $year = mysql_real_escape_string( $year ) ;\n\t}\n\n\t$params = $_REQUEST['params'] ;\n\tif( $params )\n\t{\n\t $params = trim( $params ) ;\n\t $params = mysql_real_escape_string( $params ) ;\n\t}\n\n\t$kinst = $_REQUEST['kinst'] ;\n\tif( $kinst )\n\t{\n\t $kinst = trim( $kinst ) ;\n\t $kinst = mysql_real_escape_string( $kinst ) ;\n\t}\n\n\t$query = \"SELECT DISTINCT d.MONTH\" ;\n\tif( $kinst && !$params )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t}\n\telse if( $params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( $params && $kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif,\" ;\n\t $query .= \" tbl_file_info fi, tbl_record_type rt,\" ;\n\t $query .= \" tbl_record_info ri\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND dif.RECORD_IN_FILE_ID=fi.RECORD_IN_FILE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=rt.RECORD_TYPE_ID\" ;\n\t $query .= \" AND fi.RECORD_TYPE_ID=ri.RECORD_TYPE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t $query .= \" AND rt.KINST=$kinst\" ;\n\t $query .= \" AND ri.PARAMETER_ID in ($params)\" ;\n\t}\n\telse if( !$params && !$kinst )\n\t{\n\t $query .= \" FROM tbl_date d, tbl_date_in_file dif\" ;\n\t $query .= \" WHERE d.DATE_ID=dif.DATE_ID\" ;\n\t $query .= \" AND d.YEAR=$year\" ;\n\t}\n\n\t$query .= \" ORDER BY d.MONTH ASC\" ;\n\t//print( \"$query\\n\" ) ;\n\n\t$result = parent::dbquery( $query ) ;\n\t$num_rows = mysql_num_rows( $result ) ;\n\tif( $num_rows != 0 )\n\t{\n\t while( $line = mysql_fetch_row( $result ) )\n\t {\n\t\tif( $line )\n\t\t{\n\t\t $colnum = 0 ;\n\t\t foreach( $line as $value )\n\t\t {\n\t\t\tif( $colnum > 0 ) echo \",\" ;\n\t\t\techo $value ;\n\t\t\t$colnum++ ;\n\t\t }\n\t\t echo \"\\n\" ;\n\t\t}\n\t }\n\t}\n\n\tparent::dbclose( $result ) ;\n }",
"public function scopeFrom($query, $from) {\n return $query->where('events.start_date_hour', '>=', $from);\n }",
"public function whereMonth($column, $operator, $value, $boolean = 'and')\n {\n return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean);\n }",
"public function scopegetholiday($query, $shop_id = 0, $payroll_holiday_archived = 0)\n {\n \t$query->where('shop_id', $shop_id)->where('payroll_holiday_archived', $payroll_holiday_archived);\n\n \treturn $query;\n }",
"public function actionCalendar( $month = null, $year = null, $selected = null, $filter = null, $city = null){\n\t\tif(!$month){\n\t\t\t$month = date('m');\n\t\t\t$year = date('Y');\n\t\t}\n\t\t$start = new \\Datetime($year.'-'.$month.'-01');\n\t\t$month_first_day = clone $start;\n\t\tif($start->format('w') != 1){\n\t\t\t$start->modify('previous monday');\n\t\t}\n\t\tif(!empty($selected)){\n\t\t\t$selected_day = new \\Datetime($selected);\n\t\t}else if($month == date('m') && $year == date('Y')){\n\t\t\t$selected_day = new \\Datetime();\n\t\t}else{\n\t\t\t$selected_day = clone $month_first_day;\n\t\t}\n\t\t$end = clone $start;\n\t\t$end->modify('4 weeks');\n\t\t$weeks = $this->weeks_in_month($month, $year);\n\t\t$events_sets = array();\n\t\t$events = $this->getEvents( $weeks * 7, $filter, $start, null, $city);\n\t\t// if(isset($_GET['debug'])){\n\t\t// \tvar_dump($events);\n\t\t// \tdie();\n\t\t// }\n\t\t$events_by_date = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['start']['date'])){\n\t\t\t\t$date = substr($event['start']['date'], 0, 4).substr($event['start']['date'], 5, 2).substr($event['start']['date'], 8, 2);\n\t\t\t}else{\n\t\t\t\t$date = (new \\Datetime($event['start']['dateTime']))->format('Ymd');\n\t\t\t}\n\t\t\t\n\t\t\t$events_by_date[$date][] = $event;\n\t\t}\n\t\tforeach ($events_by_date as $date => $date_events) {\n\t\t\t$events_by_date[$date] = array();\n\t\t\t$milongas = $this->filterEvents(self::DEFAULT_FILTER, $date_events);\n\t\t\tif(sizeof($milongas))\n\t\t\t\t$events_by_date[$date]['Milongas'] = $milongas;\n\t\t\t$workshops = $this->filterEvents('workshop:,workhop:', $date_events);\n\t\t\tif(sizeof($workshops))\n\t\t\t\t$events_by_date[$date]['Workshops'] = $workshops;\n\t\t}\n\n\t\t// Adding festivals in their own special categories\n\t\t// There must be an instance on all days of the festival\n\t\t$festivals = $this->filterEvents('FESTIVAL:,MARATHON:', $events);\n\t\tforeach($festivals as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Festivals']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Festivals'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Festivals/Marathons'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Adding the holidays in the workshops\n\t\t// There must be an instance on all days of the holidays\n\t\t$holidays = $this->filterEvents('HOLIDAYS:', $events);\n\t\tforeach($holidays as $event){\n\t\t\tif(isset($event['start']['dateTime'])){\n\t\t\t\t$start_datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t\t$end_datetime = new \\Datetime($event['end']['dateTime']);\n\t\t\t\twhile($start_datetime <= $end_datetime){\n\t\t\t\t\t$date = $start_datetime->format('Ymd');\n\t\t\t\t\tif(isset($events_by_date[$date]['Workshops']))\n\t\t\t\t\t\tarray_unshift($events_by_date[$date]['Workshops'], $event);\n\t\t\t\t\telse\n\t\t\t\t\t\t$events_by_date[$date]['Workshops'][] = $event;\n\t\t\t\t\t$start_datetime->modify('+1 day');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\treturn $this->render('calendar', [ 'events_by_date' => $events_by_date , 'start' => $start, 'month_first_day' => $month_first_day , 'weeks' => $weeks, 'selected_day' => $selected_day, 'city' => $city]);\n\t}",
"public function scopePublished($query)\n {\n return $query->where('status', '=', 'approved');\n }",
"public function scopePublished($query)\n {\n return $query->where('published', 1);\n }",
"public function showCurrentMonthAction()\r\n {\r\n\t\t$startDate = date('Y-m-01');\r\n\t\t$endDate = date('Y-m-d');\r\n\t\t\r\n\t\t$period = ' - bieżący miesiąc';\r\n\t\t\r\n\t\tstatic::show($startDate, $endDate, $period);\r\n }",
"public function month($year, $month)\n {\n $date = Carbon::createFromDate($year, $month, 0);\n\n // Get some articles items to show\n $news = Article::with('author', 'editor')\n ->where(DB::raw('MONTH(created_at)'), $month)\n ->where(DB::raw('YEAR(created_at)'), $year)\n ->orderBy('created_at', 'desc')\n ->get();\n\n return view('news.articles')\n ->with('articles', $news)\n ->with('title', \"News from \" . $date->format('F Y'));\n }",
"public function testScopeByDate()\n {\n $this->assertInstanceOf(\n ProjectRepository::class,\n $this->getRepoWithQB()->scopeByDate('date')\n );\n }",
"public function scopeYearsRange($query, $id, $yearFrom, $yearTo)\n {\n $fet = $query;\n if ($yearFrom && $yearTo)\n $fet = $fet->whereBetween('year', array($yearFrom, $yearTo))->whereNotNull('video')->where('video','<>','');\n\n if ($this->options->getDataProvider() == 'db' || ! $this->options->autoUpdateData())\n {\n return $fet;\n }\n\n if ($fet->isEmpty() || $fet->first()->updated_at->addDay() <= Carbon::now())\n {\n $fet = $this->updateFeatured();\n }\n\n return $fet; \n }",
"public function getMonths();",
"public function scopePublished($query)\n {\n \n $query->with(['category','tags','owner','photos'])\n ->whereNotNull('published_at')\n ->where('published_at','<=',Carbon::now())\n ->latest('published_at');\n }"
]
| [
"0.8195048",
"0.7508192",
"0.723719",
"0.7172682",
"0.70798856",
"0.6781325",
"0.6610951",
"0.65397817",
"0.6324735",
"0.6316899",
"0.63085777",
"0.6177375",
"0.6079139",
"0.60186625",
"0.5899809",
"0.5793105",
"0.5787917",
"0.57585776",
"0.5756456",
"0.5743037",
"0.573338",
"0.5685607",
"0.5658603",
"0.56201404",
"0.5598302",
"0.5572164",
"0.55619997",
"0.55429065",
"0.5541252",
"0.5523855",
"0.5512736",
"0.5504973",
"0.5493023",
"0.54778004",
"0.5470635",
"0.54681563",
"0.5447464",
"0.5438492",
"0.54341495",
"0.54065293",
"0.5403565",
"0.54004425",
"0.5393611",
"0.53865916",
"0.5366267",
"0.5365391",
"0.5357822",
"0.534383",
"0.53381044",
"0.53359324",
"0.53244936",
"0.5322578",
"0.5319624",
"0.5303521",
"0.5296146",
"0.52944416",
"0.5293418",
"0.5279849",
"0.52764535",
"0.52634764",
"0.5248248",
"0.5241582",
"0.52369016",
"0.5232748",
"0.5222433",
"0.52198035",
"0.51979005",
"0.51954305",
"0.5183028",
"0.51776946",
"0.5156438",
"0.5155566",
"0.51525795",
"0.5135329",
"0.5134527",
"0.51334614",
"0.5131581",
"0.5130449",
"0.51182216",
"0.51162446",
"0.5114087",
"0.5114075",
"0.5111519",
"0.5108909",
"0.5106796",
"0.5105679",
"0.5102813",
"0.50994545",
"0.50922424",
"0.5088343",
"0.5085578",
"0.50805515",
"0.5077104",
"0.50711495",
"0.5054333",
"0.5053995",
"0.50480413",
"0.5043419",
"0.50367284",
"0.50332654"
]
| 0.75763565 | 1 |
Scope a query to search | public function scopeSearch($query, $terms)
{
foreach (Str::of($terms)->explode(' ') as $term) {
$query->orWhere('title', 'LIKE', $term)
->orWhere('content', 'LIKE', $term);
}
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }",
"public function scopeSearch($query, $term);",
"public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }",
"public function scopeSearch($query)\n {\n $keyword = request('q');\n if ($keyword) {\n $model = $query->getModel();\n $searchable = $model->searchable;\n\n $local = Arr::where($searchable, function ($value, $key) {\n return is_numeric($key);\n });\n\n foreach ($local ?? [] as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query = $query->{$where}($field, 'like', \"%$keyword%\");\n }\n\n $relations = Arr::where($searchable, function ($value, $key) {\n return is_string($key);\n });\n\n foreach ($relations ?? [] as $key => $field) {\n $fields = Arr::wrap($field);\n $whereHas = empty($local) && $key == 0 ? 'whereHas' : 'orWhereHas';\n $query = $query->{$whereHas}($key, function ($query) use ($fields, $keyword) {\n foreach ($fields as $key => $field) {\n $where = $key == 0 ? 'where' : 'orWHere';\n $query->{$where}($field, 'like', \"%$keyword%\");\n }\n });\n }\n\n return $query;\n }\n }",
"public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }",
"public function scopeQuery($query)\n {\n // $query->where();\n }",
"public function scopeSearch($query,$search){\n if($search){\n return $query->where ('title','LIKE',\"%$search%\")\n ->orWhere('description','LIKE',\"%$search%\");\n }\n }",
"public function scopeSearched($query)\n {\n $search = request()->query('search');\n\n if (!$search && $search != 0) {\n return $query;\n }\n\n return $query->where('number', 'LIKE', \"%{$search}\");\n }",
"public function scopeSearch($query, $input) {\n \n if (isset($input['s'])) {\n $query->whereRaw('customer_name LIKE \"%'. array_get($input, 's', '') .'%\"');\n }\n\n return $query;\n }",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"public function getQueryScope()\n {\n return $this->getQuery();\n }",
"public function scopeSearch($query, $key)\n {\n return $query->where('transaction_code', 'like', '%'.$key.'%')\n ->orWhere('description', 'like', '%'.$key.'%')\n ->orWhere('total', 'like', '%'.$key.'%');\n }",
"public function scopeSearch(Builder $query)\n {\n $search = app('request')->input('search', null);\n\n if($search && static::SEARCH)\n {\n $fields = static::SEARCH;\n return $query->where(function(Builder $query) use ($search, $fields){\n foreach ($fields as $field) {\n $query = $query->orWhere( $field, \"LIKE\", \"%{$search}%\" );\n }\n return $query;\n });\n }\n\n return $query;\n }",
"public function scopeSearch($query, $search)\n\t{\n\t\treturn $query->where('address', 'like', '%' . $search . '%')\n\t\t\t->orWhere('city', 'like', '%' . $search . '%')\n\t\t\t->orWhere('zip', 'like', '%' . $search . '%')\n\t\t\t->orWhere('title', 'like', '%' . $search . '%')\n\t\t\t->orWhere('description', 'like', '%' . $search . '%')\n\t\t\t->get();\n\t}",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopeSearch($query, $term)\n {\n $columns = implode(',',$this->searchable);\n \n $query->whereRaw(\"MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)\" , $this->fullTextWildcards($term));\n \n return $query;\n }",
"public function scopeFilterBySearchWord( $query )\n {\n $word = request() -> get( 'search' );\n $word = strtolower($word);\n\n if( $word )\n {\n $query \n -> where( 'id', 'like', '%'. $word .'%' )\n -> orWhereHas( 'charger_connector_type.charger', function( $q ) use( $word ) {\n $q \n -> where( 'code', 'like', '%'. $word .'%')\n -> orWhereRaw(\"lower(location->>'$.ka') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.en') like '%{$word}%'\")\n -> orWhereRaw(\"lower(location->>'$.ru') like '%{$word}%'\");\n })\n -> orWhereHas( 'user', function( $q ) use( $word ) {\n $q \n -> whereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\")\n -> orWhereRaw(\"lower(first_name) like '%{$word}%'\");\n });\n\n }\n }",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['term']) && trim($params['term']) !== '' )\n {\n // $query->search( trim($params['term']) ); // Original\n\n $query->search( trim($params['term']), null, true, false );\n }\n\n\n\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $reference = $params['reference'];\n $query->where( function($query) use ($reference) { \n $query->where('reference', 'LIKE', '%' . $reference . '%');\n $query->orWhere('ean13', 'LIKE', '%' . $reference . '%');\n } );\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n\n /*\n // Moved from controller\n $query->orWhereHas('combinations', function($q) use ($reference)\n {\n // http://stackoverflow.com/questions/20801859/laravel-eloquent-filter-by-column-of-relationship\n $q->where('reference', 'LIKE', '%' . $reference . '%');\n }\n ); // ToDo: if name is supplied, shows records that match reference but do not match name (due to orWhere condition)\n */\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n\n if ( Auth::user()->language->iso_code == 'en' )\n {\n $query->orWhere('name_en', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['stock_control']) )\n {\n if ( $params['stock_control'] == 0 )\n $query->where('stock_control', '<=', 0);\n if ( $params['stock_control'] == 1 )\n $query->where('stock_control', '>', 0);\n }\n\n if ( isset($params['main_supplier_id']) )\n {\n if ( $params['main_supplier_id'] > 0 )\n $query->where('main_supplier_id', $params['main_supplier_id']);\n if ( $params['main_supplier_id'] < 0 )\n $query->where('main_supplier_id', 0)->orWhere('main_supplier_id', null);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id'])\n ->orderBy('position', 'asc');\n }\n\n if ( isset($params['work_center_id']) && $params['work_center_id'] > 0 )\n {\n $query->where('work_center_id', '=', $params['work_center_id']);\n }\n\n if ( isset($params['manufacturer_id']) && $params['manufacturer_id'] > 0 && 0)\n {\n $query->where('manufacturer_id', '=', $params['manufacturer_id']);\n }\n\n if ( isset($params['procurement_type']) && $params['procurement_type'] != '' )\n {\n $query->where('procurement_type', '=', $params['procurement_type']);\n }\n\n if ( isset($params['mrp_type']) && $params['mrp_type'] != '' )\n {\n $query->where('mrp_type', '=', $params['mrp_type']);\n }\n\n if ( isset($params['active']) )\n {\n if ( Configuration::isTrue('SHOW_PRODUCTS_ACTIVE_ONLY') )\n {\n if ( $params['active'] == 1 )\n {\n // Show active products, same as global scope ShowOnlyActiveScope\n // Do nothing\n ;\n\n } else {\n // Show not active products (0) or all (-1)\n // Remove global scope\n $query->withoutGlobalScope(ShowOnlyActiveScope::class);\n\n // https://www.manifest.uk.com/blog/overriding-eloquent-global-scopes\n\n // Show not active products (0)\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n }\n\n } else {\n\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n \n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n }\n\n return $query;\n }",
"public function scopeOfSearch($query, $keyword)\n {\n return $query->where('name','like','%'.$keyword.'%');\n }",
"public function scopeSearch(Builder $query, $name)\n {\n return $query->where('name', '=', $name);\n }",
"public function scopeSearchFilter($query, $q)\n {\n if(!empty($q)){\n return $query->where(DB::raw('LOWER(text)'), 'LIKE', '%' . strtolower($q) . '%');\n }\n }",
"public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter first_name\n if ($request->has('first_name')) {\n $query->where('first_name', 'like', \"%{$request->get('first_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('first_name')}%\");\n }\n // filter first_name\n if ($request->has('last_name')) {\n $query->where('first_name', 'like', \"%{$request->get('last_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('last_name')}%\");\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_active',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"private function addQueryScopeForSearch(Builder $query, $value) {\n $query->matchesSearchQuery($value);\n }",
"public function scopeSearch($query, $q)\n {\n return $query->where('title', 'LIKE', $q)\n ->select('id', 'imdb_id', 'tmdb_id', 'title', 'poster', 'type')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->groupBy('title')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->get();\n }",
"public function scopeWithKeyword($query, $keyword)\n {\n return $query->where('name', 'like', '%'.$keyword.'%');\n }",
"public function scopeSearchByUser($query, $user_id)\n {\n if (isset($user_id) && $user_id !== null) {\n return $query->where('user_id', $user_id);\n }\n }",
"public function scopeSearch($query, $term)\n {\n if($term)\n {\n $query->where(function ($q) use ($term){\n $q->where('title', 'LIKE', \"%{$term}%\");\n\n $q->orwhereHas('author', function ($qr) use ($term){\n $qr->where('name', 'LIKE', \"%{$term}%\");\n });\n });\n }\n }",
"public function scopeSearch($query, $search) {\n $searchAlt = str_replace(' ', '_', $search);\n\n if(empty($search)) {\n return $query;\n } else {\n return $query\n ->where('filename', 'like', '%' . $search . '%')\n ->Orwhere('filename', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $searchAlt . '%')\n ->Orwhere('name', 'like', '%' . $search . '%');\n }\n }",
"public function scopeFiltered(Builder $query, \\Illuminate\\Http\\Request $request): Builder\n {\n if ($request->has('status') && $status = $request->get('status'))\n $query->where('status', $status);\n\n if ($request->has('search') && $search = $request->get('search'))\n $query->search($search);\n\n return $query/*->where('user_id', '<>', $request->user('api')->id)*/;\n }",
"public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }",
"public function scopeSearch(Builder $query, $name, $userId)\n {\n return $query->where('user_id', '=', $userId)\n ->where('name', '=', $name);\n }",
"public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }",
"public function scopeName($query, $name)\n {\n return $query->orWhere('name', 'LIKE', '%'.$name.'%');\n }",
"public function scopeSupportingDocs($query)\n {\n return $query->where('type', 3);\n }",
"public function scopeSearch($query, $keyword)\n {\n return $query->shortCode($keyword)->orWhere(function (Builder $query) use ($keyword) {\n $query->contactName($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->contactNumber($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->contactEmail($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->product($keyword);\n })->orWhere(function (Builder $query) use ($keyword) {\n $query->services($keyword);\n });\n }",
"public function search($query);",
"public function scopeMine($query)\n {\n //return $query->where('shop_id', Auth::user()->merchantId());\n }",
"public function scopeSearch(Builder $query, ?string $search)\n { \n\n if( $search )\n {\n return $query\n ->where('casestudies.title', 'like', '%'.$search.'%')\n ->orWhere('casestudies.description', 'like', '%'.$search.'%')\n ->orWhere('casestudies.content', 'like', '%'.$search.'%')\n ->orWhere('casestudies.casestudy_by', 'like', '%'.$search.'%')\n ->orWhere('casestudies.company', 'like', '%'.$search.'%')\n ->orWhere('casestudies.seo_title', 'like', '%'.$search.'%')\n ->orWhere('casestudies.seo_description', 'like', '%'.$search.'%')\n ->orwhereHas('category', \n function ($query) use ($search) {\n $query->Where('categories.title','like', '%'.$search.'%');\n })\n ->orwhereHas('createdBy', \n function ($query) use ($search) {\n $query->Where('users.name','like', '%'.$search.'%');\n });\n }\n return;\n }",
"public function scopeRamSearch($query, $search)\n {\n \t$brand = strtoupper($search);\n return $query = DB::table('rams')\n ->join('brands', 'rams.brand_id', '=', 'brands.id')\n ->select('rams.*', 'rams.type as Rtype', 'rams.id AS Rid', 'brands.id AS Bid', 'brands.name AS brand', 'rams.registered')\n ->where([ ['rams.type', 'LIKE', \"%$search%\"], ['rams.deleted_at', '=', null] ])\n ->orWhere([ ['brands.name', 'LIKE', \"%$brand%\"], ['rams.deleted_at', '=', null] ])\n ->orderBy('id', 'desc')\n ->paginate(25);\n }",
"public function getQueryScope()\n {\n return $this->query_scope;\n }",
"public function scopeSearchEmployeeName($query,$employeeName=null){\n if(empty($employeeName)) {\n return $query;\n }\n/* return*/ $query = $query\n ->whereRaw('concat('.\\DB::getTablePrefix().'employees.first_name, '.\\DB::getTablePrefix().'employees.last_name) like \"%?%\"',[$employeeName]);\n dd($query->toSql());\n // ->where(function($q) use ($employeeName){\n // $q->where('employees.last_name', 'like', '%'. $employeeName.'%')\n // ->orWhere('employees.first_name', 'like', '%'. $employeeName.'%');\n // });\n }",
"public function scopePorAnno( $query, $anno=null ) {\n return $query;\n }",
"public function scopeWinners($query)\n {\n $query->whereNotNull('position')->orderBy('position');\n }",
"public function scopeSearch(Builder $query, string $name): Builder\n {\n return $query->where('title', 'ILIKE', \"%$name%\")\n ->orWhere('description', 'ILIKE', \"%$name%\");\n }",
"public function scopeForRent($query) {\n\t\treturn $query->where([\n\t\t\t['sale', '=', 'rent'],\n\t\t\t['active', '=', 'Y'],\n\t\t])->get();\n\t}",
"public function scopeSearch($query, $term, $callback = null)\n {\n if(isset($this->searchable) && is_array($this->searchable) && count($this->searchable) > 0){\n\n $columns = implode(',',$this->searchable);\n\n $filters = [];\n $term = $this->extractFilterFromTerm($term, $filters);\n\n if(strlen($term) > 0)\n $query->whereRaw(\"MATCH ({$columns}) AGAINST (? IN BOOLEAN MODE)\", $this->fullTextWildcards($term));\n\n if(count($filters) > 0 && is_callable($callback))\n call_user_func_array($callback, [ $filters ]);\n\n return $query;\n\n }\n }",
"public function scopeFilter($query, $term)\n {\n return $query\n ->where('name', 'like', '%' . $term . '%')\n ->orWhere('email', 'like', '%' . $term . '%');\n }",
"public function search(Query $query);",
"public function scopeSpaceName($query, $name)\n {\n if (!$name) return $query;\n return $query->where('name', 'like', \"%{$name}%\")\n ->orWhere('code', 'like', \"%{$name}%\");\n }",
"public function scopeSearch($query, $term): mixed\n {\n if (!is_null($term)) {\n return $query->where('name', 'ILIKE', \"%$term%\")\n ->orWhere('description', 'ILIKE', \"%$term%\");\n }\n\n return $query;\n }",
"public function scopeUser($query, $request){\n if(trim($request->user) != \"\"){\n $query->where('cuenta', 'LIKE', \"%$request->user%\");\n }\n # si esta el user y el estado\n if($request->user != \"\" && $request->estado != \"\"){\n $query->where('cuenta', 'LIKE', \"%$request->user%\")\n ->where('estado', $request->estado);\n }\n #si esta user y estasdo\n if($request->user != \"\" && $request->estado != \"\" && $request->assigned_to){\n $query->where('cuenta', 'LIKE', \"%$request->user%\")\n ->where('assigned_to', $request->assigned_to)\n ->where('estado', $request->estado);\n }\n # si esta estado\n if($request->estado != \"\" && $request->user == \"\"){\n $query->where('estado', \"=\", $request->estado);\n }\n # si esta asignado\n if($request->assigned_to && $request->user == \"\"){\n $query->where('assigned_to', $request->assigned_to);\n }\n # si esta asignado y estado\n if($request->assigned_to && $request->estado && $request->user == \"\"){\n $query->where('estado', \"=\", $request->estado)\n ->where('assigned_to', $request->assigned_to);\n }\n # si esta asignado, estado y user\n if($request->assigned_to && $request->estado && $request->user != \"\"){\n $query->where('estado', \"=\", $request->estado)\n ->where('assigned_to', $request->assigned_to)\n ->where('cuenta', 'LIKE', \"%$request->user%\");\n }\n # Si esta vacio y agrega ?clientes\n if($request->user != \" \" && $request->clientes){\n $query->where('cliente', \"=\", 1);\n }\n # si clientes y asiggned\n if($request->clientes && $request->assigned_to && !$request->user && !$request->estado){\n $query->where('cliente', \"=\", 1)\n ->where('assigned_to', $request->assigned_to);\n }\n # si clientes, assigned y estado\n if($request->clientes && $request->assigned_to && $request->estado && !$request->user){\n $query->where('cliente', \"=\", 1)\n ->where('assigned_to', $request->assigned_to)\n ->where('estado', \"=\", $request->estado);\n }\n # si tiene clientes y estado\n if($request->clientes && !$request->assigned_to && $request->estado && !$request->user){\n $query->where('cliente', \"=\", 1)\n ->where('estado', \"=\", $request->estado);\n }\n # si tiene clientes y usuario\n if($request->clientes && !$request->assigned_to && !$request->estado && $request->user){\n $query->where('cliente', \"=\", 1)\n ->where('cuenta', 'LIKE', \"%$request->user%\");\n }\n # si clientes, assigned, estado y usuario\n if($request->clientes && $request->assigned_to && $request->estado && $request->user){\n $query->where('cliente', \"=\", 1)\n ->where('assigned_to', $request->assigned_to)\n ->where('estado', \"=\", $request->estado)\n ->where('cuenta', 'LIKE', \"%$request->user%\");\n }\n }",
"public function scopeIncludes( $query, $search )\n { \n return $query->where( 'namespace', 'like', '%' . $search );\n }",
"public function scopeForOwner($query)\n {\n return $query;\n }",
"public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }",
"public function scopeNombre($query,$name){\n\n // if(trim($name) != \"\") {\n\n $query->where('nom_requisito',\"LIKE\", \"%$name%\")->where('municipio_id_municipio',\"=\",NULL);\n\n // }\n }",
"public function scopeFilter($query, $term)\n {\n $term = '%' . $term . '%';\n\n return $query->where('first_name', 'LIKE', $term)\n ->orWhere('last_name', 'LIKE', $term)\n ->orWhere('email', 'LIKE', $term);\n }",
"public function searchByName($query);",
"public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }",
"public function scopeSearch($query, $name, $iFilter)\n {\n switch ($iFilter) {\n case \\Config::get('scsys.FILTER.ACTIVES'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.ACTIVE'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.DELETED'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.DEL'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.ALL'):\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n default:\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n }\n }",
"public function scopeSearch($query, $name, $iFilter)\n {\n switch ($iFilter) {\n case \\Config::get('scsys.FILTER.ACTIVES'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.ACTIVE'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.DELETED'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.DEL'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.ALL'):\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n default:\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n }\n }",
"public function scopeUser($query)\n\t{\n\t\treturn $query->where('user_id', 'LIKE', Auth::user()->id);\n\t}",
"public function scopeSearchEmployeeId($query,$employeeId=null){\n if(empty($employeeId)) {\n return $query;\n }\n return $query\n ->where('employees.presentation_id', 'like','%' . $employeeId . '%');\n }",
"public function scopeName($query, $name)\n {\n if($name)\n return $query->where('IAP_DESC', 'LIKE', \"%$name%\");\n }",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $query->where('reference', 'LIKE', '%' . trim($params['reference']) . '%');\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id']);\n }\n\n if ( isset($params['active']) )\n {\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n\n return $query;\n }",
"public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }",
"public function scopeSearch($query, $name, $iFilter)\n {\n switch ($iFilter) {\n case \\Config::get('scsys.FILTER.ACTIVES'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.ACTIVE'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.DELETED'):\n return $query->where('is_deleted', '=', \"\".\\Config::get('scsys.STATUS.DEL'))\n ->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n case \\Config::get('scsys.FILTER.ALL'):\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n\n default:\n return $query->where('name', 'LIKE', \"%\".$name.\"%\");\n break;\n }\n return $query->where('name', 'LIKE', \"%$name%\");\n }",
"public function scopeByType($query, $type)\n {\n return $query->where('type', $type);\n }",
"public function scopeTerm($query, $term)\n {\n $query->where('term', $term);\n }",
"public function scopeOfAuthenticatedUser($query)\n {\n $query->whereUserId(Auth::id());\n }",
"public function scopeActive($query)\n {\n $query->where('status', static::PUBLISHED);\n }",
"function query() {\n // Since attachment views don't validate the exposed input, parse the search\n // expression if required.\n if (!$this->parsed) {\n $this->query_parse_search_expression($this->value);\n }\n $required = FALSE;\n if (!isset($this->search_query)) {\n $required = TRUE;\n }\n else {\n $words = $this->search_query->words();\n if (empty($words)) {\n $required = TRUE;\n }\n }\n if ($required) {\n if ($this->operator == 'required') {\n $this->query->add_where($this->options['group'], 'FALSE');\n }\n }\n else {\n $search_index = $this->ensure_my_table();\n\n $search_condition = db_and();\n\n if (!$this->options['remove_score']) {\n // Create a new join to relate the 'serach_total' table to our current 'search_index' table.\n $join = new views_join;\n $join->construct('search_total', $search_index, 'word', 'word');\n $search_total = $this->query->add_relationship('search_total', $join, $search_index);\n\n $this->search_score = $this->query->add_field('', \"SUM($search_index.score * $search_total.count)\", 'score', array('aggregate' => TRUE));\n }\n\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n $search_condition->condition(\"$search_index.type\", $base_table);\n if (!$this->search_query->simple()) {\n $search_dataset = $this->query->add_table('search_dataset');\n $conditions = $this->search_query->conditions();\n $condition_conditions =& $conditions->conditions();\n foreach ($condition_conditions as $key => &$condition) {\n // Take sure we just look at real conditions.\n if (is_numeric($key)) {\n // Replace the conditions with the table alias of views.\n $this->search_query->condition_replace_string('d.', \"$search_dataset.\", $condition);\n }\n }\n $search_conditions =& $search_condition->conditions();\n $search_conditions = array_merge($search_conditions, $condition_conditions);\n }\n else {\n // Stores each condition, so and/or on the filter level will still work.\n $or = db_or();\n foreach ($words as $word) {\n $or->condition(\"$search_index.word\", $word);\n }\n\n $search_condition->condition($or);\n }\n\n $this->query->add_where($this->options['group'], $search_condition);\n $this->query->add_groupby(\"$search_index.sid\");\n $matches = $this->search_query->matches();\n $placeholder = $this->placeholder();\n $this->query->add_having_expression($this->options['group'], \"COUNT(*) >= $placeholder\", array($placeholder => $matches));\n }\n // Set to NULL to prevent PDO exception when views object is cached.\n $this->search_query = NULL;\n }",
"public function scopeSearch($query, string $q): Builder\n {\n return $query\n ->where('title', 'LIKE', \"%{$q}%\")\n ->orWhere('desc', 'LIKE', \"%{$q}%\");\n }",
"public function scopeActive($query)\n {\n return $query->where(['status'=>1]);\n }",
"public function scopeOfType($query, $type)\n {\n return $query->where('type', $type);\n }",
"public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", \"1\");\n }",
"public function scopeBusca($query, $busqueda){\n\t\tif($busqueda){\n\t\t\treturn $query->where(\\DB::raw(\"CONCAT(name,' ',email,' ',tipo,' ',estado)\"),\"LIKE\",\"%$busqueda%\");\n\t\t}\n }",
"public function newQueryWithoutScopes();",
"public function scopeWithinRange($query, $start, $end)\n {\n return $query->whereDate('metadata_order.value', '>=', $start)\n ->whereDate('metadata_order.value', '<=', $end);\n }",
"public function scopeActive($query)\n\t{\n\t\t$query->where('display', (int) true);\n\t}",
"public function scopeQualifyForSupplier($query, $supplier_id, $currency_id) \n {\n\n return $query;\n }",
"public function scopeType($query, $type)\n {\n return $query->whereType($type);\n }",
"public function scopeActive($query)\n {\n return $query->where('status','active');\n }",
"public function scopeMatchingTerm($query, $term)\n {\n if ($term == '')\n return $query;\n else\n return $query->where('name', 'like', '%' . $term . '%')\n ->orWhere('description', 'like', '%' . $term . '%');\n }",
"public function scopeName($query, $name)\n {\n if($name)\n return $query->where('NOMBRE_COMPLETO', 'LIKE', \"%$name%\");\n }",
"public function scopeActive($query)\n {\n $query->where('active', 1);\n }",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function scopeMatches($query, $search)\n {\n return $query->where('email', $search);\n }",
"public function scopeActive($query){\n return $query->where('active',1);\n }",
"public function scopeActive($query)\n {\n $query->filter['ACTIVE'] = 'Y';\n\n return $query;\n }",
"public function scopeNaturalPerson($query) {\n\t\treturn $query->where('type', 1);\n\t}",
"public function scopeSearch($query, $value, $take)\n {\n $query->where(function ($query) use ($value) {\n $query->where('name', 'like', \"%{$value}%\")\n ->orWhere('email', 'like', \"%{$value}%\");\n })\n ->whereKeyNot(auth()->id());\n\n if (filter_var($take, FILTER_VALIDATE_INT)) {\n $query->take($take);\n }\n\n return $query;\n }",
"public function scopeMyselections($query)\n {\n $user = auth()->user();\n if($user->is_admin){\n return $query->orderBy('created_at', 'desc');\n } else {\n return $query->where('user_id', $user->id)->orderBy('created_at', 'desc');\n }\n }",
"public function scopeBuscador($query, $buscar){\n return $query->where('nombreApellido', 'LIKE', '%' . $buscar . '%');\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }"
]
| [
"0.7986923",
"0.7736811",
"0.74863183",
"0.7344266",
"0.71414536",
"0.7102804",
"0.7096783",
"0.7088438",
"0.70196533",
"0.7012579",
"0.69366217",
"0.68974185",
"0.67972225",
"0.67417127",
"0.67409146",
"0.67072606",
"0.6684333",
"0.66712075",
"0.6661555",
"0.66560185",
"0.66323066",
"0.6615699",
"0.6602981",
"0.65984",
"0.6575237",
"0.6565029",
"0.65567344",
"0.65562016",
"0.65391904",
"0.6513858",
"0.64763",
"0.6445055",
"0.6409134",
"0.6355888",
"0.6343427",
"0.6333851",
"0.6318022",
"0.63104707",
"0.6301359",
"0.6297442",
"0.62945515",
"0.629051",
"0.628873",
"0.62858874",
"0.6285234",
"0.62834376",
"0.62684196",
"0.6247005",
"0.6246514",
"0.6245453",
"0.6238366",
"0.623405",
"0.6230644",
"0.62278086",
"0.6226325",
"0.6220505",
"0.61522955",
"0.614964",
"0.61353904",
"0.6129174",
"0.6129174",
"0.61153346",
"0.61084116",
"0.6107588",
"0.610084",
"0.609555",
"0.60915613",
"0.60857886",
"0.60813236",
"0.6077935",
"0.60770535",
"0.60764587",
"0.60752803",
"0.6060685",
"0.60452205",
"0.6041925",
"0.603996",
"0.60352564",
"0.6033041",
"0.60329443",
"0.6031345",
"0.60262996",
"0.60248333",
"0.6023795",
"0.6016894",
"0.6013893",
"0.60086715",
"0.60043514",
"0.5999212",
"0.5996618",
"0.5978546",
"0.59620357",
"0.5961939",
"0.59611166",
"0.59557873",
"0.59557873",
"0.59557873",
"0.59557873",
"0.59557873",
"0.59557873",
"0.59557873"
]
| 0.0 | -1 |
Scope a query to filter by categories | public function scopeCategories($query, $values)
{
return $query->whereHas('category', function ($query) use ($values) {
return $query->whereIn('slug', explode(',', $values));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeCategory($query, $category_id){\n if($category_id){\n return $query->where('category_id', $category_id);\n }\n }",
"public function scopeInCategory($query, $category)\n {\n if ($category == null)\n return $query;\n else\n return $query->where('category_id', $category->id);\n }",
"public function scopeCategory($query, $category)\n {\n return $query->where('category', $category);\n }",
"public function scopeFilterCategories($query, $categories)\n {\n return $query->whereHas('categories', function($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }",
"public function scopeFilterCategories($query, $categories)\n {\n return $query->whereHas('categories', function ($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }",
"public function scopeOfCategory($query, $category)\n {\n return $query->where('category', $category);\n }",
"private function filterCategory()\n {\n if(empty($this->category) || $this->category === static::FILTER_CATEGORY_NONE) {\n return;\n }\n\n if($this->category === static::FILTER_CATEGORY_OTHER) {\n $this->query->andWhere(['LIKE', 'category', 'yii\\\\']);\n return;\n }\n\n $this->query->andWhere(['category' => $this->category]);\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopeMostlySearched($query, $count=5, $category=\"\"){\n if($category) {\n return $query->whereHas('categories', function($query) use ($category){\n $query->where('categories.id',$category);\n })->take($count);\n }\n\n return $query->take($count);\n }",
"public function scopeOfCategory($query, Category $category)\n {\n return $query->where('category_id', $category->id);\n }",
"public function filteredByCategory(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->where('category_id', $request->category)\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }",
"public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }",
"public function scopeBuscadorCategory($query, $name) {\n\n return $query->where('name', '=', $name); //where() es el metodo donde.\n //retornamos la $query q vamos a buscar\n // where recive como parametro el nombre de la columna a q vamos a buscar la condicion y la varible de busqueda\n //en este caso buscamos el nombre de la categorias\n\n }",
"public function scopes()\n {\n return [\n 'category' => new CategoryScope(),\n ];\n }",
"public function scopeWhereCategoryIn ($query, $id) {\n return $query->whereHas('categories', function ($categories) use ($id) {\n return $categories->whereIn('id', (array) $id);\n });\n }",
"public function scopeCategoryName($query, $name = null)\n\t {\n\t\tif(!is_null($name)) {\n\n\t\t\treturn $query->with(['categories' => function($query) use ($name){\n\t\t\t\t$query->where('name', $name);\n\t\t\t}\n\t\t\t]);\n\n\t\t}\n\t\treturn null;\n\n }",
"public function getCategories():ActiveQuery\n {\n return $this\n ->hasMany(Category::class, ['id' => 'categoryId'])\n ->viaTable(CategoryBloc::tableName(), ['blocId' => 'id']);\n }",
"public function scopeOfCategories($query, $categoryIds)\n {\n return $query->join('category_recipe', 'recipes.id', '=', 'category_recipe.recipe_id')\n ->join('categories', 'category_recipe.category_id', '=', 'categories.id')\n ->select('recipes.*')\n ->groupBy('recipes.id')\n ->whereIn('categories.id', $categoryIds);\n }",
"public function getAllWithCategory();",
"private function addQueryScopeForCategory(Builder $query, $value) {\n $category = Category::findBySlug($value);\n\n if($category == null) {\n $category = new Category();\n $category->id = 0;\n }\n\n $query->ofCategory($category);\n }",
"public function scopeCategoryId($query, $id = null)\n\t {\n\t\tif(!is_null($id)) {\n\n\t\t\treturn $query->with(['categories' => function($query) use ($id){\n\t\t\t\t$query->where('id', $id);\n\t\t\t}\n\t\t\t]);\n\n\t\t}\n\t\treturn null;\n\n\t}",
"public function scopeWithCategoryId($query, $id)\n {\n $query->with(['categories' => function ($q) use ($id) {\n $q->wherePivot('category_id', '=', $id);\n }])\n ->whereHas('categories', function ($q) use ($id) {\n $q->where('category_id', $id);\n })->with('categories');\n }",
"public function scopeVisible($query)\n {\n return $query\n ->has('categories', '=', 0)\n ->orWhereHas('categories', function ($query) {\n $query->notSecrets();\n });\n }",
"public function scopeSortCategory($query)\n {\n $ids = EventCategory::orderBy('sort', 'DESC')->pluck('id')->toArray();\n return count($ids) ? $query->orderByRaw(DB::raw('FIELD(category_id, '.implode(',', $ids).')')) : $query;\n }",
"public function scopeHasCategory($query, $id)\n\t{\n\t\treturn $query->with('categories', 'author')->whereHas('categories', function($qry) use($id) {\n\n\t\t\t$qry->where('id', $id);\n\n\t\t}\n\t\t);\n\t}",
"public function findCategories();",
"public function get_paged_categories($limit, $offset = 0, $filter = array())\n {\n $result = array();\n $result['result'] = false;\n $result['count'] = 0;\n\n if (is_array($filter) && count($filter) > 0) {\n foreach($filter as $key => $value) {\n if ($key == 'category') {\n $this->db->or_where(\"(cat_name LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(dbo.get_user_login_name_by_id(created_by) LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(created_at LIKE '%\". $value['value'] .\"%')\", '', false);\n } else {\n //$this->db->where($filter[$key]['field'], $filter[$key]['value']);\n }\n }\n }\n\n $this->db->order_by('cat_name','ASC');\n $query = $this->db->get($this->table_name, $limit, $offset);\n\n if ($query->num_rows() > 0) {\n\n $result['result'] = $query->result();\n\n // record count\n if (is_array($filter) && count($filter) > 0) {\n foreach($filter as $key => $value) {\n if ($key == 'category') {\n $this->db->or_where(\"(cat_name LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(dbo.get_user_login_name_by_id(created_by) LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(created_at LIKE '%\". $value['value'] .\"%')\", '', false);\n } else {\n //$this->db->where($filter[$key]['field'], $filter[$key]['value']);\n }\n }\n }\n\n $this->db->from($this->table_name);\n $result['count'] = $this->db->count_all_results();\n }\n\n //echo 1; die();\n\n return $result;\n }",
"public function scopeUserCategories($query, $user_id)\n {\n return $query->where('user_id', $user_id);\n }",
"function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}",
"function mySearchPostsFilter($query) {\n\tif ($query->is_search) {\n\t\t$query->set('cat','2'); // your category IDs\n\t}\n\treturn $query;\n}",
"function only_news_cat($query) {\n\n\t$query->set('category_name', 'News');\n\n\treturn $query;\n\n}",
"public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }",
"public function autocomplete()\n {\n $items = Category::orderBy('parent_id', 'ASC');\n\n $items->whereHas('translation', function ($query) {\n if (Request::filled('keyword')) {\n $query->where('title', 'LIKE', '%' . Request::input('keyword') . '%');\n } else {\n $query->where('parent_id', 0);\n }\n });\n\n\n /**\n * Content type filter\n */\n if (Request::filled('content_type_id')) {\n $items->where('content_type_id', (int) Request::input('content_type_id'));\n }\n\n\n /**\n * Query\n */\n $items = $items->paginate(5);\n\n\n /**\n * Response structure\n */\n return CategoryAutocompleteResource::collection($items);\n }",
"public function scopeParents($query)\n\t{\n\t\treturn $query->whereNull('category_id')->get();\n\t}",
"public function scopeNotPetro($query)\r\n {\r\n return $query->where('categories.name', '!=', 'Fuel');\r\n }",
"public function categoryList(Request $request)\n {\n $columns = array(\n 'category_name',\n 'category_description',\n 'category_slug'\n );\n\n $totalData = Category::count();\n\n $totalFiltered = $totalData;\n\n $limit = $request->input('length');\n $start = $request->input('start');\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n\n if (empty($request->input('search.value'))) {\n $category = Category::withCount('post')->offset($start)\n ->limit($limit)\n ->orderBy($order, $dir)\n ->get();\n } else {\n $search = $request->input('search.value');\n\n $category = Category::where('category_name', 'LIKE', \"%{$search}%\")\n ->orWhere('category_slug', 'LIKE', \"%{$search}%\")\n ->withCount('post')\n ->offset($start)\n ->limit($limit)\n ->orderBy($order, $dir)\n ->get();\n\n $totalFiltered = Category::where('category_name', 'LIKE', \"%{$search}%\")\n ->orWhere('category_slug', 'LIKE', \"%{$search}%\")\n ->count();\n }\n\n\n $data = array();\n if (!empty($category)) {\n foreach ($category as $row) {\n $nestedData['id'] = $row->id;\n $nestedData['category_name'] = $row->category_name;\n $nestedData['category_description'] = $row->category_description;\n $nestedData['category_slug'] = $row->category_slug;\n $nestedData['count'] = $row->post_count;\n $nestedData['action'] = encrypt($nestedData);\n $nestedData['edit_route'] = route('categories.edit', encrypt($row->id));\n $data[] = $nestedData;\n }\n }\n\n $json_data = array(\n \"draw\" => intval($request->input('draw')),\n \"recordsTotal\" => intval($totalData),\n \"recordsFiltered\" => intval($totalFiltered),\n \"data\" => $data\n );\n\n return response()->json($json_data);\n }",
"public function loadDataCategory(Request $request){\n $data = Category::whereRaw(\"(nama_kategori LIKE '%\".$request->get('q').\"%')\")\n ->limit(30)\n ->get();\n return response()->json($data);\n }",
"private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }",
"public function findAllCategories(): iterable;",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $query->where('reference', 'LIKE', '%' . trim($params['reference']) . '%');\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id']);\n }\n\n if ( isset($params['active']) )\n {\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n\n return $query;\n }",
"public function prepareQueryForCategory()\n {\n $sql = new SqlStatement();\n $sql->select(array('p.*'))\n ->from(array('p' => self::RESULTS_TABLE))\n ->innerJoin(array('pp' => 'product'), 'p.product_id = pp.product_id')\n ->innerJoin(array('pd' => 'product_description'), 'p.product_id = pd.product_id')\n ->where('pd.language_id = ?', (int)$this->config->get('config_language_id'))\n ->order($this->sortOrder)\n ->limit($this->productsLimit, $this->productsStart);\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n } \n \n return $sql;\n }",
"protected function getCategoryFilter($categories = [])\n {\n $filter = new BoolQuery;\n\n foreach ($categories as $value) {\n $cat = new NestedQuery();\n $cat->setPath('departments');\n\n $term = new Term;\n $term->setTerm('departments.id', $value);\n\n $cat->setQuery($term);\n\n $filter->addMust($cat);\n $this->categories[] = $value;\n }\n\n return $filter;\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter first_name\n if ($request->has('first_name')) {\n $query->where('first_name', 'like', \"%{$request->get('first_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('first_name')}%\");\n }\n // filter first_name\n if ($request->has('last_name')) {\n $query->where('first_name', 'like', \"%{$request->get('last_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('last_name')}%\");\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_active',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function category_posts_query() {\n\t\treturn new WP_Query( array(\n\t\t\t'posts_per_page' => $this->settings->post_count,\n\t\t\t'tax_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'category',\n\t\t\t\t\t'field' => 'id',\n\t\t\t\t\t'terms' => $this->settings->post_categories,\n\t\t\t\t),\n\t\t\t),\n\t\t) );\n\t}",
"function custom_post_type_cat_filter($query) {\n if ( !is_admin() && $query->is_main_query() ) {\n if ($query->is_category()) {\n $query->set( 'post_type', array( 'articles', 'guides', 'conseils' ) );\n }\n }\n}",
"function model_cat_query($query) {\n\n global $wp_query;\n\n if (is_tax('model_categories')) {\n if (!$query->is_main_query())\n return;\n\n $query->set('orderby', array( 'menu_order' => 'DESC', 'date' => 'ASC' ));\n\t}\n}",
"function fetch_all_categories($limit, $start, $query)\n {\n $search = $query['search'];\n $this->db->select('*')->from($this->table);\n // if client search something\n if(!empty($search)) $this->db->like('category_name', $search);\n $query = $this->db->limit($limit, $start)->get()->result_array();\n\n // with restaurant info\n foreach ($query as $key => $category) {\n $query[$key]['restaurant'] = $this->global_model->has_one('restaurants', 'restaurant_id', $category['restaurant_id']);\n }\n return $query;\n }",
"public function adaptCategories(&$categories)\n {\n if (!$this->geo_filter_data['applied_location']\n || !$this->geo_filter_data['is_filtering']\n || ($_POST['xjxfun'] || $GLOBALS['page_info']['Key'] == 'search')\n ) {\n return;\n }\n\n foreach ($categories as &$category) {\n if (!$category['Count']) {\n continue;\n }\n\n $sql = \"SELECT COUNT(`T1`.`ID`) AS `Count` FROM `{db_prefix}listings` AS `T1` \";\n $sql .= \"LEFT JOIN `{db_prefix}categories` AS `T3` ON `T1`.`Category_ID` = `T3`.`ID` \";\n $sql .= \"WHERE (`T1`.`Category_ID` = {$category['ID']} OR FIND_IN_SET({$category['ID']}, `Crossed`) > 0 \";\n\n if ($GLOBALS['config']['lisitng_get_children']) {\n $sql .= \"OR FIND_IN_SET({$category['ID']}, `T3`.`Parent_IDs`) > 0 \";\n }\n\n $sql .= \") AND `T1`.`Status` = 'active' \";\n\n if ($GLOBALS['plugins']['listing_status']) {\n $sql .= \"AND `T1`.`Sub_status` <> 'invisible' \";\n }\n\n foreach ($this->geo_filter_data['location_listing_fields'] as $field => $value) {\n if ($field && $value) {\n $sql .= \"AND `T1`.`{$field}` = '{$value}' \";\n }\n }\n\n $category['Count'] = $GLOBALS['rlDb']->getRow($sql, 'Count');\n }\n }",
"public function cargarcategoria()\n {\n \treturn Cont_Categoria::whereRaw(\" jerarquia ~ '*{1}' \")\n \t\t\t\t\t\t\t->orderBy('jerarquia', 'asc')\n \t\t\t\t\t\t\t->get();\n \t;\t\n }",
"public function getAllWithCategoryAndTags();",
"function fetch_category_on_condition($query)\n {\n $this->db->select('*')->from($this->table);\n\n if(isset($query['category_id'])) {\n $this->db->where('category_id', $query['category_id']);\n }\n\n if(isset($query['category_slug'])) {\n $this->db->where('category_slug', $query['category_slug']);\n }\n\n $this->db->group_by('category_id')->order_by('visit_count', 'desc');\n if(isset($query['limit'])) {\n $this->db->limit($query['limit'], 0);\n }\n $query = $this->db->get()->result_array();\n\n // with restaurant, user, template info\n foreach ($query as $key => $category) {\n \n }\n return count($query) == 1 ? $query[0] : $query;\n }",
"public function query(Category $model)\n {\n return $model->newQuery();\n }",
"public static function get_categories($filter) {\n\t\t$query = DB::table(self::$table.' AS t1')\n\t\t\t->leftjoin('tbl_user AS t2', 't1.user_id', '=', 't2.id')\n\t\t\t->select('t1.*', 't2.name AS user_name')\n\t\t\t->orderBy('t1.created_at', 'DESC');\n\t\tif (isset($filter) && !blank($filter)) {\n\t\t\t$query = self::conditions_for_category($filter, $query);\n\t\t}\n\n\t\t$categories = parent::paginate($filter, $query);\n\t\treturn $categories;\n\t}",
"public function scopeListFrontEnd($query, $options)\n {\n /*\n * Default options\n */\n extract(array_merge([\n 'page' => 1,\n 'perPage' => 30,\n 'sort' => 'created_at',\n 'categories' => null,\n 'category' => null,\n 'search' => '',\n 'published' => true,\n ], $options));\n\n $searchableFields = ['title', 'slug', 'excerpt'];\n\n if ($published) {\n $query->isPublished();\n }\n\n /*\n * Sorting\n */\n if (!is_array($sort)) {\n $sort = [$sort];\n }\n\n foreach ($sort as $_sort) {\n\n if (in_array($_sort, array_keys(self::$allowedSortingOptions))) {\n $parts = explode(' ', $_sort);\n if (count($parts) < 2) {\n array_push($parts, 'desc');\n }\n list($sortField, $sortDirection) = $parts;\n if ($sortField == 'random') {\n $sortField = Db::raw('RAND()');\n }\n $query->orderBy($sortField, $sortDirection);\n }\n }\n\n /*\n * Search\n */\n $search = trim($search);\n if (strlen($search)) {\n $query->searchWhere($search, $searchableFields);\n }\n\n /*\n * Categories\n */\n if ($categories !== null) {\n if (!is_array($categories)) $categories = [$categories];\n $query->whereHas('categories', function($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }\n\n /*\n * Category, including children\n */\n if ($category !== null) {\n $category = Category::find($category);\n\n $categories = $category->getAllChildrenAndSelf()->lists('id');\n $query->whereHas('categories', function($q) use ($categories) {\n $q->whereIn('id', $categories);\n });\n }\n\n return $query->paginate($perPage, $page);\n }",
"public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}",
"public function getCategoryData(Request $request)\n {\n // Get Kawarabis\n $search = $request->input('search');\n $kawarabis = CategoryWiseSpecification::Where('subject', 'like', '%' . $search . '%')->orderBy('created_at', 'desc')->paginate(10);\n \n // Return collection of Kawarabis as a resource\n return CategoryWiseSpecificationResouerce::collection($kawarabis);\n }",
"protected function _categoryCondition($query) {\n if (!empty($query['conditions']['category']) && array_key_exists($query['conditions']['category'], $this->categories())) {\n $this->request['uri']['path'] .= '_' . $query['conditions']['category'];\n }\n return $query;\n }",
"public static function getActiveCategories(){}",
"public function getAllCategories();",
"public function filter(Request $request)\n {\n $fields = ['isbn', 'title', 'author', 'price', 'currency'];\n $books = Book::query();\n if ($request->has('author')) {\n $books->where('author', 'like', '%' . $request->author . '%');\n }\n if ($request->has('category')) {\n $categories = $this->resolveCategories($request);\n $books\n ->join('book_category_relations', 'books.id', '=', 'book_id')\n ->join('categories', 'categories.id', '=', 'category_id');\n // add all categories to where\n foreach($categories as $category) {\n if (is_numeric($category)) {\n $books->orWhere('categories.id', '=', $request->category);\n } else {\n $books->orWhere('categories.name', 'like', '%' . trim($request->category) . '%');\n }\n }\n }\n if ($request->has('isbn') || $request->isbn) {\n $books->where('isbn', 'like', '%' . $request->isbn . '%');\n }\n return response()->json($books->get($fields));\n }",
"public function scopeGetAll($query)\n\t{\n\t\treturn $query->select('kategori3.id','kategori3.kode_kategori3', 'kategori3.nama_kategori3', 'kategori2.kode_kategori2', 'kategori2.nama_kategori2', 'kategori1.kode_kategori1', 'kategori1.nama_kategori1');\n\t}",
"public function getCategories()\n {\n return Category::all();\n }",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['term']) && trim($params['term']) !== '' )\n {\n // $query->search( trim($params['term']) ); // Original\n\n $query->search( trim($params['term']), null, true, false );\n }\n\n\n\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $reference = $params['reference'];\n $query->where( function($query) use ($reference) { \n $query->where('reference', 'LIKE', '%' . $reference . '%');\n $query->orWhere('ean13', 'LIKE', '%' . $reference . '%');\n } );\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n\n /*\n // Moved from controller\n $query->orWhereHas('combinations', function($q) use ($reference)\n {\n // http://stackoverflow.com/questions/20801859/laravel-eloquent-filter-by-column-of-relationship\n $q->where('reference', 'LIKE', '%' . $reference . '%');\n }\n ); // ToDo: if name is supplied, shows records that match reference but do not match name (due to orWhere condition)\n */\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n\n if ( Auth::user()->language->iso_code == 'en' )\n {\n $query->orWhere('name_en', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['stock_control']) )\n {\n if ( $params['stock_control'] == 0 )\n $query->where('stock_control', '<=', 0);\n if ( $params['stock_control'] == 1 )\n $query->where('stock_control', '>', 0);\n }\n\n if ( isset($params['main_supplier_id']) )\n {\n if ( $params['main_supplier_id'] > 0 )\n $query->where('main_supplier_id', $params['main_supplier_id']);\n if ( $params['main_supplier_id'] < 0 )\n $query->where('main_supplier_id', 0)->orWhere('main_supplier_id', null);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id'])\n ->orderBy('position', 'asc');\n }\n\n if ( isset($params['work_center_id']) && $params['work_center_id'] > 0 )\n {\n $query->where('work_center_id', '=', $params['work_center_id']);\n }\n\n if ( isset($params['manufacturer_id']) && $params['manufacturer_id'] > 0 && 0)\n {\n $query->where('manufacturer_id', '=', $params['manufacturer_id']);\n }\n\n if ( isset($params['procurement_type']) && $params['procurement_type'] != '' )\n {\n $query->where('procurement_type', '=', $params['procurement_type']);\n }\n\n if ( isset($params['mrp_type']) && $params['mrp_type'] != '' )\n {\n $query->where('mrp_type', '=', $params['mrp_type']);\n }\n\n if ( isset($params['active']) )\n {\n if ( Configuration::isTrue('SHOW_PRODUCTS_ACTIVE_ONLY') )\n {\n if ( $params['active'] == 1 )\n {\n // Show active products, same as global scope ShowOnlyActiveScope\n // Do nothing\n ;\n\n } else {\n // Show not active products (0) or all (-1)\n // Remove global scope\n $query->withoutGlobalScope(ShowOnlyActiveScope::class);\n\n // https://www.manifest.uk.com/blog/overriding-eloquent-global-scopes\n\n // Show not active products (0)\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n }\n\n } else {\n\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n \n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n }\n\n return $query;\n }",
"public function scopeJoinKategori1($query)\n\t{\n\t\treturn $query->join('kategori1', 'kategori1.id' , '=', 'kategori2.id_kategori1');\n\t}",
"public function allCategories()\n {\n return Category::all();\n }",
"protected function getActiveCategories()\n {\n $categories = (new \\modules\\catalog\\categories\\CatalogCategories($this->_config));\n return $categories->setSubquery(' AND `statusId` = ?d', 1);\n }",
"public function addFacetCondition()\n {\n $category = $this->getCategory();\n\n Mage::dispatchEvent('category_filter_add_facet_to_collection_before', array('filter' => $this, 'category' => $category));\n\n if (!$this->getProductCollectionFacetSet()) {\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $options = array('script_field' => 'doc.categories.values + doc.show_in_categories.values');\n $query->addFacet('categories', 'terms', $options);\n }\n\n return $this;\n }",
"public function categories(Request $request)\n {\n $faqs = FrequentlyAskedQuestion::where('categories', 'like', '%'.$request->input('query').'%')->take(20)->latest()->get();\n $categories = array();\n $transformedCategories = array();\n\n $faqs->each(function($item, $key) use ($request, &$categories) {\n foreach ($item->categories as $category) {\n if (str_contains($category, $request->input('query')) && !in_array($category, $categories)) {\n array_push($categories, $category);\n }\n }\n });\n\n foreach ($categories as $category) {\n array_push($transformedCategories, [\n 'text' => $category,\n 'value' => $category\n ]);\n }\n\n return $transformedCategories;\n }",
"public function findCategoryBy(array $criteria);",
"public function search(Request $request, $category)\n { \n\n\n\n $result= Tip::where('category', 'like', '%'.$category.'%')->get();\n\n if(!empty($result)){\n $arraycategories=[];\n foreach($result as $res){\n $arraycategories[] = $res['category'];\n\n }\n\n return response()->json(array_unique($arraycategories));\n\n }\n\n }",
"public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }",
"protected function findAllCategories()\n {\n return resolve([]);\n }",
"public function search(Request $request)\n {\n // dd( $request->all() );\n if( !$request->has('category') )\n return redirect('wiki');\n $id = $request->get('category');\n $category = WikiCategory::find($id);\n $searchInput = new \\StdClass();\n $searchInput->search = $request->get('search');\n \n $query = WikiPage::where('category_id',$id)->orderBy('updated_at','desc');\n if( ViewHelper::universalHasPermission(array(15)) == false ){\n $query->whereNotIn('status_id',array(1,3) );\n }\n $querySearch = $this->search->searchWikiCategories( $request->all() ); \n \n \n \n $categoryEntries = $query->paginate(12); \n $categoryEntriesTree = $this->document->generateWikiTreeview( $categoryEntries );\n \n $search = $querySearch->paginate(12); \n $searchTreeView = $this->document->generateWikiTreeview( $search );\n \n $myQuery = $query->where('user_id', Auth::user()->id);\n $myCategory = $myQuery->paginate(12); \n $myCategoryEntriesTree = $this->document->generateWikiTreeview( $myCategory );\n // $categoryEntries = WikiPage::where('category_id',$id)->paginate(12);\n \n return view('wiki.category', compact('category','categoryEntries','categoryEntriesTree','search','searchTreeView','searchInput',\n 'myCategory','myCategoryEntriesTree') ); \n }",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"function getAllFoodpornsByCategory($cat)\n {\n $stmt = self::$_db->prepare(\"SELECT * FROM foodporn WHERE category=:cat\");\n $stmt->bindParam(\":cat\", $cat);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function scopeOfTypes($query, $type)\n {\n return $query->whereIn('stat_type', $type);\n }",
"public function scopeSearch($query, $term);",
"function mpcth_get_query_categories($categories, $type = 'blog') {\r\n\tif($type != 'blog')\r\n\t\t$all_categories = get_categories(array('taxonomy' => 'mpcth_portfolio_category', 'hide_empty' => 1));\r\n\telse\r\n\t\t$all_categories = get_categories(array('hide_empty' => 1));\r\n\t\r\n\t// make a list of categories that should be displayed (for WP query)\r\n\t$display_categories = '';\r\n\r\n\tif(isset($categories[0])) {\r\n\t\t$categories = unserialize($categories[0]);\r\n\r\n\t\tforeach($all_categories as $key) {\r\n\t\t\tif((isset($categories[$key->slug]) && $categories[$key->slug] == 'on') || !isset($categories[$key->slug]))\r\n\t\t\t\t$display_categories .= $key->slug.', ';\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $display_categories;\r\n}",
"public function scopeQuery($query)\n {\n // $query->where();\n }",
"public function search(Request $request)\n {\n $name = $request->input('name');\n // return $name;\n // $search = TRUE;\n if ($name) {\n //primeira é a coluna a segunda é a condição, terceira é o parametro \n //se eu tive outro where só colocar antes do ->get(), ->where(); \n $categories = Categoria::where('Categoria', 'like', '%' . $name . '%')->get();\n }\n //return $categories;\n // return view('category.index', compact('categories','search'));\n }",
"public function scopeTechnology($query, string $filter)\n {\n return $query->whereHas('technologies', function (Builder $query) use ($filter) {\n $query->where('technology', 'LIKE', '%' . $filter . '%');\n });\n }",
"public function searchByCategoryName(Request $request)\n {\n $name = $request->get('name');\n if($name !='' ){\n $categories=\\DB::table('campaign_category')\n ->where('name','like', '%' . $name . '%')\n ->paginate(10);\n $categories->setPath(url('admin/campaign/category'));\n $category_pagination = $categories->render();\n $data['category_pagination'] = $category_pagination;\n $data['categories'] = $categories;\n } else {\n $categories= CampaignCategory::orderBy('id','DESC')->paginate(10);\n $categories->setPath(url('admin/campaign/category'));\n $category_pagination = $categories->render();\n $data['category_pagination'] = $category_pagination;\n $data['categories'] = $categories;\n }\n return view('campaign-category.ajax-category-search',$data);\n }",
"public function get_categorys(Context $ctx) {\n $user = $ctx->getUser();\n if($user === null){\n return ResponseHelper::error('Access denied');\n }\n \n $db = $this->connect();\n $dt = new \\DateTime();\n $time_stamp = $dt->getTimestamp();\n $date_now = new \\MongoDate($time_stamp);\n \n // Set an event into array\n $event_lists = [];\n $events = $db->event->find([\n 'build' => 1,\n 'approve' => 1,\n 'date_end' => [ '$gte' => $date_now ]\n ],['date_end']);\n foreach($events as $event){\n $event_lists[] = $event['_id']->{'$id'};\n }\n \n $categories = [];\n $items = $db->tag->find([],['en']);\n foreach($items as $item){\n $item['id'] = $item['_id']->{'$id'};\n $item['name'] = $item['en'];\n \n // sniff status\n $item['sniffed'] = false;\n if(in_array($item['id'], $user['sniff_category'])){\n $item['sniffed'] = true;\n }\n \n // Search an event from event_tag in event(Array)\n $events = $db->event_tag->find(['tag_id' => $item['id']],['event_id']);\n $count_active_event = 0;\n foreach($events as $event){\n if(in_array($event['event_id'], $event_lists)){\n $count_active_event++;\n }\n }\n $item['rows'] = $count_active_event;\n\n // - Default picture\n if(!isset($item['picture'])){\n $item['picture'] = Image::default_category_picture();\n }\n $item['picture'] = Image::load_picture($item['picture']);\n \n unset($item['_id']);\n unset($item['en']);\n \n $categories[] = $item;\n }\n \n $res = [\n 'data' => $categories,\n 'length' => count($categories)\n ];\n \n return $res;\n }",
"public function categoly($cat) \n {\n $data['languages'] = Language::orderBy('created_at', 'DESC')->get();\n $data['categories'] = Category::orderBy('created_at', 'DESC')->get();\n\n $data['projectsByCategories'] = Project::where('category_id', $cat)->orderBy('created_at', 'DESC')->paginate(6);\n\n return view('pages.projects.showByOption', $data);\n }",
"public function categories( Request $request ){\n\n $search = $request->get('search') ?: false;\n\n /* @var \\Bolt\\Cache $cache */\n $cache = $this->app['cache'];\n\n $categories = $cache->fetch('tipser-categories');\n if(!$categories){\n $tipser = $this->loadCategories();\n $categories = $this->convertCategories($tipser);\n $cache->save('tipser-categories', $categories, self::CATEGORIES_TTL);\n }\n $categories = $this->filterCategories($categories, $search);\n\n return new JsonResponse([\n 'items' => $categories,\n 'stats' => [\n 'total' => count($categories)\n ],\n 'status' => true,\n ]);\n }",
"public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }",
"public function getServerCategories($filter=\"\"){\n $category = new Category;\n return $category->get();\n }",
"public function byCategory(Request $request)\n {\n // Default return today's expense\n $myUser = Auth::user();\n if (isset($request->start_date) && isset($request->end_date)) {\n $start_date = $request->start_date;\n $end_date = $request->end_date;\n } elseif (isset($request->start_date)) {\n $start_date = $request->start_date;\n $end_date = date('Y-m-d');\n } else {\n $start_date = date('Y-m-d');\n $end_date = date('Y-m-d');\n }\n $myExpense = Expense::selectRaw('expense_code, sum(amount) as total_amount')\n ->whereBetween('expense_date', [ $start_date, $end_date ])\n ->where('user_id', $myUser->id)\n ->orderby('expense_code')\n ->groupby('expense_code')\n ->get();\n\n return view('report.bycategory')\n ->with('expenseList', $myExpense)\n ->with('start_date', $start_date)\n ->with('end_date', $end_date);\n }",
"public function authFilter(Request $request)\n {\n $user_id = Auth::user()->id;\n\n if($request->query('q')){\n $images = Image::where('user_id',$user_id )\n ->where('caption','LIKE','%'.$request->query('q').'%')\n ->paginate(6);\n }\n\n elseif ($request->query('category') && $request->query('category') != \"All\"){\n $images = Image::where('user_id',$user_id )\n ->where('category','LIKE','%'.$request->query('category').'%')\n ->paginate(6);\n }\n elseif(!$request->query('q') || ($request->query('category') && $request->query('category') == \"All\") ) {\n $images = Image::where('user_id', Auth::user()->id)->paginate(6);\n }\n\n return $images;\n }",
"public function search($category)\n {\n // but if the criteria title is specified, we use it\n \n $boolQuery = new \\Elastica\\Query\\Bool();\n /*Fetch only VALIDATED place*/\n $queryStatus = new \\Elastica\\Query\\Match();\n $queryStatus->setFieldQuery('event.status', StatusType::VALIDATED);\n $boolQuery->addMust($queryStatus);\n \n if($category !== null){\n $queryCategory = new \\Elastica\\Query\\Match();\n $queryCategory->setFieldQuery('event.categories.slug', $category);\n $boolQuery->addMust($queryCategory);\n } \n \n// if($placeSearch->getBirthdayDiscount() != null && $placeSearch->getBirthdayDiscount() > 0 ){\n// $queryRange = new \\Elastica\\Query\\Range();\n// $queryRange->setParam('place.birthdayDiscount', ['gte' => 1]);\n// $boolQuery->addMust($queryRange);\n// }\n// \n// if(($placeSearch->getName() != null || $placeSearch->getCategories() != null ) && $placeSearch != null){\n// \n// if($placeSearch->getName() != null){\n// $query = new \\Elastica\\Query\\Match();\n// $query->setFieldQuery('place.name', $placeSearch->getName());\n// $query->setFieldFuzziness('place.name', 1);\n// $query->setFieldMinimumShouldMatch('place.name', '10%');\n// $boolQuery->addMust($query);\n// }\n// \n// if($placeSearch->getCategories() != null){ \n// foreach ($placeSearch->getCategories() as $cat){ \n// $categories[] = $cat->getName(); \n// }\n// $queryCategories = new \\Elastica\\Query\\Terms();\n// $queryCategories->setTerms('place.categories', $categories);\n// $boolQuery->addShould($queryCategories);\n// }\n// \n //} \n else {\n $query = new \\Elastica\\Query\\MatchAll();\n }\n $baseQuery = $boolQuery; \n\n // then we create filters depending on the chosen criterias\n $boolFilter = new \\Elastica\\Filter\\Bool();\n\n /*\n Dates filter\n We add this filter only the getIspublished filter is not at \"false\"\n */\n// if(\"false\" != $articleSearch->getIsPublished()\n// && null !== $articleSearch->getDateFrom()\n// && null !== $articleSearch->getDateTo())\n// {\n// $boolFilter->addMust(new \\Elastica\\Filter\\Range('publishedAt',\n// array(\n// 'gte' => \\Elastica\\Util::convertDate($articleSearch->getDateFrom()->getTimestamp()),\n// 'lte' => \\Elastica\\Util::convertDate($articleSearch->getDateTo()->getTimestamp())\n// )\n// ));\n// }\n//\n // Published or not filter\n// if($placeSearch->getIs24h() !== null && $placeSearch->getIs24h()){\n// //var_dump($placeSearch->getIs24h());die();\n// $boolFilter->addMust(\n// new \\Elastica\\Filter\\Term(['is24h' => $placeSearch->getIs24h()])\n// //new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// ); \n// \n// //$boolFilter->addMust('is24h', $placeSearch->getIs24h());\n// }\n// \n// if($placeSearch->getIsWifi() !== null && $placeSearch->getIsWifi()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// );\n// }\n// \n// if($placeSearch->getIsDelivery() !== null && $placeSearch->getIsDelivery()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isDelivery' => $placeSearch->getIsDelivery()]) \n// );\n// } \n\n $filtered = new \\Elastica\\Query\\Filtered($baseQuery, $boolFilter);\n\n $query = \\Elastica\\Query::create($filtered);\n\n return $this->find($query);\n }",
"public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }",
"function get_all_trending_category( $conds = array(), $limit = false, $offset = false ) \n\t{\n\n\t\t// where clause\n\t\t//$this->custom_conds( $conds );\n\n\t\t// inner join with products and touches\n\t\t$this->db->select(\"cat.*\");\n\t\t$this->db->from($this->table_name . ' as cat');\n\t\t$this->db->join('rt_touches as tou', 'cat.id = tou.type_id');\n\t\t$this->db->where( \"tou.type_name\", \"category\");\n\t\t$this->db->where( \"cat.status\", \"1\");\n\n\t\t$this->db->group_by(\"tou.type_id\");\n\t\t$this->db->order_by(\"count(DISTINCT tou.id)\", \"DESC\");\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\t\t\n\t\t return $this->db->get();\n\n\t}",
"public function searchWithCategory(Request $request)\n {\n $category = trim($request->get('category'));\n\n if ($category) {\n $products = Product::where('category_id', '=', $category)\n ->orderBy('created_at', 'desc')\n ->paginate(4);\n }\n \n return view('products.index', [\n 'products' => $products\n ]);\n \n }",
"function get_categories_by_channel()\n\t{\n\t\t// get variables\n\t\t$vars = $this->_get_vars('get', array('channel_id'), array(\n\t\t\t'select' => array(),\n\t\t\t'where' => array(),\n\t\t\t'order_by' => 'cat_order',\n\t\t\t'sort' => 'asc',\n\t\t\t'limit' => FALSE,\n\t\t\t'offset' => 0\n\t\t));\n\n\t\t// prepare variables for sql\n\t\t$vars = $this->_prepare_sql($vars);\n\t\t\n\t\t// start hook\n\t\t$vars = $this->_hook('get_categories_by_channel_start', $vars);\n\n\t\t// load channel data library\n\t\t$this->_load_library('channel_data');\n\n\t\t$data = $this->EE->channel_data_lib->get_channel_categories($vars['channel_id'], $vars['select'], $vars['where'], $vars['order_by'], $vars['sort'], $vars['limit'], $vars['offset'])->result();\n\n\t\t// end hook\n\t\t$data = $this->_hook('get_categories_by_channel_end', $data);\n\n\t\t$this->response($data);\n\t}",
"public function scopePublished($query)\n {\n \n $query->with(['category','tags','owner','photos'])\n ->whereNotNull('published_at')\n ->where('published_at','<=',Carbon::now())\n ->latest('published_at');\n }",
"public function view_by_cat($name){\n $categories = Category::get();\n $items = Item::where('item_category', $name)->paginate(4);\n\n return view('customer.shop')->with('items', $items)->with('categories', $categories);\n}",
"function scopeActiveWithPlacesRelated($query)\n {\n return $query\n ->select('name', 'image', 'slug', 'anons', 'publish_date')\n ->where('status', 1)\n ->orderBy('created_at', 'desc')\n ->limit(8)\n ->get();\n }",
"public function get_purchased_category_by ( $conds = array(), $limit = false, $offset = false ){\n\t\t//$this->custom_conds();\n\t\t//where clause\n\t\t$this->db->select('rt_categories.*, count(rt_transactions_counts.cat_id) as t_count'); \n \t\t$this->db->from('rt_categories');\n \t\t$this->db->join('rt_transactions_counts', 'rt_categories.id = rt_transactions_counts.cat_id');\n \t\t$this->db->where('rt_categories.status',1);\n \t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n \t\t\n\n\t\tif ( isset( $conds['search_term'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\nif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\t\t\t\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"' - INTERVAL 1 DAY) AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"' - INTERVAL 1 DAY) AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_transactions_counts.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t}\n\t\t\t \n\t\t\t \n\t }\n\n \t\t$this->db->group_by('rt_transactions_counts.cat_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by('rt_transactions_counts.added_date', \"desc\");\n \t\t\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n\n\t}",
"function get_category( $conds = array(), $limit = false, $offset = false )\n\t{\n\t\t$this->db->select('rt_categories.*'); \n\t\t$this->db->from('rt_categories');\n\t\t$this->db->join('rt_products', 'rt_products.cat_id = rt_categories.id');\n\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\tif ($conds['shop_id'] != \"\" ) {\n\t\t\t\tif ($conds['shop_id'] != '0') {\n\t\t\t\t\t$this->db->where( 'rt_products.shop_id', $conds['shop_id'] );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif ( !isset( $conds['no_publish_filter'] )) {\n\t\t\t$this->db->where( 'rt_categories.status', 1 );\n\t\t}\n\n\t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n\t\t//$this->db->order_by(\"count(DISTINCT rt_subcategories.id)\", \"DESC\");\n\t\t$this->db->distinct();\n\t\treturn $this->db->get();\n\n \t}",
"public function scopeJoinKategori2($query)\n\t{\n\t\treturn $query->join('kategori2', 'kategori2.id' , '=', 'kategori3.id_kategori2');\n\t}"
]
| [
"0.7117974",
"0.7099395",
"0.7033951",
"0.7013661",
"0.70024514",
"0.69857115",
"0.6832937",
"0.67554414",
"0.6715008",
"0.6696883",
"0.665707",
"0.6564867",
"0.6559938",
"0.64579487",
"0.63689077",
"0.63406354",
"0.62794393",
"0.62668943",
"0.62645423",
"0.62170285",
"0.62165093",
"0.6210781",
"0.62012786",
"0.6201136",
"0.6143742",
"0.6003364",
"0.59949386",
"0.59809554",
"0.5946788",
"0.58783203",
"0.58605945",
"0.58398366",
"0.58273745",
"0.579077",
"0.5787886",
"0.5779405",
"0.5775682",
"0.5773005",
"0.57580864",
"0.57377845",
"0.5733753",
"0.5733231",
"0.5729447",
"0.57159543",
"0.56948566",
"0.5662956",
"0.56536245",
"0.5651542",
"0.5626121",
"0.56156087",
"0.56143755",
"0.5602747",
"0.5589087",
"0.5584046",
"0.5581032",
"0.557348",
"0.55615544",
"0.5560455",
"0.55528027",
"0.5542919",
"0.5531077",
"0.5520999",
"0.55119354",
"0.548687",
"0.5486309",
"0.5482394",
"0.5481666",
"0.54780537",
"0.5474688",
"0.5448289",
"0.5446097",
"0.5435297",
"0.54341537",
"0.54202133",
"0.5420057",
"0.5415985",
"0.54081744",
"0.54065526",
"0.54060835",
"0.5397958",
"0.5397955",
"0.53928995",
"0.5390804",
"0.5385846",
"0.5384538",
"0.53838885",
"0.53810865",
"0.537373",
"0.5370598",
"0.53597516",
"0.53585523",
"0.5352163",
"0.53511137",
"0.53489095",
"0.5347977",
"0.5337503",
"0.5335946",
"0.53330266",
"0.5332765",
"0.5322329"
]
| 0.66073895 | 11 |
Scope a query to filter by authors | public function scopeAuthors($query, $values)
{
return $query->whereHas('user', function ($query) use ($values) {
return $query->whereIn('name', explode(',', $values));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeAuthoredBy ($query, $id) {\n return $query->whereIn('author_id', (array) $id);\n }",
"static function author_query() {\n\t\tif (BlogExtensions::$author_groups) {\n\t\t\t$query = singleton('Member')->extendedSQL('', '', null,\n\t\t\t\t'INNER JOIN \"Group_Members\" ON \"Group_Members\".\"MemberID\" = \"Member\".\"ID\" '\n\t\t\t\t\t. ' AND \"Group_Members\".\"GroupID\" in (' . implode(',', BlogExtensions::$author_groups) .')');\n\t\t} else {\n\t\t\t$query = singleton('Member')->extendedSQL('', '', null,'');\n\t\t}\n\t\t\n\t\treturn $query;\n\t}",
"public function get_authors();",
"public function getAuthors(): AuthorCollection;",
"function get_editable_authors($user_id)\n {\n }",
"public function user()\n {\n $this->query->where('author_id', auth()->user()->id);\n }",
"public function getAuthors();",
"public function scopeForCreator($query, $creator)\n {\n return $query->where('created_by', $creator);\n }",
"function getAllVisibleAuthors()\r\n {\r\n $CI = &get_instance();\r\n $userlogin=getUserLogin();\r\n \r\n if ($userlogin->hasRights('read_all_override'))\r\n return $this->getAllAuthors();\r\n \r\n if ($userlogin->isAnonymous()) //get only public authors\r\n {\r\n $Q = $CI->db->query(\"SELECT DISTINCT \".AIGAION_DB_PREFIX.\"author.* FROM \".AIGAION_DB_PREFIX.\"author, \".AIGAION_DB_PREFIX.\"publicationauthorlink, \".AIGAION_DB_PREFIX.\"publication\r\n WHERE \".AIGAION_DB_PREFIX.\"publication.derived_read_access_level = 'public'\r\n AND \".AIGAION_DB_PREFIX.\"publicationauthorlink.pub_id = \".AIGAION_DB_PREFIX.\"publication.pub_id \r\n AND \".AIGAION_DB_PREFIX.\"author.author_id = \".AIGAION_DB_PREFIX.\"publicationauthorlink.author_id\r\n ORDER BY \".AIGAION_DB_PREFIX.\"author.cleanname\");\r\n }\r\n else //get all non-private authors and authors for publications that belong to the user\r\n {\r\n $Q = $CI->db->query(\"SELECT DISTINCT \".AIGAION_DB_PREFIX.\"author.* FROM \".AIGAION_DB_PREFIX.\"author, \".AIGAION_DB_PREFIX.\"publicationauthorlink, \".AIGAION_DB_PREFIX.\"publication\r\n WHERE (\".AIGAION_DB_PREFIX.\"publication.derived_read_access_level != 'private' \r\n OR \".AIGAION_DB_PREFIX.\"publication.user_id = \".$userlogin->userId().\")\r\n AND \".AIGAION_DB_PREFIX.\"publicationauthorlink.pub_id = \".AIGAION_DB_PREFIX.\"publication.pub_id \r\n AND \".AIGAION_DB_PREFIX.\"author.author_id = \".AIGAION_DB_PREFIX.\"publicationauthorlink.author_id\r\n ORDER BY \".AIGAION_DB_PREFIX.\"author.cleanname\");\r\n }\r\n \r\n //retrieve results or fail \r\n foreach ($Q->result() as $row)\r\n {\r\n $next = $this->getFromRow($row);\r\n if ($next != null)\r\n {\r\n $result[] = $next;\r\n }\r\n }\r\n return $result;\r\n \r\n }",
"private function getBooksByAuthor(array $args = []): BookCollection\n {\n// if (empty($args['author'])) {\n return new BookCollection();\n/* }\n\n $firstName = (empty($args['author']['firstName']) ? '' : $args['author']['firstName']);\n $lastName = (empty($args['author']['lastName']) ? '' : $args['author']['lastName']);\n\n try {\n $bookModel = new BookModel($this->container);\n } catch (\\Exception $e) {\n return new BookCollection();\n }\n\n return $bookModel->findBooksByAuthor($lastName, $firstName); */\n }",
"public function searchAuthors(string $q)\n {\n return User::has('posts')\n ->where(function ($query) use ($q) {\n $query->where('username', 'like', \"%{$q}%\")\n ->orWhere('email', 'like', \"%{$q}%\");\n })\n ->limit(10)\n ->get();\n }",
"function search_authors($publication_id) { \n $sql = \"SELECT * FROM people_publications INNER JOIN people ON people_publications.person_id=people.person_id WHERE people_publications.publication_id = '$publication_id' \"; \n $authors = $this->fetch($sql);\n return($authors);\n }",
"function opdsByAuthor($initial, $id, $page)\n{\n global $app, $globalSettings;\n\n // parameter checking\n if (!is_numeric($id) || !is_numeric($page)) {\n $app->getLog()->warn('opdsByAuthor: invalid author id ' . $id . ' or page id ' . $page);\n $app->halt(400, \"Bad parameter\");\n }\n\n $filter = getFilter();\n $tl = $app->calibre->authorDetailsSlice($globalSettings['lang'], $id, $page, $globalSettings[PAGE_SIZE], $filter);\n $app->getLog()->debug('opdsByAuthor 1 ' . var_export($tl, true));\n $books1 = $app->calibre->titleDetailsFilteredOpds($tl['entries']);\n $books = array_map('checkThumbnailOpds', $books1);\n $app->getLog()->debug('opdsByAuthor 2 ' . var_export($books, true));\n $gen = mkOpdsGenerator($app);\n $cat = $gen->booksForAuthorCatalog(\n null,\n $books,\n $initial,\n $tl['author'],\n false,\n $tl['page'],\n getNextSearchPage($tl),\n getLastSearchPage($tl)\n );\n mkOpdsResponse($app, $cat, OpdsGenerator::OPDS_MIME_ACQ);\n}",
"public function scopeOwnedBy($query, $ownerId)\n {\n return $query->whereHas('coordinators', function ($q) use ($ownerId) {\n $q->where('user_id', $ownerId);\n });\n }",
"public function scopeSearch($query, $term)\n {\n if($term)\n {\n $query->where(function ($q) use ($term){\n $q->where('title', 'LIKE', \"%{$term}%\");\n\n $q->orwhereHas('author', function ($qr) use ($term){\n $qr->where('name', 'LIKE', \"%{$term}%\");\n });\n });\n }\n }",
"public function find_authors(){\n //return $query;\n $this->db->select('name_chn');\n $query=$this->db->get('users');\n return $query;\n }",
"public function scopeMy($query)\n {\n return $query->where('created_by', auth()->user()->id);\n }",
"public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }",
"public function scopeOfAuthenticatedUser($query)\n {\n $query->whereUserId(Auth::id());\n }",
"public function scopeForOwner($query)\n {\n return $query;\n }",
"public function scopeArtistName($query, $artist_name) {\n return $query->whereHas('artists', function($q) use ($artist_name) {\n $q->where('artists.name', 'LIKE', '%' . $artist_name . '%');\n });\n }",
"function master_sidebar_author_quick_search( $request = array() ) {\n\n\n\tif ( ! empty( $request ) && isset( $request['q'] ) ) {\n\n\t\t// Define query args for author query \n\t\t$roles = array( 'Administrator', 'Editor', 'Author' ); \n\t\t$db_id = -9999;\n\n\t\t// Get all users that have author priviledges\n\t\tforeach ( $roles as $role ) {\n\n\t\t\t$search_query = $request['q'];\n\n\t\t\t$args = array(\n\t\t\t\t'search_columns' => array( 'ID', 'user_login', 'user_nicename', 'user_email' ),\n\t\t\t\t'role' => $role,\n\t\t\t);\n\t\n\t\t\t// The Query\n\t\t\t$user_query = new WP_User_Query( $args );\n\n\t\t\t// Output search results\n\t\t\tif ( ! empty( $user_query->results ) ) {\n\t\t\t\tforeach ( $user_query->results as $user ) {\n\t\t\t\t\tif ( false !== stripos( $user->data->display_name, $search_query ) ) {\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<label class=\"menu-item-title\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" value =\"1\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-object-id]\" class=\"menu-item-checkbox\"> <?php echo $user->data->display_name; ?>\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t<input class=\"menu-item-db-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-db-id]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-object\" type=\"hidden\" value=\"<?php echo $user->data->ID; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-object]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-parent-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-parent-id]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-type\" type=\"hidden\" value=\"author_archive\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-type]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-title\" type=\"hidden\" value=\"<?php echo $user->data->display_name; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-title]\">\n\t\t\t\t\t\t\t<input class=\"menu-item-url\" type=\"hidden\" value=\"<?php echo $user->data->user_url; ?>\" name=\"menu-item[<?php echo $db_id; ?>][menu-item-url]\">\n\t\t\t\t\t\t</li>\t\t\t\t\t\t\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\n\t\t\t\t\t$db_id++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} // endif\n}",
"function wv_posts_for_current_author($query) {\n\n if ($query->is_admin) {\n\n global $user_ID;\n $roles = $this->wv_get_loggedin_user_role();\n //if roles is vendor then set the posts by author wise.\n if ($roles == \"wvm_role_vendor\") {\n $query->set('author', $user_ID);\n }\n }\n return $query;\n }",
"private function actionGetAuthors() {\n\t\t$authors = array();\n\t\t$obj = new stdClass();\n\n\t\t$users = get_users( 'exclude=[1]&who=authors' );\n\n\t\tforeach ( $users as $user ) {\n\t\t\t$authors[] = array( 'id' => $user->ID, 'name' => $user->display_name );\n\t\t}\n\n\t\t$obj->success = true;\n\t\t$obj->errorMessage = null;\n\t\t$obj->authors = $authors;\n\n\t\t$this->sendJSON( $obj );\n\t}",
"public function authorList()\n\t{\n\t\t$authors = ee('Member')->getAuthors(ee('Request')->get('search'));\n\n\t\tif (AJAX_REQUEST)\n\t\t{\n\t\t\treturn ee('View/Helpers')->normalizedChoices($authors);\n\t\t}\n\n\t\treturn $authors;\n\t}",
"function get_posts_by_author_sql($post_type, $full = \\true, $post_author = \\null, $public_only = \\false)\n {\n }",
"public function scopeYear($query, $year)\n {\n return $query->whereYear('created_at', $year);\n }",
"public function filterByAuthor($author = null, $comparison = null)\n\t{\n\t\tif (null === $comparison) {\n\t\t\tif (is_array($author)) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t} elseif (preg_match('/[\\%\\*]/', $author)) {\n\t\t\t\t$author = str_replace('*', '%', $author);\n\t\t\t\t$comparison = Criteria::LIKE;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(LpPeer::AUTHOR, $author, $comparison);\n\t}",
"public function is_author($author = '')\n {\n }",
"function checkAuthors () {\n\t\tif ( count ( $this->authors) == 0 ) return ;\n\t\n\t\tif ( isset($this->existing_q) ) {\n\t\t\t$this->wd->loadItem ( $this->existing_q ) ;\n\t\t\t$i = $this->wd->getItem ( $this->existing_q ) ;\n\t\t\t$c1 = $i->getClaims ( $this->props['author'] ) ;\n\t\t\t$c2 = $i->getClaims ( $this->props['short author'] ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c1 ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c2 ) ;\n\t\t\t\n\t\t\t// Special case: Single author, one author already in item...\n\t\t\tif ( count($this->authors) == 1 && count($c1)+count($c2) == 1 ) {\n\t\t\t\t$this->authors[1]->hadthat = true ;\n\t\t\t}\n\t\t}\n\t}",
"public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }",
"public function scopeFilter($query, $term)\n {\n return $query\n ->where('name', 'like', '%' . $term . '%')\n ->orWhere('email', 'like', '%' . $term . '%');\n }",
"private function filter_by_author( $args, $nicename ){\n\n\t\t$author_args = array( 'author_name' => esc_attr( $nicename ) );\n\n\t\t$updated_args = array_merge( $author_args, $args );\n\n\t\treturn $updated_args;\n\n\t}",
"public function index()\n {\n\n $query = Author::query(); // FROM `authors` (will return App\\Author objects)\n\n if (isset($page_nr) && $page_nr = 2) {\n $query->offset(10); // LIMIT 10, ...\n }\n\n $query->limit(10); // LIMIT 10\n\n $query->where('name', 'like', 'George%'); // WHERE `name` LIKE 'George%'\n\n $results = $query->get(); // SELECT *\n\n\n $authors = Author::query()\n ->with('books')\n ->limit(10)\n ->where('name', 'like', 'G%')\n ->get();\n\n // $results = Author::query()\n // ->with('books')\n // ->limit(10)\n // ->where('name', 'like', 'G%')\n // ->count();\n\n // dd($results);\n\n return view('authors.index', compact('authors'));\n }",
"public function index()\n {\n //->whereNotIn('id',[Auth::user()->id])->paginate('10');\n $authors = User::with('roles')->whereNotIn('id',[Auth::user()->id])->paginate('10');\n // dd($authors);\n return view('authors.index',compact('authors'));\n }",
"public function scopeFilter($query, $term)\n {\n $term = '%' . $term . '%';\n\n return $query->where('first_name', 'LIKE', $term)\n ->orWhere('last_name', 'LIKE', $term)\n ->orWhere('email', 'LIKE', $term);\n }",
"public function customAuthors() {\n $query = \"SELECT a.*\n FROM authors a, books b, author_book ab\n WHERE b.id = ab.book_id\n AND a.id = ab.author_id\n AND b.id = :id;\";\n $query = DB::select(DB::raw($query), ['id' => $this->id]);\n return Author::hydrate($query);\n }",
"public function includeAuthors()\n {\n return $this->addInclude('authors');\n }",
"public function getAuthor();",
"public function getAuthor();",
"public function getAuthor();",
"function the_author_icq()\n {\n }",
"public function search($params)\n {\n $query = Authors::find()\n ->addSelect('{{%authors}}.*, COUNT({{%authors_books}}.author_id) as countBooks')\n ->joinWith('books')\n ->groupBy('{{%authors}}.id');\n\n /*\n $query = Authors::find()\n ->addSelect('{{%authors}}.*, COUNT({{%authors_books}}.author_id) as countBooks')\n ->leftJoin('{{%authors_books}}', '{{%authors_books}}.author_id = {{%authors}}.id')\n ->groupBy('{{%authors}}.id');\n */\n // SELECT `authors`.*, COUNT(authors_books.author_id) as count_books FROM `authors` left join authors_books on authors_books.author_id = authors.id GROUP BY authors.id\n \n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $dataProvider->setSort([\n 'attributes' => [\n // 'id',\n 'name',\n 'created_at',\n 'updated_at',\n 'countBooks',\n ],\n ]);\n \n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'id' => $this->id,\n 'FROM_UNIXTIME({{%authors}}.created_at, \"%d-%m-%Y\")' => $this->created_at,\n 'FROM_UNIXTIME({{%authors}}.updated_at, \"%d-%m-%Y\")' => $this->updated_at,\n ]);\n \n /* available since version 2.0.11\n $query->andFilterHaving([\n 'countBooks' => $this->countBooks,\n ]);\n */\n \n if ($this->countBooks !== '' && $this->countBooks !== null) {\n $query->having([\n 'countBooks' => $this->countBooks,\n ]);\n }\n \n $query->andFilterWhere(['like', 'name', $this->name]);\n \n return $dataProvider;\n }",
"public function scopeOwner($query, $user_id)\n\t{\n\t\treturn $query->where('user_id', $user_id);\n\t}",
"public function getByAuthor()\n {\n return $this->by_author;\n }",
"public function getAllAuthors()\n {\n return Author::orderBy('created_at', 'desc')->get();\n }",
"public function authorsProvider()\n {\n return [[[]]];\n }",
"public function findByAuthor(Tx_TerFe2_Domain_Model_Author $author) {\n\t\t\t$uids = $this->searchRepository->findUidsByAuthor($author);\n\n\t\t\t\t// Workaround to enable paginate\n\t\t\t$query = $this->createQuery();\n\t\t\t$query->getQuerySettings()->setRespectStoragePage(FALSE);\n\t\t\t$query->getQuerySettings()->setRespectSysLanguage(FALSE);\n\t\t\t$query->setOrderings(\n\t\t\t\tarray('extKey' => Tx_Extbase_Persistence_QueryInterface::ORDER_ASCENDING)\n\t\t\t);\n\t\t\t$this->match($query, $query->in('uid', $uids));\n\n\t\t\treturn $query->execute();\n\t\t}",
"public function getAuthor() {}",
"public function author();",
"function ridizain_list_authors() {\r\n\t$contributor_ids = get_users( array(\r\n\t\t'fields' => 'ID',\r\n\t\t'orderby' => 'post_count',\r\n\t\t'order' => 'DESC',\r\n\t\t'who' => 'authors',\r\n\t) );\r\n\r\n\tforeach ( $contributor_ids as $contributor_id ) :\r\n\t\t$post_count = count_user_posts( $contributor_id );\r\n\r\n\t\t// Move on if user has not published a post (yet).\r\n\t\tif ( ! $post_count ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t?>\r\n\r\n\t<div class=\"contributor\">\r\n\t\t<div class=\"contributor-info\">\r\n\t\t\t<div class=\"contributor-avatar\"><?php echo get_avatar( $contributor_id, 132 ); ?></div>\r\n\t\t\t<div class=\"contributor-summary\">\r\n\t\t\t\t<h2 class=\"contributor-name\"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>\r\n\t\t\t\t<p class=\"contributor-bio\">\r\n\t\t\t\t\t<?php echo get_the_author_meta( 'description', $contributor_id ); ?>\r\n\t\t\t\t</p>\r\n\t\t\t\t<a class=\"contributor-posts-link\" href=\"<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>\">\r\n\t\t\t\t\t<?php printf( _n( '%d Article', '%d Articles', $post_count, 'ridizain' ), $post_count ); ?>\r\n\t\t\t\t</a>\r\n\t\t\t</div><!-- .contributor-summary -->\r\n\t\t</div><!-- .contributor-info -->\r\n\t</div><!-- .contributor -->\r\n\r\n\t<?php\r\n\tendforeach;\r\n}",
"function hs_filter_posts_list($query)\n{\n\t global $pagenow;\n\n\t//$current_user uses the get_currentuserinfo() method to get the currently logged in user's data\n\t global $current_user;\n\t wp_get_current_user();\n \n \t//Shouldn't happen for the admin, but for any role with the edit_posts capability and only on the posts list page, that is edit.php\n \tif(!current_user_can('administrator') && current_user_can('edit_posts') && ('edit.php' == $pagenow))\n \t {\n\t\t//global $query's set() method for setting the author as the current user's id\n\t\t$query->set('author', $current_user->ID); \n \t}\n}",
"public function scopePost($query)\n {\n $query->with('author')->where('type', '=', self::POST);\n }",
"function get_the_author_aim()\n {\n }",
"public function authors() {\n return $this->belongsToMany('App\\Models\\Author');\n }",
"function the_author_aim()\n {\n }",
"public function index()\n {\n return AuthorResource::collection(Author::get()->take(3));\n }",
"public function getFilterArtworks($request){\n return DB::select('select * from users, personal_account_models where users.id = personal_account_models.user_id AND personal_account_models.published = 1 AND users.name Like \"%'.$request['artist'].'%\"');\n }",
"public static function get_authors_parameters() {\n return new external_function_parameters(array(\n 'id' => new external_value(PARAM_INT, 'Glossary entry ID'),\n 'from' => new external_value(PARAM_INT, 'Start returning records from here', VALUE_DEFAULT, 0),\n 'limit' => new external_value(PARAM_INT, 'Number of records to return', VALUE_DEFAULT, 20),\n 'options' => new external_single_structure(array(\n 'includenotapproved' => new external_value(PARAM_BOOL, 'When false, includes self even if all of their entries' .\n ' require approval. When true, also includes authors only having entries pending approval.', VALUE_DEFAULT, 0)\n ), 'An array of options', VALUE_DEFAULT, array())\n ));\n }",
"public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }",
"public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }",
"function getAuthors(PDO $connection, int $num): bool|array {\n $statement = $connection->prepare(AUTHOR_QUERY);\n $statement->bindValue(':num', $num, PDO::PARAM_INT);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}",
"public function authors(){\n $this->data['authors'] = $this->books_model->getAllAuthors();\n $this->render('books/authors');\n }",
"public function skyword_get_authors( $args ) {\n\t\tglobal $wp_xmlrpc_server;\n\t\t$wp_xmlrpc_server->escape( $args );\n\t\t$authors = $wp_xmlrpc_server->wp_getAuthors ($args);\n\t\treturn $authors;\n\n\n\t}",
"public function searchAuthor($author) {\n try {\n // escape quotes\n $checkAuthor = str_replace(\"'\", \"''\", $author);\n // search the database, using wildcards\n $sql = \"SELECT * FROM books WHERE author LIKE '%$checkAuthor%' ORDER BY title\";\n $stmt = $this->conn->query($sql);\n \n // fetch as numeric array\n $result = $stmt->setFetchMode(PDO::FETCH_NUM);\n \n // show results in a list of update forms\n echo \"<br /><div id='searchResult'><h3>Author: $author</h3><ul>\";\n while ($row = $stmt->fetch()) {\n // call result form function\n $this->echoResultForm($row);\n }\n echo \"</ul></div>\";\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }",
"public function author($id);",
"public function authors()\n {\n return $this->belongsToMany(Author::class);\n }",
"public function authors()\n {\n return $this->belongsToMany(Author::class);\n }",
"function get_the_author_icq()\n {\n }",
"function cwrc_get_authorities_list($setup_data, $query) {\n $collection = $setup_data['collection'];\n $query_string = 'collection:\"' . $collection . '\"';\n // $records = emic_process_query($query_string);\n $terms = explode(' ', $query);\n $terms = array_filter($terms);\n $solr = variable_get('islandora_solr_search_block_url', 'http://localhost:8080/solr');\n\n $url = \"http://$solr/select?indent=on&version=2.2&q=$query_string&fq=&start=0&rows=1000&qt=standard&wt=json&explainOther=&hl.fl=\";\n $results = json_decode(file_get_contents($url), TRUE);\n $docs = $results['response']['docs'];\n foreach ($docs as $doc) {\n $pid = $doc['PID'];\n $contents = array();\n foreach ($doc['emic.searchname'] as $sample) {\n $identifier = null;\n if (!empty($sample) & !$identifier) {\n $identifier = $sample;\n }\n }\n //$identifier = implode('', $doc['emic.searchname']);\n $contents['identifier'] = $identifier;\n $contents['Object'] = \"<a href='/fedora/repository/$pid' target='_blank'>$pid</a>\";\n $contents['Note'] = $doc['dc.description'][0];\n $records[$doc['PID']] = $contents;\n }\n\n while (count($terms) > 0) {\n $term = array_shift($terms) . \"*\";\n $query_string = 'collection:\"' . $collection . '\" AND emic.searchname:' . strtolower($term);\n\n $new_records = emic_process_query($query_string);\n if (is_array($new_records) && is_array($records)) {\n $records = array_intersect_key($records, $new_records);\n }\n }\n if (is_array($records)) {\n return array_values($records);\n }\n}",
"public function show(Author $author)\n {\n //\n }",
"public function scopePublished($query)\n\t{\n\t\t$query->where('published_at', '<=', Carbon::now());\n\t}",
"public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }",
"protected function restrict_to_author() {\n if ($this->post->author_id != $this->current_user->id) {\n forbidden();\n }\n }",
"public function authors() {\n return $this->connected( Person::postType() );\n }",
"public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }",
"public function scopeGuest($query)\n {\n $user = Auth::user();\n\n if (is_null($user) || ! $user->hasRole('documents')) {\n return $query->where('published', true);\n }\n\n return $query;\n }",
"public function scopeScope($query)\n {\n $query->where($this->getTable().'.company_id', '=', auth()->user()->company()->id);\n\n return $query;\n }",
"function &getAuthorsAlphabetizedByJournal($journalId = null, $initial = null, $rangeInfo = null, $includeEmail = false, $disallowRepeatedEmail = false) {\n\t\t$authors = array();\n\t\t$params = array(\n\t\t\t'affiliation', AppLocale::getPrimaryLocale(),\n\t\t\t'affiliation', AppLocale::getLocale()\n\t\t);\n\n\t\tif (isset($journalId)) $params[] = $journalId;\n\t\t$params[] = AUTHOR_TOC_DEFAULT;\n\t\t$params[] = AUTHOR_TOC_SHOW;\n\t\tif (isset($initial)) {\n\t\t\t$params[] = String::strtolower($initial) . '%';\n\t\t\t$initialSql = ' AND LOWER(aa.last_name) LIKE LOWER(?)';\n\t\t} else {\n\t\t\t$initialSql = '';\n\t\t}\n\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT DISTINCT\n\t\t\t\tCAST(\\'\\' AS CHAR) AS url,\n\t\t\t\t0 AS author_id,\n\t\t\t\t0 AS submission_id,\n\t\t\t\t' . ($includeEmail?'aa.email AS email,':'CAST(\\'\\' AS CHAR) AS email,') . '\n\t\t\t\t0 AS primary_contact,\n\t\t\t\t0 AS seq,\n\t\t\t\taa.first_name,\n\t\t\t\taa.middle_name,\n\t\t\t\taa.last_name,\n\t\t\t\tCASE WHEN asl.setting_value = \\'\\' THEN NULL ELSE SUBSTRING(asl.setting_value FROM 1 FOR 255) END AS affiliation_l,\n\t\t\t\tasl.locale,\n\t\t\t\tCASE WHEN aspl.setting_value = \\'\\' THEN NULL ELSE SUBSTRING(aspl.setting_value FROM 1 FOR 255) END AS affiliation_pl,\n\t\t\t\taspl.locale AS primary_locale,\n\t\t\t\tCASE WHEN aa.country = \\'\\' THEN NULL ELSE aa.country END AS country\n\t\t\tFROM\tauthors aa\n\t\t\t\tLEFT JOIN author_settings aspl ON (aa.author_id = aspl.author_id AND aspl.setting_name = ? AND aspl.locale = ?)\n\t\t\t\tLEFT JOIN author_settings asl ON (aa.author_id = asl.author_id AND asl.setting_name = ? AND asl.locale = ?)\n\t\t\t\t'.($disallowRepeatedEmail?\" LEFT JOIN authors aa2 ON (aa.email=aa2.email AND aa.author_id < aa2.author_id) \":\"\").'\n\t\t\t\tJOIN articles a ON (a.article_id = aa.submission_id AND a.status = ' . STATUS_PUBLISHED . ')\n\t\t\t\tJOIN published_articles pa ON (pa.article_id = a.article_id)\n\t\t\t\tJOIN issues i ON (pa.issue_id = i.issue_id AND i.published = 1)\n\t\t\t\tJOIN sections s ON (a.section_id = s.section_id)\n\t\t\t\tJOIN journals j ON (a.journal_id = j.journal_id)\n\t\t\tWHERE ' . (isset($journalId)?'a.journal_id = ?':'j.enabled = 1') . '\n\t\t\t\tAND (aa.last_name IS NOT NULL AND aa.last_name <> \\'\\')\n\t\t\t\tAND ((s.hide_author = 0 AND a.hide_author = ?) OR a.hide_author = ?)\n\t\t\t\t' .\t($disallowRepeatedEmail?' AND aa2.email IS NULL ':'')\n\t\t\t\t. $initialSql . '\n\t\t\tORDER BY aa.last_name, aa.first_name',\n\t\t\t$params,\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnSimpleAuthorFromRow');\n\t\treturn $returner;\n\t}",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['term']) && trim($params['term']) !== '' )\n {\n // $query->search( trim($params['term']) ); // Original\n\n $query->search( trim($params['term']), null, true, false );\n }\n\n\n\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $reference = $params['reference'];\n $query->where( function($query) use ($reference) { \n $query->where('reference', 'LIKE', '%' . $reference . '%');\n $query->orWhere('ean13', 'LIKE', '%' . $reference . '%');\n } );\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n\n /*\n // Moved from controller\n $query->orWhereHas('combinations', function($q) use ($reference)\n {\n // http://stackoverflow.com/questions/20801859/laravel-eloquent-filter-by-column-of-relationship\n $q->where('reference', 'LIKE', '%' . $reference . '%');\n }\n ); // ToDo: if name is supplied, shows records that match reference but do not match name (due to orWhere condition)\n */\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n\n if ( Auth::user()->language->iso_code == 'en' )\n {\n $query->orWhere('name_en', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['stock_control']) )\n {\n if ( $params['stock_control'] == 0 )\n $query->where('stock_control', '<=', 0);\n if ( $params['stock_control'] == 1 )\n $query->where('stock_control', '>', 0);\n }\n\n if ( isset($params['main_supplier_id']) )\n {\n if ( $params['main_supplier_id'] > 0 )\n $query->where('main_supplier_id', $params['main_supplier_id']);\n if ( $params['main_supplier_id'] < 0 )\n $query->where('main_supplier_id', 0)->orWhere('main_supplier_id', null);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id'])\n ->orderBy('position', 'asc');\n }\n\n if ( isset($params['work_center_id']) && $params['work_center_id'] > 0 )\n {\n $query->where('work_center_id', '=', $params['work_center_id']);\n }\n\n if ( isset($params['manufacturer_id']) && $params['manufacturer_id'] > 0 && 0)\n {\n $query->where('manufacturer_id', '=', $params['manufacturer_id']);\n }\n\n if ( isset($params['procurement_type']) && $params['procurement_type'] != '' )\n {\n $query->where('procurement_type', '=', $params['procurement_type']);\n }\n\n if ( isset($params['mrp_type']) && $params['mrp_type'] != '' )\n {\n $query->where('mrp_type', '=', $params['mrp_type']);\n }\n\n if ( isset($params['active']) )\n {\n if ( Configuration::isTrue('SHOW_PRODUCTS_ACTIVE_ONLY') )\n {\n if ( $params['active'] == 1 )\n {\n // Show active products, same as global scope ShowOnlyActiveScope\n // Do nothing\n ;\n\n } else {\n // Show not active products (0) or all (-1)\n // Remove global scope\n $query->withoutGlobalScope(ShowOnlyActiveScope::class);\n\n // https://www.manifest.uk.com/blog/overriding-eloquent-global-scopes\n\n // Show not active products (0)\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n }\n\n } else {\n\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n \n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n }\n\n return $query;\n }",
"public function getPopularAuthors($limit)\n {\n return User::withCount(['posts' => function ($query) {\n $query->published();\n }])\n ->whereHas('posts', function ($query) {\n $query->published();\n })\n ->where('privilege', '>', 1)\n ->orderBy('posts_count', 'desc')\n ->take($limit)\n ->get();\n }",
"protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}",
"public function scopeOwned($query, $userId=null) {\n\t\tif(is_null($userId)) {\n\t\t\t$userId = user('id');\n\t\t}\n\t\treturn $query->where('user_id', $userId);\n\t}",
"public function scopeLegalPerson($query) {\n\t\treturn $query->where('type', 0);\n\t}",
"public function scopeSearch($query, $term);",
"abstract public function getAuthor();",
"function emic_cwrc_get_authorities($dataType, $query = \"\") {\n $mappings = array(\n 'Tag Place' => array('collection' => 'islandora:9247', 'type' => t('Place')),\n 'Tag Person' => array('collection' => 'islandora:9239', 'type' => t('Person')),\n 'Tag Event' => array('collection' => 'islandora:9242', 'type' => t('Event')),\n 'Tag Organization' => array('collection' => 'islandora:9236', 'type' => t('Organization')),\n );\n\n\n\n $authorities = cwrc_get_authorities_list($mappings[$dataType], $query);\n if ($authorities) {\n $json = json_encode($authorities);\n echo $json;\n }\n}",
"public function testSearchBookHasInputValueSelectAuthor()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/books')\n ->resize(1200,1600)\n ->assertSee('List Books')\n ->type('search', 'Pytago')\n ->select('filter', 'author')\n ->click('#btn-search')\n ->visit('/admin/books?search=Pytago&filter=author')\n ->assertQueryStringHas('search', 'Pytago')\n ->assertQueryStringHas('filter', 'author');\n $elements = $browser->elements('#list-books tbody tr');\n $this->assertCount(1, $elements);\n });\n }",
"public function scopeArtistGenres($query, array $genres) {\n return $query->whereHas('artists', function($q) use ($genres) {\n $q->whereHas('genres', function($q) use ($genres) {\n $q->whereIn('genres.id', $genres);\n });\n });\n }",
"function filter_media( $query ) {\r\n\t\t// admins get to see everything\r\n\t\tif ( ! current_user_can( 'manage_options' ) )\r\n\t\t\t$query['author'] = get_current_user_id();\r\n\t\treturn $query;\r\n\t}",
"public function scopeSearchChamber($query, string $scope = 'where', $chamber)\n {\n return $query->$scope('companyActivity', 'LIKE', '%'.$chamber.'%'); \n }",
"public function getAuthorcompany() {}",
"public function scopeDeveloper($query)\n {\n return $query->where('slug', 'developer');\n \n }",
"public function authorsInitials();",
"public function findById(AuthorId $authorId);",
"public function findAll()\n {\n return $this->performRequest('GET', '/authors');\n }",
"public function getAll () {\n $order = new stdClass();\n $order->column = 'name';\n $order->type = 'asc';\n $authors = $this->Author_model->getAll($order);\n\n print(json_encode($authors));\n }",
"public function getAuthors(){\n\n if(Auth::check())\n if(Auth::user()->tipo_utilizador == \"admin\")\n return $autoresAll=Utilizador::where(\"tipo_utilizador\",\"autor\")->with(\"tutoriais\")->get();\n\n return view(\"pages.error\");\n\n\n }",
"public function scopePublished($query)\n {\n return $query->where('status', '=', 'approved');\n }",
"public function scopeUser($query)\n\t{\n\t\treturn $query->where('user_id', 'LIKE', Auth::user()->id);\n\t}"
]
| [
"0.680987",
"0.6253435",
"0.6182234",
"0.59986085",
"0.5968391",
"0.59103054",
"0.58862984",
"0.58326435",
"0.58252543",
"0.57345665",
"0.5721945",
"0.57089645",
"0.56787306",
"0.5677248",
"0.5664478",
"0.56352454",
"0.562931",
"0.5598625",
"0.5596776",
"0.5577336",
"0.556308",
"0.5532048",
"0.5527082",
"0.55264664",
"0.550845",
"0.54929125",
"0.5488615",
"0.5483864",
"0.54634905",
"0.5450684",
"0.54458654",
"0.54443264",
"0.5443906",
"0.54427266",
"0.5436876",
"0.54324657",
"0.542808",
"0.54234785",
"0.5411092",
"0.5411092",
"0.5411092",
"0.5410974",
"0.5396431",
"0.5382456",
"0.5377788",
"0.5373967",
"0.53668886",
"0.536358",
"0.5360928",
"0.5357753",
"0.5349327",
"0.5340312",
"0.53372735",
"0.5336851",
"0.53337055",
"0.5332179",
"0.533203",
"0.53274",
"0.5326997",
"0.5321313",
"0.5321175",
"0.53089267",
"0.5299404",
"0.5298181",
"0.5291596",
"0.5285418",
"0.5285007",
"0.5285007",
"0.5280011",
"0.5272196",
"0.5272162",
"0.526816",
"0.52675855",
"0.52651846",
"0.5260084",
"0.52585226",
"0.5253854",
"0.52537036",
"0.52522886",
"0.52515614",
"0.5242816",
"0.5242121",
"0.52418107",
"0.52352613",
"0.5231622",
"0.52235305",
"0.5209328",
"0.52059275",
"0.5205465",
"0.5203747",
"0.52020556",
"0.5198092",
"0.51934385",
"0.51816684",
"0.51815075",
"0.51802593",
"0.5159472",
"0.51580614",
"0.5154023",
"0.51440376"
]
| 0.68597955 | 0 |
/ api request to api server using curl return json response | public function httpPost($params, $url, $method="PUT") {
//print_r($params);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($params))
);
$result = curl_exec($ch);
return $result; //return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_rest_api($api_url = '')\n{\n try {\n // url\n $url = $api_url;\n\n // init\n $curl = curl_init();\n // execute rest\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n \n // save data \n $response = curl_exec($curl); \n\n // close connection\n curl_close($curl);\n\n return $response;\n\n } catch (\\Throwable $th) {\n //throw $th;\n }\n}",
"public static function apiRequest($url){\n $handle = curl_init();\n curl_setopt($handle, CURLOPT_URL, $url);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, $url);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, 5);\n\n $output = curl_exec($handle);\n $status = curl_getinfo($handle,CURLINFO_HTTP_CODE);\n curl_close($handle);\n\n if($status != 200){\n return json_encode(\"RESOURCE NOT FOUND\");\n }\n\n return $output;\n\n }",
"function __apiCall($url, $post_parameters = FALSE) {\n \n \t// Initialize the cURL session\n\t $curl_session = curl_init();\n\t \t\n\t // Set the URL of api call\n\t\tcurl_setopt($curl_session, CURLOPT_URL, $url);\n\t\t \n\t\t// If there are post fields add them to the call\n\t\tif($post_parameters !== FALSE) {\n\t\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $post_parameters);\n\t\t}\n\t\t \n\t\t// Return the curl results to a variable\n\t curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);\n\t\t \n\t // Execute the cURL session\n\t $contents = curl_exec ($curl_session);\n\t\t \n\t\t// Close cURL session\n\t\tcurl_close ($curl_session);\n\t\t \n\t\t// Return the response\n\t\treturn json_decode($contents);\n \n }",
"function chargeAPI($api_url, $server_key, $request_body){\n $ch = curl_init();\n $curl_options = array(\n CURLOPT_URL => $api_url,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n // Tambahkan heder ke permintaan, termasuk Otorisasi yang dihasilkan dari kunci server\n CURLOPT_HTTPHEADER => array(\n 'Content-Type: application/json',\n 'Accept: application/json',\n 'Authorization: Basic ' . base64_encode($server_key . ':')\n ),\n CURLOPT_POSTFIELDS => $request_body\n );\n curl_setopt_array($ch, $curl_options);\n $result = array(\n 'body' => curl_exec($ch),\n 'http_code' => curl_getinfo($ch, CURLINFO_HTTP_CODE),\n );\n return $result;\n}",
"public function requestFromApi() \n {\n $clientApi = new \\GuzzleHttp\\Client([\n \"base_uri\" => \"https://services.mysublime.net/st4ts/data/get/type/\",\n \"timeout\" => 4.0]);\n \n try { \n $response = $clientApi->request(\"GET\", $this->_urlEndPoint);\n if ($response->getStatusCode() == \"200\") {\n $body = $response->getBody();\n $this->_jsonRequestedArr = json_decode($body); \n }\n else { \n $this->_error .= \"Bad status code: . \" . $response->getStatusCode(); \n }\n }\n catch (Exception $exc) {\n $this->_error .= $exc->getMessage();\n }\n\n }",
"function callApi($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt ($ch, CURLOPT_URL, $url);\n\n // Get the response and close the channel.\n $response = curl_exec ( $ch );\n\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n }\n\n curl_close($ch);\n\n return $response;\n}",
"function callJsonApi($url) {\n $response = callApi($url);\n $jsonResponse = false;\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n } else {\n $jsonResponse = json_decode ( $response );\n if (! isset ( $jsonResponse->success )) {\n echo \"Failed to $url : $response\";\n } else if (! $jsonResponse->success) {\n echo \"Failed to $url : $jsonResponse->code - $jsonResponse->message\";\n }\n }\n return $jsonResponse;\n}",
"function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t \t'Accept: application/json',\n\t \t'X-ELS-APIKey: 82b47f24bf707a447d642d170ae6e318'\n\t ));\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }",
"function display_cars()\n{\n //displays posted cars\n $url = set_url('advert');\n $url .= '?limit=10&page=1';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"function _do_api_call($verb, $url, $data, &$result) { \n $api_key = elgg_get_plugin_setting('api_key', 'babelroom');\n $api_server = elgg_get_plugin_setting('api_server', 'babelroom');\n $server_url = $api_server.$url;\n $rc = false;\n\n if (!extension_loaded('curl'))\n return false;\n\n if (\n !(stripos(ini_get('disable_functions'), 'curl_init') !== FALSE) and\n ($ch = @curl_init($server_url)) !== false) {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $verb); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n# curl_setopt($ch, CURLOPT_HEADER, false); -- for later reference\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, $api_key.':');\n if ($data) {\n $data_string = json_encode($data);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string)));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); \n }\n $tmp_result = curl_exec($ch);\n if (!curl_errno($ch)) {\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n if ($code>=200 and $code<=299) {\n $result = json_decode($tmp_result);\n $rc = true;\n }\n else {\n elgg_log(\"BRAPI error response code $code, [$server_url]\",'ERROR');\n }\n }\n else {\n elgg_log(\"BRAPI connect error [$server_url]\",'ERROR');\n }\n curl_close($ch);\n }\n else {\n elgg_log(\"BRAPI curl initialization error [$server_url]\",'ERROR');\n }\n\n return $rc;\n}",
"function CallAPI($method, $url, $data = false)\n{\n $curl = curl_init();\n\n switch ($method)\n {\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_PUT, 1);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // Optional Authentication:\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n\n// echo \"<pre>\",print_r($result);\n return $result;\n}",
"function api_request($zone_uri, $req_type, $api_params, $token)\n{\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); # TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.\n\tcurl_setopt($ch, CURLOPT_FAILONERROR, false); # Do not fail silently. We want a response regardless\n\tcurl_setopt($ch, CURLOPT_HEADER, false); # disables the response header and only returns the response body\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Auth-Token: '.$token)); # Set the token and the content type so we know the response format\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $req_type);\n\tcurl_setopt($ch, CURLOPT_URL, $zone_uri); # Where this action is going,\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($api_params));\n\t\n\t$http_result = curl_exec($ch);\n\t\n\t$decoded_result = json_decode($http_result); # Decode from JSON as our results are in the same format as our request\n\t$decoded_result = api_fail($token, $decoded_result);\t\n\treturn $decoded_result;\n}",
"private function just_curl_get_data($url,$data)\n {\n \n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n\n }",
"function get_cities()\n{\n $url = set_url('cities');\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"function acapi_call($method, $resource, $args, $params = array(), $body = array(), $options = array()) {\n $default_options = array(\n 'display' => TRUE,\n );\n $options = array_merge($default_options, $options);\n\n $debug = drush_get_option('debug', FALSE);\n $verbose = drush_get_option('verbose', FALSE);\n $simulate = drush_get_option('simulate', FALSE);\n $format = acapi_get_option('format');\n\n // Build the API call URL.\n $url = acapi_get_option('endpoint');\n $url .= acapi_dt($resource, $args);\n $url .= '.json';\n\n foreach ($params as $k => $v) {\n if (is_array($v)) {\n unset($params[$k]);\n foreach ($v as $key => $val) {\n $params[\"$k-$key\"] = \"$k%5B%5D=\" . urlencode($val);\n }\n }\n else {\n $params[$k] = \"$k=\" . urlencode($v);\n }\n }\n\n $url .= '?' . implode('&', $params);\n\n $creds = acapi_get_creds();\n if (!$creds) {\n return FALSE;\n }\n\n // Build the body.\n $json_body = json_encode($body);\n\n $display = \"curl -X $method '$url'\";\n if ($debug) {\n $display .= \" ($creds)\";\n }\n if ($debug || $verbose || $simulate) {\n drush_print($display, 0, STDERR);\n if (!empty($body)) {\n drush_print(\" $json_body\", 0, STDERR);\n }\n }\n\n if ($simulate) {\n return;\n }\n\n $headers = array();\n $ch = curl_init($url);\n // Basic request settings\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n curl_setopt($ch, CURLOPT_USERAGENT, basename(__FILE__));\n if (!empty($options['result_stream'])) {\n curl_setopt($ch, CURLOPT_FILE, $options['result_stream']);\n }\n else {\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n }\n // User authentication\n curl_setopt($ch, CURLOPT_HTTPAUTH, TRUE);\n curl_setopt($ch, CURLOPT_USERPWD, $creds);\n // SSL\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, preg_match('@^https:@', acapi_get_option('endpoint')));\n curl_setopt($ch, CURLOPT_CAINFO, acapi_get_option('cainfo'));\n // Redirects\n if (!empty($options['redirect'])) {\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_MAXREDIRS, $options['redirect']+1);\n }\n /* Body\n We need to set a Content-Length header even on empty POST requests, or the webserver\n will throw a 411 Length Required.\n */\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_body);\n $headers[] = 'Content-Type: application/json;charset=utf-8';\n $headers[] = 'Content-Length: ' . strlen($json_body);\n // Headers\n if (!empty($headers)) {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n // Debugging\n curl_setopt($ch, CURLOPT_VERBOSE, $debug);\n // Go\n $content = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n return drush_set_error('ACAPI_CURL_ERROR', dt('Error accessing @url: @err', array('@url' => $url, '@err' => curl_error($ch))));\n }\n\n $result = json_decode($content);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if (!empty($format)) {\n drush_print(drush_format($result, NULL, $format));\n }\n else if ($options['display']) {\n if (is_array($result)) {\n foreach ($result as $item) {\n if (! is_scalar($item)) {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($item)));\n }\n else {\n drush_print($item);\n }\n }\n }\n else {\n if ($method == 'POST') {\n // All POST actions return a task. Display something helpful.\n drush_log(dt('Task @taskid started.', array('@taskid' => $result->id)), 'ok');\n }\n else {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($result)));\n }\n }\n }\n\n if ($status != 200) {\n return drush_set_error('ACAPI_HTTP_STATUS_' . $status, dt('API status code @status', array('@status' => $status)));\n }\n\n return array($status, $result);\n}",
"private function curl_get($url)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }",
"function doCurl ($url, $options) {\n\tglobal $adminName, $adminPass, $verbose, $doe;\n\t\n\t$options = $options +\n\t\t\t array(CURLOPT_RETURNTRANSFER => true,\n\t\t\t\t\t CURLOPT_USERPWD => $adminName . \":\" . $adminPass,\n\t\t\t\t\t CURLOPT_HTTPHEADER => array('OCS-APIRequest:true', 'Accept: application/json'),\n\t\t\t );\n\n\tif ($verbose > 2) {\n\t\t$options = $options +\n\t\t\t\t array(CURLOPT_VERBOSE => TRUE,\n\t\t\t\t\t\t CURLOPT_HEADER => TRUE\n\t\t\t\t );\n\t}\n\n\t$ch = curl_init($url);\n\n \tcurl_setopt_array( $ch, $options);\n\t\n// For use with Charles proxy:\n// \tcurl_setopt($ch, CURLOPT_PROXYPORT, '8888');\n// \tcurl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');\n// \tcurl_setopt($ch, CURLOPT_PROXY, '127.0.0.1');\n\n $response = curl_exec($ch);\n //print_r($response);\n $response = json_decode($response);\n //print_r($response);\n\n $statuscode = $response->{'ocs'}->{'meta'}->statuscode;\n\n \n if($statuscode != \"100\"){\n echo $statuscode;\n echo $response->{'ocs'}->{'meta'}->message;\n return $statuscode;\n exit(1);\n }\n\n if($response === false) {\n echo 'Curl error: ' . curl_error($ch) . \"\\n\";\n\t\texit(1);\n\t}\n\t\n\tcurl_close($ch);\n \n\t/* An error causes an exit\n\tif (preg_match(\"~<statuscode>(\\d+)</statuscode>~\", $response, $matches)) {\n $responseCode = $matches[1]; // what's the status code\n //echo $matches[3];\n //echo \"<h3>\" . $response . \"</h3>\";\n if ($responseCode == '404') {\n return \"2\";\n exit(2);\n } elseif ($responseCode != '100') {\n echo \"1Error response code; exiting\\n$response\\n\";\n\t\t\texit(1);\n\t\t}\n\t}\n\telse { // something is definitely wrong\n echo \"No statuscode response; exiting:\\n$response\\n\";\n \n\t\texit(1);\n\t}\n */\n\t// What sort of response do we want to give\n//\tif ($verbose == 1) { echo \"Response code from server: $responseCode\\n\"; }\n\t//if ($verbose == 1) { echo \"\\n\"; }\n\t//if ($verbose > 1) { echo \"Response from server:\\n$response\\n\\n\"; }\n\n\treturn $response;\n}",
"private function request($url) {\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n \t\t$response = curl_exec($ch);\n\t\t// TODO: Some processing here\n\t\t$response = json_decode($response);\n\t\treturn $response;\n\t}",
"function getrequest($url){\n\t// gets cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_USERAGENT => 'BenGreenlineApp'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t//returns the json encoded response\n\t\n\t\n\t$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\tif($httpCode == 404) {\n $resp[0]= \"MetroTransit API gave 404\" ;\n\t};\n\t\n\t\n\treturn json_decode($resp);\n}",
"private function make_api_call($url, $options) {\n $options['wsapikey'] = $this->wsapikey;\n $options['format'] = 'json';\n $query = http_build_query($options);\n $response_url = $url . '?' . $query;\n $curlHandler = curl_init();\n curl_setopt($curlHandler,CURLOPT_ENCODING , \"gzip\");\n curl_setopt($curlHandler, CURLOPT_URL, $response_url);\n curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, true);\n // curl_setopt($curlHandler, CURLOPT_USERAGENT, $user_agent);\n curl_exec($curlHandler);\n $response_json = curl_multi_getcontent($curlHandler);\n $response = json_decode($response_json);\n return $response;\n }",
"public function apiCall($url) {\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}",
"function curl_function($url){\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n//$searchResponse = json_decode($output,true);\n return $output;\n\t\n\t}",
"abstract function do_api_request();",
"function GetAPIResponse($url, $jsonbody) {\n\t$ch = curl_init();\n\tcurl_setopt($ch,CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); \n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 10);\n\tcurl_setopt($ch,CURLOPT_TIMEOUT, 20);\n\n\tif($jsonbody) {\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $jsonbody);\n\t}\n\n\t$response = curl_exec($ch);\n\tcurl_close ($ch);\n\treturn $response;\n}",
"function CallAPI($method, $url, $api_name, $data = false)\n{\n if (!endsWith($url, '/')) {\n $url .= '/';\n }\n $url .= $api_name;\n $curl = curl_init();\n\n switch ($method) {\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n\n if ($data)\n $data = json_encode($data, JSON_PRETTY_PRINT);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n //Set the content type to application/json\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_PUT, 1);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n // // HTTP GET\n // $query_data = http_build_query($data);\n // curl_setopt($ch, CURLOPT_URL, \"$url?$query_data\");\n // curl_setopt($ch, CURLOPT_POST, false);\n }\n\n // Optional Authentication:\n // curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n // curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n $data = json_decode($result);\n\n return $data;\n}",
"private function __request($method, $api) {\n\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL , $this->__apiURL($api));\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST , $method);\n curl_setopt($curl, CURLOPT_POSTFIELDS , http_build_query($this->__leadData));\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_VERBOSE , $this->__debug);\n curl_setopt($curl, CURLOPT_IPRESOLVE , CURL_IPRESOLVE_V4);\n\n $result = curl_exec($curl);\n\n $response = array();\n $response['result'] = json_decode ($result);\n\n if ($this->__debug) {\n\n $response['error'] = curl_error ($curl);\n $response['info'] = curl_getinfo($curl);\n }\n\n curl_close($curl);\n\n return $response;\n }",
"private function call_api_get($api_url) {\n set_time_limit(30);\n $urlrequest = $api_url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $urlrequest);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n $result = curl_exec($ch);\n $err_msg = \"\";\n\n if ($result === false)\n $err_msg = curl_error($ch);\n\n //var_dump($result);\n //die;\n curl_close($ch);\n return $result;\n }",
"private function call_api_get($api_url) {\n set_time_limit(30);\n $urlrequest = $api_url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $urlrequest);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n $result = curl_exec($ch);\n $err_msg = \"\";\n\n if ($result === false)\n $err_msg = curl_error($ch);\n\n //var_dump($result);\n //die;\n curl_close($ch);\n return $result;\n }",
"function getCurl( $url )\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n$res = curl_exec($curl); // execute\n if(curl_error($curl) ) // check for error\n {\n return false; // return false if error\n } else {\n return json_decode($res); // return json decoded\n }\ncurl_close($curl);\n}",
"public function process()\n {\n \t$client = $this->client->getClient();\n\n \ttry {\n $response = $client->get($this->buildUrl());\n return new ResponseJson((string)$response->getBody(), true);\n } catch (RequestException $e) {\n return new ResponseJson((string)$e->getResponse()->getBody(), false);\n }\n }",
"public function getResultByCurlRequest($url) {\n//\t\terror_log(\"API Call: '\".$url.\"'\");\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$result = curl_exec($ch);\n\t\tcurl_close($ch);\n//\t\terror_log(\"JSON: $result\");\n\t\treturn $result;\n\t}",
"private function callAPI($url)\n {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($curl);\n curl_close($curl);\n return $result;\n }",
"private function getJsonApiCall($rest_api_url) {\n $client = new Client();\n $myConfig = \\Drupal::config('filefield_sources_jsonapi');\n $username = $myConfig->get('username');\n $password = $myConfig->get('password');\n\n $response = $client->get($rest_api_url, [\n 'headers' => ['Authorization' => 'Basic ' . base64_encode(\"$username:$password\")],\n ]);\n\n return $response;\n }",
"function curlWrap($url, $json, $action)\n{\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10 );\n\tcurl_setopt($ch, CURLOPT_URL, ZDURL.$url);\n\tcurl_setopt($ch, CURLOPT_USERPWD, ZDUSER.\"/token:\".ZDAPIKEY);\n\tswitch($action){\n\t\tcase \"POST\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\t\tbreak;\n\t\tcase \"GET\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t\tbreak;\n\t\tcase \"PUT\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\t$decoded = json_decode($output);\n\treturn $decoded;\n}",
"function get_categories($id)\n{\n $url = set_url('categories');\n $url .= '/' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"function callAPI($method, $url, $data){\n $curl = curl_init();\n\n switch ($method){\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n ));\n\n // EXECUTE:\n $result = curl_exec($curl);\n if(!$result){die(\"Connection Failure\");}\n curl_close($curl);\n return $result;\n}",
"function GetMyClubApiJson($url)\n{\n\t$returnString=\"\";\n\t\n\t$apiKey=GetMyClubApiKeyHeader();\n\tif (CheckError($json))\n\t{\n\t\treturn $json;\n\t}\n\n\t$headers = [\n\t $apiKey,\n\t];\n\t\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t$serverOutput = curl_exec ($ch);\n\tcurl_close ($ch);\n\t// Did anything come back\n\tif (strlen($serverOutput) < 20)\n\t{\n\t\t$returnString= \"<div class='myclubapi-error'>\";\n\t\t$returnString=$returnString . \"MyClubApi did not respond to request: \" .$url. \" </div>\";\n\t\treturn $returnString;\n\t}\n\treturn $serverOutput;\n}",
"function airtableCallByCurl($url, $headers) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HTTPGET, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_URL, $url);\n $entries = curl_exec($ch);\n curl_close($ch);\n $airtableResponse = json_decode($entries, TRUE);\n\n return $airtableResponse;\n}",
"function apiCall ($url, $data) {\n\t$url = \"https://api.cloudns.net/{$url}\";\n\t$data = \"auth-id=\".AUTH_ID.\"&auth-password=\".AUTH_PASS.\"&{$data}\";\n\t\n\t$init = curl_init();\n\tcurl_setopt($init, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($init, CURLOPT_URL, $url);\n\tcurl_setopt($init, CURLOPT_POST, true);\n\tcurl_setopt($init, CURLOPT_POSTFIELDS, $data);\n\tcurl_setopt($init, CURLOPT_USERAGENT, 'cloudns_api_script/0.1 (+https://github.com/ClouDNS/cloudns-api-bulk-updates/tree/master/bulk-records-update)');\n\t\n\t$content = curl_exec($init);\n\t\n\tcurl_close($init);\n\t\n\treturn json_decode($content, true);\n}",
"private function sendCurl($url) {\n $handle = curl_init();\n $opts = curl_setopt_array($handle, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'https://' . $url . \"&method=CURL\",\n CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'],\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $this->payload\n ));\n // Send the request & save response to $resp\n $exec = curl_exec($handle);\n // Close request to clear up some resources\n $close = curl_close($handle);\n\n //$json_array = json_decode($exec, TRUE);\n\n if($this->testing) echo \"<hr /><h1>JSON RESPONSE:</h1><br />$exec <hr />\";\n }",
"public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}",
"function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n }",
"function curlWrap($url, $json)\n{\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_URL, ZDURL . $url);\n curl_setopt($ch, CURLOPT_USERPWD, ZDUSER . \"/token:\" . ZDAPIKEY);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-type: application/json'\n ));\n curl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\n $info = curl_getinfo($ch);\n $output = curl_exec($ch);\n curl_close($ch);\n $decoded = json_decode($output);\n return $decoded;\n\n $info = curl_getinfo($ch);\n return $info;\n\n}",
"function simple_curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_NOBODY, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));\n $content = curl_exec($ch);\n $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n curl_close($ch);\n //echo $content;\n return $content;\n}",
"function callService($endpoint, $request)\n{\n $request_string = json_encode($request);\n\n $service = curl_init('http://studio.mdl.io/REST/'.$endpoint);\n curl_setopt($service, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($service, CURLOPT_POSTFIELDS, $request_string);\n curl_setopt($service, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($service, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($request_string))\n );\n $response_string = curl_exec($service);\n\n $response = json_decode($response_string);\n return($response);\n}",
"function make_get_call($mid_url) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n \n $output = json_decode(curl_exec($curl));\n curl_close($curl);\n \n return $output;\n }",
"function apiCall ($url, $data) {\n\t$url = \"https://api.cloudns.net/{$url}\";\n\t$data = \"auth-id=\".AUTH_ID.\"&auth-password=\".AUTH_PASS.\"&{$data}\";\n\t$init = curl_init();\n\tcurl_setopt($init, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($init, CURLOPT_URL, $url);\n\tcurl_setopt($init, CURLOPT_POST, true);\n\tcurl_setopt($init, CURLOPT_POSTFIELDS, $data);\n\tcurl_setopt($init, CURLOPT_USERAGENT, 'cloudns_api_script/0.1 (+https://github.com/ClouDNS/cloudns-api-bulk-updates/tree/master/powerdns-pgsql-slave-zones-delete)');\n\t$content = curl_exec($init);\n\tcurl_close($init);\n\treturn json_decode($content, true);\n}",
"function GoCURL($campos, $url)\n{\n\n //url do destino da requsiçao, equivalente ao \"action\" de um formulário\n $url = 'http://localhost/API/'.$url;\n\n $token = GenerateToken();\n \n $campos['TokenRequest'] = $token; \n\n $string_campos = '';\n foreach($campos as $name => $valor) {\n $string_campos .= $name . '=' . $valor . '&';\n }\n $string_campos = rtrim($string_campos,'&');\n\n $ch = curl_init();\n //configurando as opções da conexão curl\n curl_setopt($ch,CURLOPT_URL,$url);\n //este parâmetro diz que queremos resgatar o retorno da requisição\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch,CURLOPT_POST,count($campos));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$string_campos);\n //manda a requisição post\n $resultado = curl_exec($ch);\n //echo '<Pre>';print_r($resultado);\n curl_close($ch);\n $json = json_decode($resultado,1);\n \n if(!$json['request'])\n { \n echo '<Pre>';print_r($resultado);\n echo '<Pre>';print_r($json);\n echo utf8_decode(\"ocorreu um erro na sua conexão, tente novamente\");\n exit;\n } \n\n return $json;\n}",
"function make_curl($search_param, $url){\n \n // default header shit\n $headers = array(\"Accept: application/json\", \"Content-Type: application/json\");\n \n //step1\n $cSession = curl_init($url);\n \n //echo $search_param[\"league_name\"];\n //echo json_encode($search_param);\n\n //step2\n //curl_setopt($cSession,CURLOPT_URL, $url.\"?league_name=\".$search_param[\"league_name\"].\"&year=\".$search_param[\"year\"]);\n curl_setopt($cSession,CURLOPT_POSTFIELDS, json_encode($search_param));\n curl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($cSession,CURLOPT_HEADER, false);\n curl_setopt($cSession,CURLOPT_HTTPHEADER, $headers);\n \n //step3\n $jsonData = curl_exec($cSession);\n $err = curl_error($cSession);\n \n //step4\n curl_close($cSession);\n //echo ($jsonData);\n \n //step5\n return ($jsonData);\n}",
"public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }",
"private function request($url)\n\t{\n\t\t$curl_handler = curl_init();\n\n\t\t$url = $url . \"&api_key=\" . $this->apikey;\n\n\t\tcurl_setopt($curl_handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$response = curl_exec($curl_handler);\n\n\t\tcurl_close($curl_handler);\n\n\t\tif ($response !== false)\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"function make_call($url)\n {\n echo \"API Call:<br /><textarea id='orig' rows='4' cols='150'>$url</textarea><br />\";\n $ch = curl_init();\n $timeout = 20;\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n\n $data = curl_exec($ch);\n\n if (curl_errno($ch)) {\n print curl_error($ch);\n } else {\n curl_close($ch);\n }\n echo htmlentities($data) . \"<br />\";\n return $data;\n }",
"function tfnm_call_api( $api_key, $api_url ){\n\n\t$header_args = array();\n\n\tif( !empty( $api_key ) ){\n\t\t$header_args = array(\n\t\t\t'user-agent' => '',\n\t\t\t'headers' => array(\n\t\t\t\t'authorization' => 'Bearer ' . $api_key\n\t\t\t)\n\t\t);\n\t}\n\n\t$response = wp_safe_remote_get( $api_url, $header_args );\n\n\t// Error proofing\n\tif ( is_wp_error( $response ) ) {\n\t\treturn 'There was an error in response. Please contact the administrator.';\n\t}\n\n\t// Doing some data clean up before returning.\n\tif( !empty( $response['body'] ) ){\n\t\t$response = json_decode( $response['body'] );\n\t}\n\n\treturn $response;\n}",
"function callRemitaApiGet($endPoint) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $endPoint);\n curl_setopt($ch, CURLOPT_ENCODING, \"\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Cache-Control: no-cache',\n 'Content-Type: application/json')\n );\n $output = curl_exec($ch);\n return $output;\n}",
"private function _call_api($url, $method, $data = array()) {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_VERBOSE, 0);\n curl_setopt($curl, CURLOPT_HEADER, 0);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);\n\n if($method == 'POST')\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n\n //curl_setopt($curl, CURLOPT_POSTFIELDS, $product);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n $response = curl_exec($curl);\n curl_close ($curl);\n\n return $response;\n }",
"function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}",
"function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"public function testcurls(){\n\t\tself::noView();\n\t\theader(\"Content-Type:application/json\");\n\t\t$data = json_decode(file_get_contents('php://input'), true);\n\t\treturn $data;\n\t\t$insertcurlvalue = $this->User->query(\"INSERT INTO test_curls(`usename`,`email`) VALUES ()\");\n\t\t$getDetails = $this->User->query(\"SELECT * FROM test_curls\");\n\t\t$getDataDetails = array('data' => $getDetails);\n\t\t$final_json = json_encode($getDataDetails);\n\t\treturn $final_json;\n\t}",
"private function QueryAPI($api_suffix) {\n $api_endpoint = \"https://api.patreon.com/oauth2/api/\".$api_suffix;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $api_endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $authorization_header = \"Authorization: Bearer \" . $this->access_token;\n curl_setopt($ch, CURLOPT_HTTPHEADER, array($authorization_header));\n return json_decode(curl_exec($ch), true);\n }",
"protected function exec($url)\n {\n $client = $this->getRequest();\n try{\n $response = $client->request('POST',$this->buildRequestUrl(),[\n 'json' => [\n 'longUrl' => $url\n ]\n ]);\n } catch (\\GuzzleHttp\\Exception\\ClientException $e){\n $response = $e->getResponse();\n }\n return $this->handleResponse($response->getBody());\n }",
"function restPost($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}",
"function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}",
"public function testcurls(){\r\n\r\n\t\tself::noView();\r\n\r\n\t\theader(\"Content-Type:application/json\");\r\n\r\n\t\t$data = json_decode(file_get_contents('php://input'), true);\r\n\r\n\t\treturn $data;\r\n\r\n\t\t$insertcurlvalue = $this->User->query(\"INSERT INTO test_curls(`usename`,`email`) VALUES ()\");\r\n\r\n\r\n\r\n\t\t$getDetails = $this->User->query(\"SELECT * FROM test_curls\");\r\n\r\n\t\t$getDataDetails = array('data' => $getDetails);\r\n\r\n\t\t$final_json = json_encode($getDataDetails);\r\n\r\n\t\treturn $final_json;\r\n\r\n\r\n\r\n\t}",
"function CallAPI($method, $url, $data = false){\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\t\t\n\t\t$update_json = json_encode($data);\t\n\t\tcurl_setopt($curl, CURLOPT_URL, $url . \"?\" . http_build_query($data));\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSLVERSION, 4);\n\t\t$result = curl_exec($curl); \n\t\t$api_response_info = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\treturn $result;\n}",
"function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}",
"function CallAPI($method, $url, $data = false)\r\n{\r\n $curl = curl_init();\r\n\r\n switch ($method)\r\n {\r\n case \"POST\":\r\n curl_setopt($curl, CURLOPT_POST, 1);\r\n\r\n if ($data)\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n break;\r\n case \"PUT\":\r\n curl_setopt($curl, CURLOPT_PUT, 1);\r\n break;\r\n default:\r\n if ($data)\r\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n }\r\n\r\n // Optional Authentication:\r\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\r\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\r\n\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n $result = curl_exec($curl);\r\n\r\n curl_close($curl);\r\n\r\n return $result;\r\n}",
"function crowd_rest_request($url, $content_type, $method, $method_field = \"\"){\n $curl = curl_init();\n\n // Set common parameters.\n curl_setopt($curl, CURLOPT_URL,\n \"http://localhost:8095/crowd/rest/usermanagement/latest/\" . $url);\n curl_setopt($curl, CURLOPT_USERPWD, \"appname:apppassword\");\n curl_setopt($curl, CURLOPT_TIMEOUT, 30);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\n // Set content type.\n if (strtolower($content_type) === 'json'){\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-type: application/json\",\n \"Accept: application/json\"));\n }\n else if (strtolower($content_type) === 'xml'){\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-type: application/xml\",\n \"Accept: application/xml\"));\n }\n else throw new Exception(\"Bad request -- invalid content type: \" . $content_type);\n\n // Set method.\n if (strtolower($method) === 'get'){}\n else if (strtolower($method) === 'post'){\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $method_field);\n }\n else if (strtolower($method) === 'put'){\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, $method_field);\n }\n else if (strtolower($method) === 'delete'){\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n }\n else throw new Exception(\"Bad request -- invalid method: \" . $method);\n\n // Perform request.\n $return = curl_exec($curl);\n\n // If status code is not between 200 and 206, throw an exception.\n $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($http_status < 200 || $http_status > 206){\n throw new Exception(\"Bad request -- HTTP status code: \" . $http_status);\n }\n\n curl_close($curl);\n return $return;\n}",
"function api_test_curl()\r\n\t{\r\n\t\techo \"true\";\r\n\t}",
"public function curlinit($data) {\n\t\t$sweet = curl_init();\n\t\tcurl_setopt($sweet, CURLOPT_URL, $this->bkash_api_base);\n\t\tcurl_setopt($sweet, CURLOPT_POST, 1);\n\t\tcurl_setopt($sweet, CURLOPT_POSTFIELDS, http_build_query($data));\n\t\tcurl_setopt($sweet, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($sweet);\n\t\tcurl_close($sweet);\n\t\treturn json_decode($response);\n\t}",
"public function api_connect($url) {\n return curl_init($url);\n }",
"function quick_curl( $url, $user_auth = null, $rest = 'GET', $input = null, $type = 'JSON'){\n if( function_exists('curl_init') ){\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url ); // The URL we're using to get/send data\n\n if( $user_auth ){\n curl_setopt( $ch, CURLOPT_USERPWD, $user_auth ); // Add the authentication\n }\n\n if( $rest == 'POST' ){\n curl_setopt( $ch, CURLOPT_POST, true ); // Send a post request to the server\n } elseif( $rest == 'PATCH' ){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // Send a patch request to the server to update the listing\n } elseif( $rest == 'PUT'){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // Send a put request to the server to update the listing\n } // If POST or PATCH isn't set then we're using a GET request, which is the default\n\n curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 15 ); // Timeout when connecting to the server\n curl_setopt( $ch, CURLOPT_TIMEOUT, 30 ); // Timeout when retrieving from the server\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // We want to capture the data returned, so set this to true\n //curl_setopt( $ch, CURLOPT_HEADER, true ); // Get the HTTP headers sent with the data\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // We don't want to force SSL incase a site doesn't use it\n\n if( $rest !== 'GET' ){\n\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: ' . mime_type( $type ), 'Content-Length: ' . strlen( $input ) ) ); // Tell server to expect the right content type and the content length\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); // Send the actual data\n }\n\n // Get the response\n $response = curl_exec( $ch );\n\n // Check if there's an error in the header\n $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\n // If there's any cURL errors\n if( curl_errno( $ch ) || ( $httpcode < 200 || $httpcode >= 300 ) ){\n $data = 'error';\n } else {\n \n // Turn response into stuff we can use\n if( $type == 'JSON' ){\n $data = json_decode( $response, true );\n } elseif( $type == 'csv' ){\n $data = csv_to_array( $response );\n } else {\n $data = $response;\n }\n\n }\n\n // Close curl\n curl_close( $ch );\n \n // Send the data back to the function calling the cURL\n return $data;\n \n } else {\n \n // cURL not installed so leave\n return false;\n \n }\n\n\t\n}",
"function doApiRequest($email, $name, $location, $phone, $category){\n try{\n #!important!\n $eamil = get_value($email);\n $final = 0;\n #get api data from hosted server\n $request = file_get_contents(\"http://34.212.19.150:8000/request/users\");\n #parse api data to json_decoder \n $json_response = json_decode($request);\n #create array to hold api data \n $response_array = array();\n #split fetched data from api for array\n foreach ($json_response->data as $response ) {\n #add email addresses to response_array \n array_push($response_array, $response->email);\n }\n #check if value exist in fetched api array\n if(in_array($email, $response_array)){\n #add free_lancer to database\n $addFreeLancer = doAddFreeLancer($name, $email, $location, $phone, $category);\n #fetch inserted data from parameters \n $insertedData = array('email' => $email ,'name' => $name,'location' => $location,'phone' => $phone,\n 'category' => $category);\n #send reponses \n $final = api_response(true, $insertedData, $addFreeLancer);\n }else{\n $final = api_response(false, null, \"not found in api\");\n }\n #returned data to user\n return $final;\n \n }catch(Exception $ex){\n return $ex->getMessage();\n }\n}",
"public static function getApiResponse($url){\n\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_POST, 1);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3);\n curl_setopt($ch,CURLOPT_TIMEOUT, 20);\n\n $response = curl_exec($ch);\n\n return strval($response);\n }",
"function fetch_curl($url) {\n $ch = curl_init($url); //initialize the fetch command\n //prevent automatic output to screen\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // in case of MAMP issues\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n $results = curl_exec($ch); //execute the fetch command\n curl_close($ch); //close curl request\n //decode JSON that is returned\n $data = json_decode($results);\n\n return $data;\n}",
"function curl_return($url,$json = TRUE) {\n\t\t\n\t\t$ch = curl_init($url);\t\t\n\t\t\n\t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t$curl_result = curl_exec($ch);\n\t\t\n\t\tcurl_close($ch);\n\n\t\tif (!$json) {\n\t\t\treturn $curl_result;\n\t\t}\n\t\treturn json_decode($curl_result);\n\n\t}",
"public function curlGetCall( $url ) \n {\n \n try\n {\n $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($curl);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n $responseArr = json_decode($result,true);\n return $responseArr;\n }",
"function post_HostCreate($json){\n //Posterior se establecen los metodos: POST.\n //Se establecen lo headers.\n $peticion = curl_init('http://10.21.211.105/zabbix/api_jsonrpc.php'); \n curl_setopt($peticion, CURLOPT_CUSTOMREQUEST, \"POST\"); \n curl_setopt($peticion, CURLOPT_POSTFIELDS, $json); \n curl_setopt($peticion, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($peticion, CURLOPT_HTTPHEADER, array( \n 'Content-Type: application/json', \n 'Content-Length: ' . strlen($json)) \n ); \n //Se ejecuta el curl de la peticion y se guarda la respuesta del servidor \n //en la variable response que es retornada por la funcion Post_HostCreate \n $response = curl_exec($peticion);\n return json_decode($response, true);\n}",
"function makecurl($api,$data=array())\n{\n$options = array(\n);\n$ds1=array();\n$ds1['header']=\"Content-type: application/x-www-form-urlencoded\\r\\n\";\n$ds1['method']=\"POST\";\n$ds1['content']=http_build_query($data);\n$options['http']=$ds1;\n \n$context = stream_context_create($options);\n$result = file_get_contents($api, false, $context);\nif ($result === FALSE) { /* Handle error */ }\nreturn $result;\n}",
"function get_regions()\n{\n $url = set_url('regions');\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"abstract function parse_api_response();",
"function getRequest($url) {\n // url to GET info for this table\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n if (curl_errno($ch)) { // Check if any error occurred\n echo 'Curl error: ' . curl_error($ch);\n }\n curl_close($ch); // close curl resource to free up system resources\n $res = json_decode($output, true); // json to array\n return $res;\n }",
"private function _api($args = array()) {\n\n\t\t$path = '';\n\t\tswitch($this->_api){\n\t\tcase 'json': $path = '/json-api/cpanel?'; break;\n\t\tcase 'xml': $path = '/xml-api/cpanel?'; break;\n\t\t}\n\n\t\t$url = 'https://' . $this->_hostname . ':' . $this->_port;\n\t\t$url .= $path . http_build_query($args, '', '&');\n\n\t\t$pass = base64_encode($this->_username . \":\" . $this->_password);\n\t\t$header = array();\n\t\t$header[] = \"Authorization: Basic \" . $pass . \"\\n\\r\";\n\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $header);\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\n\t\tif (($result = curl_exec($curl)) === false) {\n\t\t\tthrow new Exception(\"cURL: \" . curl_error($curl));\n\t\t}\n\n\t\tcurl_close($curl);\n\t\treturn $result;\n\t}",
"public static function curlCall($param) {\n $retVal = '';\n $method = ((isset($param['method'])) && ($param['method'] != \"\")) ? strtolower($param['method']) : \"get\";\n $formate = ((isset($param['formate'])) && ($param['formate'] != \"\")) ? strtolower($param['formate']) : \"array\";\n # Init Curl Call #\n $ch = curl_init();\n # Set Options #\n curl_setopt($ch, CURLOPT_URL, $param['url']);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_TIMEOUT, 300);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n if ($method == 'post') {\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $param['postData']);\n }\n if(isset($param['headerJson']) && $param['headerJson'] != '') {\n\t\t\tif($param['headerJson']\t==\t'json') {\n\t\t\t\tif(isset($param['auth_token']) && $param['auth_token']!= ''){\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array( \n\t\t\t\t\t\t'Content-Type: application/json', \n\t\t\t\t\t\t'Content-Length: ' . strlen($param['postData']),\n\t\t\t\t\t\t'HR-API-AUTH-TOKEN:'.$param['auth_token'])); \n\t\t\t\t}else{\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array( \n\t\t\t\t\t\t'Content-Type: application/json', \n\t\t\t\t\t\t'Content-Length: ' . strlen($param['postData']))); \n\t\t\t\t}\n\t\t\t} else if($param['headerJson']\t==\t'array') {\n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t\t\t'Content-type: multipart/form-data'\n\t\t\t\t));\n\t\t\t}\n\t\t}\n $retVal = curl_exec($ch);\n curl_close($ch);\n unset($method);\n if ($formate == \"array\") {\n return json_decode($retVal, TRUE);\n } else {\n return $retVal;\n }\n }",
"function callAPI($method, $url, $data){\n $curl = curl_init();\n switch ($method){\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\t\t\t \t\t\t\t\t\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n // EXECUTE:\n $result = curl_exec($curl);\n curl_close($curl);\n return $result;\n}",
"function Qassim_HTTP($method, $url, $header, $data){\r\n\r\n if( $method == 1 ){\r\n $method_type = 1; // 1 = POST\r\n }else{\r\n $method_type = 0; // 0 = GET\r\n }\r\n\r\n $curl = curl_init();\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\r\n curl_setopt($curl, CURLOPT_HEADER, 0);\r\n\r\n if( $header !== 0 ){\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, $header);\r\n }\r\n\r\n curl_setopt($curl, CURLOPT_POST, $method_type);\r\n\r\n if( $data !== 0 ){\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n }\r\n\r\n $response = curl_exec($curl);\r\n $json = json_decode($response, true);\r\n curl_close($curl);\r\n\r\n return $json;\r\n}",
"function send_curl_xld($url)\n{\n //请求URL地址\n// $url = \"http://xiaoyao.ssup.cn/api/UserBind/GetUserIdByUserNameOrCellPhone?UserName=\" . $send_data[\"UserName\"];\n //请求数据格式\n $header = array(\"Content-type: application/json\");\n //初始化\n $curl = curl_init(); // 启动一个CURL会话\n curl_setopt($curl, CURLOPT_VERBOSE, '1');\n curl_setopt($curl, CURLOPT_HTTPHEADER, $header);\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HEADER, 0);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $tmpInfo = curl_exec($curl); //返回api的json对象\n $result = ((array) json_decode($tmpInfo, true));\n //关闭URL请求\n curl_close($curl);\n return $result; //返回json对象\n}",
"function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n}",
"public function api_call($query) {\n $query = $this->sanitize_str($query); \n $url = \"https://superheroapi.com/api/1180364012471833/search/\" . $query;\n \n if (!file_get_contents($url)) {\n $err = array(\n \"response\" => \"error\",\n \"error\" => \"Couldn't connect to API\",\n );\n \n $res = json_encode($err);\n }\n else {\n $res = file_get_contents($url);\n }\n \n return $res;\n }",
"private function curl($url,$data){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS,\n http_build_query($data));\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $server_output = curl_exec($ch);\n if($server_output===false){\n $error = curl_error($ch);\n $this->log_middle(\"curl false:\" . $error);\n }\n curl_close($ch);\n\n return $server_output;\n\n }",
"function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}",
"protected function curl($url) \n {\n if ( empty($url) ) return false;\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n $data = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($data);\n }",
"function request_API($bypassCahe,$path, $parameters){\r\n\t // Create connection\r\n\t global $host, $username, $db, $password;\r\n\t $con=mysqli_connect($host, $username, $password, $db);\r\n\r\n\t if (mysqli_connect_errno()) {\r\n\t printf(\"Connect failed: %s\\n\", mysqli_connect_error());\r\n\t exit();\r\n\t }\r\n\t include('cache/translink_config.php');\r\n\t \r\n\t $url=\"https://opia.api.translink.com.au/v1/\";\r\n\t \r\n\t $headers = array('Accept: applicationk/json','Content-Type: application/json');\r\n\t \r\n\r\n\t //intiitial ther cURL \r\n\t $curl = curl_init();\r\n\t \r\n\t curl_setopt($curl, CURLOPT_URL, $url.$path.'?'.$parameter);\r\n\t curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\r\n\t curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);\r\n\t curl_setopt($curl, CURLOPT_USERPWD,$opia_username.':'.$opia_password);\r\n\t $resp = curl_exec($curl);\r\n\r\n\t $query = \"SELECT * FROM API_Cache.date_test\";\r\n\t $result = mysqli_query($con, $query);\r\n\t $rows = mysqli_fetch_array($result, MYSQLI_ASSOC);\r\n\t mysqli_close($con);\r\n\t //print_r($rows);\r\n\t //die();\r\n\r\n\t $data = parseJSON($resp);\r\n\t pushStopData($data);\r\n\t pushData($data, \"caches\");\r\n\t die();\r\n\r\n\t $sql_string = \"INSERT INTO `API_Cache`.`caches` (`cache_ID`, `time_stamp`, `stored_responds`) VALUES (NULL, CURRENT_TIMESTAMP,\".$resp.\" )\";\r\n\t mysqli_query($con, $sql_string);\r\n\t mysqli_close($con);\r\n\r\n\r\n\t \r\n\t echo ('<hr>'.curl_getinfo($curl, CURLINFO_HEADER_OUT));\r\n\t curl_close($curl);\r\n\t \r\n\t}",
"function web_client($url) {\n $post = array();\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\n $result = curl_exec($ch);\n \n $response = json_decode($result, true);\n}",
"function api_response($res)\n{\n $response_code = $res['code'];\n $response_data = $res['data'];\n\n header('Content-Type: application/json');\n if(DEBUG)\n {\n exit('<pre>' . print_r(\n array(\n 'response'=>$response_code,\n 'data'=>$response_data\n\n ),true));\n }\n exit(json_encode(\n array(\n 'response'=>$response_code,\n 'data'=>$response_data\n )\n ));\n}",
"public function api_call($cmd, $req = array()) {\n $public_key = config('coinpayment.public_key');\n $private_key = config('coinpayment.private_key');\n\n // Set the API command and required fields\n $req['version'] = 1;\n $req['cmd'] = $cmd;\n $req['key'] = $public_key;\n $req['format'] = 'json'; //supported values are json and xml\n\n // Generate the query string\n $post_data = http_build_query($req, '', '&');\n\n // Calculate the HMAC signature on the POST data\n $hmac = hash_hmac('sha512', $post_data, $private_key);\n\n // Create cURL handle and initialize (if needed)\n static $ch = NULL;\n if ($ch === NULL) {\n $ch = curl_init('https://www.coinpayments.net/api.php');\n curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n }\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('HMAC: '.$hmac));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n\n // Execute the call and close cURL handle\n $data = curl_exec($ch);\n // Parse and return data if successful.\n if ($data !== FALSE) {\n if (PHP_INT_SIZE < 8 && version_compare(PHP_VERSION, '5.4.0') >= 0) {\n // We are on 32-bit PHP, so use the bigint as string option. If you are using any API calls with Satoshis it is highly NOT recommended to use 32-bit PHP\n $dec = json_decode($data, TRUE, 512, JSON_BIGINT_AS_STRING);\n } else {\n $dec = json_decode($data, TRUE);\n }\n if ($dec !== NULL && count($dec)) {\n return $dec;\n } else {\n // If you are using PHP 5.5.0 or higher you can use json_last_error_msg() for a better error message\n return array('error' => 'Unable to parse JSON result ('.json_last_error().')');\n }\n } else {\n return array('error' => 'cURL error: '.curl_error($ch));\n }\n }",
"function get_districts($id)\n{\n $url = set_url('disctricts');\n $url .= '?city_id=' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }",
"public function call($url)\n {\n $method = $_SERVER['REQUEST_METHOD'];\n\n $curl = curl_init();\n switch ($method){\n case 'POST':\n curl_setopt($curl, CURLOPT_POST, 1);\n if (!empty($_POST))\n curl_setopt($curl, CURLOPT_POSTFIELDS, $_POST);\n break;\n case 'DELETE':\n case 'PATCH':\n $data = array();\n mb_parse_str(file_get_contents(\"php://input\"),$data);\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST,$method);\n if (!empty($data))\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\t\t\t \t\t\t\t\t\n break;\n default:\n break;\n }\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $this->api_url.$url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'X-TOKEN:'.$this->token,\n 'Person-Id:'.$this->pid,\n 'User-Agent:'.$_SERVER['HTTP_USER_AGENT'],\n 'IP:'.$_SERVER['REMOTE_ADDR'],\n ));\n curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n // EXECUTE:\n $result = curl_exec($curl);\n if(!$result){die(\"Connection Failure\");}\n curl_close($curl);\n\n if($url == '/admin_login') $_SESSION['sinfo']['token'] = json_decode($result,true)['data']['token'];\n\n print_r($result);\n die;\n }",
"function api_response($res)\n{\nheader('Content-Type: application/json');\n if(ENABLE_DEBUG)\n {\n exit('<pre>' . print_r(\n $res,true));\n }\n exit(json_encode(\n $res\n ));\n}",
"function revSPORTapiRequest(string $api, string $endpoint, int $id = null, array $parameters = [])\n{\n date_default_timezone_set('Australia/Sydney');\n\n //Replace these with\n //revdemoclub\n $apiKey = '';\n $secretKey = '';\n $method = 'GET';\n //$url = 'https://lz-1.revolutionise.com.au/' . $api . '/' . $endpoint . '/';\n $url = 'https://lz-1-staging.revolutionise.com.au/' . $api . '/' . $endpoint . '/';\n //$url = 'https://lz-1.rev.local/' . $api . '/' . $endpoint . '/';\n\n if (empty($id) === false)\n {\n $url .= $id;\n }\n\n $now = time();\n $date = date('d M Y H:i:s', $now);\n $URLFriendlyDate = str_replace(' ', '', $date);\n $nonce = rand(100000, 999999); // generated randomly\n\n // Build the digest to send\n $digest = base64_encode(hash_hmac('sha256', $method . \"+/\" . $endpoint . \"/\" . (empty($id) ? '' : $id) . \"+$URLFriendlyDate+$nonce\", $secretKey));\n $x = array(\n 'api_key' => $apiKey,\n 'date' => $date,\n 'nonce' => $nonce,\n 'digest' => $digest\n );\n\n $postfields = array_merge($x, $parameters);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //make sure it returns a response\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // allow https verification if true\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // allow https verification if true\n curl_setopt($ch, CURLOPT_POST, true); //tell it we are posting\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query_for_curl($postfields)); //tell it what to post\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json')); //response comes back as json\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: multipart/form-data')); //response comes back as json\n $response = curl_exec($ch);\n\n\n // Check if any error occurred\n if (!curl_errno($ch))\n {\n $info = curl_getinfo($ch);\n }\n // Close handle\n curl_close($ch);\n\n //$response = json_decode($response, true);\n\n return $response;\n}",
"function _curlRequest( $url, $method, $data = null, $sendAsJSON = true, $auth = true ) {\n\t$curl = curl_init();\n\tif ( $method == 'GET' && $data !== null ) {\n\t\t$url .= '?' . http_build_query( $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_URL, $url );\n\tif ( $auth ) {\n\t\tcurl_setopt( $curl, CURLOPT_USERPWD, P_SECRET );\n\t}\n\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $method );\n\tif ( $method == 'POST' && $data !== null ) {\n\t\tif ( $sendAsJSON ) {\n\t\t\t$data = json_encode( $data );\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen( $data ) ) );\n\t\t}\n\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );\n\t$response = curl_exec( $curl );\n\tif ( $response === false ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\t$httpCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE );\n\tif ( $httpCode >= 400 ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\tcurl_close( $curl );\n\n\treturn json_decode( $response, true );\n}"
]
| [
"0.71147305",
"0.7107087",
"0.69499046",
"0.6896348",
"0.6890213",
"0.6873541",
"0.6785073",
"0.67107266",
"0.66757363",
"0.66366076",
"0.6625114",
"0.65980345",
"0.6585834",
"0.65316",
"0.6530395",
"0.6523018",
"0.65162617",
"0.64918",
"0.648922",
"0.64834034",
"0.6482985",
"0.64546096",
"0.64523494",
"0.6447299",
"0.639226",
"0.63863426",
"0.6373272",
"0.6373272",
"0.6366168",
"0.63605636",
"0.63595676",
"0.635671",
"0.634018",
"0.6331559",
"0.63104737",
"0.62854844",
"0.6279453",
"0.62680393",
"0.6261185",
"0.62599945",
"0.6256473",
"0.6243548",
"0.6231039",
"0.62265307",
"0.622527",
"0.6218049",
"0.62128806",
"0.62116164",
"0.6198276",
"0.6179107",
"0.61762553",
"0.6175356",
"0.61733645",
"0.6169281",
"0.6146526",
"0.6141259",
"0.61348057",
"0.6125132",
"0.61242765",
"0.6123389",
"0.6119044",
"0.61184746",
"0.61058086",
"0.6099922",
"0.60771936",
"0.60770965",
"0.6073808",
"0.6072868",
"0.6071987",
"0.60715836",
"0.6065588",
"0.60654896",
"0.60626477",
"0.60465443",
"0.6044731",
"0.60431105",
"0.60421413",
"0.60331357",
"0.6030518",
"0.6022387",
"0.6022102",
"0.60181004",
"0.60180247",
"0.6017933",
"0.60126966",
"0.6012563",
"0.60080844",
"0.6002662",
"0.60001403",
"0.5997587",
"0.5994603",
"0.59684396",
"0.59631586",
"0.5960172",
"0.5952085",
"0.59518236",
"0.59502333",
"0.5948717",
"0.59455746",
"0.5943222",
"0.5934079"
]
| 0.0 | -1 |
orm result to json | public static function as_object_array($result) {
$output = array();
foreach ($result as $r) {
$output[] = $r->as_array();
}
return $output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toJson();",
"public function toJson();",
"function fire_query_get_json() {\n $res = $this->fire_query();\n $res_arr = array();\n while($row = $res->fetch_array(MYSQL_ASSOC)) {\n $res_arr[] = $row;\n }\n return json_encode($res_arr);\n }",
"public function resultsToJson ()\n {\n// $res = array();\n// foreach ($this->results() as $result)\n// {\n// array_push($res, array($result));\n// }\n return json_encode($this->results());\n }",
"function resultToJSON($result,$parameters,$allFields=null)\r\n\t{\r\n\t\t$array=resultToArray($result,extractFields($parameters));\r\n\t\treturn arrayToDBGridJSON($array,$parameters,$allFields);\r\n\t}",
"public function json()\n {\n //\n return Laratables::recordsOf(Record::class, function ($query) {\n return $query->where('user_id', Auth::id());\n });\n }",
"public function getResult() {\n return json_encode($this->result);\n }",
"public function toJson(){\n\t\t$array = $this->toArray();\n\t\treturn json_encode($array);\n\t}",
"public function toJson()\n {\n return Json::encode($this->toArray(), false, array(\n 'enableJsonExprFinder' => TRUE,\n ));\n }",
"public function toJson() : string\n {\n return json_encode($this->all());\n }",
"public function getResult() {\r\n return json_encode($this);\r\n }",
"public function json(){ return json_encode( $this->objectify() ); }",
"public function jsonSerialize()\n\t{\n\t\treturn array(\n\t\t\t'count' => $this->count, \n\t\t\t'objects' => $this->tableObjects\n\t\t\t);\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"public function to_json()\n {\n }",
"private static function mappingFromDBResult(&$result){\n $bindResult= [];\n $result->bind_result($bindResult['id'],$bindResult['descripcion'],$bindResult['estatus']);\n\n $results = [];\n while($result->fetch()){\n $estadoActual = new EstadoActual($bindResult['id'],$bindResult['descripcion']);\n $estadoActual->estatus = new Estatus($bindResult['estatus']);\n $results[] = $estadoActual;\n }\n return $results;\n }",
"public function JSONifyResults($result)\n {\n $output = array();\n $output = $result->fetch_all(MYSQLI_ASSOC);\n echo json_encode($output, JSON_PRETTY_PRINT);\n }",
"function getJsonObjFromResult(&$result){\n // by reference doorgeven, waardoor deze niet gekopieerd word\n // naar een nieuwe variabele voor deze functie.\n\n $fixed = array();\n \n $typeArray = array(\n MYSQLI_TYPE_TINY, MYSQLI_TYPE_SHORT, MYSQLI_TYPE_INT24, \n MYSQLI_TYPE_LONG, MYSQLI_TYPE_LONGLONG,\n MYSQLI_TYPE_DECIMAL, \n MYSQLI_TYPE_FLOAT, MYSQLI_TYPE_DOUBLE );\n $fieldList = array();\n // haal de veldinformatie van de velden in deze resultset op\n while($info = $result->fetch_field()){\n $fieldList[] = $info;\n }\n // haal de data uit de result en pas deze aan als het veld een\n // getaltype zou moeten bevatten\n while ($row = $result -> fetch_assoc()) {\n $fixedRow = array();\n $teller = 0;\n\n foreach ($row as $key => $value) {\n if (in_array($fieldList[$teller] -> type, $typeArray )) {\n $fixedRow[$key] = 0 + $value;\n } else {\n $fixedRow[$key] = $value;\n }\n $teller++;\n }\n $fixed[] = $fixedRow;\n }\n\n // geef een json object terug\n return '{\"data\":'.json_encode($fixed).'}';\n}",
"public function jsonSerialize()\n {\n return $this->tinydb_get_serializable_data();\n }",
"function return_json($sqlresult) {\n header(\"Content-type:application/json;charset=utf-8\");\n echo json_encode($sqlresult);\n }",
"function queryResultToJSON($qResult,$parameters=NULL,$allFields=NULL)\r\n\t{\r\n//If configuration is not defined we add the fields in the result of the query by default.\r\n\t\tif (!is_array($parameters['columns']))\r\n\t\t{\r\n\t\t\t$fieldNum = mysql_num_fields($qResult);\r\n\t\t\t$fields = array();\r\n\t\t\tfor ($i=0; $i<$fieldNum; $i++)\r\n\t\t\t\t$fields []= mysql_field_name($qResult,$i);\r\n\t\t\t$parameters['columns'] = fieldsToParams($fields);\t\r\n\t\t}\r\n\t\treturn resultToJSON($qResult,$parameters,$allFields);\r\n\t}",
"public function toDB()\n {\n return json_encode([\n 'template' => $this->template->getName(),\n 'options' => $this->options\n ]);\n }",
"public function toJson(): string;",
"public function toJson(): string;",
"public function jsonSerialize()\n {\n return\n [\n 'kind' => $this->getKind(),\n 'result' => $this->getResult(),\n 'sql' => Functions::formatSql($this->getSql()->getSentence(), $this->getSql()->getParams()),\n 'performance' => $this->getPerformance()\n ];\n }",
"public function toJson()\n\t{\n\t\treturn json_encode($this->data());\n\t}",
"function sqlData($sql){\n // \n $result = $this->query($sql);\n //\n //\n if (!$result) {\n print \"<p>Could not retrieve data: </p>\";\n }\n while ($row = $result->fetchAll()) {\n $data = $row;\n return json_encode($data);\n }\n }",
"public static function viewTeenCoin(){\n try {\n $conexion = ConexionDB::conectar(\"cryptoMonedas\");\n $cursor = $conexion->monedas->find();\n $result = json_encode($cursor->toArray());\n } catch(Exception $e) {\n echo $e;\n }\n $conexion = null;\n return $result;\n}",
"public function export() {\n return json_encode(\n $this->manager->all()->toArray()\n );\n }",
"function asJSON(){\n\t\t\treturn json_encode($this->asArray());\n\t\t}",
"public function jsonSerialize()\n {\n return $this->all();\n }",
"public function jsonSerialize()\n {\n return $this->all();\n }",
"public function jsonSerialize()\n {\n return $this->all();\n }",
"public function toJson()\n {\n return json_encode( $this->toArray() );\n }",
"public function toJson()\n {\n return json_encode($this->dataSource->toArray());\n }",
"public function jsonSerialize()\n {\n return [['id' => $this->id,\n 'users_id' => $this->users,\n 'result' => $this->result,\n 'time' => $this->time]\n\n ];\n }",
"public function __toString() {\n $cols = self::Schema()->Columns()->all();\n $data = array();\n foreach($cols as $col) {\n if ($col->serializable)\n $data[$col->name] = $this->__cache->getValue($col->getAbsoluteName());\n }\n\n return json_encode($data);\n }",
"public function toJson()\n {\n return json_encode($this->toArray(), true);\n }",
"public function GetJSON()\r\n\t{\r\n\t\tif( $this->last_result )\r\n\t\t{\r\n\t\t\tif( $this->RowCount() > 0 )\r\n\t\t\t{\r\n\t\t\t\tfor( $i = 0, $il = mysql_num_fields( $this->last_result ); $i < $il; $i++ )\r\n\t\t\t\t{\r\n\t\t\t\t\t$types[$i] = mysql_field_type( $this->last_result, $i );\r\n\t\t\t\t}\r\n\t\t\t\t$json = '[';\r\n\t\t\t\t$this->MoveFirst();\r\n\t\t\t\twhile( $member = mysql_fetch_object( $this->last_result ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$json .= json_encode( $member ) . \",\";\r\n\t\t\t\t}\r\n\t\t\t\t$json .= ']';\r\n\t\t\t\t$json = str_replace(\"},]\", \"}]\", $json );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$json = 'null';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->active_row = -1;\r\n\t\t\t$json = 'null';\r\n\t\t}\r\n\t\treturn $json;\r\n\t}",
"public function toJson()\n\t{\n\t\treturn json_encode($this->toArray(), \\JSON_PARTIAL_OUTPUT_ON_ERROR);\n\t}",
"public function json_table() {\n\t\t\techo json_encode($this->populate_rows());\n\t\t}",
"public function toJson()\r\n {\r\n return json_encode($this->toArray());\r\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson()\n {\n return json_encode($this->toArray());\n }",
"public function toJson() {\n\t\treturn json_encode($this->toArray());\n\t}",
"public function getResult()\n {\n $data = [\n 'query' => $this->getQuery(),\n 'table' => $this->table,\n ];\n\n if (isset($this->columns)) {\n $data['columns'] = $this->columns;\n }\n if (isset($this->with)) {\n $data['with'] = $this->with;\n }\n if (isset($this->where)) {\n $data['where'] = $this->where;\n }\n if (isset($this->data)) {\n $data['data'] = $this->data;\n }\n if (isset($this->order)) {\n $data['order'] = $this->order;\n }\n if (isset($this->limit)) {\n $data['limit'] = $this->limit;\n }\n\n return $data;\n }",
"public function JsonDioceses() {\n $o_data = new Db();\n $qr_result = $o_data->query(\"select grandsparents.idno, CASE objects.status WHEN 0 THEN \\\"en attente\\\" WHEN 1 THEN \\\"en cours\\\" WHEN 2 THEN \\\"à valider\\\" WHEN 3 THEN \\\"validé\\\" ELSE \\\"valeur incohérente\\\" END as statut, count(*) as nombre from ca_objects as objects left join ca_objects as parents on parents.object_id=objects.parent_id left join ca_objects as grandsparents on parents.parent_id=grandsparents.object_id and grandsparents.type_id=261 where objects.type_id = 262 and objects.deleted=0 and parents.type_id=23 and parents.parent_id is not null and grandsparents.object_id is not null group by parents.parent_id, objects.status;\");\n $first=1;\n print \"[\";\n while($qr_result->nextRow()) {\n if(!$first) print \",\";\n print \"{\\\"idno\\\":\\\"\".$qr_result->get('idno').\"\\\",\\n\";\n print \"\\\"statut\\\":\\\"\".$qr_result->get('statut').\"\\\",\\n\";\n print \"\\\"nombre\\\":\\\"\".$qr_result->get('nombre').\"\\\"}\\n\";\n $first=0;\n }\n print \"]\\n\";\n exit;\n }",
"public function outputAsJson()\n {\n header('Content-type: application/json');\n echo json_encode($this->result());\n }",
"private function tableJson() {\n $json = DB::table('products')\n ->leftjoin('categories', 'products.cid', '=', 'categories.id')\n ->leftjoin('sub_categories', 'products.scid', '=', 'sub_categories.id')\n ->select('products.*', 'categories.name as cname', 'sub_categories.name as sname')\n ->orderBy('products.id', 'DESC')\n ->get();\n\n return $json;\n }",
"function getDatos(){\n $res = $this->Consulta('SELECT C.*, P.id_planta FROM '.$this->Table .' C\n INNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\n INNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\n INNER JOIN\n plantas P ON P.id_planta = S.id_planta\n \n WHERE '.$this->PrimaryKey.' = '.$this->_datos);\n $resultado = $res[0];\n // $resultado = array_map('utf8_encode',$resultado);\n \n print_r( json_encode( $resultado ) );\n }",
"public function jsonize()\n {\n return json_encode($this->toArray());\n }",
"public function toJSON()\n\t{\n\t\t$columns = array();\n\t\t\n\t\t$rf = new ReflectionClass($this);\n\t\t$props = $rf->getProperties();\n\t\tforeach ($props as $prop)\n\t\t{\n\t\t\t$column = AttributeReader::PropertyAttributes($this,$prop->getName())->Column;\n\t\t\t$columns[$column] = $prop->getValue($this);\n\t\t}\n\n\t\treturn json_encode($columns);\n\t}",
"function getAll(){ \n $db = $this->_db->dbConnection();\n $sql = 'SELECT * FROM users';\n $stmt = $db->query($sql);\n $rows = $stmt->fetchAll();\n return json_encode($rows);\n }",
"public function toJson() {\n return json_encode($this->toArray());\n }",
"public function getResultsInJSON(): string {\n return json_encode($this->getResults());\n }",
"public function toJSON(){\n $jsondata = array();\n $jsondata[\"idCliente\"]=$this->getIdCliente();\n $jsondata[\"idPedido\"]=$this->getIdPedido();\n \n return $jsondata;\n }",
"function returnJSON($stmt){\n $stmt->execute();\n $stmt->store_result();\n $meta = $stmt->result_metadata();\n $bindVarsArray = array();\n //using the stmt, get it's metadata (so we can get the name of the name=val pair for the associate array)!\n while ($column = $meta->fetch_field()) {\n $bindVarsArray[] = &$results[$column->name];\n }\n //bind it!\n call_user_func_array(array($stmt, 'bind_result'), $bindVarsArray);\n //now, go through each row returned,\n while($stmt->fetch()) {\n $clone = array();\n foreach ($results as $k => $v) {\n $clone[$k] = $v;\n }\n $data[] = $clone;\n }\n return json_encode($data);\n}",
"public function getJSON ( $sql, $params = array()){\r\n\t\tif (!empty($params)) {\r\n\t\t $resultArray = parent::boundQuery($sql, $params);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$resultArray = parent::query($sql);\r\n\t\t}\r\n\t\t$result = array ( 'data' => $resultArray);\r\n\t\treturn (json_encode($result));\r\n\t}",
"public function json(){\n $data = pinjamkbl::all();\n return DataTables::of($data)\n\n ->addColumn('buku',function($data){\n return $data->Buku->judul;\n })\n \n ->addColumn('anggota',function($data){\n return $data->Anggota->namaagt;\n })\n ->rawColumns(['buku','anggota'])->make(true);\n }",
"public function getResult()\n {\n $json = $this->object->toJsonEncodeable();\n\n if(! $this->showEmpty) {\n $json = $this->removeEmpty($json);\n }\n\n if(! $this->showType) {\n $json = $this->removeType($json);\n }\n\n if($this->dataGroup) {\n $output = new \\stdClass();\n $group = $this->dataGroup;\n\n if(!empty($this->extraInfo) && is_array($this->extraInfo)) {\n foreach($this->extraInfo as $key => $value) {\n if($key === $group) {\n continue;\n }\n\n $output->$key = $value;\n }\n }\n $output->$group = $json;\n\n } else {\n if(!empty($this->extraInfo) && is_array($this->extraInfo)) {\n $output = new \\stdClass();\n foreach($this->extraInfo as $key => $value) {\n if($key === \"body\") {\n continue;\n }\n $output->$key = $value;\n }\n $output->body = $json;\n } else {\n $output = $json;\n }\n }\n\n return json_encode($output, $this->jsonOptions);\n }",
"public function serialize() {\n\n // pega o mapeamentp\n $mapping = $this->mapping;\n\n // verifica se existe\n if ( !$mapping ) return;\n\n // seta os dados\n $data = [];\n foreach( $mapping as $atributo => $colunaTabela ) {\n $data[$colunaTabela] = $this->$atributo;\n }\n\n // volta os dados\n return $data;\n }",
"function findNodesJSON(){\n\t\t$qb = $this->createQueryBuilder('n');\n\t\t$qb->select('n.id')\n\t\t->addSelect('n.name');\n\t\t$nodes = $qb->getQuery()->getResult();\n\t\t$nodes_json = json_encode($nodes);\n\t\treturn $nodes_json;\n\t}",
"public function annonceJson(){\n $db = $this->getPDO();\n $sql = \"SELECT * FROM annonces INNER JOIN utilisateurs ON annonces.utilisateur_id = utilisateurs.id_utilisateur INNER JOIN categories ON annonces.categorie_id = categories.id_categorie INNER JOIN regions ON annonces.regions_id = regions.id_regions\";\n $json = $db->query($sql);\n return $json;\n }",
"public function toJson()\n {\n return json_encode($this->data);\n }",
"public function to_json()\n {\n $json_string = \"\";\n if(count($this->data))\n {\n $json_string = '{\"'.$this->bean.'\":[{';\n foreach($this->data as $key => $val)\n {\n $json_string .= '\"'.$key.'\":\"'.$val.'\",';\n }\n $json_string .= '}]}'; \n } \n return $json_string; \n }",
"public function toJson()\n {\n return json_encode($this->toArray(), JSON_FORCE_OBJECT | JSON_NUMERIC_CHECK);\n }",
"public function toJson()\n {\n return json_decode(json_encode($this->toArray()));\n }",
"public function getResult() {\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }",
"private function JSON($result)\n {\n // Check numb of rows\n if ($result) {\n $num = $result->num_rows;\n } else {\n $num = '';\n }\n // Create array\n $outputArr = [];\n // Output object\n if ($num > 0) {\n while ($row = $result->fetch_assoc()) {\n // Extract each value\n extract($row);\n // Create array items\n $arrItem = [\n 'Wid' => $Wid,\n 'Wname' => $Wname,\n 'Wtitle' => $Wtitle,\n 'WstartDate' => $WstartDate,\n 'WendDate' => $WendDate,\n 'Wdesc' => $Wdesc,\n 'UserID' => $UserID\n ];\n // Push to array\n array_push($outputArr, $arrItem);\n }\n // OK response\n http_response_code(200);\n\n // Output JSON\n echo json_encode($outputArr);\n } else {\n // Add error response code\n http_response_code(404);\n\n // If no items found\n echo json_encode(\n ['message' => 'No work found']\n );\n }\n }",
"public function toJson() {\n return json_encode($this->data);\n }",
"public function getJsonBroDeployOverseas(){\n\t\t$query = \"Select BroDeployOverseas.post, Sum(bandwidth.capacity) as capacity, BroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude, BroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted,\n\t\t\tBroDeployOverseas.region, BroDeployOverseas.vsencompatableworkstation, BroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining\n\t\t\tFrom public.BroDeployOverseas, public.bandwidth\n\t\t\tWhere BroDeployOverseas.post = bandwidth.post\n\t\t\tGroup By BroDeployOverseas.post, BroDeployOverseas.region, \n\t\t\tBroDeployOverseas.regworkpercentcompleted, BroDeployOverseas.vsenpercentcompleted, \n\t\t\tBroDeployOverseas.regularworkstation, BroDeployOverseas.regworkdeployed, BroDeployOverseas.regworkremaining,\n\t\t\tBroDeployOverseas.vsencompatableworkstation,\n\t\t\tBroDeployOverseas.vsendeployed, BroDeployOverseas.vsenremaining,\n\t\t\tBroDeployOverseas.latitude, BroDeployOverseas.longitude; \n\t\t\"; // There might be a better way to do this.\n\t\t$result = $this->connectPG($query);\t\t\t\n\t\t$rows = pg_fetch_all($result);\t\n\n\t\t$jsonArrayOfObjs = \"[\";\n\t\tforeach($rows as $keys => $datums){\n\t\t\t//Build JSON string\n\t\t\t$rows2 = array_keys($rows);\n\t\t\tif(end($rows2) == $keys){\n\t\t\t\t//This will be the last element in the array of objects\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"}\";\n\t\t\t}else{\n\t\t\t\t$jsonArrayOfObjs .= \"{\";\n\t\t\t \t\t$jsonArrayOfObjs .= \"\\\"region\\\":\\\"\".trim($datums['region']).\"\\\", \\\"post\\\":\\\"\".trim($datums['post']).\"\\\",\"; \n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regularworkstation\\\":\".$datums['regularworkstation'].\", \\\"regworkdeployed\\\":\".$datums['regworkdeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"regworkremaining\\\":\".$datums['regworkremaining'].\", \\\"regworkpercentcompleted\\\":\".$datums['regworkpercentcompleted'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsencompatableworkstation\\\":\".$datums['vsencompatableworkstation'].\", \\\"vsendeployed\\\":\".$datums['vsendeployed'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"vsenremaining\\\":\".$datums['vsenremaining'].\", \\\"vsenpercentcompleted\\\":\".$datums['vsenpercentcompleted'].\", \\\"capacity\\\":\".$datums['capacity'].\",\";\n\t\t\t \t$jsonArrayOfObjs .= \"\\\"latitude\\\":\".$datums['latitude'].\", \\\"longitude\\\":\".$datums['longitude'].\"\";\n\t\t \t$jsonArrayOfObjs .= \"},\";\n\t\t\t}\n\n\t\t} \n\t\t$jsonArrayOfObjs .= \"]\"; \n\t\t//error_log($jsonArrayOfObjs);\n\n\t\t$cleanJsonStr = json_decode($jsonArrayOfObjs);\n\n\t\t//Validate the JSON\n\t\tif($cleanJsonStr === NULL){error_log(\"Error in JSON in getJsonBroDeployOverseas() method.\"); }else{return $jsonArrayOfObjs;}\n\t}",
"public function toJson() : string\n {\n return json_encode( $this->toArray() );\n }",
"function GetEmployeeById($id)\n{\n include_once(\"../Model/Employee.php\");\n $emp_model = new EmployeeModel();\n $list= $emp_model->GetEmployeById($id);\n $results = $list->fetchAll(PDO::FETCH_ASSOC);\n \n return json_encode($results);\n\n}",
"public function buildJson();",
"public function json()\n {\n $this->fetchFields();\n Log::json($this);\n }",
"public function getAllJson()\n { \n $estaciones = $this->mibiciDAO->getAllMibici();\n return $estaciones;\n }",
"public function json() \n\t{\n return json_encode($this);\n\t}",
"public function toJson() {\n\t\t\treturn json_encode(array(\n\t\t\t\t'id' => $this->id,\n\t\t\t\t'model' => $this->model,\n\t\t\t\t'type' => json_decode($this->type->toJson()),\n\t\t\t\t'description' => $this->description,\n\t\t\t\t'area' => json_decode($this->area->toJson()),\n\t\t\t\t'status' => $this->status\n\t\t\t));\n\t\t}",
"public function toJson()\n {\n return json_encode($this);\n }",
"public function toJson() {\n\t\treturn json_encode($this->jsonSerialize());\n\t}",
"public function toJSON(){\n return json_encode($this);\n }",
"public function toJson() {\n\t\t$data = array();\n\t\tforeach ($this->fields as $name => $field) {\n\t\t\t$data += [$name => $field->toJson()];\n\t\t}\n\t\t$top = array(\"success\"=>$this->getSuccess(),\"data\"=>$data,\"text\"=>$this->text);\n\t\treturn $top;\n\t}",
"public static function getAll() {\n try {\n $conexion = ConexionDB::conectar(\"cryptoMonedas\");\n $cursor = $conexion->monedas->find();\n $result = json_encode($cursor->toArray());\n } catch(Exception $e) {\n echo $e;\n }\n $conexion = null;\n return $result;\n }",
"public function results()\n {\n //by default data get as array/stdclasses\n\n // to trunit to arrays of arrays\n // return json_decode(json_encode($this->_results), true);\n return $this->_results;\n // gives array data with column name and itsvalue not index array\n }",
"public function resultSet(){\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }"
]
| [
"0.7104776",
"0.7104776",
"0.7060802",
"0.68967706",
"0.6857247",
"0.6704377",
"0.66888225",
"0.6634893",
"0.6570535",
"0.6565906",
"0.6555925",
"0.65421313",
"0.65088093",
"0.65051717",
"0.65051717",
"0.65051717",
"0.65051717",
"0.65051717",
"0.65051717",
"0.65051717",
"0.65051717",
"0.65051717",
"0.64852273",
"0.64063257",
"0.6393338",
"0.6382847",
"0.63814867",
"0.6363208",
"0.63600504",
"0.63590753",
"0.63590753",
"0.63099223",
"0.63091594",
"0.63013726",
"0.62905115",
"0.6288932",
"0.6288635",
"0.628807",
"0.628807",
"0.628807",
"0.6280515",
"0.6280398",
"0.6273316",
"0.62497115",
"0.6237648",
"0.62341964",
"0.62292266",
"0.62267786",
"0.6223047",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.6220704",
"0.62155795",
"0.62150466",
"0.6199889",
"0.61998725",
"0.6198602",
"0.61945647",
"0.6188374",
"0.6187383",
"0.6186912",
"0.61755913",
"0.6159078",
"0.6154989",
"0.61508816",
"0.61316794",
"0.6125666",
"0.6114201",
"0.6077207",
"0.60720795",
"0.6043061",
"0.60244596",
"0.6015063",
"0.6014315",
"0.6010552",
"0.6001077",
"0.59922546",
"0.59827524",
"0.5975043",
"0.5974381",
"0.5966877",
"0.5963164",
"0.5959559",
"0.594701",
"0.5946702",
"0.59306765",
"0.59285796",
"0.59197766",
"0.59190834",
"0.5910412",
"0.59078634",
"0.5904811",
"0.5902199"
]
| 0.0 | -1 |
$this>middleware('auth')>only(['create', 'edit', 'destroy', 'update']); | public function __construct()
{
$this->middleware('auth')->except(['index', 'show']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('Admin',['only'=>['create','edit']]); \n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['create', 'show', 'edit']]);\n }",
"function __construct(){\n $this->middleware('auth',['except'=>['create','store']]);\n }",
"public function __construct()\n {\n $this->middleware('auth')->only('index','create');\n }",
"public function __construct()\n {\n $this->middleware('auth')->only(['create', 'edit', 'delete']);\n }",
"public function __construct()\n {\n $this->middleware(\"admin\")->only(['edit','create','store','show'\n ,'update','destroy','permissions','makeAdmin','approveAccount']);\n // $this->middleware(\"auth\")->except(['index']);\n }",
"public function __construct() {\n $this->middleware('auth', ['only' => ['edit', 'update', 'destroy']]); // actions only for logged user\n }",
"public function __construct()\n {\n $this->middleware('auth')->only('create', 'store', 'edit', 'update', 'destroy');\n }",
"public function __construct()\n {\n $this->middleware('auth')->only('edit', 'update', 'destroy', 'changePassword');\n }",
"public function __construct()\n {\n $this->middleware('auth')->only(['store', 'update', 'destroy']);\n }",
"public function __construct()\n {\n $this->middleware('auth', ['only' => ['edit', 'update', 'create', 'store', 'destroy']]);\n }",
"public function __construct()\n {\n// $this->middleware('auth', ['only'=>'store']); // Single privilege for Auth\n $this->middleware('auth'); // All privilege for Auth\n }",
"public function __construct()\n {\n $this->middleware('auth');\n //$this->middleware('check-permission:profile customization',['only' => ['profile_custom_index','profile_custom_list']]);\n }",
"public function __construct()\n {\n $this->middleware('auth')->only(['create', 'store', 'destroy']);\n }",
"public function __construct()\n {\n \n $this->middleware('auth')->except('logout','create','liste','store','show','edit','destroy');\n }",
"public function __construct()\n {\n $this->middleware('auth')->only('update');\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['index','show']]);\n }",
"public function __construct(){\n $this->middleware('auth',['except'=>['show']]);\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=> ['show','index']]);\n }",
"public function __construct(){\n $this->middleware('role:super-admin|moderator')->only('index');\n }",
"public function __construct()\n {\n $this->middleware(['auth','check.role:A'])->only('index','show','edit','update');\n }",
"public function __construct(){\n\t\t$this->middleware('auth', ['only'=>['create']])\n\t}",
"public function __construct()\n {\n $this->middleware('auth',['except' => ['index','show']]);\n }",
"public function __construct(){\n $this->middleware('auth', ['except' => 'index', 'show']);\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except'=>['index','show']]);\n }",
"public function __construct()\n {\n $this->middleware('auth',['except' => ['login','register','logout','userInfo','refresh','checkUser','editUser']]);\n }",
"public function __construct(){\n\n $this->middleware('auth')->except('show','index');\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>'show']);\n }",
"public function __construct(){\n $this->middleware('auth', ['except' => 'show']);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('role:[\"administrador\"],\" \"')->only('destroy','update');\n $this->middleware('role:[\"administrador\"],[\"vendedor\"]')->only('index');\n \n //$this->middleware()->only('');\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['show']]);\n }",
"public function __construct()\n {\n $this->middleware('isAdmin', ['only' => ['create', 'store', 'edit', 'delete']]);\n }",
"public function __construct() {\n $this->middleware('auth', ['only' => ['getLogout', 'admin', 'orders', 'products', 'addProduct', 'categories', 'users']]);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('admin',['only' => ['reportes','edit','update','create','destroy']]);\n }",
"public function __construct()\n {\n $this->middleware('auth',['only' => [\n 'index','dark_mode'\n ]]);\n }",
"public function __construct(){\n $this->middleware('check')->only('create','store');\n }",
"public function __construct()\n {\n $this->middleware('auth')->only('update', 'updatePassword');\n }",
"public function __construct(){\n $this->middleware(\"auth\", [\"except\" => \"show\"]);\n }",
"public function __construct()\n {\n $this->middleware('deny.admin', ['only' => ['update','store']]);\n }",
"public function __construct()\n {\n $this->middleware('auth')->except('create','store');\n \n //Multiple exclude\n // $this->middleware('auth')->except(['index','other']);\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except' => ['index','show']]);\n }",
"public function __construct(){\r\n \r\n $this->middleware('email-verification')->only(['update_avatar','profile',\r\n 'editProfile','editInterests','dashboard','MatchUser','interests','interested']);\r\n $exemptedMethods=['login','passwordReset','register','resetToken','PasswordResetReal','UserLogout'];\r\n $this->middleware('email-verification')->except($exemptedMethods);\r\n $this->middleware('auth')->except($exemptedMethods);\r\n\r\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except' => ['index', 'show']]);\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except' => ['index', 'show']]);\n }",
"public function __construct()\n {\n //$this->middleware(['role:user'],['only' => 'index']);\n\n }",
"public function __construct()\n {\n $this->middleware('auth')->except(['index','details']);\n }",
"function __construct(){\n\t\t$this->middleware('auth', ['only' => ['add', 'index']]);\n\t}",
"public function __construct()\n\n {\n $this->middleware(\n 'user',\n [ 'except'=>\n [\n 'create'\n ]\n ]);\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except'=>['index','show','search']]);\n }",
"public function __construct(){\n $this->middleware('auth');\n $this->middleware('admin', ['except' =>[\"show\",\"index\"]]);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n //$this->middleware('auth', ['only' => 'create']);\n }",
"public function __construct()\n {\n $this->middleware('auth')->except(['index', 'show','search','mayorfirst','bandas','solistas','DJS','mapa']);\n $this->middleware('checkDprofile')->only(['create','store']);\n }",
"public function __construct()\n {\n // $this->middleware('auth', ['except' => ['index','show']]);\n }",
"public function __construct()\n {\n $this->middleware('auth:admin');\n $this->middleware('role:super;editor;writer', ['only'=>'show']);\n }",
"public function __construct()\n {\n // $this->middleware('auth');\n // per proteggerne solo alcune\n // $this->middleware('auth')->only(['create', 'edit']);\n }",
"public function __construct()\n{\n $this->middleware('auth');\n $this->middleware('role:user,admin'); //can add more authorisation to view the page e.g admin\n}",
"public function __construct(){\n // $this->middleware('admin', ['except' => ['delete','trash','restore','permanentDelete']]);\n\n $this->middleware('author', ['only' => ['create','store','edit','update']]);\n $this->middleware('admin', ['only' => ['delete','trash','restore','permanentDelete']]);\n }",
"public function __construct()\n {\n $this->middleware('auth')->except(['index','show']);\n }",
"public function __construct(){\n $this->middleware('auth');\n // $this->middleware('acces:1,2');\n }",
"public function __construct()\n {\n $this->middleware('auth');\n //this->middleware('checkPDPermission', ['only' => ['edit', 'update', 'destroy']]);\n }",
"public function __construct()\n {\n $this->middleware('auth')->only( 'commentedit', 'commentdelete', 'commentadd');\n }",
"public function __construct()\n {\n $this->middleware('auth:api', ['except' => ['login','register','profile','editreg']]);\n }",
"public function __construct()\n {\n $this->middleware('auth')->except('index','show');\n }",
"public function _construct()\n {\n $this->middleware('permission:read_roles')->only(['index']);\n $this->middleware('permission:create_roles')->only(['create','store']);\n $this->middleware('permission:update_roles')->only(['edit','update']);\n $this->middleware('permission:delete_roles')->only(['destroy']);\n \n }",
"public function __construct(){\n $this->middleware('auth')->except(['show']);\n }",
"public function __construct()\n {\n $this->middleware('admin',['only' => ['make_order']]);\n }",
"public function __construct() {\n\n // Routes [create/store/edit/delete] are protected\n // $this->middleware('auth', ['only' => ['create', 'store', 'edit', 'delete']]);\n\n // All routes are protected except [search]\n $this->middleware('auth', ['except' => ['search']]);\n }",
"public function __construct()\n {\n $this->middleware('isTeacherOwner')->only(['store', 'edit', 'update', 'destroy']);\n }",
"public function __construct()\n {\n $this->middleware('auth' );\n #$this->middleware('ventas' , ['only' => ['create','edit','show'] ] );\n }",
"public function __construct() {\n $this->middleware('auth')->only('index');\n }",
"public function __construct()\n {\n $this->middleware('admin', ['except' => ['cart','show','update','changePassword','destroy']]);\n }",
"public function __construct()\n {\n //blocks user not logged in from accessing pages like create a new post except for forum page\n $this->middleware('auth',['except'=>['index','show']]);\n }",
"public function __construct()\n {\n $this->middleware('orga')->only(['create', 'edit', 'update', 'infosEdit', 'infosUpdate']);\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['index']]);\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['index']]);\n }",
"public function __construct(){\n $this->middleware('Admin', ['except' => ['index', 'show']]);\n }",
"public function __construct()\n {\n $this->middleware('creator', ['except' => ['index','indexPublic','show','showPublic',]]);\n $this->middleware('admin', ['except' => ['indexPublic','showPublic']]);\n }",
"public function __construct()\n {\n //$this->middleware('auth')->except(['index', 'show']);\n }",
"public function __construct()\n {\n $this->middleware('auth',['except'=>['showTimeline']]);//except those methods, non authed user cannot access\n\n }",
"function __construct()\n {\n $this->middleware('permission:admin-list|admin-create|admin-edit|admin-delete', ['only' => ['index','store']]);\n $this->middleware('permission:admin-create', ['only' => ['create','store']]);\n $this->middleware('permission:admin-edit', ['only' => ['edit','update']]);\n $this->middleware('permission:admin-delete', ['only' => ['destroy']]);\n }",
"public function __construct()\n {\n $this->middleware(['auth:admin','admin']);\n }",
"public function __cosnstruct(){\n $this->middleware('auth');\n }",
"protected function middleware() {\n return array('auth');\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except'=> ['index', 'show']]);\n }",
"public function __construct() \n\t{\n\t\t\n\t $this->middleware('auth');\n $this->middleware('auth',array('only'=> array('delete')));\n\t}",
"public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('permission:list|create|edit|delete|show', ['only' => ['index','show']]);\n $this->middleware('permission:create', ['only' => ['create','store']]);\n $this->middleware('permission:edit', ['only' => ['edit','update']]);\n $this->middleware('permission:delete', ['only' => ['destroy']]);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('permission:list|create|edit|delete|show', ['only' => ['index','show']]);\n $this->middleware('permission:create', ['only' => ['create','store']]);\n $this->middleware('permission:edit', ['only' => ['edit','update']]);\n $this->middleware('permission:delete', ['only' => ['destroy']]);\n }",
"public function __construct(){\n //\n $this->middleware('auth');\n\n $this->middleware('sale', ['except' => [\n 'index',\n 'create',\n 'store',\n 'show',\n 'edit',\n 'update',\n 'destroy'\n ]]);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n $this->middleware('role:admin,manager',['except' => ['show']]);\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except' => ['index', 'show', 'create', 'store']]);\n }",
"public function __construct()\n {\n $this->middleware('auth:user')->except(['index', 'create', 'store', 'login', 'detail']);\n }",
"public function __construct()\n {\n $this->middleware(['auth','admin']);\n }",
"public function __construct()\n {\n $this->middleware(['auth','admin']);\n }",
"public function __construct()\n {\n $this->middleware(['auth','admin']);\n }",
"public function __construct()\n {\n $this->middleware('auth');\n/*\n // only the index method has to have an authorized user (user logged in)\n $this->middleware('auth', ['only' => 'index']);\n $this->middleware('auth')->only(['index']);\n\n // all methods in this controller need to have an authorized user EXCEPT index\n $this->middleware('auth', ['except' => 'index']);\n*/\n }",
"public function __construct(){\n $this->middleware('auth')->except(['index','show','byuser','bycatagory']);\n }",
"public function __construct(){\n parent::__construct();\n $this->middleware('auth:admin');\n $this->middleware('permission')->except('toSlug');\n }",
"public function __construct()\n {\n $this->middleware('auth');/*, ['except' =>['index', 'show']]*/\n }",
"public function __construct()\n {\n $this->middleware(['auth','auth.admin'])->except('logout');\n }",
"public function __construct()\n {\n $this->middleware('auth', ['except' => ['index']]);\n }",
"public function __construct()\n{\n $this->middleware('auth'); //only the authenticated user have access to the methods below. unauthenticated users will not have any access to these methods.\n $this->middleware('role:doctor'); //can add more authorisation to view the page e.g doctor\n}"
]
| [
"0.76848286",
"0.75818306",
"0.7555048",
"0.7548914",
"0.7496205",
"0.7483246",
"0.74283904",
"0.7402735",
"0.7356354",
"0.7353877",
"0.7304286",
"0.7280138",
"0.72487056",
"0.72239995",
"0.72231084",
"0.7209917",
"0.7193158",
"0.71898204",
"0.71520597",
"0.7137787",
"0.7134826",
"0.71243286",
"0.7118474",
"0.70838183",
"0.7077521",
"0.70624375",
"0.70602804",
"0.70572793",
"0.7039647",
"0.7037976",
"0.70378023",
"0.7033538",
"0.7029987",
"0.702786",
"0.70156467",
"0.70141834",
"0.701351",
"0.69920135",
"0.69834656",
"0.6977817",
"0.6975653",
"0.6955746",
"0.6934875",
"0.6934875",
"0.6933947",
"0.6932034",
"0.6925231",
"0.692423",
"0.69239783",
"0.69070107",
"0.69062036",
"0.69055474",
"0.69024205",
"0.68940467",
"0.6892879",
"0.6889687",
"0.6881597",
"0.6881193",
"0.68770486",
"0.68736434",
"0.68686444",
"0.686121",
"0.6860663",
"0.6835915",
"0.68308514",
"0.6824012",
"0.6819524",
"0.68189025",
"0.6802812",
"0.6792985",
"0.6792676",
"0.6778188",
"0.67763567",
"0.6772458",
"0.6772458",
"0.67700714",
"0.67659193",
"0.6756528",
"0.67508733",
"0.67459255",
"0.6742864",
"0.6741691",
"0.6741491",
"0.6735597",
"0.6731089",
"0.67262286",
"0.67262286",
"0.6725186",
"0.6723764",
"0.6720195",
"0.6712417",
"0.6703404",
"0.6703404",
"0.6703404",
"0.67014897",
"0.67006844",
"0.6697826",
"0.6692712",
"0.66882837",
"0.66856784",
"0.667907"
]
| 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$posts = Post::withCount('comment')->where('user_id',Auth::id())->simplePaginate(4);
return view('pages.index', compact('posts'));
} | {
"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->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"function listing() {\r\n\r\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"public function _index(){\n\t $this->_list();\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
]
| [
"0.7446377",
"0.7361922",
"0.72984487",
"0.7248631",
"0.7162871",
"0.7148215",
"0.7131838",
"0.71028054",
"0.7102395",
"0.70988023",
"0.7048243",
"0.6993516",
"0.6989079",
"0.69341344",
"0.69001913",
"0.6899167",
"0.68920904",
"0.6887188",
"0.68661547",
"0.6849159",
"0.683002",
"0.6801792",
"0.6796645",
"0.67952746",
"0.678579",
"0.6760132",
"0.6741144",
"0.67304057",
"0.6726034",
"0.6723304",
"0.6723304",
"0.6723304",
"0.67188966",
"0.67061126",
"0.67046595",
"0.67042124",
"0.6664004",
"0.6663109",
"0.66603667",
"0.66595376",
"0.6656908",
"0.66536283",
"0.6648508",
"0.6619696",
"0.66191936",
"0.66145146",
"0.66056865",
"0.6600895",
"0.66007215",
"0.6593214",
"0.6587006",
"0.6585572",
"0.6584028",
"0.65802413",
"0.65751636",
"0.6574276",
"0.6572553",
"0.65703243",
"0.6569474",
"0.6563628",
"0.6563418",
"0.65516967",
"0.655156",
"0.65460885",
"0.65367365",
"0.6533626",
"0.6533064",
"0.6527408",
"0.65251255",
"0.6524834",
"0.65202224",
"0.6517302",
"0.65167385",
"0.6516062",
"0.65148616",
"0.6506742",
"0.65018",
"0.6501768",
"0.6494415",
"0.64921784",
"0.6486631",
"0.6485237",
"0.6484199",
"0.64841217",
"0.6479556",
"0.6478558",
"0.6469807",
"0.646858",
"0.64683306",
"0.6466808",
"0.64637285",
"0.64616066",
"0.6458575",
"0.6457558",
"0.64535207",
"0.64534074",
"0.64524984",
"0.64491946",
"0.6448726",
"0.6447211",
"0.64461327"
]
| 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
return view('pages.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('resource.create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }",
"public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n return view ('forms.create');\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }",
"public function create()\n {\n return view(\"request_form.form\");\n }",
"public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }",
"public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle école'\n\t\t) ) );\n\t}",
"public function create()\n {\n return view($this->forms . '.create');\n }",
"public function create()\n {\n return view('restful.add');\n }",
"public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return view('backend.student.form');\n }",
"public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function create()\n {\n return view('client.form');\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"public function create()\n {\n return view('Form');\n }",
"public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }",
"public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }",
"public function create()\n {\n return view('backend.schoolboard.addform');\n }",
"public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}",
"public function create()\n {\n //\n return view('form');\n }",
"public function create()\n {\n return view('rests.create');\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return view(\"Add\");\n }",
"public function create(){\n return view('form.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n {\n\n return view('control panel.student.add');\n\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }",
"public function create()\n {\n return $this->cView(\"form\");\n }",
"public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }",
"public function create()\n {\n return view(\"dresses.form\");\n }",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }",
"public function create()\n {\n return view('fish.form');\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}",
"public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }",
"public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }",
"public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }",
"public function create()\n {\n return view('essentials::create');\n }",
"public function create()\n {\n return view('student.add');\n }",
"public function create()\n {\n return view('url.form');\n }",
"public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}",
"public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }",
"public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}",
"public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view('crud/add'); }",
"public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}",
"public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}",
"public function create()\n {\n //load create form\n return view('products.create');\n }",
"public function create()\n {\n return view('article.addform');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n {\n return view('saldo.form');\n }",
"public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}",
"public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}",
"public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }",
"public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }",
"public function create()\n {\n return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view(\"familiasPrograma.create\");\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}",
"public function create()\n {\n return view(\"create\");\n }",
"public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}",
"public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view('forming');\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }",
"public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }",
"public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}"
]
| [
"0.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516",
"0.71492815",
"0.7143504",
"0.7143484",
"0.71349627",
"0.71274126",
"0.7122271",
"0.7115064",
"0.7115064",
"0.7115064",
"0.7110841",
"0.70930386",
"0.70841706",
"0.7079425",
"0.7079275",
"0.70567256",
"0.70567256",
"0.7054091",
"0.70386195",
"0.7038531",
"0.7034834",
"0.7032825",
"0.7029208",
"0.70263356",
"0.7025177",
"0.7018699",
"0.70156187",
"0.7004536",
"0.7002615",
"0.7000439",
"0.69960874",
"0.6992934",
"0.6991493",
"0.6988563",
"0.698635",
"0.69649065",
"0.6963641",
"0.69552153",
"0.6950279",
"0.69498897",
"0.69465077",
"0.6943029",
"0.6940043",
"0.6939427",
"0.69359136",
"0.69359136",
"0.69357383",
"0.6933012",
"0.6929994",
"0.69270134",
"0.69259113",
"0.6923401",
"0.6917057",
"0.69144267",
"0.6911519",
"0.6909902",
"0.690978",
"0.6905855",
"0.6903688",
"0.6900189",
"0.68999064",
"0.6898482",
"0.6893158",
"0.6892387",
"0.6891021",
"0.68905854",
"0.6890334",
"0.6890334",
"0.68871844",
"0.68864834",
"0.68854547",
"0.6881966",
"0.68814063",
"0.68788683",
"0.68738896",
"0.6871671",
"0.68716353",
"0.68688464",
"0.6868651",
"0.68685114",
"0.686829"
]
| 0.0 | -1 |
Store a newly created resource in storage. | public function store(StoreRequest $request)
{
$post=new Post();
$post->title=$request->input('title');
$post->content=$request->input('content');
$post->user_id=Auth::id();
$post->save();
return redirect()->route('postsC.index')->with('success', 'Post added');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"0.72875285",
"0.71454394",
"0.71323526",
"0.6639812",
"0.6620611",
"0.6568348",
"0.6526527",
"0.6509403",
"0.64499927",
"0.6375791",
"0.63739914",
"0.6365971",
"0.6365971",
"0.6365971",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667",
"0.6342667"
]
| 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$post = Post::withCount('comment')->where('user_id',Auth::id())->findOrFail($id);
return view('pages.show', compact('post'));
} | {
"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);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
]
| [
"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.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
]
| 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
$post = Post::where('user_id',Auth::id())->findOrFail($id);
return view('pages.edit', compact('post'));
} | {
"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 $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
]
| [
"0.7855416",
"0.769519",
"0.72748375",
"0.724256",
"0.7173659",
"0.7064689",
"0.70549816",
"0.6985127",
"0.6949479",
"0.69474626",
"0.694228",
"0.6929372",
"0.6903047",
"0.6899655",
"0.6899655",
"0.688039",
"0.68649715",
"0.68618995",
"0.68586665",
"0.68477386",
"0.68366665",
"0.6812782",
"0.6807947",
"0.68078786",
"0.6803727",
"0.6796845",
"0.67935634",
"0.67935634",
"0.67894953",
"0.67862976",
"0.67815566",
"0.6777874",
"0.67700446",
"0.6764179",
"0.6747784",
"0.6747784",
"0.67476946",
"0.6746584",
"0.67417157",
"0.67370653",
"0.6727131",
"0.6714694",
"0.66953164",
"0.6693583",
"0.6690321",
"0.66898996",
"0.6689058",
"0.66865313",
"0.6684526",
"0.66717213",
"0.6670211",
"0.6666833",
"0.6666833",
"0.66633433",
"0.6663041",
"0.6661699",
"0.6658396",
"0.6657984",
"0.665473",
"0.6644314",
"0.66343915",
"0.6633082",
"0.6629606",
"0.6629606",
"0.6620677",
"0.6620635",
"0.66180485",
"0.66171867",
"0.6612161",
"0.6610249",
"0.660762",
"0.6597593",
"0.6596027",
"0.6595597",
"0.65925545",
"0.65920216",
"0.65896076",
"0.65822965",
"0.6581996",
"0.65817595",
"0.65770084",
"0.65768373",
"0.6575926",
"0.65713066",
"0.6569505",
"0.656938",
"0.65680295",
"0.65636957",
"0.65636957",
"0.65624565",
"0.65597314",
"0.6559697",
"0.65576696",
"0.65573514",
"0.65564495",
"0.6556307",
"0.655628",
"0.65558994",
"0.6549784",
"0.6549675",
"0.65461886"
]
| 0.0 | -1 |
Update the specified resource in storage. | public function update(StoreRequest $request, $id)
{
$post = Post::findOrFail($id);
$post->update($request->all());
return redirect()->route('postsC.index')->with('success', 'Post was Uptaded');
} | {
"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 ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\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.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$post = Post::find($id);
$post->delete();
return redirect()->route('postsC.index')->with('success', 'Post was Deleted');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\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.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
]
| 0.0 | -1 |
/ just for test | public function bindmobile(Request $request)
{
$session = $request -> getSession();
$openid = $session -> get("_userinfo")['openid'];
$merchantRepo = (new MerchantService()) -> where("openid", "=", $openid) -> first();
if($merchantRepo && $merchantRepo -> getAttribute("mobile")) {
return $this -> _sendJsonResponse("你的微信号已经使用手机注册了", null, false);
}
$this -> validate($request, [
'name' => 'required',
'mobile' => 'required',
'code' => 'required',
'password' => 'required',
], [
'name.required' => "用户名不能为空",
'mobile.required' => '手机号不能为空',
"code.required" => "验证码不能为空",
'password.required' => '密码不能为空',
]);
$name = $request -> input("name");
$mobile = $request -> input("mobile");
$password = $request -> input("password");
$code = $request -> input("code");
if(DevEnvUtils::isDevelopEnv() || $code == Cache::get("_captcha_" . $mobile)) {
//Cache::forget("_captcha_".$mobile); // remove cache
if($merchantRepo) {
$merchantRepo -> fill([
'name' => $name,
'phone' => $mobile,
'password' => md5($code.$password),
'salt' => $code,
'created_at' => date('Y-m-d H:i:s'),
]) -> save();
$expiredDays = $merchantRepo -> getExpiredDays();
$respData = [
'mobile' => $mobile,
'name' => $name,
'expiredDays' => $expiredDays,
'isAvailable' => ($expiredDays > 0) ? : false,
];
return $this -> _sendJsonResponse("注册成功", $respData);
}
return $this -> _sendJsonResponse("网络繁忙, 请稍候再试", $request -> all(), false);
}
return $this -> _sendJsonResponse("验证码错误", null, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function test9() {\n\n }",
"public function helper()\n\t{\n\t\n\t}",
"public function testPingTreeGetItem()\n {\n }",
"private function _i() {\n }",
"protected abstract function test();",
"protected abstract function test();",
"public function testGetPatrimonio()\n {\n }",
"public function testPingTreeGet()\n {\n }",
"public function testSpecial(): void {\n\t}",
"public static function dummy() {}",
"public function testPreprocessingGetPageAngle()\n {\n }",
"function cork_test()\n\t{\n\t}",
"abstract public function testSniff(): void;",
"public function testAddLowStockFile()\n {\n }",
"public function testGetSuperfund()\n {\n }",
"public function testQuarantineFind()\n {\n\n }",
"function test(){\r\n //placeholder for future test functions\r\n }",
"public function test_method()\n\t{\n\n\t}",
"public function testGetSuperfunds()\n {\n }",
"public function testGetLowStockFiles()\n {\n }",
"abstract public function test();",
"abstract public function test();",
"private function __() {\n }",
"public function testPreprocessingBinarize()\n {\n }",
"public function oops () {\n }",
"function specialop() {\n\n\n\t}",
"public function testFileRefs() {}",
"public function test() {\n\n\t}",
"public function testGetExpedicao()\n {\n }",
"public function testCreatePatrimonio()\n {\n }",
"public function testGetPackingPlanFiles()\n {\n }",
"public function testPreprocessingUnrotate()\n {\n }",
"public function testCreateSuperfund()\n {\n }",
"public function testPingTreeCreatePingTree()\n {\n }",
"public function testPingTreeGetReferences()\n {\n }",
"public function testPreprocessingBinarizeAdvanced()\n {\n }",
"public function testPingTreeGetCurrentCounts()\n {\n }",
"public function preTesting() {}",
"function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}",
"public function testGetOrderPackData()\n {\n }",
"public function testValidateDocumentTarValidation()\n {\n }",
"public function testAddLowStockFileByURL()\n {\n }",
"abstract public function testSniff();",
"public function testPingTreePatchItem()\n {\n }",
"private function static_things()\n\t{\n\n\t\t# code...\n\t}",
"public function testGetPublicDocument()\n {\n }",
"public function testGetExternalShipmentFiles()\n {\n }",
"public function testInboundDocumentSearch()\n {\n }",
"public function testGetPackingPlanByFilter()\n {\n }",
"public function testGetExpert()\n {\n }",
"public function testReportsSpamchecksHistoryGet()\n {\n }",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}",
"public function main() {}"
]
| [
"0.63843095",
"0.62901247",
"0.6005288",
"0.5960263",
"0.5896589",
"0.5896589",
"0.58457106",
"0.5841033",
"0.58291054",
"0.58283544",
"0.57365406",
"0.57076925",
"0.5702443",
"0.5688181",
"0.5682766",
"0.56676066",
"0.5662619",
"0.5649012",
"0.5643087",
"0.5628376",
"0.56155473",
"0.56155473",
"0.5596988",
"0.55876774",
"0.5574818",
"0.55660516",
"0.5562983",
"0.55626005",
"0.55584574",
"0.55313516",
"0.55273354",
"0.5525525",
"0.5516571",
"0.5490844",
"0.54792565",
"0.5477461",
"0.54720443",
"0.5470421",
"0.54679614",
"0.54670775",
"0.54603654",
"0.5456591",
"0.5456238",
"0.54514825",
"0.5451083",
"0.54468244",
"0.5443237",
"0.5440239",
"0.54397994",
"0.5437052",
"0.5424981",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.54160213",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445",
"0.5415445"
]
| 0.0 | -1 |
upload one file enctype="multipart/formdata" | function uploadOne($file) {
if (! isset ( $baseDir ) || ! File::isAbsolutePath ( $baseDir )) {
user_error ( 'base dir must be absolute', E_USER_ERROR );
}
$type = 'file';
if ($file ['error'] == UPLOAD_ERR_OK) {
$ext = pathinfo ( $file ['name'], PATHINFO_EXTENSION );
$funcMkdir = function ($dir) {
if (! is_dir ( $dir )) {
mkdir ( $dir, 0755, true );
}
};
$funcFile = function ($md5, $isNew) use($ext, $funcMkdir) {
$subDir = substr ( $md5, 0, 3 ) . '/' . substr ( $md5, 3, 3 );
$funcMkdir ( $this->baseDir . '/' . $subDir );
$md5 = substr ( $md5, 6 );
for($i = 0; $i < 100; $i ++) {
$suffix = '';
if ($i > 0) {
$suffix = '_' . $i;
}
$fileName = $subDir . '/' . $md5 . $suffix . '.' . $ext;
$file = $this->baseDir . '/' . $fileName;
if ($isNew || ! is_file ( $file )) {
return array (
$fileName,
$file
);
}
}
user_error ( 'upload error, can not generate filename', E_USER_WARNING );
};
$md5raw = md5_file ( $file ['tmp_name'], true );
$md5 = bin2hex ( $md5raw );
$st = $this->pdo->prepare ( 'select * from ' . $this->tableName . ' where type=\'' . $type . '\' md5=?' );
$st->execute ( array (
$md5raw
) );
$rows = $st->fetchAll ( PDO::FETCH_OBJ );
// records found in database
if (count ( $rows ) > 0) {
foreach ( $rows as $v ) {
$fileUploaded = $this->baseDir . '/' . $v->path;
if (is_file ( $fileUploaded )) {
// already uploaded
if (file_get_contents ( $fileUploaded ) === file_get_contents ( $file ['tmp_name'] )) {
return $v->id;
}
} else {
// repare uploaded file
$funcMkdir ( dirname ( $fileUploaded ) );
if (move_uploaded_file ( $file ['tmp_name'], $fileUploaded )) {
return $v->id;
} else {
user_error ( 'upload error, move file error', E_USER_WARNING );
return false;
}
}
}
}
$localFile = $funcFile ( $md5, 0 === count ( $rows ) );
if (! is_array ( $localFile )) {
return false;
}
if (move_uploaded_file ( $file ['tmp_name'], $localFile [1] )) {
$row = array ();
$row [] = $md5raw;
$row [] = $localFile [0];
$row [] = $file ['size'];
if ($this->pdo->prepare ( 'insert into ' . $this->tableName . '(type,md5,path,size) values(\'' . $type . '\',?,?,?)' )->execute ( $row )) {
return $this->pdo->lastInsertId ();
} else {
user_error ( 'insert failed', E_USER_WARNING );
return false;
}
} else {
user_error ( 'upload error, move file error', E_USER_WARNING );
return false;
}
} else {
user_error ( 'upload error, error=' . $file ['error'], E_USER_WARNING );
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function uploadFile(){\n\n if (!$this->request->is('post'))\n {\n $this->setErrorMessage('Post method required');\n return;\n }\n\n if (!isset($this->request->data['currentPath']) ||\n !isset($this->request->params['form']) ||\n !isset($this->request->params['form']['idia'])\n ){\n $this->setErrorMessage('Invalid parameters');\n return;\n }\n\n $path = ltrim(trim($this->request->data['currentPath']), DS);\n $tokens = explode(DS, strtolower($path));\n\n ($tokens[0] == 'root') && ($tokens = array_slice($tokens, 1, null, true));\n\n $path = implode(DS, $tokens);\n $fullPath = WWW_FILE_ROOT . strtolower($path);\n\n if(!is_dir($fullPath)){\n $this->setErrorMessage('Invalid path');\n return;\n }\n\n if(is_file($fullPath . DS . strtolower($this->request->params['form']['idia']['name']))){\n $this->setErrorMessage('File with similar name already exist');\n return;\n }\n\n $newFile = new File($fullPath . DS . strtolower($this->request->params['form']['idia']['name']), true );\n $newFile->close();\n\n $tempFile = new File(($this->request->params['form']['idia']['tmp_name']));\n $tempFile->copy($fullPath . DS .$this->request->params['form']['idia']['name']);\n $tempFile->delete();\n\n $this->set(array(\n 'status' => 'ok',\n \"message\" => 'successful',\n \"_serialize\" => array(\"message\", \"status\")\n ));\n }",
"protected function fileUpload($upload) {\n $this->_enctype = $upload;\n }",
"public function upload();",
"public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}",
"function set_submit_multipart()\n\t{\n\t\t$this->_submit_type = \"multipart/form-data\";\n\t}",
"function form_multipart_encoding() {\n\techo ' enctype=\"multipart/form-data\"';\n}",
"public function ieditor_upload () {\n\t\t\tif (!empty($_FILES)) {\n\t\t\t\t$oUploadedFile = umiImageFile::upload('eip-ieditor-upload-fileinput', 0, CURRENT_WORKING_DIR . '/images/cms/data');\n\t\t\t\t// Переопределение стандартного вывода, чтобы выводилась просто строка с путем к файлу в plain text, без json.\n\t\t\t\t// Это нужно для обхода особенностей работы IE, который при выводе в hidden iframe валидного JSON предлагает его сохранить как файл.\n\t\t\t\t$buffer = new HTTPOutputBuffer();\n\t\t\t\t$buffer->push($oUploadedFile->getFilePath(true));\n\t\t\t\t$buffer->send();\n\t\t\t\texit();\n\t\t\t}\n\t\t}",
"function media_upload_file()\n {\n }",
"public function set_file($file){\n //error checking\n if(empty($file) || !$file || !is_array($file)){\n $this->errors[] =\"There was no file uploaded here\";\n return false; \n // Check if the file is uploaded \n }elseif($file['error'] !==0){\n \n $this->error[] = $this->upload_errors_array[$file['error']];\n return false;\n \n }else {\n //Submit data \n $this->user_image = basename($file['name']); //basename is function\n $this->tmp_path = $file['tmp_name'];\n $this->type = $file ['type'];\n $this->size = $file ['size'];\n }\n }",
"public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_tol_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_tol',\n\t\t]);\n\t}",
"public function set_form_multipart($post) {\n\n\t\t\tif (isset($post->ID) && $this->screen == get_post_type($post->ID)) {\n\n\t\t\t\tprintf(' enctype=\"multipart/form-data\" encoding=\"multipart/form-data\" ');\n\t\t\t}\n\t\t}",
"function upload_file() {\n upload_file_to_temp();\n }",
"abstract protected function doUpload();",
"public function upload()\n\t{\n\t}",
"public function handle_upload()\n {\n }",
"function doUpload(){\n if(count($_FILES) > 0){\n if(array_key_exists($this->name,$_FILES) AND $_FILES[$this->name]['name'] != \"\"){\n\n $this->CI->upload->initialize($this->config);\n\n if (!$this->CI->upload->do_upload($this->name)){\n show_error($this->CI->upload->display_errors());\n } \n else{\n $data = $this->CI->upload->data();\n $this->CI->codexmessages->add('info',$this->CI->lang->line('codexforms_file').' '.$_FILES[$this->name]['name'].' '.$this->CI->lang->line('codexforms_uploaded_correctly'),'',true);\n return $data['file_name'];\n }\n }\n }\n }",
"function media_upload_form_handler()\n {\n }",
"public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }",
"public function addPostFile($name, $file, $content_type = null) {}",
"public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_bendungan_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_bendungan',\n\t\t]);\n\t}",
"private function _do_upload_file($i) {\n\t\tif (g($_FILES, 'name_'.$i.'.tmp_name')) {\n\t\t\tif (g($this->conf, 'disable.add')) die('Forbidden');\n\t\t\t\n\t\t\tif (in_array(g($_FILES, 'name_'.$i.'.type'), [\n\t\t\t\t'application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed', 'application/octet-stream', 'application/octet'\n\t\t\t\t])) {\n\t\t\t\treturn $this->_do_upload_zip($i);\n\t\t\t}\n\t\t\t\n\t\t\t$file = g($_FILES, 'name_'.$i);\n\t\t\t\n\t\t\t$fname = strtolower(preg_replace(\"/[^a-zA-Z0-9\\/_|+ .-]/\", \"\", g($file, 'name')));\n\t\t\t$fname = strtolower(str_replace(' ', '-', $fname));\n\t\t\t\n\t\t\t$ext = pathinfo($fname, PATHINFO_EXTENSION);\n\t\t\t\n\t\t\tif (!in_array($ext, (array) g($this->conf, 'ext'))) {\n\t\t\t\t$this->_msg('Failed upload file : Extension not supported : File ['.$fname.']', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$fpath = $this->_path(g($this->conf, 'path') . '/' . $fname);\n\t\t\t\n\t\t\tif (file_exists($fpath) && !g($_POST, 'overide')) {\n\t\t\t\t$this->_msg('Failed upload file : File ['.$fname.'] already exists', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif (!move_uploaded_file(g($file, 'tmp_name'), $fpath)) {\n\t\t\t\t$this->_msg('Failed upload file : please call your administrator', 'error');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$this->_msg('Success upload file ['.$fname.']');\n\t\t\treturn true;\n\t\t}\n\t}",
"public function upload($file, $local_file);",
"public function step_2_manage_upload()\n {\n }",
"function kiwip_post_edit_form_tag(){\n\t\techo ' enctype=\"multipart/form-data\"';\n\t}",
"function ft_hook_upload($dir, $file) {}",
"public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}",
"public static function upload($type, $name = '') {\r\n\t\t\t$hasFile = false;\r\n\t\t\tif(empty($name)) {\r\n\t\t\t\t$name = 'File uploaded ' . date('d/m/Y');\r\n\t\t\t}\r\n\r\n\t\t\tif(isset($_FILES[$type]) && $_FILES[$type]['name'] != '') {\r\n\r\n\t\t\t\tswitch($_FILES[$type]['error']) {\r\n\t\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\r\n\t\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\r\n\t\t\t\t\t\t$error = 'The file was too large. Maximum file size is ' . self::getUploadLimit();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase UPLOAD_ERR_PARTIAL:\r\n\t\t\t\t\tcase UPLOAD_ERR_CANT_WRITE:\r\n\t\t\t\t\tcase UPLOAD_ERR_EXTENSION:\r\n\t\t\t\t\t\tLogger::log('Ndoorse/Document/Upload: Problem uploading file: ' . $_FILES[$type]['error'], 'error');\r\n\t\t\t\t\t\t$error = 'There was a problem uploading the file. Please try again.';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase UPLOAD_ERR_OK:\r\n\t\t\t\t\t\t$hasFile = true;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif($hasFile) {\r\n\r\n\t\t\t\t$oldFile = $_FILES[$type]['name'];\r\n\t\t\t\t$oldFileParts = explode('.', $oldFile);\r\n\t\t\t\t$ext = end($oldFileParts);\r\n\r\n\t\t\t\tswitch($type) {\r\n\t\t\t\t\tcase 'cv':\r\n\t\t\t\t\t\t$validExts = explode(',', self::VALID_CV_EXTENSIONS);\r\n\t\t\t\t\t\tbreak;\r\n case 'logo':\r\n case 'avatar':\r\n $validExts = explode(',', self::VALID_IMAGE_EXTENSIONS);\r\n break;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$validExts = array();\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tif(!empty($validExts) && !in_array($ext, $validExts)) {\r\n\t\t\t\t\t$error = 'The file you uploaded is not in a valid format.';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$ext = '.' . $ext;\r\n\t\t\t\t$base = 'resources/' . $type . '/';\r\n\r\n\t\t\t\tif(!isset($error) && !file_exists(ROOT_PATH . $base)) {\r\n\t\t\t\t\tmkdir(ROOT_PATH . $base, 0664);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$filename = $base . $_SESSION['user']->getID() . '_' . date('YmdHis') . $ext;\r\n\t\t\t\tif(!isset($error) && move_uploaded_file($_FILES[$type]['tmp_name'], ROOT_PATH . $filename)) {\r\n\t\t\t\t\tchmod(ROOT_PATH . $filename, 0664);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// resize image if necessary\r\n\t\t\t\tif($type == 'avatar') {\r\n\t\t\t\t\tImage::resize(ROOT_PATH . $filename, ROOT_PATH . $filename, 244, 244, false);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$document = new Ndoorse_Document();\r\n\r\n\t\t\t\t$document->userID = $_SESSION['user']->getID();\r\n\t\t\t\t$document->filePath = $filename;\r\n\t\t\t\t$document->name = $name;\r\n\t\t\t\t$document->type = $type;\r\n\t\t\t\t$document->status = self::STATUS_ACTIVE;\r\n\r\n\t\t\t\tif(!isset($error) && $document->saveModel()) {\r\n\t\t\t\t\treturn array(true, $document->getID());\r\n\t\t\t\t}\r\n\t\t\t\t$error = 'Could not upload this file.';\r\n\t\t\t}\r\n\r\n\t\t\tif(!isset($error)) {\r\n\t\t\t\t$error = '';\r\n\t\t\t}\r\n\t\t\treturn array(false, $error);\r\n\t\t}",
"public function set_file($file){\n\t\tif(empty($file) || !$file || !is_array($file)){\n\t\t$this->errors[] = \"There Was No File Uploaded\";\n\t\treturn false;\t\n\t\t}elseif($file['error']!=0){\n\t\t\t$this->errors[]\t= $this->upload_errors_array[$file['error']];\n\t\t}else{\n\t\t\t$this->user_image = basename($file['name']);\n\t\t\t$this->tmp_path = $file['tmp_name'];\n\t\t\t$this->type = $file['type'];\n\t\t\t$this->size = $file['size'];\n\t\t}\n\t}",
"public static function uploadFile($name)\n\t{\n\t LuLu::info($name,__METHOD__.',the form name is '.$name);\n\t\t$uploadedFile = UploadedFile::getInstanceByName($name);\n\t\t\n\t\tif($uploadedFile === null)\n\t\t{\n\t\t\treturn ['message'=>'没有文件'];\n\t\t}\n\t\n\t\tif($uploadedFile->hasError)\n\t\t{\n \t\tswitch($uploadedFile->error){\n \t\tcase '1':\n \t\t\t$error = '超过php.ini允许的大小。';\n \t\t\tbreak;\n \t\tcase '2':\n \t\t\t$error = '超过表单允许的大小。';\n \t\t\tbreak;\n \t\tcase '3':\n \t\t\t$error = '图片只有部分被上传。';\n \t\t\tbreak;\n \t\tcase '4':\n \t\t\t$error = '请选择图片。';\n \t\t\tbreak;\n \t\tcase '6':\n \t\t\t$error = '找不到临时目录。';\n \t\t\tbreak;\n \t\tcase '7':\n \t\t\t$error = '写文件到硬盘出错。';\n \t\t\tbreak;\n \t\tcase '8':\n \t\t\t$error = 'File upload stopped by extension。';\n \t\t\tbreak;\n \t\tcase '999':\n \t\tdefault:\n \t\t\t$error = '未知错误。';\n \t}\n\t\t \n\t\t LuLu::error($error,'上传文件出错');\n\t\t return ['message'=>$error];\n\t\t}\n\t\t\n\t\t$ymd = date(\"Ymd\");\n\t\n\t\t$save_path = \\Yii::getAlias('@attachmentPath') . '/' . $ymd . \"/\";\n\t\t$save_url = 'data/attachment/' . $ymd . \"/\";\n\t\n\t\tif(! file_exists($save_path))\n\t\t{\n\t\t\tmkdir($save_path);\n\t\t}\n\t\n\t\t$file_name = $uploadedFile->getBaseName();\n\t\t$file_ext = $uploadedFile->getExtension();\n\t\n\t\t// 新文件名\n\t\t$new_file_name = date(\"YmdHis\") . '_' . rand(10000, 99999) . '.' . $file_ext;\n\t\n\t\t$uploadedFile->saveAs($save_path . $new_file_name);\n\t\n\t\treturn ['path' => $save_path, 'url' => $save_url, 'name' => $file_name, 'new_name' => $new_file_name, 'ext' => $file_ext,\n 'full_name'=>$save_url.$new_file_name,\n\t\t 'temp_name'=>$uploadedFile->tempName,'type'=>$uploadedFile->type,'size'=>$uploadedFile->size,'message'=>'ok'];\n\t}",
"public function upload($input);",
"private function _upload_file($dir, $field_name)\n\t{\n\t\t// --------------------------------------------------------------------\n\t\t// Make sure the file is allowed\n\n\t\t// Is this a custom field?\n\t\tif (strpos($field_name, 'field_id_') === 0)\n\t\t{\n\t\t\t$field_id = str_replace('field_id_', '', $field_name);\n\n\t\t\tee()->db->select('field_type, field_settings');\n\t\t\t$type_query = ee()->db->get_where('channel_fields', array('field_id' => $field_id));\n\n\t\t\tif ($type_query->num_rows())\n\t\t\t{\n\t\t\t\t$settings = unserialize(base64_decode($type_query->row('field_settings')));\n\n\t\t\t\t// Permissions can only get more strict!\n\t\t\t\tif (isset($settings['field_content_type']) && $settings['field_content_type'] == 'image')\n\t\t\t\t{\n\t\t\t\t\t$allowed_types = 'gif|jpg|jpeg|png|jpe';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$type_query->free_result();\n\t\t}\n\n\t\t// --------------------------------------------------------------------\n\t\t// Upload the file\n\n\t\t$field = ($field_name) ? $field_name : 'userfile';\n\t\t$original_filename = $_FILES[$field]['name'];\n\t\t$clean_filename = basename($this->clean_filename(\n\t\t\t$_FILES[$field]['name'],\n\t\t\t$dir['id'],\n\t\t\tarray('ignore_dupes' => TRUE)\n\t\t));\n\n\t\t$config = array(\n\t\t\t'file_name'\t\t=> $clean_filename,\n\t\t\t'upload_path'\t=> $dir['server_path'],\n\t\t\t'max_size'\t\t=> round((int)$dir['max_size'], 3)\n\t\t);\n\n\t\t// Restricted upload directory?\n\t\tif ($dir['allowed_types'] == 'img')\n\t\t{\n\t\t\t$config['is_image'] = TRUE;\n\t\t}\n\n\t\tee()->load->helper('xss');\n\n\t\t// Check to see if the file needs to be XSS Cleaned\n\t\tif (xss_check())\n\t\t{\n\t\t\t$config['xss_clean'] = TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$config['xss_clean'] = FALSE;\n\t\t\t$this->xss_clean_off();\n\t\t}\n\n\t\t/* -------------------------------------------\n\t\t/*\tHidden Configuration Variable\n\t\t/*\t- channel_form_overwrite => Allow authors to overwrite their own files via Channel Form\n\t\t/* -------------------------------------------*/\n\n\t\tif (bool_config_item('channel_form_overwrite'))\n\t\t{\n\t\t\t$original = ee('Model')->get('File')\n\t\t\t\t->filter('file_name', $clean_filename)\n\t\t\t\t->filter('upload_location_id', $dir['id'])\n\t\t\t\t->first();\n\n\t\t\tif ($original && $original->uploaded_by_member_id == ee()->session->userdata('member_id'))\n\t\t\t{\n\t\t\t\t$config['overwrite'] = TRUE;\n\t\t\t}\n\t\t}\n\n\t\t// Upload the file\n\t\tee()->load->library('upload');\n\t\tee()->upload->initialize($config);\n\n\t\tif ( ! ee()->upload->do_upload($field_name))\n\t\t{\n\t\t\treturn $this->_upload_error(\n\t\t\t\tee()->upload->display_errors()\n\t\t\t);\n\t\t}\n\n\t\t$file = ee()->upload->data();\n\n\t\t// (try to) Set proper permissions\n\t\t@chmod($file['full_path'], FILE_WRITE_MODE);\n\n\n\t\t// --------------------------------------------------------------------\n\t\t// Add file the database\n\n\t\t// Make sure the file has a valid MIME Type\n\t\tif ( ! $file['file_type'])\n\t\t{\n\t\t\treturn $this->_upload_error(\n\t\t\t\tlang('invalid_mime'),\n\t\t\t\tarray(\n\t\t\t\t\t'file_name'\t\t=> $file['file_name'],\n\t\t\t\t\t'directory_id'\t=> $dir['id']\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$thumb_info = $this->get_thumb($file['file_name'], $dir['id']);\n\n\t\t// Build list of information to save and return\n\t\t$file_data = array(\n\t\t\t'upload_location_id'\t=> $dir['id'],\n\t\t\t'site_id'\t\t\t\t=> ee()->config->item('site_id'),\n\n\t\t\t'file_name'\t\t\t\t=> $file['file_name'],\n\t\t\t'orig_name'\t\t\t\t=> $original_filename, // name before any upload library processing\n\t\t\t'file_data_orig_name'\t=> $file['orig_name'], // name after upload lib but before duplicate checks\n\n\t\t\t'is_image'\t\t\t\t=> $file['is_image'],\n\t\t\t'mime_type'\t\t\t\t=> $file['file_type'],\n\n\t\t\t'file_thumb'\t\t\t=> $thumb_info['thumb'],\n\t\t\t'thumb_class' \t\t\t=> $thumb_info['thumb_class'],\n\n\t\t\t'modified_by_member_id' => ee()->session->userdata('member_id'),\n\t\t\t'uploaded_by_member_id'\t=> ee()->session->userdata('member_id'),\n\n\t\t\t'file_size'\t\t\t\t=> $file['file_size'] * 1024, // Bring it back to Bytes from KB\n\t\t\t'file_height'\t\t\t=> $file['image_height'],\n\t\t\t'file_width'\t\t\t=> $file['image_width'],\n\t\t\t'file_hw_original'\t\t=> $file['image_height'].' '.$file['image_width'],\n\t\t\t'max_width'\t\t\t\t=> $dir['max_width'],\n\t\t\t'max_height'\t\t\t=> $dir['max_height']\n\t\t);\n\n\t\t/* -------------------------------------------\n\t\t/*\tHidden Configuration Variable\n\t\t/*\t- channel_form_overwrite => Allow authors to overwrite their own files via Channel Form\n\t\t/* -------------------------------------------*/\n\n\t\tif (isset($config['overwrite']) && $config['overwrite'] === TRUE)\n\t\t{\n\t\t\t$file_data['file_id'] = $original->file_id;\n\t\t}\n\n\t\t// Check to see if its an editable image, if it is, check max h/w\n\t\tif ($this->is_editable_image($file['full_path'], $file['file_type']))\n\t\t{\n\t\t\t// Check and fix orientation\n\t\t\t$orientation = $this->orientation_check($file['full_path'], $file_data);\n\n\t\t\tif ( ! empty($orientation))\n\t\t\t{\n\t\t\t\t$file_data = $orientation;\n\t\t\t}\n\n\t\t\t$file_data = $this->max_hw_check($file['full_path'], $file_data);\n\n\t\t\tif ( ! $file_data)\n\t\t\t{\n\t\t\t\treturn $this->_upload_error(\n\t\t\t\t\tlang('exceeds_max_dimensions'),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'file_name'\t\t=> $file['file_name'],\n\t\t\t\t\t\t'directory_id'\t=> $dir['id']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Save file to database\n\t\t$saved = $this->save_file($file['full_path'], $dir['id'], $file_data);\n\n\t\t// Return errors from the filemanager\n\t\tif ( ! $saved['status'])\n\t\t{\n\t\t\treturn $this->_upload_error(\n\t\t\t\t$saved['message'],\n\t\t\t\tarray(\n\t\t\t\t\t'file_name'\t\t=> $file['file_name'],\n\t\t\t\t\t'directory_id'\t=> $dir['id']\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Merge in information from database\n\t\t$file_data = array_merge($file_data, $this->_file_info($saved['file_id']));\n\n\t\t// Stash upload directory prefs in case\n\t\t$file_data['upload_directory_prefs'] = $dir;\n\t\t$file_data['directory'] = $dir['id'];\n\n\t\t// Change file size to human readable\n\t\tee()->load->helper('number');\n\t\t$file_data['file_size'] = byte_format($file_data['file_size']);\n\n\t\treturn $file_data;\n\t}",
"public function upload()\n {\n }",
"public function upload_file(){\n //return from method if file name is sample\n if($this->file_name == 'sample.jpg'){\n return;\n }\n\n $allowed_types = ['image/jpeg', 'image/gif', 'image/png'];\n //check file is an image\n if(!in_array($this->file_type, $allowed_types)){\n throw new Exception('File must be an image');\n exit;\n }\n\n //move from temp dir in to uploads folder\n move_uploaded_file($this->tmp_file_name, $this->dir_location . $this->file_name );\n }",
"public function upload_file()\n {\n if (!isset($_POST['ticket']) || empty($_POST['ticket'])) {\n $response['status'] = false;\n $response['error'] = __('Ticket not set.', 'kong-helpdesk');\n die(json_encode($response));\n }\n\n $id = intval($_POST['ticket']);\n\n $author = get_userdata(get_current_user_id());\n\n $commentdata = array(\n 'comment_post_ID' => $id,\n 'comment_author' => $author->display_name,\n 'comment_author_email' => $author->user_email,\n 'comment_author_url' => '',\n 'comment_content' => sanitize_text_field($_FILES['helpdesk-attachments']['name'][0]),\n 'comment_type' => '',\n 'comment_parent' => 0,\n 'user_id' => $author->ID,\n );\n\n //Insert new comment and get the comment ID\n $comment_id = wp_new_comment($commentdata, true);\n\n if (!is_int($comment_id)) {\n die('Error while inserting comment');\n }\n\n $response = array(\n 'status' => 'true',\n 'message' => ''\n );\n\n $status = $this->attachments->save_comment_attachments(null, get_comment($comment_id) );\n\n if (!$status) {\n $response['status'] = 'false';\n $response['error'] = __('Error while uploading your attachment.', 'kong-helpdesk');\n }\n\n die(json_encode($response));\n }",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"function form_file_upload_handle($file_data, $field_config, $table_name = null) {\n $file_max_size = $field_config['file-max-size'] + 0;\n $file_type = $field_config['file-type'];\n if (strstr($file_data['type'], $file_type) === FALSE) {\n return \"The file type is {$file_data['type']} not {$file_type}\";\n }\n if ($file_data['size'] > $file_max_size) {\n return \"Size is bigger than \" . $file_max_size / 1024 . \"k\";\n }\n /**\n * ALL ok? then place the file and let it go... let it goooo! (my daughter Allison fault! <3 )\n */\n if (file_uploads::place_upload_file($file_data['tmp_name'], $file_data['name'], $table_name)) {\n return TRUE;\n } else {\n return file_uploads::get_last_error();\n }\n// $file_location = file_uploads::get_uploaded_file_path($file_data['name']);\n// $file_location_url = file_uploads::get_uploaded_file_url($file_data['name']);\n}",
"function acf_upload_file($uploaded_file)\n{\n}",
"public function attach_file($file) {\r\n // Perform error checking on the form parameters\r\n if(!$file || empty($file) || !is_array($file)) {\r\n // error: nothing uploaded or wrong argument usage\r\n $this->errors[] = \"No file was uploaded.\";\r\n return FALSE;\r\n } elseif ($file['error'] != 0 ) {\r\n // error: report what PHP says went wrong\r\n $this->errors[] = $this->upload_errors[$file['error']];\r\n return FALSE;\r\n } else {\r\n // Set object attributes to the form parameters.\r\n $this->temp_path = $file['tmp_name'];\r\n $this->passport_path = basename($file['name']);\r\n\r\n return TRUE;\r\n }\r\n }",
"public function isUploadedFile() {}",
"public function attach_file($file){\n\t\t\t//perform error checking on form parameters.\n\t\t\tif(!$file || empty($file) || !is_array($file)){\n\t\t\t\t$this->error[]=\"No File Was Uploaded!\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telseif($file[\"error\"]!=0){\n\t\t\t\t$this->error[]=$this->upload_errors[$file[\"error\"]];\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//setting object attributes to form params.\n\t\t\t\t$this->temp_path=$file[\"tmp_name\"];\n\t\t\t\t$this->filename=basename($file[\"name\"]);\n\t\t\t\t$this->type=$file[\"type\"];\n\t\t\t\t$this->size=$file[\"size\"];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"public function uploadFile(UploadFileRequest $request): UploadFileResponse\n {\n }",
"public static function uploadFile(string $name) {\n\n\tif (empty($_FILES[self::InputKey])) {\n\t\t//die(\"File Missing!\");\n trigger_error(\"File Missing!\");\n\t}\n\tif ($_FILES[self::InputKey]['error'] > 0) {\n\t\ttrigger_error(\"Handle the error! \" . $_FILES[InputKey]['error']);\n\t}\n\tif (!in_array($_FILES[self::InputKey]['type'], self::AllowedTypes)) {\n\t\ttrigger_error(\"Handle File Type Not Allowed: \" . $_FILES[self::InputKey]['type']);\n\t}\n\n\t$tempFile = $_FILES[self::InputKey]['tmp_name'];\n //$path = \"C:/xampp/htdocs/blogFinalProject/views/images/\";\n $path = dirname(__DIR__) . \"/views/images/\";\n\t$destinationFile = $path . $_FILES[self::InputKey]['name'];\n \n\tif (!move_uploaded_file($tempFile, $destinationFile)) {\n\t\ttrigger_error(\"Handle Error\");\n\t}\n\t\t\n\t//Clean up the temp file\n\tif (file_exists($tempFile)) {\n\t\tunlink($tempFile); \n\t}\n}",
"function uploadImage($fieldName){\r\n \r\n // Undefined | Multiple Files | $_FILES Corruption Attack\r\n // If this request falls under any of them, treat it invalid.\r\n if ( !isset($_FILES[$fieldName]['error']) || is_array($_FILES[$fieldName]['error']) ) { \r\n throw new RuntimeException('Invalid parameters.');\r\n }\r\n\r\n // Check $_FILES['upfile']['error'] value.\r\n switch ($_FILES[$fieldName]['error']) {\r\n case UPLOAD_ERR_OK:\r\n break;\r\n case UPLOAD_ERR_NO_FILE:\r\n throw new RuntimeException('No file sent.');\r\n case UPLOAD_ERR_INI_SIZE:\r\n case UPLOAD_ERR_FORM_SIZE:\r\n throw new RuntimeException('Exceeded filesize limit.');\r\n default:\r\n throw new RuntimeException('Unknown errors.');\r\n }\r\n \r\n // You should also check filesize here. \r\n if ($_FILES[$fieldName]['size'] > 1000000) {\r\n throw new RuntimeException('Exceeded filesize limit.');\r\n }\r\n\r\n // DO NOT TRUST $_FILES['upfile']['mime'] VALUE !!\r\n // Check MIME Type by yourself.\r\n $finfo = new finfo(FILEINFO_MIME_TYPE);\r\n $validExts = array(\r\n 'jpg' => 'image/jpeg',\r\n 'png' => 'image/png',\r\n 'gif' => 'image/gif'\r\n ); \r\n $ext = array_search( $finfo->file($_FILES[$fieldName]['tmp_name']), $validExts, true );\r\n \r\n \r\n if ( false === $ext ) {\r\n throw new RuntimeException('Invalid file format.');\r\n }\r\n \r\n /* Alternative to getting file extention \r\n $name = $_FILES[\"upfile\"][\"name\"];\r\n $ext = strtolower(end((explode(\".\", $name))));\r\n if (preg_match(\"/^(jpeg|jpg|png|gif)$/\", $ext) == false) {\r\n throw new RuntimeException('Invalid file format.');\r\n }\r\n Alternative END */\r\n\r\n // You should name it uniquely.\r\n // DO NOT USE $_FILES['upfile']['name'] WITHOUT ANY VALIDATION !!\r\n // On this example, obtain safe unique name from its binary data.\r\n \r\n $fileName = sha1_file($_FILES[$fieldName]['tmp_name']); \r\n $location = sprintf('./uploads/%s.%s', $fileName, $ext); \r\n \r\n if (!is_dir('./uploads')) {\r\n mkdir('./uploads');\r\n }\r\n \r\n if ( !move_uploaded_file( $_FILES[$fieldName]['tmp_name'], $location) ) {\r\n throw new RuntimeException('Failed to move uploaded file.');\r\n }\r\n\r\n /* return the file name uploaded */\r\n return $fileName.'.'.$ext;\r\n}",
"public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public function update_form_enctype() {\n\n\t\tif ( 'event' === get_post_type() ) {\n\t\t\techo ' enctype=\"multipart/form-data\"';\n\t\t}\n\n\t}",
"public function getWholeFile()\n {\n \treturn isset($_FILES) ? $_FILES : null;\n }",
"function post_file()\r\n\t{\r\n\r\n\t}",
"function do_upload()\r\n\t{\r\n\t\tif (isset($_FILES[$this->post_name]))\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$tmp_file\t= ( !$this->isArrayPostName ) ? $post['tmp_name'] : $post['tmp_name'][$this->arrayPostName];\r\n\r\n\t\t\tif ( is_uploaded_file( $tmp_file ) )\r\n\t\t\t{\r\n\t\t\t\tif ($this->filteringExtension($post))\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($this->checkFileSize())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$file_name = $this->getFileNameUploaded();\r\n\t\t\t\t\t\t$dest = $this->folder.$file_name;\r\n\t\t\t\t\t\t$upload = move_uploaded_file($tmp_file, $dest);\r\n\t\t\t\t\t\tif ($upload)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t@chmod($dest, $this->chmod);\r\n\t\t\t\t\t\t\t$this->file_name_sukses_uploaded = $file_name;\r\n\t\t\t\t\t\t\t$cfg_resize = array('source_image'=> $dest);\r\n\t\t\t\t\t\t\tif($this->is_resize)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$cfg_resize = array(\r\n\t\t\t\t\t\t\t\t\t'source_image'=> $dest,\r\n\t\t\t\t\t\t\t\t\t'width'\t\t\t\t=> $this->rez_width,\r\n\t\t\t\t\t\t\t\t\t'height'\t\t\t=> $this->rez_height\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t// pr(json_encode($cfg_resize, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $cfg_resize)->resize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_watermark)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this->watermark_param['source_image'] = $dest;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($this->watermark_param, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $this->watermark_param)->watermark();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif($this->is_thumbnail)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(substr($this->thumb_prefix, -1) == '/' && !is_dir($this->folder.$this->thumb_prefix))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t@mkdir($this->folder.$this->thumb_prefix, 0777);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$config = array_merge($cfg_resize, $this->thumb_param);\r\n\t\t\t\t\t\t\t\t$config['create_thumb'] = FALSE ;\r\n\t\t\t\t\t\t\t\t$config['new_image'] = $this->folder.$this->thumb_prefix.$file_name;\r\n\t\t\t\t\t\t\t\t// pr(json_encode($config, JSON_PRETTY_PRINT), __FILE__.':'.__LINE__);\r\n\t\t\t\t\t\t\t\t_class('image_lib', $config)->resize();\r\n\t\t\t\t\t\t\t\t_class('images')->move_upload($this->folder.$this->thumb_prefix.$file_name);\r\n\t\t\t\t\t\t\t\t@chmod($this->folder.$this->thumb_prefix.$file_name, $this->chmod);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t_class('images')->move_upload($dest);\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse $this->error_code .= 'move_upload_file_failed';\r\n\t\t\t\t\t} else $this->error_code .= 'file_size_max_exceeded';\r\n\t\t\t\t} else $this->error_code .= 'file_type_unallowed';\r\n\t\t\t}// end if is_uploaded_file\r\n#\t\t\telse $this->error_code .= 'file_upload_from_post_failed';\r\n\t\t}// end if isset\r\n\t\telse {\r\n#\t\t\t$this->error_code .= 'file_post_un_uploaded';\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function upload() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n\n if (!empty($this->request->data['Upload'])) {\n // form is niet leeg\n\n $upload = $this->stripdefaults($this->request->data['Upload'], $defaults); // strip default values\n\n $thereisfile = false;\n\n if (isset($upload['selimg']['size'])) {\n if ($upload['selimg']['size'] != 0) {\n // upload file\n if ($upload['selimg']['error'] == 0) {\n $thereisfile = true;\n }\n }\n }\n\n if ($thereisfile) {\n // sometimes filenames contain a . , get the last item\n $fnamea = explode('.', $upload['selimg']['name']);\n $thepos = count($fnamea) - 1;\n $extension = strtolower($fnamea[$thepos]);\n $this->Media->set('extensie', $extension);\n\n // remove unwanted characters\n $filename = str_replace(\" \", \"_\", $upload[\"selimg\"][\"name\"]);\n $filename = str_replace(\",\", \"_\", $filename);\n $filename = str_replace(\"*\", \"_\", $filename);\n $filename = str_replace(\"%\", \"_\", $filename);\n $filename = str_replace(\"?\", \"_\", $filename);\n $filename = str_replace(\":\", \"_\", $filename);\n $filename = str_replace(\"|\", \"_\", $filename);\n\n\n // fix extension to remove extra .\n $filename = str_replace(\".\", \"_\", $filename);\n $filename = str_replace(\"_\" . $extension, \".\" . $extension, $filename);\n\n $this->Media->set(\"originalfilename\", $filename);\n }\n\n\n\n if ($this->Auth->loggedIn()) {\n // echo('logged in');\n $this->Media->set('user_id', $this->Auth->user('id'));\n } else {\n if ($upload['email'] != \"\") {\n $user_id = $this->User->giveid($upload['email'], $upload['naam']);\n } else {\n $user_id = 0;\n }\n\n $this->Media->set('user_id', $user_id);\n }\n\n\n\n // *** datering\n if (isset($upload['datum']))\n $this->Media->set('datering', $upload['datum']);\n if (isset($upload['opmerkingen'])) {\n $opmerkingen = htmlentities($upload['opmerkingen']);\n $opmerkingen = str_replace(\"'\", \"’\", $opmerkingen);\n $this->Media->set('opmerkingen', $opmerkingen);\n }\n if (isset($upload['exturl']))\n $this->Media->set('exturl', $upload['exturl']);\n if (isset($upload['extid']))\n $this->Media->set('extid', $upload['extid']);\n if (isset($upload['extthumb'])) {\n $this->Media->set('extthumb', $upload['extthumb']);\n // $extension \t\t= pathinfo($upload['extthumb'],PATHINFO_EXTENSION);\n //\t$this->Media->set('extensie', $extension);\n }\n // *** straat\n $this->Locationcode = $this->Components->load('Locationcode'); // load component\n $this->Locationcode->startup();\n\n if (isset($upload['latlng'])) {\n // pin put on map\n // store or get lat lon ; get the id\n $ll = explode(\",\", $upload['latlng']);\n $lat = $ll[0];\n $lng = $ll[1];\n $location_id = $this->Location->giveanid($lat, $lng);\n\n // $upload['straat']\n } else {\n // adres entry\n $huis = ($upload['huisnummer'] != \"\" ? \",\" . $upload['huisnummer'] : \"\");\n $searchfor = $upload['straat'] . $huis . ',amsterdam,netherlands';\n\n\n\n $location_id = $this->Locationcode->getlocation($searchfor);\n }\n\n\n\n $object_id = $this->Objectsatlocation->giveobjectid($location_id);\n\n if (!$object_id) {\n $this->Objects->set('naam', ' ');\n $this->Objects->set('type', ' ');\n\n $this->Objects->save();\n $object_id = $this->Objects->id;\n\n $this->Objectsatlocation->set('object_id', $object_id);\n $this->Objectsatlocation->set('location_id', $location_id);\n\n $this->Objectsatlocation->save();\n }\n\n // *** titel\n $titel = $upload['titel'];\n if ($titel && $titel != \"titel\")\n $this->Media->set('titel', $titel);\n\n\n $this->Media->set('storageloc_id', '1');\n $this->Media->set('soort_id', '1'); // 1-image,2-video\n $this->Media->set('huisnummer', $upload['huisnummer']);\n\n $this->Media->save();\n\n $media_id = $this->Media->id;\n\n\n $this->Mediaaboutobjects->set('object_id', $object_id);\n $this->Mediaaboutobjects->set('media_id', $media_id);\n $this->Mediaaboutobjects->save();\n\n\n if ($thereisfile) {\n\n // u =uploaded file\tSKIPPED\n // e= external fileSKIPPED\n // subdirs calc = dechex ( intval($filename/1000) ) .\"/\".dechex ( $filename % 1000);\n $filecalc = dechex(intval($this->Media->id / 1000)) . DS . dechex($this->Media->id % 1000) . '.' . $extension;\n\n $storename = '/sites/bvstemmen.nl/media' . DS . $filecalc;\n $success = rename($upload['selimg']['tmp_name'], $storename);\n\n\n // determine filetype\n\n $theurl = \"http://media.bvstemmen.nl/\" . $filecalc;\n\n $info = get_headers($theurl, 1);\n $mime = split(\"/\", $info['Content-Type']);\n\n $mimekind = $mime[0]; // type: video, audio, image, text, application\n $mimetypa = $mime[1]; // subtype, e.g.: jpg, gif, html, mp3 etc\n $mimetmps = split(\";\", $mimetypa); // e.g. text/html;charset: utf-8\n $mimetype = $mimetmps[0];\n\n\n if ($mimekind == 'video') {\n $cachedir = pathinfo('/sites/bvstemmen.nl/cache/video' . DS . $filecalc, PATHINFO_DIRNAME);\n $subdirs = split(\"/\", $cachedir);\n $existsdir = \"/sites/bvstemmen.nl/cache/\";\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n\n\n $toopen = \"http://83.163.41.197:8008/bvstemmen/convert/video.php?f=/\" . $filecalc; // convert video file on remote server\n file_get_contents($toopen);\n $this->Media->set('soort_id', '2'); // 1-image,2-video\n $this->Media->save();\n }\n\n\n if ($mimekind == 'audio') {\n $cachedir = pathinfo('/sites/bvstemmen.nl/cache/video' . DS . $filecalc, PATHINFO_DIRNAME);\n $subdirs = split(\"/\", $cachedir);\n $existsdir = \"/sites/bvstemmen.nl/cache/\";\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n $toopen = \"http://83.163.41.197:8008/bvstemmen/convert/audio.php?f=/\" . $filecalc; // convert video file on remote server\n file_get_contents($toopen);\n $this->Media->set('soort_id', '3'); // 1-image,2-video,3-audio\n $this->Media->save();\n }\n\n\n if ($mimekind == 'text') {\n // $toopen = \"http://83.163.41.197/bvstemmen/convert/video.php?f=/\" . $filecalc;\t// convert video file on remote server\n // file_get_contents($toopen);\n $this->Media->set('soort_id', '4'); // 1-image,2-video,3-audio,4-text\n $this->Media->save();\n }\n\n if ($mimekind == 'application') {\n // $toopen = \"http://83.163.41.197/bvstemmen/convert/video.php?f=/\" . $filecalc;\t// convert video file on remote server\n // file_get_contents($toopen);\n $this->Media->set('soort_id', '5'); // 1-image,2-video,3-audio,4-text,5-application\n $this->Media->save();\n }\n }\n\n\n if (isset($upload['extthumb'])) {\n //store local, no external img linking\n $extfile = file_get_contents($upload['extthumb']);\n $extension = pathinfo($upload['extthumb'], PATHINFO_EXTENSION);\n $filecalc = dechex(intval($this->Media->id / 1000)) . DS . dechex($this->Media->id % 1000) . '.' . $extension;\n\n\n $existsdir = '/sites/bvstemmen.nl/media' . \"/\";\n $subdirs = split(\"/\", pathinfo($filecalc, PATHINFO_DIRNAME));\n\n foreach ($subdirs as &$value) {\n $existsdir .= $value . \"/\";\n if (!is_dir($existsdir))\n mkdir($existsdir);\n }\n\n\n $storename = '/sites/bvstemmen.nl/media' . DS . $filecalc;\n $handle = fopen($storename, \"w\");\n fwrite($handle, $extfile);\n fclose($handle);\n }\n\n // *** tags\n\n if (PROJECTSHORTNAME != \"www\") {\n // save a tag for this project\n $tagid = $this->Tagnames->giveanid(PROJECTSHORTNAME);\n\n $this->Tags->create();\n $this->Tags->set('tagnames_id', $tagid);\n $this->Tags->set('rel', 'media');\n $this->Tags->set('media_id', $media_id);\n $this->Tags->save();\n }\n\n if ($upload['tags'] != \"\") {\n $tags = split(\",\", $upload['tags']);\n\n $numtags = count($tags);\n\n for ($i = 0; $i < $numtags; ++$i) {\n $thetag = trim($tags[$i]);\n $tagid = $this->Tagnames->giveanid($thetag);\n\n $this->Tags->create();\n $this->Tags->set('tagnames_id', $tagid);\n $this->Tags->set('rel', 'media');\n $this->Tags->set('media_id', $media_id);\n $this->Tags->save();\n }\n }\n\n\n // *** maker\n if ($upload['maker'] != \"\") {\n $maker_id = $this->User->nametoid($upload['maker']);\n $this->Nameswithmedium->create();\n $this->Nameswithmedium->set('user_id', $maker_id);\n $this->Nameswithmedium->set('relatiesoort', 'maker');\n $this->Nameswithmedium->set('media_id', $media_id);\n $this->Nameswithmedium->save();\n }\n\n // *** wie staan er op\n if ($upload['personen'] != \"\") {\n $personen_id = $this->User->nametoid($upload['personen']);\n $this->Nameswithmedium->create();\n $this->Nameswithmedium->set('user_id', $personen_id);\n $this->Nameswithmedium->set('relatiesoort', 'staat op');\n $this->Nameswithmedium->set('media_id', $media_id);\n $this->Nameswithmedium->save();\n }\n\n\n\n $onderwerp = 'Nieuwe upload ' . $upload['naam'];\n $bericht = \"http:\" . HOMEURL . \"/media/detail/\" . $media_id;\n $bericht .= \"\\n\\n\\nDit is een automatisch genegeerd e-mailbericht.\";\n $to = EMAILINFO;\n $from = EMAILINFO;\n $audience = 'internal';\n $level = \"info\";\n\n $this->notify($onderwerp, $bericht, $to, $from, $audience, $level);\n\n $this->render('uploaddank');\n } else {\n\n $this->Session->setFlash('Selecteer een bestand en probeer het opnieuw.');\n }\n }",
"public function uploadfiles(){\n\t\tif($this->request->isPost()){\n\t\t\t//die(\"kkk\");\n\t\t\tif($this->processfile()){\n\t\t\t\t\n\t\t\t\t\tif($this->Upload->save($this->data,array('validate'=>true))){\n\t\t\t\t} else {\n\t\t\t\t\t// didn’t validate logic\n\t\t\t\t\t$errors = $this->Upload->validationErrors;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"function fileForm($sqlType){ ?>\n\t\t<form name=\"eventInput\" action=\"<? printHTML(fullURL(getLangVar(\"fileURL\"), \"commit\")); ?>\" method=\"post\" enctype=\"multipart/form-data\">\n\t<?\tobjectForm(); ?>\n\t\t\t<div>\n\t\t\t\t<label for=\"file\">Filename:</label><input type=\"file\" name=\"file\" id=\"file\" />\n\t\t\t</div>\n\t\t\t<div class=\"fr\">\n\t\t\t\t<input type=\"submit\" value=\"Submit\"></input>\n\t\t\t</div>\n\t\t\t<input id=\"sqlType\" name=\"sqlType\" type=\"hidden\" value=\"<? printHTML($sqlType); ?>\"></input>\n\t\t\t<input id=\"fileId\" name=\"fileId\" type=\"hidden\" value=\"<? printHTML($GLOBALS['fileId']); ?>\"></input>\n\t\t</form>\n<?\t}",
"public function uploadAction($file) {\n\t\t\n\t\t$renderPartial = $this->request->hasArgument('renderPartial') ? $this->request->getArgument('renderPartial') : '';\n\t\t$mode = $this->request->hasArgument('mode') ? $this->request->getArgument('mode') : '';\n\t\t$filetype = $this->request->hasArgument('filetype') ? $this->request->getArgument('filetype') : 'file';\n\t\tif ($filetype == 'pdf') {\n\t\t\tif ($file->getOriginalResource()->getFileextension() !== 'pdf') {\n\t\t\t\t$this->forward('new', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->persistenceManager->isNewObject($file)) {\n\t\t\t$this->fileResourceRepository->add($file);\n\t\t} else {\n\t\t\t$this->fileResourceRepository->update($file);\n\t\t}\n\t\t\n\t\t$this->forward('edit', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t}",
"function upload(){\r\n\t\t\t$config=array(\r\n\t\t\t'allowed_types'=>'jpg|jpeg|png|gif', 'upload_path'=>'./foto/', 'max_size'=>'1024', \r\n\t\t\t'file_name'=>url_title($this->input->post('gambar'))\t\t\t\r\n\t\t\t);\t\t\r\n\t\t\t$this->upload->initialize($config);\r\n\t\t\tif ($this->upload->do_upload('gambar')) {\t//jika file telah di upload\t\t\r\n\t\t\t//menyimpan data ke Database\r\n\t\t\t$nis=$this->input->post('nis',true);\r\n\t\t\t$file=$this->upload->file_name;\r\n\t\t\t$aktif=$this->input->post('aktif',true);\r\n\t\t\t$this->model_foto->add($nis,$file,$aktif);\r\n\t\t\tredirect('foto');\r\n\t\t\t} else {\r\n\t\t\t$error=$this->upload->display_errors();\r\n\t\t\techo $error;\t\t\t\r\n\t\t\t}\r\n\t\t}",
"public function uploadfile($refdoc){\n\t\t$filename = $_FILES['file']['name'];\n\t\t$filename = $filename;\n\t\t$location = \"./images/grfile/\". $filename;\n\t\t$temp = $_FILES['file']['tmp_name'];\n\t\t$fileType = pathinfo($location,PATHINFO_EXTENSION);\n\t\t$acak = rand(000000,999999);\t\n\n\t\t// move_uploaded_file($temp, $location);\n\t\t$this->model('Grpo_model')->uploadfile($refdoc, $temp, $location, $filename, $fileType);\n\t\tmove_uploaded_file($temp, $location);\n\t\t// /* Valid Extensions */\n\t\t// $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n\t\t// /* Check file extension */\n\t\t// if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n\t\t// \t$uploadOk = 0;\n\t\t// }\n\n\t\t// if($uploadOk == 0){\n\t\t// echo 0;\n\t\t// }else{\n\t\t// /* Upload file */\n\t\t// if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n\t\t// \techo $location;\n\t\t// }else{\n\t\t// \techo 0;\n\t\t// }\n\t}",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }",
"public function content_for_upload();",
"public function file ( \\r8\\Form\\File $field )\n {\n $this->addField( \"file\", $field );\n }",
"public function uploadfileAction(){\n \t$cand_model = new Default_Model_Candidatedetails();\n \t$result = $cand_model->saveUploadedFile($_FILES);\n \t$this->_helper->json($result);\n }",
"function upload_file_mo1()\n {//begin\n if( $this->ck_login() == 1 && $this->ck_permission() == 1 )\n {//if \n $path=\"upload/\"; \n echo $id_tb_person=trim($this->input->get_post('id_tb_person'));\n \n ## note หลักการตั้งชื่อไฟล์ที่จะ upload ต้องไม่มี . (จุด)\n /*\n \n echo \"name: \".$_FILES['doc_38_1']['name'].br();\n echo \"size: \".$_FILES['doc_38_1']['size'] .br();\n echo \"temp name: \".$_FILES['doc_38_1']['tmp_name'].br();\n echo \"type: \".$_FILES['doc_38_1']['type'].br();\n echo \"error: \".$_FILES['doc_38_1']['error'].br(); \n */\n \n echo \"<hr>\";\n if( isset($_FILES['doc_38_1']) )\n {\n //echo \"testing\"; \n echo $doc_38_1=$_FILES[\"doc_38_1\"][\"name\"];\n $file_wd1=\"doc_38_1\"; \n $this->uploadmodels->upload_file_hn($file_wd1,$path);\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_passport']) )//4.สำเนาพาสปอร์ต\n {\n $file_wd2=\"doc_passport\"; \n $this->uploadmodels->upload_file_hn($file_wd2,$path); \n echo $doc_passport=$_FILES['doc_passport']['name'];\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_visa']) )//สำเนาวีซ่า\n {\n $file_wd3=\"doc_visa\"; \n $this->uploadmodels->upload_file_hn($file_wd3,$path); \n echo $doc_visa=$_FILES['doc_visa']['name'];\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_for_permission']) )//ใบขออนุญาตการทำงาน \n {\n $file_wd4=\"doc_for_permission\"; \n $this->uploadmodels->upload_file_hn($file_wd4,$path); \n echo $doc_for_permission=$_FILES['doc_for_permission']['name'];\n // echo $doc_pay_permission=$_FILES['doc_pay_permission']['name'];\n echo \"<hr>\";\n }\n if( isset($_FILES['doc_pay_permission']) )//ใบเสร็จรับเงินอนุญาตทำงาน\n {\n $file_wd5=\"doc_pay_permission\"; \n $this->uploadmodels->upload_file_hn($file_wd5,$path); \n echo $doc_pay_permission=$_FILES['doc_pay_permission']['name'];\n echo \"<hr>\";\n }\n \n echo $doc_permission=trim($this->input->get_post('doc_permission'));\n echo \"<hr>\";\n \n $tb=\"tb_document\"; \n $data_doc=array(\n 'id_document'=>NULL,\n 'id_tb_person'=>$id_tb_person,\n 'doc_38_1'=>$doc_38_1,\n 'doc_passport'=>$doc_passport,\n 'doc_visa'=>$doc_visa,\n 'doc_for_permission'=>$doc_for_permission,\n 'doc_pay_permission'=>$doc_pay_permission,\n 'doc_permission'=>$doc_permission\n \n );\n $insert=$this->db->insert($tb,$data_doc);\n\t\t\t\tif( $insert )\n\t\t\t\t{\n\t\t\t\t\techo \"บันทึกข้อมูลแล้ว\";\n\t\t\t\t}\n\t\t\t\t elseif( !$insert )\n\t\t\t\t{\n\t\t\t\t\techo \"เกิดข้อผิดพลาดในการบันทึกข้อมูล\";\n\t\t\t\t}\n \n redirect('home/load_content/19'); \n }//end if\n }",
"public function upload($file) {\n /*\n ** is there some file to upload\n */\n if (isset($file))\n FileLoaderController::setFiles($file);\n else\n API::error('No file found.');\n\n /*\n ** Upload the current media\n */\n FileLoaderController::upload($this);\n\n }",
"public function anexar(){\n// var_dump($_FILES);\n// var_dump($_POST);\n if(isset($_FILES) && isset($_POST['id']) && !empty($_FILES)){\n extract($_POST);\n $extensao = $this->validaExtensao($_FILES['arquivo']['name']);\n if($_FILES['arquivo']['size'] <= 4000000 && $extensao){\n $newName = md5(time()).\".\".$extensao;\n $this->validaPasta($tipo, $id);\n $caminho = \"arquivos/$tipo/$id/$newName\";\n if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $caminho)) {\n $arquivos = new Arquivos();\n $retorno = $arquivos->insereArquivoBD($_FILES['arquivo']['name'], $id, $caminho, $tipo);\n echo json_encode('ok');\n }else{\n echo json_encode(3);\n }\n \n } else {\n echo json_encode(2);\n }\n } else {\n echo json_encode(1);\n }\n }",
"function get_uploaded_file($form_name, &$file_name = null, $only_path = false) {\n if (isset($_FILES[$form_name]) && is_uploaded_file(@$_FILES[$form_name]['tmp_name'])) {\n $file_name = @$_FILES[$form_name]['name'];\n return $only_path? $_FILES[$form_name]['tmp_name']: \\file_get_contents($_FILES[$form_name]['tmp_name']);\n }\n return null;\n}",
"public function dz_files()\n {\n if (!empty($_FILES) && $_FILES['file']) {\n $file = $_FILES['file'];\n\n\n foreach ($file['error'] as $key=>$error) {\n $uploadfile = sys_get_temp_dir().basename($file['name']['key']);\n move_uploaded_file($file['tmp_name'],$uploadfile);\n\n }\n }\n }",
"public static function upload($name='file',$file=null){\n\t\t$errorMessage=self::fileErrorMessage($_FILES[$name]['error']);\n\t\tif($errorMessage===true){\n\t\t\t$tmpFile=tempnam('/tmp','uploadFile');\n\t\t\tmove_uploaded_file($_FILES[$name]['tmp_name'], $tmpFile);\n\t\t\tif($file===null) $file=static::createObject();\n\t\t\tstatic::_cleanName($file,$_FILES[$name]['name']);\n\t\t\tstatic::add($tmpFile,$file);\n\t\t\treturn $file;\n\t\t}else throw new FileUploadException($errorMessage);\n\t\treturn false;\n\t}",
"public function actionUploadImageNews()\n {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/news/\".$filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location,PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n /* Check file extension */\n if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n $uploadOk = 0;\n }\n if($uploadOk == 0){\n echo 0;\n }else{\n /* Upload file */\n if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n echo $filename;\n\n }else{\n // echo 0;\n }\n }\n }",
"function uploadMaterial(){\n if(isset($_FILES['userfile'])) {\n // Make sure the file was sent without errors\n if($_FILES['userfile']['error'] == 0) {\n \n // Gather all required data \n $name = $_FILES['userfile']['name'];\n $type = $_FILES['userfile']['type'];\n $content = $_FILES['userfile']['tmp_name']; //this is the actual file\n \n // Create the SQL query\n $query = \"INSERT INTO _uploaded_mateirial('cwid','course_id','file_name', 'file_type','content')VALUES('$cwid','$courseID','$name', '$type','$content')\";\n \n // Execute the query\n $result = $this->connection->query($query);\n \n // Check if it was successfull\n if($result) {\n echo 'Success! Your file was successfully added!';\n }\n else {\n echo 'Error! Failed to insert the file'\n . \"<pre>{$this->connection->error}</pre>\";\n }\n }\n else {\n echo 'An error accured while the file was being uploaded. '\n .'Error code: '. intval($_FILES['userfile']['error']);\n }\n \n \n }\n else {\n echo 'Error! A file was not sent!';\n } \n\n }",
"public function upload(Request $request)\n {\n //\n }",
"function _webform_submit_file(&$data, $component) {\r\n $upload_dir = file_directory_path() .'/webform/'. $component['extra']['savelocation'];\r\n if (!empty($_FILES['files']['name'][$data['new']])) {\r\n if (file_check_directory($upload_dir, FILE_CREATE_DIRECTORY)) {\r\n $file_saved = file_save_upload($data['new'], array(), $upload_dir);\r\n if (!$file_saved) {\r\n drupal_set_message(t('The uploaded file %filename was unable to be saved. The destination directory may not be writable.', array('%filename' => $file_saved['filename'])), 'error');\r\n }\r\n else {\r\n @chmod($file_saved->filepath, 0664);\r\n file_set_status($file_saved, FILE_STATUS_PERMANENT);\r\n if (isset($data['existing']['filepath'])) {\r\n file_delete($data['existing']['filepath']);\r\n }\r\n $data = serialize((array)$file_saved);\r\n }\r\n }\r\n else {\r\n drupal_set_message(t('The uploaded file was unable to be saved. The destination directory does not exist.'), 'error');\r\n }\r\n }\r\n else {\r\n $data = serialize(array());\r\n }\r\n}",
"public function attach_file($file){\n\t \t\t//ERROR CHECKNG , SET OJESCT ATTRIBUTESss\n\t \t\tif(!$file || empty($file) || !is_array($file)){\n\t \t\t\t$this->errors[] = \"No file was uploaded. \";\n\t \t\t\treturn false;\n\t \t\t}elseif($file['error'] != 0){\n\t \t\t\t$this->errors[] = $this->upload->errors[$file['error']];\n\t \t\t\treturn false;\n\t \t\t}else{\n\t \t\t\tif (!isset($this->testimony_id)) \n\t \t\t\t\t$this->setTestimonyid();\n\n\t \t\t\t$this->temp_path = $file['tmp_name'];\n\t \t\t\t$this->passport = str_replace(\"/\", \"_\", $this->testimony_id).\".\".basename($file[\"type\"]);\n\t \t\t\t$this->type = $file['type'];\n\t \t\t\t$this->size = $file['size'];\n\t \t\t\treturn true;\n\t \t\t}\n\t \t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }",
"public function uploadSingle()\n {\n\n foreach ($this->uploads['single'] as $field) {\n $file = [];\n\n if (Request::hasFile($field)) {\n $upfile = Request::file($field);\n\n if ($upfile instanceof UploadedFile) {\n $file = Uploader::upload($upfile, $this->upload_folder . '/' . $field);\n }\n\n }\n\n $this->setFileSingle($field, $file);\n }\n\n }",
"function save_files($post_id = 0){\r\n if(empty($_FILES['acf']['name'])){\r\n return;\r\n }\r\n \r\n // upload files\r\n $this->upload_files();\r\n \r\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"function media_upload()\r\n{\r\n\tglobal $DIR_MEDIA, $member, $CONF, $manager;\r\n\r\n\t$uploadInfo = postFileInfo('uploadfile');\r\n\r\n\t$filename = $uploadInfo['name'];\r\n\t$filetype = $uploadInfo['type'];\r\n\t$filesize = $uploadInfo['size'];\r\n\t$filetempname = $uploadInfo['tmp_name'];\r\n\t$fileerror = intval($uploadInfo['error']);\r\n\t$mediatocu = $manager->getPlugin('NP_Mediatocu');\r\n// added yama 20080131\r\n\tif ($mediatocu->getOption('filename_rule') == \"ascii\") {\r\n\t\t$path_parts = pathinfo($filename);\r\n\t\t$filename = time() . \".\" . $path_parts['extension'];\r\n\t}\r\n// end\r\n\t\r\n\tswitch ($fileerror) {\r\n\t\tcase 0: // = UPLOAD_ERR_OK\r\n\t\t\tbreak;\r\n\t\tcase 1: // = UPLOAD_ERR_INI_SIZE\r\n\t\tcase 2: // = UPLOAD_ERR_FORM_SIZE\r\n\t\t\tmedia_doError(_ERROR_FILE_TOO_BIG);\r\n\t\t\tbreak;\r\n\t\tcase 3: // = UPLOAD_ERR_PARTIAL\r\n\t\tcase 4: // = UPLOAD_ERR_NO_FILE\r\n\t\tcase 6: // = UPLOAD_ERR_NO_TMP_DIR\r\n\t\tcase 7: // = UPLOAD_ERR_CANT_WRITE\r\n\t\tdefault:\r\n\t\t\t// include error code for debugging\r\n\t\t\t// (see http://www.php.net/manual/en/features.file-upload.errors.php)\r\n\t\t\tmedia_doError(_ERROR_BADREQUEST . ' (' . $fileerror . ')');\r\n\t\t\tbreak;\r\n\t}\r\n\t// T.Kosugi add 2006.9.1\r\n\tif (stristr($filename, '%00')) {\r\n\t\tmedia_doError(_MEDIA_PHP_38);\r\n\t}\r\n\t// T.Kosugi add end\r\n\tif (strpos($filename,\"\\0\") !== false) {\r\n\t\tmedia_doError(_MEDIA_PHP_38);\r\n\t}\r\n\tif ($filesize > $CONF['MaxUploadSize']) {\r\n\t\tmedia_doError(_ERROR_FILE_TOO_BIG);\r\n\t}\r\n\r\n\t// check file type against allowed types\r\n\t$ok = 0;\r\n\t$allowedtypes = explode (',', $CONF['AllowedTypes']);\r\n\tforeach ( $allowedtypes as $type ) {\r\n\t\tif (eregi(\"\\.\" .$type. \"$\",$filename)) {\r\n\t\t\t$ok = 1;\r\n\t\t}\r\n\t}\r\n\tif (!$ok) {\r\n\t\tmedia_doError(_ERROR_BADFILETYPE);\r\n\t}\r\n\r\n\tif (!is_uploaded_file($filetempname)) {\r\n\t\tmedia_doError(_ERROR_BADREQUEST);\r\n\t}\r\n\r\n\t// prefix filename with current date (YYYY-MM-DD-)\r\n\t// this to avoid nameclashes\r\n\tif ($CONF['MediaPrefix']) {\r\n\t\t$filename = strftime(\"%Y%m%d-\", time()) . $filename;\r\n\t}\r\n\r\n\t// Filename should not contain '/' or '\\'.\r\n\tif (preg_match('#(/|\\\\\\\\)#',$filename)) media_doError(_ERROR_DISALLOWED);\r\n\r\n\t$collection = media_requestVar('collection');\r\n\t$res = MEDIA::addMediaObject($collection, $filetempname, $filename);\r\n\r\n\tif ($res != '') {\r\n\t\tmedia_doError($res);\r\n\t}\r\n\t$uppath = $DIR_MEDIA.$collection . \"/\";\r\n\t$upfile = $DIR_MEDIA.$collection . \"/\" . $filename;\r\n\r\n\t$res = move_uploaded_file($filetempname, $upfile);\r\n\tif ($res != '') {\r\n\t media_doError($res);\r\n\t}\r\n\r\n\tmake_thumbnail($DIR_MEDIA, $collection, $upfile, $filename);\r\n\r\n\t// shows updated list afterwards\r\n\tmedia_select();\r\n}",
"public function upload_foto_ktp()\n\t{\n\t\t$where = $this->input->post('id_warga');\n\t\tif ($_FILES != null) {\n\t\t\t$this->aksi_upload_foto_ktp($_FILES);\n\t\t}\n\t\t$this->session->set_flashdata('success', 'diubah');\n\t\tredirect('warga/profil_saya/' . $where);\n\t}",
"public function attach_file($file){\n\t \t\t//ERROR CHECKNG , SET OJESCT ATTRIBUTESss\n\t \t\tif(!$file || empty($file) || !is_array($file)){\n\t \t\t\t$this->errors[] = \"No file was uploaded. \";\n\t \t\t\treturn false;\n\t \t\t}elseif($file['error'] != 0){\n\t \t\t\t$this->errors[] = $this->upload->errors[$file['error']];\n\t \t\t\treturn false;\n\t \t\t}else{\n\t \t\t\tif (!isset($this->interview_id)) \n\t \t\t\t\t$this->setInterviewid();\n\n\t \t\t\t$this->temp_path = $file['tmp_name'];\n\t \t\t\t$this->passport = str_replace(\"/\", \"_\", $this->interview_id).\".\".basename($file[\"type\"]);\n\t \t\t\t$this->type = $file['type'];\n\t \t\t\t$this->size = $file['size'];\n\t \t\t\treturn true;\n\t \t\t}\n\t \t}",
"public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}",
"function wp_import_handle_upload()\n {\n }",
"public function renderUploadForm() {}",
"public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }",
"public function handleUploadFile() {\n\t\t$this->templateName = 'Upload.latte';\n\n\t\t$this->storage->addFile($_FILES['upload']['tmp_name'], $_FILES['upload']['name']);\n\n\t\t$this->template->url = $this->template->basePath . '/' . $this->storage->getBaseUrl() . '/' . $_FILES['upload']['name'];\n\t\t$this->template->message = 'Soubor byl nahrán';\n\t\t$this->template->setFile(__DIR__ . '/templates/' . $this->templateName);\n\t\t$this->template->render();\n\t\t$this->getPresenter()->terminate();\n\t}",
"public function upload()\n\t {\n\t\t $this->validator->validate( Input::all() );\n\n\t\t $data = $this->upload->upload( Input::file('file') , Input::get('destination') );\n\n $colloque_file = $this->file->create(\n array(\n 'filename' => $data['name'],\n 'type' => Input::get('type'),\n 'colloque_id' => Input::get('colloque_id')\n )\n );\n\n return Redirect::back()->with( array('status' => 'success' , 'message' => 'Fichier ajouté') );\n\n\t }",
"private function upload_file()\n\t{\n\t\t/* File upload properties. */\n\t\t$config['upload_path'] = 'uploads/';\n $config['allowed_types'] = 'gif|jpg|jpeg|png|mp4|mov|wmv|avi|mp3';\n $config['max_filename'] = '255';\n $config['remove_spaces'] = TRUE;\n $config['encrypt_name'] = TRUE;\n $config['max_size'] = '102400'; //100 MB\n\n /* Load the file upload library with the provided configurations. */\n $this->load->library('upload', $config);\n\n /* If the upload was successful then return the file name. Otherwise, return false. */\n if($this->upload->do_upload('file'))\n {\n return $this->upload->data('file_name');\n }\n\n return false;\n\t}",
"function\nwidget_upload ($name, $upload_path, $max_file_size, $mime_type, $submit_button_html, $uploaded_html)\n{\n $debug = 0;\n $p = '';\n\n if (!$_FILES)\n return '<form action=\"'\n .$_SERVER['PHP_SELF']\n .'\" method=\"POST\" enctype=\"multipart/form-data\"'\n// .' style=\"margin:0;\"'\n .' style=\"display:inline;\"'\n .'>'\n .'<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"'\n .$max_file_size\n .'\">'\n .'<input type=\"file\"'\n .' name=\"'.$name.'\"'\n// .' title=\"'\n// .$tooltip\n// .'\"'\n .($max_file_size ? ' maxlength=\"'.$max_file_size.'\"' : '')\n .($mime_type ? ' accept=\"'.$mime_type.'\"' : '')\n .'>'\n .($submit_button_html ? $submit_button_html :\n '<input type=\"submit\" name=\"'.$name.'\" value=\"Upload\"'\n// .' tooltip=\"'\n// .$tooltip\n// .'\"'\n)\n .'>'\n .'</form>'\n;\n\n if ($debug)\n {\n $p .= '<pre><tt>'\n .sprint_r ($_FILES);\n }\n\n $d = $upload_path.'/'\n// .str_replace (' ', '_', basename($_FILES[''.$name.'']['name']));\n .basename($_FILES[''.$name.'']['name']);\n\n if (file_exists ($d))\n $p .= 'ERROR: file already exists';\n else if (move_uploaded_file ($_FILES[''.$name.'']['tmp_name'], $d) == FALSE)\n $p .= 'ERROR: move_uploaded_file() failed';\n\n $s = Array (\n UPLOAD_ERR_OK => 'OK',\n UPLOAD_ERR_INI_SIZE => 'The uploaded file exceeds the upload_max_filesize directive ('\n .ini_get ('upload_max_filesize')\n .') in php.ini',\n UPLOAD_ERR_FORM_SIZE => 'The uploaded file exceeds the MAX_FILE_SIZE directive ('\n .$max_file_size\n .') that was specified in the HTML form',\n UPLOAD_ERR_PARTIAL => 'The uploaded file was only partially uploaded',\n UPLOAD_ERR_NO_FILE => 'No file was uploaded',\n UPLOAD_ERR_NO_TMP_DIR => 'Missing a temporary folder',\n// UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',\n// UPLOAD_ERR_EXTENSION => 'File upload stopped by extension'\n );\n\n if (!empty ($_FILES[''.$name.'']) &&\n $_FILES[''.$name.'']['error'] == UPLOAD_ERR_OK)\n {\n $p .= $uploaded_html;\n }\n else\n {\n $e = $s[$_FILES[''.$name.'']['error']];\n if (!$e)\n $e .= 'An unknown error occured';\n $p .= 'ERROR: '.$e;\n }\n\n if ($debug)\n {\n $p .= '<pre><tt>'\n .sprint_r ($s)\n .sprint_r ($_FILES);\n }\n\n return $p;\n}",
"function mvpm_upload_file(){\n check_ajax_referer( 'mvpm_system', 'security' );\n // && current_user_can( 'edit_post', $_POST['post_id']\n\n require_once( ABSPATH . 'wp-admin/includes/image.php' );\n require_once( ABSPATH . 'wp-admin/includes/file.php' );\n require_once( ABSPATH . 'wp-admin/includes/media.php' );\n \n\n // $file = $_REQUEST['entity'];\n\n // var_dump($_FILES['file']);\n\n // Undefined | Multiple Files | $_FILES Corruption Attack\n // If this request falls under any of them, treat it invalid.\n if (\n !isset($_FILES['file']['error']) ||\n is_array($_FILES['file']['error'])\n ) {\n throw new RuntimeException('Invalid parameters.');\n }\n\n // Check $_FILES['upfile']['error'] value.\n switch ($_FILES['file']['error']) {\n case UPLOAD_ERR_OK:\n break;\n case UPLOAD_ERR_NO_FILE:\n throw new RuntimeException('No file sent.');\n case UPLOAD_ERR_INI_SIZE:\n case UPLOAD_ERR_FORM_SIZE:\n throw new RuntimeException('Exceeded filesize limit.');\n default:\n throw new RuntimeException('Unknown errors.');\n }\n\n // You should also check filesize here. \n if (filesize($pdf_final) > 1000000) {\n throw new RuntimeException('Exceeded filesize limit.');\n }\n\n $attachment_id = media_handle_upload( 'file', 0 );\n \n if ( is_wp_error( $attachment_id ) ) {\n \n // There was an error uploading the image.\n echo '$attachement_id error';\n\n } else {\n \n // The image was uploaded successfully!\n $returnObj = [];\n $returnObj['file_id'] = $attachment_id;\n $returnObj['file_url'] = wp_get_attachment_url( $attachment_id );\n echo json_encode($returnObj);\n \n }\n\n wp_die();\n}",
"function upload( $form_name, $path = 'data/uploads/', $filename = '' ) {\n\n // Extension variable\n $extension = ext_get( $_FILES[ $form_name ][ 'name' ] );\n\n\n // Filename\n if ( empty( $filename ) ) { // If filename is empty, use uploaded file filename\n\n $filename = $_FILES[ $form_name ][ 'name' ];\n\n } else if ( $filename == '.' ) { // If we used dot, generate random filename\n\n $filename = uniqid() . '.' . $extension;\n\n } else { // If filename is set, add extension to it\n\n $filename .= '.' . $extension;\n\n }\n\n\n // Check if path for upload exists, if not create it\n if ( !is_dir( $path ) ) mkdir( $path, 0755, true );\n\n\n // ERR Handler\n $errors = array(\n UPLOAD_ERR_OK => \"\",\n UPLOAD_ERR_INI_SIZE => \"Larger than upload_max_filesize.\",\n UPLOAD_ERR_FORM_SIZE => \"Your upload is too big !\",\n UPLOAD_ERR_PARTIAL => \"Upload partially completed !\",\n UPLOAD_ERR_NO_FILE => \"No file specified !\",\n UPLOAD_ERR_NO_TMP_DIR => \"Woops, server error. Please contact us! <span style=\\\"display:none\\\">UPLOAD_ERR_NO_TMP_DIR</span>\",\n UPLOAD_ERR_CANT_WRITE => \"Woops, server error. Please contact us! <span style=\\\"display:none\\\">UPLOAD_ERR_CANT_WRITE</span>\",\n UPLOAD_ERR_EXTENSION => \"Woops, server error. Please contact us! <span style=\\\"display:none\\\">UPLOAD_ERR_EXTENSION</span>\",\n \"UPLOAD_ERR_EMPTY\" => \"File is empty.\",\n \"UPLOAD_ERR_NOT_MOVED\" => \"Error while saving file !\"\n );\n\n\n // Handle results & do last touches\n if ( !empty ( $_FILES[ $form_name ][ 'error' ] ) ) {\n\n return $errors[ $_FILES[ $form_name ][ 'error' ] ];\n\n } else {\n\n // Try to move uploaded file from TEMP directory to our new set directory\n if ( !move_uploaded_file( $_FILES[ $form_name ][ 'tmp_name' ], $path . $filename ) ) return $errors[ \"UPLOAD_ERR_NOT_MOVED\" ];\n\n // Handle return array\n return array(\n 'filename' => $filename,\n 'path' => $path . $filename,\n 'extension' => $extension,\n 'mimetype' => $_FILES[ $form_name ][ 'type' ],\n 'size' => $_FILES[ $form_name ][ 'size' ]\n );\n\n }\n\n\n }",
"public function file_settings_do_upload($file)\n\t{\n\t\t$config['upload_path'] = './'.BID_ATTACHMENTS;//define in constants\n\t\t$config['allowed_types'] = 'doc|docx|xls|xlsx|pdf';\n\t\t$config['remove_spaces'] = TRUE;\t\t\n\t\t$config['max_size'] = '2000';\n\t\t// $config['max_width'] = '1000';\n\t\t// $config['max_height'] = '1000';\n\t\t$this->upload->initialize($config);\n\t\t//print_r($_FILES);\n\t\t\n\t\t$this->upload->do_upload($file);\n\t\tif($this->upload->display_errors())\n\t\t{\n\t\t\t$this->error_img = $this->upload->display_errors();\n\t\t\t// echo $this->error_img;\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->upload->data();\n\t\t\treturn $data;\n\t\t}\t\t\t\n\t}",
"public static function uploadfile($upload_file){\r\n\t\t\r\n\t\t$file_store_options = array(\"base_dir\" => $file_upload_dir);\r\n\t\t\r\n \tif (empty($upload_file) && empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') {\r\n \t\tthrow new FileHandlerException($error_msg, Error::FILE_SIZE_EXCEEDED, \"upload_err_size_exceeded\");\r\n \t}\r\n $file = new Filesobject();\r\n $file->file_orig_name = $upload_file['name'];\r\n $file->file_size\t = $upload_file['size'];\r\n $path_parts = pathinfo($file->file_orig_name);\r\n $file->file_extension = strtolower($path_parts['extension']);\r\n $file->file_mime_type = $upload_file['type'];\r\n $file->file_tmp_name = $upload_file['tmp_name'];\r\n $error = $upload_file['error']; \r\n if($error) {\r\n $error_msg = $this->uploadErrors[$error];\r\n if($error == UPLOAD_ERR_INI_SIZE || $error == UPLOAD_ERR_FORM_SIZE) {\r\n throw new FileHandlerException($error_msg, Error::FILE_SIZE_EXCEEDED, \"upload_err_size_exceeded\");\r\n }\r\n else if($error == UPLOAD_ERR_NO_FILE) {\r\n throw new FileHandlerException($error_msg, Error::FILE_EMPTY, \"upload_err_empty\");\r\n }\r\n else {\r\n throw new Exception($error_msg, Error::FILE_UNKNOWN_UPLOAD_ERROR);\r\n }\r\n }\r\n return self::handleKliqBoothFile($file);\r\n\t}",
"function handle_upload() {\n\t\tif ( !isset($_FILES['import']) ) {\n\t\t\t$file['error'] = '文件为空';\n\t\t}\n\t\t$temp_file = tempnam(sys_get_temp_dir(), 'chemcsv');\n\t\tmove_uploaded_file($_FILES[\"import\"][\"tmp_name\"], $temp_file);\n\t\t$file['file'] = $temp_file;\n\n\t\tif ( isset( $file['error'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\techo esc_html( $file['error'] ) . '</p>';\n\t\t\treturn false;\n\t\t} else if ( ! file_exists( $file['file'] ) ) {\n\t\t\techo '<p><strong>错误</strong><br />';\n\t\t\tprintf('无法读取导入的文件 <code>%s</code>.', esc_html( $file['file'] ) );\n\t\t\techo '</p>';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $file['file'];\n\t}",
"public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }",
"public function getContentType()\n {\n return 'multipart/form-data; boundary='.substr($this->boundary, 2);\n }",
"public function uploadFile($base_dir, $file_post_name){\r\n $this->upload_dir = $base_dir;\r\n $this->file = $this->upload_dir.basename($_FILES[$file_post_name]['name']); \r\n\r\n if(move_uploaded_file($_FILES[$file_post_name]['tmp_name'], $this->file)){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"public function file($name)\n {\n return isset($_FILES[$name]) ? (object)$_FILES[$name] : null;\n }",
"public function upload()\n {\n if (!Request::hasPost('requestToken') || !RequestToken::validate(Request::getPost('requestToken'))) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Invalid Request Token!');\n $objResponse->output();\n }\n\n if (!Request::getInstance()->files->has($this->name)) {\n return;\n }\n\n $objTmpFolder = new \\Folder(MultiFileUpload::UPLOAD_TMP);\n\n // contao 4 support, create tmp dir symlink\n if (version_compare(VERSION, '4.0', '>=')) {\n // tmp directory is not public, mandatory for preview images\n if (!file_exists(System::getContainer()->getParameter('contao.web_dir') . DIRECTORY_SEPARATOR . MultiFileUpload::UPLOAD_TMP)) {\n $objTmpFolder->unprotect();\n $command = new SymlinksCommand();\n $command->setContainer(System::getContainer());\n $input = new ArrayInput([]);\n $output = new NullOutput();\n $command->run($input, $output);\n }\n }\n\n $strField = $this->name;\n $varFile = Request::getInstance()->files->get($strField);\n // Multi-files upload at once\n if (is_array($varFile)) {\n // prevent disk flooding\n if (count($varFile) > $this->maxFiles) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Bulk file upload violation.');\n $objResponse->output();\n }\n\n /**\n * @var UploadedFile $objFile\n */\n foreach ($varFile as $strKey => $objFile) {\n $arrFile = $this->uploadFile($objFile, $objTmpFolder->path, $strField);\n $varReturn[] = $arrFile;\n\n if (\\Validator::isUuid($arrFile['uuid'])) {\n $arrUuids[] = $arrFile['uuid'];\n }\n }\n } // Single-file upload\n else {\n /**\n * @var UploadedFile $varFile\n */\n $varReturn = $this->uploadFile($varFile, $objTmpFolder->path, $strField);\n\n if (\\Validator::isUuid($varReturn['uuid'])) {\n $arrUuids[] = $varReturn['uuid'];\n }\n }\n\n if ($varReturn !== null) {\n $this->varValue = $arrUuids;\n $objResponse = new ResponseSuccess();\n $objResult = new ResponseData();\n $objResult->setData($varReturn);\n $objResponse->setResult($objResult);\n\n return $objResponse;\n }\n }",
"public function upload()\n {\n $path = $this->file_path;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n\n // Upload file. \n $file_name = strtolower(basename($_FILES['uploaded_file']['name']));\n $file_name = str_replace(' ', '-', $file_name); // Replace spaces with dashes.\n $path = $path . $file_name;\n\n $acceptable = array(\n 'image/jpeg',\n 'image/jpg',\n 'image/gif',\n 'image/png'\n );\n\n if(in_array($_FILES['uploaded_file']['type'], $acceptable)) {\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n\n $file_msg = 'The file '. $path . ' has been uploaded';\n \n // Not ideal but good for now\n \n // Refresh parent on upload.\n echo \"<script>window.parent.location.reload(true);</script>\";\n\n } else {\n\n $file_msg = 'There was a problem with the upload.';\n }\n }\n else {\n\n $file_msg = 'Bad file uploaded.';\n }\n return $file_msg;\n }",
"function type_url_form_file()\n {\n }",
"protected function checkFileUploadEnabled() {}",
"public function set_file($file) {\n if (empty($file) || !$file || !is_array($file)) {\n $this->custom_errors[] = \"This was no file uploaded here\";\n return false;\n } else if ($file['error'] != 0) {\n $this->custom_errors[] = $this->upload_errors[$file['error']]; # save official errors in your error array\n return false;\n } else {\n $this->user_image = basename($file['name']);\n $this->tmp_path = $file['tmp_name']; # this is the temporary path that store the file\n $this->type = $file['type'];\n $this->size = $file['size'];\n }\n }",
"function upload($upload) {\n\t\t$file = $upload->getFile ();\n\t\t$userid = $upload->getUserid ();\n\t\t\n\t\t// echo $file;\n\t\t// exit();\n\t\t\n\t\t// 判断是否上传成功的标志\n\t\t$flag = false;\n\t\t\n\t\t// 获取文件的大小\n\t\t$file_size = $file ['size'];\n\t\tif ($file_size > 2 * 1024 * 1024) {\n\t\t\techo \"文件过大,不能上传大于2M的文件\";\n\t\t\texit ();\n\t\t}\n\t\t\n\t\t// 获取文件的类型\n\t\t// $file_type = $file ['type'];\n\t\t// if ($file_type != 'image/jpeg' && $file_type != 'imgage/pjepg') {\n\t\t// echo \"文件类型只能是jpg的\";\n\t\t// exit ();\n\t\t// }\n\t\t\n\t\t// 判断上传是否成功\n\t\t\n\t\tif (is_uploaded_file ( $file ['tmp_name'] )) {\n\t\t\t// 把这个文件转存到你希望的目录\n\t\t\t$uploaded_file = $file ['tmp_name'];\n\t\t\t\n\t\t\t// 我们给每个用户动态的创建一个文件夹\n\t\t\t$user_path = $_SERVER ['DOCUMENT_ROOT'] . Common::$uploadPath . $userid;\n\t\t\t\n\t\t\t// $user_path=iconv(\"utf-8\",\"gb2312\",$user_path);\n\t\t\t\n\t\t\t// 判断该用户是否已经有文件夹\n\t\t\tif (! file_exists ( $user_path )) {\n\t\t\t\tmkdir ( iconv ( \"utf-8\", \"gb2312\", $user_path ) );\n\t\t\t}\n\t\t\t\n\t\t\t// $move_to_file=$user_path.\"/\".$_FILES['myfile']['name'];\n\t\t\t\n\t\t\t// $file_type=$_FILES['myfile']['name']\n\t\t\t$file_true_name = $file_type = $file ['name'];\n\t\t\t\n\t\t\t$file_true_type = substr ( $file_true_name, strrpos ( $file_true_name, \".\" ) );\n\t\t\t$file_final_name = \"\" . time () . rand ( 1, 1000 ) . $file_true_type;\n\t\t\t$move_to_file = $user_path . \"/\" . $file_final_name;\n\t\t\t$upload->setFile_final_name ( $file_final_name );\n\t\t\t\n\t\t\t// echo $move_to_file;\n\t\t\t// exit ();\n\t\t\t\n\t\t\t// echo $move_to_file;\n\t\t\t// echo \"<br/>$uploaded_file\";\n\t\t\t// exit();\n\t\t\t\n\t\t\t// echo $uploaded_file.\"||\".$move_to_file;\n\t\t\tif (move_uploaded_file ( $uploaded_file, iconv ( \"utf-8\", \"gb2312\", $move_to_file ) )) {\n\t\t\t\t$flag = true;\n\t\t\t} else {\n\t\t\t}\n\t\t} else {\n\t\t}\n\t\t\n\t\t$upload->setFlag ( $flag );\n\t}",
"public function set_file($file){\n\t\tif(empty($file) || !$file || !is_array($file)){\n\t\t\t$this->errors[]=\"There was no file uploaded here\";\n\t\t\treturn false;\n\t\t}elseif($file['error'] != 0){\n\t\t\t$this->errors[]=$this->upload_errors_array[$file['error']];\n\t\t\treturn false;\n\t\t}else {\n\n\t\t\t$this->user_image=basename($file['name']);\n\t\t\t$this->tmp_path=$file['tmp_name'];\n\t\t\t$this->type=$file['type'];\n\t\t\t$this->size=$file['size'];\n\n\t\t}\n\n\t}",
"function form_file($name = '') {\n\n\tif ($name == 'attachment') {\n\t\tunset($name);\n\t\t$name = \"\";\n\t}\n\n\t$value = html_form_escape($value, $override);\n\n\t$name = 'attachment' . $name;\n\treturn \"<input type=\\\"file\\\" name=\\\"$name\\\" />\";\n\n}"
]
| [
"0.67454284",
"0.6687821",
"0.66607755",
"0.6566097",
"0.6476333",
"0.643228",
"0.6425863",
"0.64131457",
"0.64070076",
"0.63913304",
"0.6350117",
"0.6317984",
"0.6271519",
"0.62599754",
"0.6234323",
"0.6192849",
"0.61581963",
"0.6156452",
"0.61521405",
"0.6129594",
"0.61274266",
"0.6122401",
"0.6121154",
"0.6117488",
"0.61168385",
"0.6114685",
"0.60935575",
"0.60792845",
"0.60578907",
"0.605742",
"0.60548663",
"0.6053679",
"0.6048954",
"0.6041287",
"0.6031023",
"0.6019657",
"0.6019382",
"0.6018881",
"0.6007782",
"0.5970392",
"0.5956438",
"0.59514165",
"0.5943666",
"0.59432155",
"0.59371257",
"0.5931017",
"0.5927956",
"0.59261996",
"0.5924152",
"0.5922977",
"0.5921154",
"0.5920042",
"0.59119767",
"0.5910519",
"0.5910316",
"0.59027296",
"0.58971214",
"0.589711",
"0.58856463",
"0.5882523",
"0.5876253",
"0.5875364",
"0.58737266",
"0.58684176",
"0.5863747",
"0.5861823",
"0.58479536",
"0.5846439",
"0.5842713",
"0.5840887",
"0.5833559",
"0.5827967",
"0.5822652",
"0.5818758",
"0.5817077",
"0.58150506",
"0.58144087",
"0.5810773",
"0.5807776",
"0.58046746",
"0.57957816",
"0.57902694",
"0.576764",
"0.57643944",
"0.5760304",
"0.57587385",
"0.5758577",
"0.57552904",
"0.57489467",
"0.5744145",
"0.57436687",
"0.5740448",
"0.5739648",
"0.57392454",
"0.5739143",
"0.5738634",
"0.5735355",
"0.57338715",
"0.57323694",
"0.5722102",
"0.5721977"
]
| 0.0 | -1 |
Create a new Route instance. | public function __construct($methods, $uri, $action)
{
$this->uri = $uri;
$this->regexUri = $this->parseUri();
$this->methods = (array) $methods;
$this->action = $this->parseAction($action);
$this->parameterNames = $this->parseParameterNames();
$this->parameterPatterns = $this->parseParameterPatterns();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createRouteObject();",
"protected function makeRoute()\n {\n new MakeRoute($this, $this->files);\n }",
"public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }",
"public static function createRoute($type, $from, $to) {\n\t\treturn new Routes\\Route($type, $from, $to);\n\t}",
"public function createRoute($route)\n {\n return new Route($this->adapter, $this->container, $this->container['request'], $route);\n }",
"public function createRoute(\n string $name,\n string $path,\n array $methods,\n RequestHandlerInterface $requestHandler,\n array $middlewares,\n array $attributes\n ) : RouteInterface;",
"private function _createRoute( $options )\n {\n $url = $this->_di->getService( \"url\" );\n\n /**\n * All route uris should have the uri prefix\n */\n $options[\"uri\"] = $url->getUriPrefix() . $options[\"uri\"];\n\n if (isset($options[\"controller_action\"]))\n {\n $controller_action_exploded = explode( \"#\", $options[\"controller_action\"] );\n\n $options[\"controllerName\"] = $controller_action_exploded[0];\n $options[\"actionName\"] = $controller_action_exploded[1];\n }\n\n // $uri = $settings[\"uri\"];\n //\n // $controllerName = $settings[\"controllerName\"];\n //\n // $actionName = $settings[\"actionName\"];\n //\n // $params = $settigns[\"params\"];\n\n return new Route($options);\n }",
"public function __construct(Route $route) {\n $this->route = $route;\n }",
"public function __construct(Route $route)\n {\n $this->route = $route;\n }",
"public function __construct(Route $route)\n {\n $this->route = $route;\n }",
"public function __construct(Route $route)\n {\n $this->route= $route;\n }",
"protected function getRouteForCreate()\n {\n return new $this->routeClass(\n sprintf('%s/%s.:sf_format', $this->options['prefix_path'], 'create'),\n array_merge(array('module' => $this->options['module'], \n\t\t\t'action' => $this->getActionMethod('create'), 'sf_format' => 'html'), \n\t\t$this->options['default_params']),\n array_merge($this->options['requirements'], array('sf_method' => 'post')),\n array('model' => $this->options['model'], 'type' => 'object')\n );\n }",
"private function createRoute(string $pathTemplate, string $hostTemplate = null): Route\n {\n return new Route(new UriTemplate($pathTemplate, $hostTemplate), new MethodRouteAction('Foo', 'bar'), []);\n }",
"public function getRoute($id = null) {\r\n return new Route($id, $this);\r\n }",
"public function getRoute(): Route;",
"protected abstract function createRoutes(RoutingTable $routes);",
"protected static function createRouter() {\n\t\tstatic::$router = new Router();\n\t}",
"public function create()\n {\n //Not Used because using API Route\n }",
"public function route(): RouteContract;",
"public function testProperConstructor()\n {\n $name = 'foo';\n $pattern = '(?<foo>foo)';\n $destination = function($foo){};\n $data = ['foo'=>'foo'];\n $route = new Route($name, $pattern, $destination);\n\n $this->assertEquals($name, $route->getName());\n $this->assertEquals($pattern, $route->getPattern());\n $this->assertSame($destination, $route->getDestination());\n $this->assertNotSame($data, $route->getData());\n\n return $route;\n }",
"public function actionCreate()\n\t{\n\t\t$model = new Route();\n\n\t\tif ($model->load(Yii::$app->request->post())) {\n\t\t\t$model->save();\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public static function create($name, SymfonyRoute $route, $method, $description = '')\n {\n return new static($name, $route, $method, $description);\n }",
"public static function create(array $options = [])\n {\n $options['collection'] = isset($options['collection'])\n ? $options['collection']\n : new RouteCollection();\n\n $options['matcher'] = isset($options['matcher'])\n ? $options['matcher']\n : new Matcher($options['collection']);\n\n $options['resolver'] = isset($options['resolver'])\n ? $options['resolver']\n : new CallableResolver();\n\n return new Router($options['matcher'], $options['resolver']);\n }",
"public function build($callback, $path = null, $method = null, $count_match = true, $name = null)\r\n {\r\n return new Route(\r\n $callback,\r\n $this->preprocessPathString($path),\r\n $method,\r\n $this->shouldPathStringCauseRouteMatch($path) // Ignore the $count_match boolean that they passed\r\n );\r\n }",
"public function createRouter(): IRouter;",
"protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}",
"public function create(\n $pattern,\n $handler,\n array $httpMethods = null\n ) {\n $pattern = static::preparePattern($pattern);\n\n $route = new RouteDefinition(\n $pattern,\n static::createRegex($pattern),\n $handler,\n $httpMethods\n );\n\n $route->setAnnotationReader($this->annotationReader);\n $route->setHandlerContainer($this->handlerContainer);\n\n return $route;\n }",
"public function create()\n\t{\n\t\t// handled by backbone routes\n\t}",
"protected function createRouteDispatcher()\n {\n $this->dispatcher = \\FastRoute\\simpleDispatcher($this->config['routes'], [\n 'routeCollector' => \\Rid\\Http\\Route\\RouteCollector::class,\n ]);\n }",
"protected function _createRouter(){\n\t\treturn new SimpleRouter();\n\t}",
"public function withAttributes(array $attributes): Route;",
"public function __construct(){\n $this->findRoute();\n }",
"protected function newRoute(array $attributes)\n {\n if (empty($attributes['action']['prefix'] ?? '')) {\n $baseUri = $attributes['uri'];\n } else {\n $prefix = trim($attributes['action']['prefix'], '/');\n\n $baseUri = trim(implode(\n '/', array_slice(\n explode('/', trim($attributes['uri'], '/')),\n count($prefix !== '' ? explode('/', $prefix) : [])\n )\n ), '/');\n }\n\n return $this->router->newRoute($attributes['methods'], $baseUri === '' ? '/' : $baseUri, $attributes['action'])\n ->setFallback($attributes['fallback'])\n ->setDefaults($attributes['defaults'])\n ->setWheres($attributes['wheres'])\n ->setBindingFields($attributes['bindingFields'])\n ->block($attributes['lockSeconds'] ?? null, $attributes['waitSeconds'] ?? null)\n ->withTrashed($attributes['withTrashed'] ?? false);\n }",
"public function __construct()\n {\n $this->checkRequestType($_SERVER['REQUEST_METHOD']);\n\n $this->setRoute();\n\n $this->executeRoute();\n }",
"public function add(string $path, $callable): Route{\n\t\t$route = new Route($path, $callable);\n\t\t$this->routes[] = $route;\n\t\treturn $route;\n\t}",
"public static function route();",
"public function __construct(\\Afosto\\Sdk\\Model\\WmsCreateRouteRequest $body)\n {\n $this->body = $body;\n }",
"public function __construct()\n {\n $this->uri = Fly::app()->getUri();\n Fly::log('debug', \"Router Class Initialized\");\n $this->setRouting();\n }",
"protected function createRouteAction(Request $request) : RouteAction\n {\n $this->controller = null;\n if (!$this->action->isStatic()) {\n $this->controller = $this->action->getDeclaringClass()->newInstance();\n $this->controller->request = $request;\n $this->controller->route = $this;\n }\n $this->action->setAccessible($this->accessible);\n return new RouteAction($this, $this->action, $this->controller);\n }",
"public function add($pattern, $paths = null, $httpMethods = null) {\n\n\t\t$route = new Route($pattern, $paths, $httpMethods);\n\n\t\t$this->_routes[] = $route;\n\n\t\treturn $route;\n\t}",
"public function addRoute(string $pattern, array $methods, $handler = null): Route\n {\n $this->routes[] = $route = new Route($pattern, $methods, $handler);\n\n $this->resolveWith($route);\n\n return $route;\n }",
"public static function route($routeName,$param = Array(),$withBase = true)\n\t{\n\t\treturn self::createByRoute($routeName,$param,$withBase);\n\t}",
"public function __construct(Route $route = null, array $parameters = [])\n {\n\t\t$this->parameters = $parameters;\n\n\t\t// save route reference\n\n if($route) {\n $this->setRoute($route);\n }\n\t}",
"public function add($pattern, $paths = null, $httpMethods = null, $position = 4)\n {\n $route = new Route($pattern, $paths, $httpMethods);\n $route->setGroup($this);\n\n if ($position == Router::POSITION_FIRST) {\n array_unshift($this->routes, $route);\n } else {\n array_push($this->routes, $route);\n }\n return $route;\n }",
"public function testAddRouteAsObject()\n {\n $this->collection->add(new Route('name', '/', 'action'));\n $this->collection->compile();\n\n $this->assertCount(1, $this->collection->all());\n }",
"public function add(Route $route): Route\n {\n $this->routes[] = $route;\n return $route;\n }",
"function __construct(){\r\n $parser = new Shumvc_RouteParser();\r\n $this->routes = $parser->getRoutes();\r\n }",
"function route(string|null $name = null, string|array|null ...$params)\n{\n if (!empty($params[0])) if (is_array($params[0])) $params = $params[0];\n\n if ($name !== null) return Route::name($name, $params);\n\n return new Route;\n}",
"public function create()\n {\n $data['places'] = Place::lists('name', 'id');\n\n return $this->makeResponse(null, 'admin.mapRoutes.create', $data);\n }",
"public function test_construct_withValidParameters()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertSame(\n 'test',\n $route->getTarget(),\n 'Target specified in constructor must be returned via getTarget() method.'\n );\n $this->assertSame(\n [],\n $route->getParams(),\n 'Route from an URI pattern without parameters must return an empty array via getParams() method.'\n );\n }",
"protected function initRouter()\n {\n $xml = new \\DOMDocument;\n $xml->load(ROOT_DIR . '/configs/routing.xml');\n\n $routes = $xml->getElementsByTagName('route');\n\n $routeList = new RouteList();\n\n /** @var $DOMRoute DOMElement */\n foreach ($routes as $DOMRoute) {\n $attrController = $DOMRoute->getAttribute('controller');\n list($controller, $action) = explode('::', $attrController);\n\n /** @var Route $route */\n $route =\n new Route(\n $DOMRoute->getAttribute('path'),\n $controller,\n $action\n );\n\n if ($DOMRoute->hasChildNodes()) {\n /** @var \\DOMElement $node */\n $requirements = [];\n foreach ($DOMRoute->childNodes as $node) {\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"requirement\") {\n $requirements[$node->getAttribute('key')] = $node->nodeValue;\n }\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"condition\") {\n $route->setCondition($node->nodeValue);\n }\n }\n $route->setRequirements($requirements);\n }\n\n $routeList->offsetSet(\n $DOMRoute->getAttribute('id'),\n $route\n );\n }\n\n $this->router = new Router($routeList);\n }",
"public function __construct(string $type, string $route, string $name)\n {\n $this->type = $type;\n $this->route = $route;\n $this->name = $name;\n }",
"protected function getCreateRoute(Request $req, Response $res)\n {\n $route = new CreateModelRoute($req, $res);\n $route->setApp($this->app)\n ->setSerializer($this->getSerializer($req));\n\n return $route;\n }",
"public function __construct(string $name, string $route)\n {\n $this->name = $name;\n $this->route = $route;\n }",
"public function addRoute($routeName) {\n\t\t// We cannot allow duplicate route names for reversing reasons\n\t\tif (isset(self::$_routes[$routeName])) {\n\t\t\tthrow new \\InvalidArgumentException(\"The route {$routeName} has already been declared.\");\n\t\t}\n\n\t\tself::$_routes[$routeName] = new Route($routeName);\n\t\treturn self::$_routes[$routeName];\n\t}",
"public final function __construct(Route &$route, Request &$request)\n {\n $autowire = new AutoWire([$this]);\n $this->dbFactory = new DboFactory();\n $this->route = $autowire->addHandle($route);\n $this->request = $autowire->addHandle($request);\n $this->session = $autowire->addHandle(new Session);\n $this->db = $autowire->addHandle($this->initDatasources($this->dbFactory, $this->request, $this->route));\n $this->initResponse($this->request);\n $autowire->execute($this, 'init');\n $this->autowire = $autowire;\n }",
"public function __construct(RouteCacheContext $route) {\n $this->route = $route;\n }",
"public function __construct()\n {\n if (Registry::isKeySet('route')) {\n\n $this->route = Registry::get('route');\n\n }\n\n }",
"public function __construct(array $routes = [])\n {\n $this->routes = $routes;\n }",
"private function addRoute($path, $callable, $method, $name)\n {\n $route = new Route($path, $callable);\n $this->routes[$method][] = $route;\n\n if ( $name ) {\n $this->namedRoutes[$name] = $route;\n }\n\n return $route;\n }",
"function __construct($route)\n {\n $this->_controller = $route['controller'];\n $this->_action = $route['action'];\n $this->_params = $route['params'];\n $this->_template = new Template($route);\n }",
"public function __construct($config)\n {\n if (isset($_SERVER['PATH_INFO']))\n {\n $this->route_path = $this->pathSplit($_SERVER['PATH_INFO']);\n }\n $this->config = $config;\n $this->defineRoute();\n }",
"public function route(\n string $name,\n string $path,\n array $methods,\n $requestHandler,\n array $middlewares = [],\n array $attributes = []\n ) : RouteInterface {\n foreach ($middlewares as &$middleware) {\n $middleware = $this->referenceResolver->toMiddleware($middleware);\n }\n\n $route = $this->routeFactory->createRoute(\n $name,\n $path,\n $methods,\n $this->referenceResolver->toRequestHandler($requestHandler),\n $middlewares,\n $attributes\n );\n\n $this->collection->add($route);\n\n return $route;\n }",
"public function __construct()\n {\n $this->routes = array();\n }",
"private function setup($Route) {\n $this->Route = $Route;\n \n \n }",
"public function make(array $routes);",
"protected function route()\n {\n return route($this->uri, $this->params);\n }",
"public function withMethods(array $methods): Route;",
"public function add( Route $route ): Collection;",
"public function __construct(RouteMatchInterface $route_match) {\n $this->routeMatch = $route_match;\n }",
"public function __construct(RouteMatchInterface $route_match) {\n $this->routeMatch = $route_match;\n }",
"public function addRoute(RouteInterface $route) : RouterInterface;",
"abstract public function getRoute();",
"private function add($path, $callable, $name, $method){\n $route = new Route($path, $callable);\n $this->routes[$method][] = $route;\n if(is_string($callable) && $name === null){\n $name = $callable;\n }\n if($name){\n $this->namedRoutes[$name] = $route;\n }\n return $route;\n }",
"private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }",
"private function __construct() {\n\n /**\n * Throw an exception if we are trying to create\n * a second instance of the router class.\n */\n if (self::$instance != null) {\n throw new Exception('Cannot create multiple router instances.');\n }\n\n $this->registry = Registry::getInstance();\n\n request::parseRequest();\n $this->route = request::getRoute();\n\n }",
"public function addRoute(Route $route)\r\n {\r\n /**\r\n * Auto-generate a name from the object's hash\r\n * This makes it so that we can autogenerate names\r\n * that ensure duplicate route instances are overridden\r\n */\r\n $name = spl_object_hash($route);\r\n\r\n return $this->set($name, $route);\r\n }",
"public function getRoute();",
"protected function factory()\n {\n $this->request = $this->request();\n $this->response = $this->response();\n $this->route = $this->route();\n\n return $this;\n }",
"function create_initial_rest_routes()\n {\n }",
"public function testProperConstructor()\n {\n $router = new Router();\n $scope = function(Routeable $routeable){\n return $routeable->value;\n };\n\n $router->setScope($scope);\n\n $destinationResult = $this->destinationResult;\n\n $name = 'foo';\n $pattern = '(?<foo>foo)';\n $destination = function($foo) use ($destinationResult){\n return $destinationResult;\n };\n $data = ['foo'=>'foo'];\n $route = new Route($name, $pattern, $destination);\n $router->addRoute($route);\n\n $dispatcher = new Dispatcher($router);\n\n $rules = $dispatcher->getRules();\n\n $this->assertInternalType('array', $rules);\n $this->assertEmpty($rules);\n\n return $dispatcher;\n }",
"public function __construct()\r\n {\r\n $routesPath = ROOT . 'config/routes.php';\r\n $this->routes = include($routesPath);\r\n }",
"public function getRoute()\n {\n }",
"function route(string $name, $params = [])\n{\n return Route::route($name, $params);\n}",
"public function __construct($routeInfo) {\n $this->name = $routeInfo['name'];\n $this->pattern = $routeInfo['pattern'];\n\n \n foreach ($routeInfo as $key => $value) {\n \n switch($key) {\n case ('requirements'): {\n $this->requirements = $value;\n if(is_array($value)) {\n if(array_key_exists('_method', $value)) {\n $this->methodRequirement = $value['_method'];\n }\n }\n break;\n }\n case ('_method'): {\n $this->methodRequirement = $value;\n break;\n }\n case ('defaults'): {\n $this->defaults = $value;\n break;\n }\n case ('fnCheck'): {\n $this->fnCheck = $routeInfo['fnCheck'];\n break;\n }\n case('name'):\n case('pattern'):{ \n break;\n }\n case('optional'): {\n $this->optionalInfo = $routeInfo['optional'];\n break;\n }\n default:{\n $this->extra[$key] = $value;\n break;\n }\n }\n }\n\n $this->calculateStaticPrefix();\n\n //For paths other than the route path '/' allow the last '/' to be optional\n //If the string terminates there.\n if(mb_strlen($this->staticPrefix) > 1) {\n if(mb_substr($this->staticPrefix, mb_strlen($this->staticPrefix)-1) == '/'){\n $this->staticPrefix = mb_substr($this->staticPrefix, 0, mb_strlen($this->staticPrefix)-1);\n }\n\n if(mb_substr($this->pattern, mb_strlen($this->pattern)-1) == '/'){\n $this->pattern = mb_substr($this->pattern, 0, mb_strlen($this->pattern)-1);\n }\n }\n\n $this->buildRegex();\n }",
"private function defineRoute(){\n if($this->route_path === '/'){\n //go to home\n $controller_name = ucfirst($this->config->getLandingPageControllerName().\"Controller\");\n }\n elseif (array_key_exists($this->route_path[1],$this->nameRoutes())){\n $name_route = $this->nameRoutes()[$this->route_path[1]];\n $controller_name = !empty($name_route[0])?ucfirst($name_route[0]):'';\n $this->route_path[2] = $name_route[1];\n }\n else{\n $controller_name = !empty($this->route_path[1])?ucfirst($this->route_path[1].\"Controller\"):'';\n }\n $method_name = !empty($this->route_path[2])?$this->route_path[2]:'index';\n $parameters = is_array($this->route_path)?array_slice($this->route_path, 3):'';\n\n $file_path = ROOT_DIR.\"/src/Controllers/{$controller_name}.php\";\n if(file_exists($file_path)){\n $controller_name_with_namespace = 'App\\Controllers\\\\'.$controller_name;\n $controller_object = new $controller_name_with_namespace();\n if(method_exists($controller_object,$method_name)){\n $controller_object->$method_name($parameters);\n }else{\n exit('Wrong Method');\n }\n\n }else{\n exit('Wrong Controller');\n }\n }",
"protected function _getRouter() {\n\t\treturn new Router;\n\t}",
"public function __construct(array $l_routes)\n {\n # Initialisation du Routeur\n $this->router = new \\AltoRouter();\n\n # Ajout du tableau de routes au router.\n $this->router->addRoutes($l_routes);\n }",
"public function __construct()\n\n\t{\n $this->thisRoute = Route::current()->uri();\n\t}",
"public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }",
"public function addRoute($name, $route, $priority = null);",
"public function setRoute(string $route): self \n {\n $this->route = $route;\n return $this;\n }",
"public function add( $route, $params = array() ){\n\n //convert the route to a regular expression\n //escape forward slashes\n $route = preg_replace('/\\//', '\\\\/', $route);\n //convert variables to capture groups\n $route = preg_replace('/\\{([a-z]+)\\}/', '(?P<\\1>[a-z-_]+)', $route);\n //convert variables with custom regular expressions e.g. {id:\\d+}\n $route = preg_replace('/\\{([a-z]+):([^\\}]+)\\}/', '(?P<\\1>\\2)', $route);\n //add start and end delimeters, forgive trailing slash and add case insensitive flag\n $route = '/^' . $route . '\\/?$/i';\n\n //add route to object\n $this->routes[$route] = $params;\n\n }",
"public function __construct( $route, $controller, $action, array $params, $method=self::DEFAULT_METHOD ) {\n \n $this->route = $route;\n $this->controller = $controller;\n $this->action = $action;\n $this->params = $params;\n $this->method = $method;\n\n }",
"public function __construct()\n {\n $this->route = null;\n }",
"public function __construct($route = '')\n {\n $route = isset($route) \n ? preg_replace('/^route=(.*)/','$1',$_SERVER['QUERY_STRING']) \n : '';\n \n $this->route = $route;\n }",
"protected function buildRoute()\n {\n $module = $this->module;\n\n $this->route = [\n 'name' => $module->name,\n '--controller' => $this->class,\n '--view' => $module->showPermission->name,\n '--create' => $module->createPermission->name,\n '--edit' => $module->editPermission->name,\n '--delete' => $module->deletePermission->name,\n '--module' => $module->id,\n ];\n }",
"public function create()\n {\n //\n return response()->route('home');\n }",
"public function add(Route $route)\n {\n $this->store($route);\n\n return $route;\n }",
"public function build($name, $path, array $requirements, $view, array $controller, array $defaults = [])\n {\n return new Route($name, $path, $requirements, $view, [], new RequestMatcher());\n }",
"private function route() {\n if (class_exists($this->controllerName . $this->postfix)) {\n $fullName = $this->controllerName . $this->postfix;\n $this->controllerClass = new $fullName;\n $this->controllerClass->setUp();\n if (count($this->args > 1)) { // Pass args that are not controller class\n $this->controllerClass->setArgs($this->args);\n }\n\n // Second arg in url is our \"action\", try that as a method-call\n $method = strtolower($this->args[0]); // method names are case-insensitive. Might as well take advantage of it.\n if (isset($method) && method_exists($this->controllerClass, $method)) {\n $this->controllerClass->{$this->args[0]}();\n }\n \n } else { // No such class. Use our default\n $this->defaultRoute();\n }\n }"
]
| [
"0.8042464",
"0.75201494",
"0.73371285",
"0.72660995",
"0.7079843",
"0.6925242",
"0.6923975",
"0.68747777",
"0.687252",
"0.687252",
"0.67511135",
"0.67499816",
"0.6635953",
"0.66251606",
"0.6533837",
"0.6514894",
"0.6499072",
"0.6466502",
"0.6450068",
"0.64437973",
"0.6380525",
"0.636279",
"0.6361139",
"0.63484174",
"0.63302535",
"0.62940687",
"0.6250223",
"0.62457496",
"0.62050396",
"0.61498845",
"0.61446905",
"0.6140246",
"0.6103748",
"0.6082443",
"0.60734886",
"0.6045288",
"0.6042914",
"0.60049033",
"0.5987711",
"0.59692264",
"0.5947412",
"0.59469795",
"0.59359896",
"0.5910864",
"0.59099853",
"0.5887911",
"0.58439755",
"0.58397835",
"0.58127135",
"0.5802195",
"0.5763917",
"0.57600695",
"0.5742435",
"0.5732931",
"0.5732793",
"0.57063454",
"0.57058954",
"0.56953347",
"0.5693665",
"0.5691963",
"0.56880164",
"0.5683429",
"0.568202",
"0.5681433",
"0.5664637",
"0.5657155",
"0.5651137",
"0.5648625",
"0.5641452",
"0.562746",
"0.562746",
"0.56247216",
"0.56244355",
"0.56237125",
"0.5617534",
"0.5616167",
"0.56101596",
"0.5602057",
"0.5591364",
"0.5581137",
"0.5567349",
"0.55618095",
"0.5559825",
"0.55583185",
"0.55558306",
"0.5547681",
"0.55319965",
"0.5531628",
"0.55314547",
"0.5524122",
"0.5517683",
"0.55103266",
"0.5503734",
"0.5489828",
"0.54863167",
"0.5485893",
"0.5469996",
"0.54689085",
"0.5463553",
"0.5462339",
"0.5453888"
]
| 0.0 | -1 |
Set the router instance on the route. | public function setRouter(Router $router)
{
$this->router = $router;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set_router( sn\\base\\routing\\I_Router $router );",
"public function bootstrapRouter()\n {\n $this->router = new Router($this);\n }",
"public function SetRouter (\\MvcCore\\IRouter $router);",
"protected static function createRouter() {\n\t\tstatic::$router = new Router();\n\t}",
"public function setRouter($router)\n\t{\n\t\t$this->router = $router;\n\t}",
"protected function _initRouter()\n {\n $front = Zend_Controller_Front::getInstance();\n $router = $front->getRouter();\n \n // Add some routes\n $router->addRoute('routeId', new Zend_Controller_Router_Route('route/definition/:param'));\n //...\n \n // Returns the router resource to bootstrap resource registry\n return $router;\n }",
"public function setRoute(RouteService $router)\n {\n $this->router = $router;\n }",
"public static function router(){\n if(iRouter::callMade()) {\n viewManager::registerComponent(iRouter::$route);\n }\n }",
"public function & SetRouter (\\MvcCore\\IRouter & $router) {\n\t\t/** @var $this \\MvcCore\\Route */\n\t\t$this->router = & $router;\n\t\treturn $this;\n\t}",
"protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}",
"protected function _getRouter() {\n\t\treturn new Router;\n\t}",
"public function __construct()\n {\n $this->uri = Fly::app()->getUri();\n Fly::log('debug', \"Router Class Initialized\");\n $this->setRouting();\n }",
"public static function configure($closure) {\n self::$instance = $route = new Router();\n $closure($route);\n }",
"public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }",
"public function setRouter($var)\n {\n GPBUtil::checkString($var, True);\n $this->router = $var;\n\n return $this;\n }",
"public function withRouter(RouterInterface $router): void\n {\n $this->router = $router;\n }",
"public function setViaRouter($via_router);",
"public function setRouter(Router $router)\n {\n $this->router = $router;\n\n return $this;\n }",
"public function setupRoutes(Router $router)\n {\n\n }",
"public static function router() {\n\t\tif (!isset(self::$_router)) {\n\t\t\tself::$_router=new \\GO\\Base\\Router();\n\t\t}\n\t\treturn self::$_router;\n\t}",
"protected function __construct(Router $router)\n {\n $this->_router = $router;\n }",
"protected function overrideRouter()\n\t{\n\t\t$this->app['router'] = $this->app->share(function($app)\n\t\t{\n\t\t\treturn $app['api.router'];\n\t\t});\n\t}",
"private function get_router()\n\t{\n\t\treturn $this->m_router;\n\t}",
"public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }",
"protected function initRouter()\n {\n $xml = new \\DOMDocument;\n $xml->load(ROOT_DIR . '/configs/routing.xml');\n\n $routes = $xml->getElementsByTagName('route');\n\n $routeList = new RouteList();\n\n /** @var $DOMRoute DOMElement */\n foreach ($routes as $DOMRoute) {\n $attrController = $DOMRoute->getAttribute('controller');\n list($controller, $action) = explode('::', $attrController);\n\n /** @var Route $route */\n $route =\n new Route(\n $DOMRoute->getAttribute('path'),\n $controller,\n $action\n );\n\n if ($DOMRoute->hasChildNodes()) {\n /** @var \\DOMElement $node */\n $requirements = [];\n foreach ($DOMRoute->childNodes as $node) {\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"requirement\") {\n $requirements[$node->getAttribute('key')] = $node->nodeValue;\n }\n if ($node->nodeType === XML_ELEMENT_NODE && $node->nodeName === \"condition\") {\n $route->setCondition($node->nodeValue);\n }\n }\n $route->setRequirements($requirements);\n }\n\n $routeList->offsetSet(\n $DOMRoute->getAttribute('id'),\n $route\n );\n }\n\n $this->router = new Router($routeList);\n }",
"public static function set($route) {\n self::registerRoute($route);\n }",
"private function registerRouter($router) {\n\n if ($router !== null) {\n $this->queue[] = $router;\n }\n }",
"public function & SetRouteClass ($routerClass);",
"public function setRouter(Symfony\\Component\\Routing\\Router $router)\n {\n $this->router = $router;\n\n return $this;\n }",
"public function __construct(Router $router)\n {\n $this->router = $router;\n }",
"public function __construct(Router $router)\n {\n $this->router = $router;\n }",
"public function __construct(Router $router)\n {\n $this->router = $router;\n }",
"public function __construct(Router $router)\n {\n $this->router = $router;\n }",
"public function __construct(Router $router)\n {\n $this->router = $router;\n }",
"public function __construct(Router $router)\n {\n $this->router = $router;\n }",
"public final function & router( ZRouter & $a_router = null )\r\n\t{\r\n\t\tif( $a_router === null )\r\n\t\t\treturn $this->getRouter();\r\n\r\n\t\treturn $this->setRouter($a_router);\r\n\t}",
"public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }",
"protected function _createRouter(){\n\t\treturn new SimpleRouter();\n\t}",
"public function __construct(Router $router)\n {\n //Set the variables\n $this->router = $router;\n }",
"public function setRouter(RouteStackInterface $router)\r\n {\r\n $this->router = $router;\r\n return $this;\r\n }",
"public function & SetRouterClass ($routerClass);",
"public function router() \n\t{\n\t\treturn $this->router;\n\t}",
"public function registerRouter(): ApplicationInterface\n {\n $this->instance(RouterInterface::class, $this->router = new Router($this));\n\n return $this;\n }",
"public function setRoute($route) {\n\t\t$this->route = $route;\n\t}",
"public function & GetRouter () {\n\t\treturn $this->router;\n\t}",
"protected function setUp()\n {\n $this->object = new Router();\n }",
"public function getRouter(){\n return $this->router;\n }",
"public function createRouter(): IRouter;",
"public function router()\n {\n return $this->_router;\n }",
"public function __construct(Router $router)\n {\n $this->middleware('auth');\n $this->currentRoute = $router->currentRouteName();\n }",
"private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }",
"public function setRoute (string $route) : self {\n $this->route = $route;\n return $this;\n }",
"public function setRoute($route)\n {\n $this->route = $route;\n }",
"public function setRoute($route)\n {\n $this->route = $route;\n }",
"public function __construct(protected Router $router)\n {\n $this->router = $router;\n $this->prefix = config('social-accounts.route_prefix');\n }",
"protected function _initRouter()\n\t{\n\t\t$cfgPath = $this->getOption('configPath');\n\t\t$config = new Zend_Config_Ini($cfgPath . 'routes.ini', 'production');\n\n\t\t$front = Zend_Controller_Front::getInstance();\n\t\t$router = $front->getRouter();\n\t\t$router->addConfig($config, 'routes');\n\t}",
"private function initRouter()\n {\n $this->di->mapService('core.router', '\\Core\\Router\\Router');\n\n $this->router = $this->di->get('core.router');\n $this->router->setBaseUrl(BASEURL);\n $this->router->setParametersToTarget([\n 'app',\n 'controller',\n 'action'\n ]);\n $this->router->addMatchTypes([\n 'mvc' => '[A-Za-z0-9_]++'\n ]);\n\n // Generic routes\n $routes = [\n 'index' => [\n 'route' => '/[mvc:app]/[mvc:controller]',\n 'target' => [\n 'action' => 'index'\n ]\n ],\n 'action' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[mvc:action]'\n ],\n 'id' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]'\n ],\n 'child' => [\n 'route' => '/[mvc:app]/[mvc:controller]/[i:id]?/[mvc:action]/of/[i:id_parent]'\n ]\n ];\n\n foreach ($routes as $name => $route) {\n $this->router->map($route['method'] ?? 'GET|POST', $route['route'], $route['target'] ?? [], 'generic.' . $name);\n }\n }",
"public function get_router();",
"private function configureRouting()\n {\n // Setup the router.\n $router = new FastRoute([]);\n\n // Add routes.\n $router->addRoutes([\n new Route('/', Controller\\Home::class, 'home'),\n ]);\n\n // Set the router object.\n $this->setRouter($router);\n }",
"public function __construct(\\Symfony\\Component\\Routing\\Router $router) {\n //Set stuff\n $this->router = $router;\n\n //Init\n $routeParameters = array();\n }",
"public function __construct()\n {\n if (Registry::isKeySet('route')) {\n\n $this->route = Registry::get('route');\n\n }\n\n }",
"public function router()\n {\n // Initializing variables\n LSReqenvironment::initialize();\n }",
"public function __construct() {\n $this->setRouteData();\n }",
"public function setRoute(string $route): self \n {\n $this->route = $route;\n return $this;\n }",
"public function __construct()\n {\n $this->routes = array();\n }",
"protected function setUp() {\n $this->object = new MainSetupRouter;\n }",
"public function setRouter(RouteStackInterface $router)\n {\n $this->router = $router;\n\n return $this;\n }",
"public function __construct(Router $router)\n {\n parent::__construct($router);\n }",
"public function setRouter($sRouter) {\n\n // Set our router\n $this->sRouter = (string) $sRouter;\n\n // Return instance\n return $this;\n }",
"public function getRouter()\n {\n if (is_null($this->_router)) {\n $this->_router = new Router(['request' => $this->getRequest()]);\n }\n return $this->_router;\n }",
"public static function getInstance() {\n\n if (self::$instance == NULL) {\n self::$instance = new router();\n }\n return self::$instance;\n\n }",
"private function setup($Route) {\n $this->Route = $Route;\n \n \n }",
"public function getRouter()\n {\n return $this->router;\n }",
"public function getRouter()\n {\n return $this->router;\n }",
"public function set_route($route)\n {\n }",
"protected function setRoute(Route $route)\r\n {\r\n $this->route = $route;\r\n\r\n return $this;\r\n }",
"public function __construct(Router $router)\n {\n parent::__construct();\n\n $this->router = $router;\n }",
"public static function getRouter() {\n\t\tif (is_null(static::$router)) {\n\t\t\tstatic::createRouter();\n\t\t}\n\n\t\treturn static::$router;\n\t}",
"protected function setUp() { \n $dispatcherMock = $this->getMockBuilder('\\Router\\dispatcher')\n ->getMock();\n \n $this->object = new Router\\router();\n $this->object->setDispatcher($dispatcherMock); \n }",
"protected function routeMap()\n {\n $this->routCollection = new RouteCollection();\n\n foreach ($this->routers as $rout) {\n $this->routCollection->add(\n $rout['name'],\n new Route(\n $rout['route'],\n ['controller' => $rout['controller']]\n )\n );\n }\n\n return $this;\n }",
"private function __di_init_service_route () {\n $this->route = $this->constant(new GoDiService_Route_Property($this));\n }",
"private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }",
"protected function get410eb27931e780eeccc23e52a6c17e0e6e2e1827d28f90c4254c8f4111788d4e(): \\Viserio\\Component\\Routing\\Router\n {\n $this->services[\\Viserio\\Contract\\Routing\\Router::class] = $instance = new \\Viserio\\Component\\Routing\\Router(($this->services[\\Viserio\\Contract\\Routing\\Dispatcher::class] ?? $this->get584908ff464e7559233910f9ef37cbbc81593674d92ff5b6e814b73127f8e05c()));\n\n $instance->setContainer($this);\n\n return $instance;\n }",
"protected function get410eb27931e780eeccc23e52a6c17e0e6e2e1827d28f90c4254c8f4111788d4e(): \\Viserio\\Component\\Routing\\Router\n {\n $this->services[\\Viserio\\Contract\\Routing\\Router::class] = $instance = new \\Viserio\\Component\\Routing\\Router(($this->services[\\Viserio\\Contract\\Routing\\Dispatcher::class] ?? $this->get584908ff464e7559233910f9ef37cbbc81593674d92ff5b6e814b73127f8e05c()));\n\n $instance->setContainer($this);\n\n return $instance;\n }",
"public function __construct(){\n\n $this->routes = new \\SplObjectStorage();\n\n }",
"public function __construct()\n\n\t{\n $this->thisRoute = Route::current()->uri();\n\t}",
"public static function setRouting($path) {\n self::getInstance()->routingPath = $path;\n }",
"public static function init()\n {\n $instance = static::instance();\n\n return $instance\n ->setRouter(Router::instance())\n ->_handle();\n }",
"public function & GetRouter ();",
"public function set_matched_route($route)\n {\n }",
"public function __construct(AccessAwareRouterInterface $router) {\n $this->router = $router;\n }",
"private function __construct() {\n\n /**\n * Throw an exception if we are trying to create\n * a second instance of the router class.\n */\n if (self::$instance != null) {\n throw new Exception('Cannot create multiple router instances.');\n }\n\n $this->registry = Registry::getInstance();\n\n request::parseRequest();\n $this->route = request::getRoute();\n\n }",
"protected function makeRoute()\n {\n new MakeRoute($this, $this->files);\n }",
"public function setRoute(string $route): self\n {\n $this->route = $route;\n\n return $this;\n }",
"public function getRouter()\n\t{\n\t\treturn self::$router;\n\t}",
"public function setRoute($value)\n {\n return $this->set('Route', $value);\n }",
"public function setRoute($value)\n {\n return $this->set('Route', $value);\n }",
"protected function getMonolog_Logger_RouterService()\n {\n $this->services['monolog.logger.router'] = $instance = new \\Symfony\\Bridge\\Monolog\\Logger('router');\n\n $instance->pushHandler($this->get('monolog.handler.console'));\n $instance->pushHandler($this->get('monolog.handler.main'));\n\n return $instance;\n }",
"public function __construct(){\n $this->findRoute();\n }",
"public function __construct(Route $route) {\n $this->route = $route;\n }"
]
| [
"0.757606",
"0.7382648",
"0.7250746",
"0.7069904",
"0.70647365",
"0.6701671",
"0.669553",
"0.6676275",
"0.6669394",
"0.66394645",
"0.6594393",
"0.6496615",
"0.649143",
"0.64906824",
"0.6490444",
"0.64884293",
"0.64529693",
"0.642795",
"0.6426933",
"0.6418428",
"0.64146537",
"0.6402538",
"0.6395453",
"0.6390532",
"0.6349355",
"0.6337186",
"0.6310066",
"0.62866664",
"0.626991",
"0.62511086",
"0.62511086",
"0.62511086",
"0.62511086",
"0.62511086",
"0.62511086",
"0.6242566",
"0.6227058",
"0.6195216",
"0.6183845",
"0.61704",
"0.6156808",
"0.61512184",
"0.61490303",
"0.6148501",
"0.61482084",
"0.6133203",
"0.6127115",
"0.6125413",
"0.612328",
"0.609494",
"0.6082943",
"0.6073482",
"0.6072375",
"0.6072375",
"0.607044",
"0.6061019",
"0.6053486",
"0.6044673",
"0.60432136",
"0.6022148",
"0.6014032",
"0.6005296",
"0.6003889",
"0.6003416",
"0.59841305",
"0.59839404",
"0.59797686",
"0.59768134",
"0.5975675",
"0.59738004",
"0.596481",
"0.5955927",
"0.5953977",
"0.5953977",
"0.59466416",
"0.59408253",
"0.59342116",
"0.59173775",
"0.5913192",
"0.5901894",
"0.58986974",
"0.5891873",
"0.58793235",
"0.58793235",
"0.5857979",
"0.5856183",
"0.5854504",
"0.5852483",
"0.5844942",
"0.5842738",
"0.5833762",
"0.58332026",
"0.5831561",
"0.582773",
"0.5813974",
"0.5810012",
"0.58094025",
"0.57944685",
"0.5787236",
"0.5786293"
]
| 0.65719175 | 11 |
Parse the route action into a standard array. | public function parseAction($action)
{
return RouteAction::parse($this->uri, $action);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getRoute() {\n $path = $_SERVER['PATH_INFO'];\n\n $parts = explode('/', trim($path, '/'));\n $action = array_shift($parts);\n $this->uri_params = $parts;\n\n if (!$action) $action = 'index';\n $action .= 'Action';\n return array($this, $action);\n }",
"public function parseAction($action) {\n if ( ! strstr($action, '@')) {\n return [$action, 'index'];\n }\n\n return [\n substr($action, 0, strpos($action, '@')),\n substr($action, strpos($action, '@') + 1),\n ];\n }",
"protected function parseRoute()\n { \n $matches = explode(\"/\", $this->route);\n\n $pattern = '/^([a-zA-Z0-9_-])+$/';\n \n if (preg_match($pattern, $matches[0])) {\n $this->controller = ucfirst(strtolower($matches[0]));\n }\n\n if (!empty($matches[1]) && preg_match($pattern, $matches[1])) {\n $this->action = $this->convert($matches[1]);\n }\n }",
"protected function parseAction($action) {\n if (is_string($action)) {\n return ['uses' => $action];\n } elseif (! is_array($action)) {\n return [$action];\n }\n\n return $action;\n }",
"public function parseURL() : array\n {\n if ($GLOBALS['config']['useUrlParsing']) {\n \n /**\n * @todo Create a parsing of url when the index is switched off\n */\n $this->_routes = '';\n } else {\n try {\n $this->_routes = $this->parseParams();\n \n if (!$this->_routes) return $this->indexPage;\n \n $path = explode('/', $this->_routes['r']);\n $controller = 'App\\\\Controllers\\\\'.ucfirst($path[0]) . 'Controller';\n $action = 'action'. ucfirst($path[1]);\n return [$controller, $action];\n } catch (Exception $ex) {\n \n }\n }\n }",
"private function parseActions()\n {\n // default controller actions\n $actions = array_keys($this->getObject()->actions());\n $actionMethods = array_filter($this->reflection->getMethods(),\n function ($method) {\n // should match all methods named actionSomeAction\n return preg_match('/action([A-Z]{1}[a-zA-Z]+)/', $method->name, $matches);\n });\n $actionMethods = array_map(function ($method) {\n return Inflector::slug(str_replace('action', '', $method->name));\n }, $actionMethods);\n $actionMethods = array_merge($actions, $actionMethods);\n\n return array_intersect(['index', 'view', 'create', 'update', 'delete', 'options'], $actionMethods);\n }",
"public static function parseRoute($route)\n {\n $method = '';\n $controller = '';\n $route = explode('/', $route);\n\n if (isset($route[0])) {\n $controller = $route[0];\n }\n if (isset($route[1])) {\n $method = $route[1];\n }\n\n return [$controller, $method];\n }",
"private function parseRoutes()\n\t{\n\t\t@list($controller, $action, $params) = explode('/', $this->routes, 3);\n\t\tif (isset($controller)) {\n\t\t\t$this->setController($controller);\t\n\t\t}\n\t\tif (isset($action)) {\n\t\t\t$this->setAction($action);\n\t\t}\n\t\tif (isset($params)) {\n\t\t\t$this->setParams(explode('/', $params));\n\t\t}\n\t}",
"private function getActionRoutes() : array {\n return [\n 'session_entity.close',\n 'session_entity.download_answers',\n 'la_pills_timer.la_pills_timer_controller_sessionTimer',\n 'la_pills_timer.la_pills_timer_controller_stopAll',\n 'la_pills_timer.la_pills_timer_controller_exportTimers', // This produces two events one of those AJAX preflight and the other one POST download event if that is possible\n 'la_pills_timer.la_pills_timer_controller_ajaxTimerActiveInactive',\n 'la_pills_quick_feedback.la_pills_quick_feedback_controller_ajaxQuestionActiveInactive',\n ];\n }",
"function extract_action_and_args($string) {\n\n if ('' === $string) {\n return array('index', array(), NULL);\n }\n\n // find optional file extension\n $format = NULL;\n if (preg_match('/^(.*[^\\/.])\\.(\\w+)$/', $string, $matches)) {\n list($_, $string, $format) = $matches;\n }\n\n // TODO this should possibly remove empty tokens\n $args = explode('/', $string);\n $action = array_shift($args);\n return array($action, $args, $format);\n }",
"public static function getRoute()\n {\n global $req;\n\n $route = [];\n $uri = trim($req->getPathInfo(), '/');\n $uri = explode('/', $uri);\n\n $route['base'] = $uri[0];\n $route['section'] = empty($uri[1]) ? '' : $uri[1];\n $route['action'] = empty($uri[2]) ? '' : $uri[2];\n $route['page'] = $uri[count($uri)-1];\n\n return $route;\n }",
"protected static function requestRoute() {\n $route = [];\n\n $currentUrlOptions = parse_url($_SERVER['REQUEST_URI']);\n $fullUri = $currentUrlOptions['path'];\n $prefixLen = strlen(self::$uriPrefix);\n if ($fullUri == self::$uriPrefix){ //all default\n $route['controller'] = '';\n $route['action'] = '';\n } elseif (substr($fullUri, 0, $prefixLen) === self::$uriPrefix) {\n $uri = substr($fullUri, $prefixLen);\n $parts = explode('/', rtrim($uri, '/'));\n $route['controller'] = ucfirst($parts[0]);\n $route['action'] = isset($parts[1]) ? ucfirst($parts[1]) : '';\n } else {\n //do nothing\n }\n\n return $route;\n }",
"private static function parseAction(Route $route, Redirection $redirection): array\n {\n return RouteAction::parse($route->uri(), function () use ($redirection, $route) {\n event(new RouteRedirected($redirection));\n\n return redirect()->to(\n $redirection->getResolvedUrl(),\n $redirection->getStatus()\n );\n });\n }",
"private function normalizeAction($raw)\n {\n $action = array();\n $action['id'] = strval($raw->Name);\n $action['appId'] = $this->config->application->appId;\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n $action[$name] = $value;\n }\n return $action;\n }",
"function parseURL($url){\r\n //Explodeo la url para convertirla en un array\r\n $urlExploded = explode('/' ,$_GET['action']);\r\n //Creo un nuevo array y en la posición 'action' le asigno la acción recibida\r\n $arrayReturn[ConfigApp::$ACTION] = $urlExploded[0];\r\n //Si esta seteado, llama al metodo array_slice(), lo que hace este metodo es crear un arrego a partir de una posición dada, en este caso desde la posición 1\r\n $arrayReturn[ConfigApp::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded, 1) : null;\r\n\r\n return $arrayReturn;\r\n }",
"protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }",
"public function actions(): array;",
"function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }",
"public function getListRoutes()\r\n {\r\n $result = array();\r\n \r\n if (count( $this->routes ))\r\n {\r\n foreach ( $this->routes as $act )\r\n {\r\n \r\n $route_str = '';\r\n if (isset( $this->default_params['url_prefix'] ) && ! empty( $this->default_params['url_prefix'] ))\r\n {\r\n $route_str = $this->default_params['url_prefix'];\r\n }\r\n \r\n if (is_array( $act['type'] ))\r\n {\r\n $route_str = implode( '|', $act['type'] ) . ' ' . $route_str;\r\n }\r\n else\r\n {\r\n $route_str = $act['type'] . ' ' . $route_str;\r\n }\r\n $route_str .= $act['route'];\r\n \r\n if (isset( $act['params']['ajax'] ) && (bool) ($act['params']['ajax']))\r\n {\r\n $route_str .= ' [ajax]';\r\n }\r\n \r\n $action_str = '';\r\n if (isset( $act['params']['namespace'] ) && ! empty( $act['params']['namespace'] ))\r\n {\r\n $action_str = (string) $act['params']['namespace'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['namespace'] ) && ! empty( $this->default_params['namespace'] ))\r\n {\r\n $action_str = $this->default_params['namespace'];\r\n }\r\n }\r\n $action_str .= '\\\\';\r\n \r\n if (isset( $act['params']['controller'] ))\r\n {\r\n $action_str .= (string) $act['params']['controller'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['controller'] ) && ! empty( $this->default_params['controller'] ))\r\n {\r\n $action_str .= $this->default_params['controller'];\r\n }\r\n }\r\n $action_str .= '->' . (string) $act['params']['action'];\r\n \r\n $kbps = $this->default_params['kbps'];\r\n if( isset( $act['params']['kbps'] ) ){\r\n \t$kbps = $act['params']['kbps'];\r\n }\r\n $ttl = $this->default_params['ttl'];\r\n if( isset( $act['params']['ttl'] ) ){\r\n \t$ttl = $act['params']['ttl'];\r\n }\r\n \r\n $route = new \\stdclass();\r\n $route->pattern = $route_str;\r\n $route->handler = $action_str;\r\n $route->ttl = $ttl;\r\n $route->kbps = $kbps;\r\n $result[] = $route;\r\n }\r\n }\r\n \r\n return $result;\r\n }",
"protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}",
"public function getRouteInfo()\r\n {\r\n $rawRoutes = $this->getRoutes();\r\n $routes = array();\r\n foreach ($rawRoutes as $route => $params){\r\n $defaults = $params->getDefaults();\r\n if (isset($defaults['_controller']))\r\n {\r\n $controllerAction = explode(':', $defaults['_controller']);\r\n $controller = $controllerAction[0];\r\n $action = isset($controllerAction[2]) ? $controllerAction[2] : $controllerAction[1];\r\n\r\n if (!isset($routes[$controller])) {\r\n $routes[$controller] = array();\r\n }\r\n\r\n $routes[$controller][$action] = array(\r\n 'route' => $route,\r\n 'controller' => $controller,\r\n 'action' => $action,\r\n );\r\n }\r\n }\r\n return $routes;\r\n }",
"public function parseRoute($route) {\n\t\tif ($route) {\n\t\t\t$request = explode('/',$route);\n\t\t\tif (is_array($request)) {\n\t\t\t\t$request_type = array_shift($request);\n\t\t\t\t$request_options = $request;\n\t\t\t\tif ($request_type == 'writing') {\n\t\t\t\t\t$request_type = 'view';\n\t\t\t\t}\n\n\t\t\t\t$use_json = false;\n\t\t\t\t// test for JSON request\n\t\t\t\tif ($request_options) {\n\t\t\t\t\tif (count($request_options)) {\n\t\t\t\t\t\tif (strpos($request_options[0],'.json')) {\n\t\t\t\t\t\t\t// found a trailing.json\n\t\t\t\t\t\t\t$request_options[0] = str_replace('.json','',$request_options[0]);\n\t\t\t\t\t\t\t$use_json = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (strpos($request_type,'.json')) {\n\t\t\t\t\t\t// found a trailing.json\n\t\t\t\t\t\t$request_type = str_replace('.json','',$request_type);\n\t\t\t\t\t\t$use_json = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($use_json) {\n\t\t\t\t\t$this->setJSONHeaders();\n\t\t\t\t}\n\n\t\t\t\treturn array(\n\t\t\t\t\t\"type\" => $request_type,\n\t\t\t\t\t\"options\" => $request_options,\n\t\t\t\t\t\"json\" => $use_json\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function getRouteArray()\n{\n\t// Get the current route as a string from the getRoute function.\n\t$route = getRoute();\n\n\t// Remove the first directory separator so we dont get an array with\n\t// an empty string as the first value in the route array when we\n\t// explode it.\n\t$route = ltrim($route, '/');\n\n\t// Divide the route into separate parts divided by the directory seperator\n\t// as the delimiter. The DIRECTORY_SEPARATOR is the same as typing '/' or\n\t// '\\' depending on the current filesystem.\n\t$route = explode(DIRECTORY_SEPARATOR, $route);\n\n\treturn $route;\n}",
"public static function getRoutes()\n {\n $a = array();\n $router = ROUTER::init();\n foreach ($router->assigns as $ass)\n {\n if (isset($ass['module']) and isset($ass['action']))\n {\n $a[] = array('route' => $ass['route'], 'execute' => $router->current_dir . '/' . $ass['module'] . '/' . $ass['action'] . '.action.php');\n }\n elseif (isset($ass['function']))\n {\n $a[] = array('route' => $ass['route'], 'function' => $ass['function']);\n }\n else\n {\n /*do nothing*/;\n }\n }\n return $a;\n }",
"public function dumpRoute()\n {\n $route = substr($this->getRouteString(), 1);\n return explode(\"/\", $route);\n }",
"protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }",
"public function parse(string $url, string $method = ''): ?array\n {\n $params = parent::parse($url, $method);\n if (!$params) {\n return null;\n }\n if (!empty($params['controller'])) {\n $params['controller'] = Inflector::camelize($params['controller'], '_');\n }\n if (!empty($params['plugin'])) {\n $params['plugin'] = $this->_camelizePlugin($params['plugin']);\n }\n if (!empty($params['action'])) {\n $params['action'] = Inflector::variable(str_replace(\n '-',\n '_',\n $params['action']\n ));\n }\n\n return $params;\n }",
"public function getActionsForRoute($route_appears);",
"function actions()\n {\n return[];\n }",
"private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }",
"public static function parseRoute($p_request)\n {\n // split the requested path by slash\n $routeSegments = explode('/', trim($p_request->getPathInfo(), '/'));\n\n if (empty($routeSegments[0])) { // Route is just forward-slash\n $mainRoute = self::DEFAULT_ROUTE;\n } else { // determine the canonical route being requested\n $mainRoute = self::translateRoute(\n self::sanitizeRoute($routeSegments[0])\n );\n }\n\n // if there are 2 route segments use the second one as the command\n if (isset($routeSegments[1]) && !empty($routeSegments[1])) {\n $command = $routeSegments[1];\n } else { // without a 2nd route segment, look for command in the input\n $command = (string)RequestWrapper::getPostOrGet(self::COMMAND_PARAM);\n }\n\n if (empty($command)) {\n if (isset(self::$routes[$mainRoute]['actions'][self::DEFAULT_COMMAND])) {\n $command = self::$routes[$mainRoute]['actions'][self::DEFAULT_COMMAND];\n } else {\n $command = self::DEFAULT_ACTION;\n }\n }\n\n return [$mainRoute, $command];\n }",
"function parsePath($url)\n{\n $vars = array();\n\n if (preg_match_all('#\\{(\\w+)\\}#', $url, $matches)) {\n // First we convert the action route with its {variable_name} format to a preg-able string...\n for ($i=0; $i<count($matches[0]); $i++) {\n $str = $matches[0][$i];\n $vars[] = $matches[1][$i]; // Get the list of variables in the route into a different array.\n }\n\n // // Match - assign the values to the assoc array for return.\n // $url_variables = array();\n // for($i=0; $i<count($vars); $i++) {\n // \t$url_variables[$vars[$i]] = $route_matches[$i+1][0];\n // }\n }\n\n return $vars;\n}",
"private function parseSegments(String $internalRoute) {\n $segments = explode('/', $internalRoute);\n $controllerName = ucfirst(array_shift($segments)) . 'Controller';\n $action = 'action' . ucfirst(array_shift($segments));\n return [$controllerName, $action, $segments];\n }",
"public function useRoute(){\n\t\t\t$routeParts = explode(\"@\", $this->matchingRoute->location);\n\t\t\treturn [\"controller\" => ucfirst($routeParts[0]), \"method\" => $routeParts[1]];\n\t\t}",
"private function setGoalsArray($action) {\r\n $post_array = json_decode($this->requestParameters);\r\n $type = array_search($post_array->type, $this->type_array);\r\n $name = array_key_exists('name', $post_array) ? $post_array->name : '';\r\n $param = 'NA';\r\n\r\n if ($action == 'POST' && !$type) {\r\n throw new Exception('type: \"' . $post_array->type . '\"', 400004);\r\n }\r\n\r\n if (in_array($type, $this->param_types) && $this->projecttype != OPT_TESTTYPE_TEASER) {\r\n $param = array_key_exists('param', $post_array) ? $post_array->param : FALSE;\r\n if (!$param || trim($param) == '') {\r\n throw new Exception('For this goal type, the field \"param\" is mandatory.', 400600);\r\n }\r\n }\r\n\r\n return array(\r\n 'type' => $type,\r\n 'arg1' => $param,\r\n 'name' => $name,\r\n );\r\n }",
"public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }",
"public function getActions(): array;",
"public function getRoutes(){\n return CoreArrayUtils::asArray(CoreControllerObject::buildAction('/^\\/email\\/activate\\/([^\\/]+)\\/?$/i', __CLASS__, CoreControllerObject::MATCH_TYPE_REGEX, CoreControllerObject::REQUEST_GET));\n }",
"public function getRoutes()\n {\n $routes = array();\n array_push($routes, CoreControllerObject::buildAction('/admin/performanceutils', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n return $routes;\n }",
"protected function parseUri()\n {\n $path = trim(parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH), \"/\");\n $pathInfo = explode(\"/\", $path, 3);\n $this->params = [];\n $this->action = 'index';\n $this->controller = self::DEFAULT_CONTROLLER;\n\n if (count($pathInfo) >= 1 && $pathInfo[0] !== '') {\n if (isset($pathInfo[0])) {\n $this->setController($pathInfo[0]);\n }\n\n if (isset($pathInfo[1])) {\n $this->setAction($pathInfo[1]);\n }\n\n if (isset($pathInfo[2])) {\n $this->params = [$pathInfo[2]];\n }\n }\n }",
"public function resolveAction(&$segments)\n {\n \n echo $this->action = array_shift($segments); //array_shift me devuelve el primer segmento del array\n \n if (empty($this->action))\n \t{\n \n $this->action = $this->defaultAction; //index\n\n \t}\n }",
"public static function check() : array\n\t{\n\t\tforeach(RegistryRecords::routes() as $key => $array)\n\t\t{\n\t\t\tself::$RouteURI = $array;\n\n\t\t\tif($array[\"METHOD\"] !== RegistryRecords::request()['METHOD'])\n\t\t\t\tcontinue;\n\n\t\t\tif(self::check_uri($array['URI']))\n\t\t\t\treturn $array;\n\t\t\telse\n\t\t\t\tcontinue;\n\t\t}\n\n\t\treturn [];\n\t}",
"static protected function get_resource_actions(): array\n\t{\n\t\treturn [\n\n\t\t\tself::ACTION_INDEX => [ '/{name}', Request::METHOD_GET ],\n\t\t\tself::ACTION_NEW => [ '/{name}/new', Request::METHOD_GET ],\n\t\t\tself::ACTION_CREATE => [ '/{name}', Request::METHOD_POST ],\n\t\t\tself::ACTION_SHOW => [ '/{name}/{id}', Request::METHOD_GET ],\n\t\t\tself::ACTION_EDIT => [ '/{name}/{id}/edit', Request::METHOD_GET ],\n\t\t\tself::ACTION_UPDATE => [ '/{name}/{id}', [ Request::METHOD_PUT, Request::METHOD_PATCH ] ],\n\t\t\tself::ACTION_DELETE => [ '/{name}/{id}', Request::METHOD_DELETE ]\n\n\t\t];\n\t}",
"public function actions(): array\n {\n /**\n * @var string\n */\n $cmd = request('cmd', '');\n\n return [\n // new Actions\\FullcalendarAction(),\n // new Actions\\TestAction(),\n new ArtisanAction($cmd),\n ];\n }",
"public function action()\n {\n if (!$this->action) {\n $this->action = array();\n foreach (monsterToAction::where('mid', '=', $this->id)->get() as $a) {\n $this->action[] = array(\n 'name' => $a->name,\n 'desc' => $a->description,\n 'dc' => array(\n 'attr' => $a->dc,\n 'beat' => $a->dcv,\n 'success' => $a->dc_success,\n ),\n 'damage' => array(\n 'type' => $a->damage_type,\n 'damage' => $a->damage,\n 'roll_bonus' => $a->bonus,\n ),\n 'legendery_action' => ($a->legendery) ? TRUE : FALSE,\n );\n }\n }\n return $this->action;\n }",
"public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}",
"public function get_actions(): array;",
"private function decodeControler(string $route): iterable {\n\n $con = explode(\"@\", $route);\n\n return [\n \"controller\" => $con[0],\n \"action\" => $con[1],\n ];\n }",
"protected function getActions() {}",
"function get_actions_data() {\n\t\t$actions_data = $this->get_meta( 'actions' );\n\t\treturn is_array( $actions_data ) ? array_map( [ $this, 'format_action_fields' ], $actions_data ) : [];\n\t}",
"public function matchAndParse($url) {\n $httpVerb = $_SERVER['REQUEST_METHOD'];\n $matchResult = [];\n $matchResult['args'] = [];\n $foundFlag = false;\n \n // Search for matching path\n foreach($this->routes as $pathPattern => $value) {\n if(preg_match($pathPattern, $url, $matches) && isset($value[$httpVerb])) {\n $foundFlag = true;\n break;\n }\n }\n \n if(!$foundFlag) {\n return false;\n }\n //Parse controller and action\n $controller = $this->routes[$pathPattern][$httpVerb]['controller'];\n $matchResult['controller'] = ($controller[0] == '$') ? $matches[ltrim($controller, '$')] : $controller;\n \n $action = $this->routes[$pathPattern][$httpVerb]['action'];\n $matchResult['action'] = ($action[0] == '$') ? $matches[ltrim($action, '$')] : $action;\n \n $matchResult['args'] = $matches;\n \n //If action is a keyword ('before' or 'after') throw exception\n if($matchResult['action'] === 'before' || $matchResult['action'] === 'after') {\n throw new Exception(\"Action cannot be 'before' or 'after'\");\n }\n \n return $matchResult;\n }",
"public static function decode ($action_string) {\n // Check if the subaction needs any decoding.\n $decoded = explode(ActionLink::SEPARATOR, $action_string);\n\n // Put data in appropriate place.\n $action = array(\n 'action' => '',\n 'subaction' => '',\n );\n if (isset($decoded[0])) $action['action'] = $decoded[0];\n if (isset($decoded[1])) $action['subaction'] = $decoded[1];\n if (!empty($decoded[2])) $action['options'] = explode(ActionLink::OPTION_SEPARATOR, $decoded[2]);\n\n return $action;\n }",
"public function getRoutes(): array\r\n {\r\n return [\r\n [\r\n 'name' => 'exclusive/json/messagetutor',\r\n 'path' => '/exclusive/json/mT',\r\n 'middleware' => Action\\Json\\MessageTutor::class,\r\n 'allowed_methods' => ['POST']\r\n ],\r\n [\r\n 'name' => 'exclusive/json/certificateprintfree',\r\n 'path' => '/exclusive/json/cPf',\r\n 'middleware' => Action\\Json\\CertificatePrintFree::class,\r\n 'allowed_methods' => ['POST']\r\n ]\r\n ];\r\n }",
"function parseAction()\n {\n $action_regexs = array(\n 'REGEX_ACTION' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Folds|Checks|Calls|Bets|Raises|All-in|All-in\\(raise\\)|Hand result(-Side pot)?)( \\((auth|timeout|disconnect)\\))?( \\$(?<chips>[0-9.]+)( to \\$(?<to_chips>[0-9.]+))?)?$/',\n 'REGEX_RETURN' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Return) uncalled portion of bet \\$(?<chips>[0-9.]+)$/',\n 'REGEX_NOSHOW' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Does not show|Mucks|Folds)( & shows)? \\[(?<card1>[2-9TJQKA][cdhs]) (?<card2>[2-9TJQKA][cdhs])\\]( Show1 \\[(?<show1>[2-9TJQKA][cdhs])\\])?( \\((?<ranking>.*)\\))?$/',\n 'REGEX_SHOWDOWN' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Showdown) \\[(?<card1>[2-9TJQKA][cdhs]) (?<card2>[2-9TJQKA][cdhs]) (?<card3>[2-9TJQKA][cdhs]) (?<card4>[2-9TJQKA][cdhs]) (?<card5>[2-9TJQKA][cdhs])\\] \\((?<ranking>.*)\\)$/',\n // ignore, not an actual showdown\n 'REGEX_SHOWDOWN_NOT' => '/^(?<player>.*?)(?<me> \\[ME\\])? : (?<action>Showdown\\(High Card\\))$/',\n );\n\n $state_property = array(\n self::STATE_CARDS => 'preflop',\n self::STATE_FLOP => 'flop',\n self::STATE_TURN => 'turn',\n self::STATE_RIVER => 'river',\n );\n $prop_name = $state_property[$this->state];\n\n foreach ($action_regexs as $regex) {\n if (preg_match($regex, $this->line, $this->hand->{$prop_name}['action'][])) {\n return true;\n }\n }\n\n throw new IcFileException('Unexpected action line');\n }",
"#[Pure]\n public function getActionArguments() : array\n {\n return $this->actionArguments;\n }",
"protected function getPathInfo()\r\n {\r\n\t\t// Init var\r\n\t\t$Result = array('','','');\r\n\t\t$tabStr = explode(PARAM_KERNEL_ROUTE_SEPARATOR, $this->strPath);\r\n\t\t$strModPath = '';\r\n\t\t$strClassNm = '';\r\n\t\t$strActionNm = '';\r\n\t\t\r\n\t\tif((count($tabStr) == 1) || (count($tabStr) == 2))\r\n\t\t{\r\n\t\t\t// Set path and action\r\n\t\t\t$strModPath = trim($tabStr[0]);\r\n\t\t\tif(count($tabStr) == 2) // Get\r\n\t\t\t{\r\n\t\t\t\t$strActionNm = trim($tabStr[1]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Set class name\r\n\t\t\tif\r\n\t\t\t(\r\n\t\t\t\t(strpos($strModPath, '/') !== false) && \r\n\t\t\t\t(strpos($strModPath, '.') !== false) && \r\n\t\t\t\t(strlen($strModPath)>2)\r\n\t\t\t)\r\n\t\t\t{\r\n\t\t\t\t$tabStr = explode('/', $strModPath);\r\n\t\t\t\t$str = $tabStr[count($tabStr)-1];\r\n\t\t\t\t$tabStr = explode('.', $str);\r\n\t\t\t\t$strClassNm = trim($tabStr[0]);\r\n\t\t\t\t\r\n\t\t\t\t$ToolboxNameSpace = $this->getToolboxNameSpace();\r\n\t\t\t\t$strNS = $ToolboxNameSpace::getNameSpaceReprocess(PARAM_KERNEL_PATH_ROOT.'/'.$strModPath);\r\n\t\t\t\t$strClassNm = $strNS.$strClassNm;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check Path\r\n\t\t\tif(file_exists(PARAM_KERNEL_PATH_ROOT.'/'.$strModPath))\r\n\t\t\t{\r\n\t\t\t\t$Result[0] = $strModPath;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Put other infos\r\n\t\t\t$Result[1] = $strClassNm;\r\n\t\t\t$Result[2] = $strActionNm;\r\n\t\t}\r\n\t\t\r\n\t\t// Return result\r\n\t\treturn $Result;\r\n }",
"public function getRoutes()\n\t{\n\t\t$routes = array();\n\t\tarray_push($routes, CoreControllerObject::buildAction('/login', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n\t\treturn $routes;\n\t}",
"public function ParseRequestUri(){\n $uri_arr = explode('/',$this->request_uri);\n $this->controller_name = empty($uri_arr[2]) ? 'top' : $uri_arr[2];\n $this->action_name = empty($uri_arr[3]) ? 'index' : $uri_arr[3];\n }",
"protected function parseActionType($className)\n { if ( preg_match('/delete|update|add(?=_)/i', $className, $matches) ) \n {\n $tableAction = 'table';\n $tableEvent = strtolower($matches[0]);\n } \n else \n {\n $tableAction = $tableEvent = 'create';\n }\n\n return array($tableAction, $tableEvent);\n }",
"private static function get_full_action($action, $args, $matches=array() )\n\t{\n\t\t// some routes don't specify the controller (e.g. errors), hence the check for the -> and assignment of null to the controller part otherwise\n\t\tlist($a['controller_name'], $a['method'], $a['protocol'], $a['args']) = array_merge(\n\t\t\t((preg_match('/^\\p{L}[\\p{L}\\p{N}_]+\\-\\>\\p{L}[\\p{L}\\p{N}_]+$/', $action) )?explode('->', $action):array(null, $action)),\n\t\t\tarray(\n\t\t\t\tstrtolower($_SERVER['REQUEST_METHOD']),\n\t\t\t\t$args\n\t\t\t)\n\t\t);\n\t\t\n\t\t// individual segments of the URL have been matched by a route are and have been requested by the route to be passed on as arguments to the controller\n\t\tif(!empty($args) && count($matches) > 1 )\n\t\t{\n\t\t\t$a['args'] = (array)$a['args'];\n\n\t\t\t// go through array of arguments that are being passed and check them for placeholders ($1, $2, etc)\n\t\t\tforeach($a['args'] as $key => &$arg)\n\t\t\t{\n\t\t\t\t// the placeholder check\n\t\t\t\tif(preg_match_all('/\\$(\\d+)/', $arg, $arg_matches) && !empty($arg_matches[1]) )\n\t\t\t\t{\n\t\t\t\t\t// now go through the matched arguments and see if they are valid, and replace each one with the part of the route matched by the regex in the routes file\n\t\t\t\t\tforeach($arg_matches[1] as $arg_key => $arg_m)\n\t\t\t\t\t{\n\t\t\t\t\t\t$arg_m = intval($arg_m);\n\t\t\t\t\t\tif(!$arg_m || !isset($matches[$arg_m]) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$arg = str_replace($arg_matches[0][$arg_key], $matches[$arg_m], $arg);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}//end foreach\n\t\t}//end if\n\t\t\n\t\t// remove any unmatched arguments still left \n\t\tif(!empty($a['args']))\n\t\t{\n\t\t\t$a['args'] = (array)$a['args'];\n\t\t\t\n\t\t\tforeach($a['args'] as $key => &$arg)\n\t\t\t{\n\t\t\t\t$arg = preg_replace('/\\$\\d+/', '', $arg);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// finally convert the return back to the requested format\n\t\tif(is_string($args) && is_array($a['args']) )\n\t\t\t$a['args'] = reset($a['args']);\n\t\t\n\t\treturn $a;\n\t}",
"public static function parseReverseSymmetryData(): array\n {\n return [\n ['/controller/action'],\n ['/controller/action/param'],\n ['/controller/action?param1=value1¶m2=value2'],\n ['/controller/action/param?param1=value1'],\n ];\n }",
"function parse($url) {\r\n\t\tif ($url && ('/' != $url[0])) {\r\n\t\t\tif (!defined('SERVER_IIS')) {\r\n\t\t\t\t$url = '/' . $url;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out = array();\r\n\t\t$r = null;\r\n\t\t$default_route = array('/:controller/:action/* (default)',\r\n\t\t\t\t\t\t\t\t'/^(?:\\/(?:([a-zA-Z0-9_\\\\-\\\\.\\\\;\\\\:]+)(?:\\\\/([a-zA-Z0-9_\\\\-\\\\.\\\\;\\\\:]+)(?:[\\\\/\\\\?](.*))?)?))[\\\\/]*$/',\r\n\t\t\t\t\t\t\t\tarray('controller', 'action'), array());\r\n\r\n\t\tif (defined('CAKE_ADMIN') && $this->__admin != null) {\r\n\t\t\t$this->routes[]=$this->__admin;\r\n\t\t\t$this->__admin =null;\r\n\t\t}\r\n\t\t$this->connect('/bare/:controller/:action/*', array('bare' => '1'));\r\n\t\t$this->connect('/ajax/:controller/:action/*', array('bare' => '1'));\r\n\r\n\t\tif (defined('WEBSERVICES') && WEBSERVICES == 'on') {\r\n\t\t\t$this->connect('/rest/:controller/:action/*', array('webservices' => 'Rest'));\r\n\t\t\t$this->connect('/rss/:controller/:action/*', array('webservices' => 'Rss'));\r\n\t\t\t$this->connect('/soap/:controller/:action/*', array('webservices' => 'Soap'));\r\n\t\t\t$this->connect('/xml/:controller/:action/*', array('webservices' => 'Xml'));\r\n\t\t\t$this->connect('/xmlrpc/:controller/:action/*', array('webservices' => 'XmlRpc'));\r\n\t\t}\r\n\t\t$this->routes[] = $default_route;\r\n\r\n\t\tif (strpos($url, '?') !== false) {\r\n\t\t\t$url = substr($url, 0, strpos($url, '?'));\r\n\t\t}\r\n\r\n\t\tforeach($this->routes as $route) {\r\n\t\t\tlist($route, $regexp, $names, $defaults) = $route;\r\n\r\n\t\t\tif (preg_match($regexp, $url, $r)) {\r\n\t\t\t\t// remove the first element, which is the url\r\n\t\t\t\tarray_shift ($r);\r\n\t\t\t\t// hack, pre-fill the default route names\r\n\t\t\t\tforeach($names as $name) {\r\n\t\t\t\t\t$out[$name] = null;\r\n\t\t\t\t}\r\n\t\t\t\t$ii=0;\r\n\r\n\t\t\t\tif (is_array($defaults)) {\r\n\t\t\t\t\tforeach($defaults as $name => $value) {\r\n\t\t\t\t\t\tif (preg_match('#[a-zA-Z_\\-]#i', $name)) {\r\n\t\t\t\t\t\t\t$out[$name] = $value;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$out['pass'][] = $value;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach($r as $found) {\r\n\t\t\t\t\t// if $found is a named url element (i.e. ':action')\r\n\t\t\t\t\tif (isset($names[$ii])) {\r\n\t\t\t\t\t\t$out[$names[$ii]] = $found;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// unnamed elements go in as 'pass'\r\n\t\t\t\t\t\t$found = explode('/', $found);\r\n\t\t\t\t\t\t$pass = array();\r\n\t\t\t\t\t\tforeach($found as $key => $value) {\r\n\t\t\t\t\t\t\tif ($value == \"0\") {\r\n\t\t\t\t\t\t\t\t$pass[$key] = $value;\r\n\t\t\t\t\t\t\t} elseif ($value) {\r\n\t\t\t\t\t\t\t\t$pass[$key] = $value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$out['pass'] = $pass;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$ii++;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $out;\r\n\t}",
"public function dispatch()\n\t{\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\tif($method == 'OPTIONS')\n\t\t{\n\t\t\treturn $this->handle(function() {\n\t\t\t\t$response = array('options' => 'Defined!');\n\t\t\t\treturn [200, $response];\n\t\t\t});\n\t\t}\n\n\t\t$uri = $_SERVER['REQUEST_URI'];\n\n\t\t$end = strpos($uri, '?');\n\t\t$path = substr($uri, 0, $end ? $end : strlen($uri));\n\n\t\t$action = NULL;\n\t\t// Match directly, we skip it.\n\t\tif(!empty($this->_routes[$method][$path]))\n\t\t{\n\t\t\t$action = $this->_routes[$method][$path];\n\t\t}\n\n\t\t$argumentsList = array();\n\n\t\tif($action === NULL)\n\t\t{\n\t\t\t/**\n\t\t\t * Match URL\n\t\t\t *\n\t\t\t * WARNING: Known bug, the first endpoint with params to match will be choosen!\n\t\t\t * Example for the path: /order/125/update\n\t\t\t * - /order\n\t\t\t * - /order/{id} <-- This endpoint will be choosen\n\t\t\t * - /order/{id}/update\n\t\t\t */\n\t\t\tforeach($this->_routes[$method] AS $endpoint => $actionParam)\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Retrieve the params from the endpoint.\n\t\t\t\t */\n\t\t\t\t$paramRegex = '/{[^}]*}/';\n\t\t\t\tpreg_match_all($paramRegex, $endpoint, $params);\n\n\t\t\t\t/* The endpoint wasn't requiring any param, it should be matched before, we skip it. */\n\t\t\t\tif(empty($params[0]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Generate the regex for URL matching\n\t\t\t\t */\n\t\t\t\t$arguments = array();\n\t\t\t\tforeach($params[0] AS $param)\n\t\t\t\t{\n\t\t\t\t\t$param_name = substr($param, 1, -1);\n\t\t\t\t\t$regexp = '(?P<' . $param_name . '>[^/]+)';\n\t\t\t\t\t$endpoint = str_replace($param, $regexp, $endpoint);\n\t\t\t\t\t$arguments[] = $param_name;\n\t\t\t\t}\n\t\t\t\t$endpoint_matcher = '@^' . $endpoint . '|/?$@';\n\n\t\t\t\t/**\n\t\t\t\t * Match the endpoint.\n\t\t\t\t */\n\t\t\t\tpreg_match($endpoint_matcher, $path, $args);\n\n\t\t\t\t/**\n\t\t\t\t * Endpoint doesn't match.\n\t\t\t\t */\n\t\t\t\tif(empty($args[0]))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Set action and retrieve the list of values.\n\t\t\t\t */\n\t\t\t\t$action = $actionParam;\n\t\t\t\tforeach($arguments AS $name)\n\t\t\t\t{\n\t\t\t\t\t$argumentsList[$name] = $args[$name];\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(empty($action))\n\t\t{\n\t\t\treturn $this->handle(function() use($method, $path) {\n\t\t\t\t$response = array('error' => 'Not found!', 'method' => $method, 'route' => $path);\n\t\t\t\treturn [404, $response];\n\t\t\t});\n\t\t}\n\n\t\tif(!$this->checkAuthentication($action))\n\t\t{\n\t\t\treturn $this->handle(function() use($action) {\n\t\t\t\treturn [401, 'Access denied!'];\n\t\t\t});\n\t\t}\n\n\t\treturn $this->handle($action['action'], $argumentsList);\n\t}",
"public function getActions() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'action'=>\"nav_primary_client\",\n\t\t\t\t'uri'=>\"plugin/knowledgebase/client_main/\",\n\t\t\t\t'name'=>Language::_(\"KnowledgebasePlugin.client_main\", true)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'action' => \"nav_secondary_staff\",\n\t\t\t\t'uri' => \"plugin/knowledgebase/admin_main/\",\n\t\t\t\t'name' => Language::_(\"KnowledgebasePlugin.admin_main\", true),\n\t\t\t\t'options' => array('parent' => \"tools/\")\n\t\t\t)\t\t\t\n\t\t);\n\t}",
"function action(string $method, string $path, callable ...$handlers): array {\n $regexp = '@^'.preg_replace('@:(\\w+)@', '(?<\\1>[^/]+)', $path).'$@';\n return [strtoupper($method), $regexp, $handlers];\n}",
"public function getRouteName($action);",
"public static function returnActions() {\n return array();\n }",
"public function get(): array\n {\n return $this->actions->toArray();\n }",
"public function handleRouting(){\n\t\t$request = ControllerRequest::getInstance();\n\t\t$soapRawRequest = $request->getRawBody();\n\t\t$domDocument = new DOMDocument();\n\t\t$xmlValidation = @$domDocument->loadXML($soapRawRequest);\n\t\tif($xmlValidation==false){\n\t\t\t$soapException = new SoapException('SOAP Envelope mal formado. '.$php_errormsg);\n\t\t\t$soapException->setFaultCode('Sender');\n\t\t\tthrow $soapException;\n\t\t}\n\n\t\tif(isset($_SERVER['HTTP_SOAPACTION'])){\n\t\t\t$soapAction = str_replace(\"\\\"\", \"\", $_SERVER['HTTP_SOAPACTION']);\n\t\t} else {\n\t\t\tif(isset($_SERVER['CONTENT_TYPE'])){\n\t\t\t\tif(preg_match('/action=\"(.+)\"/', $_SERVER['CONTENT_TYPE'], $matches)){\n\t\t\t\t\t$soapAction = $matches[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new SoapException('No se indicó la acción SOAP a ejecutar');\n\t\t\t}\n\t\t}\n\n\t\t$soapAction = explode('#', $soapAction);\n\t\tforeach($domDocument->getElementsByTagNameNS($soapAction[0], $soapAction[1]) as $domElement){\n\t\t\t$parameters = array();\n\t\t\tforeach($domElement->childNodes as $actionParam){\n\t\t\t\tif($actionParam->nodeType==1){\n\t\t\t\t\t$paramType = $actionParam->getAttributeNS($this->_xmlSchemaNamespace, 'type');\n\t\t\t\t\tif($paramType=='ns2:Map'){\n\t\t\t\t\t\t$parameters[] = $this->_getXSIMap($actionParam);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($paramType=='SOAP-ENC:Array'||$paramType=='enc:Array'){\n\t\t\t\t\t\t\t$parameters[] = $this->_decodeSoapArray($actionParam);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$parameters[] = $this->_decodeXSDType($paramType, $actionParam->nodeValue);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tRouter::setAction($soapAction[1]);\n\t\t\tRouter::setParameters($parameters);\n\t\t}\n\t}",
"public function get_actions() {\n $actions = get_post_meta( $this->post_id, '_wcs_actions', true );\n\n if ( ! $actions ) {\n return array();\n }\n\n return (array) $actions;\n }",
"public static function parseUrl()\n {\n $route = trim($_SERVER['QUERY_STRING'], '/');\n $params = explode('/', $route);\n $params = array_slice($params, 2);\n\n return [$route, $params];\n }",
"public static function returnActions() {\n ##return array();\n }",
"public function rules(){\n $rules = [];\n if(!empty($this->rules)){\n foreach ($this->rules as $action => $rule) {\n $regex = \"*\" . $action;\n if($this->is($regex)){\n $rules = $rule;\n break;\n }\n }\n }\n return $rules;\n }",
"protected function getRouteParams(): array {\n return [];\n }",
"protected function getActionInformation(Action $action) {\n return [\n $action->getPattern(),\n $action->getName(),\n $action->getMethod(),\n $action->group->getName() . ', ' . $action->group->getPattern(),\n Formatter::shortArray($action->getMiddleware()),\n $action->getUses(),\n Formatter::boolean($action->register),\n Formatter::boolean($action->useSmoothState)\n ];\n }",
"public function getMethodUrlPathArray(){\n\n $getAllKeys = array_keys($this->HTTP_GET_VARS);\n $dirControllers = $this->getDirFiles('controller/', self::FILE);\n foreach ($getAllKeys as $key) {\n if($key == 'task'){\n\n foreach ($dirControllers as $controller){\n\n if($this->HTTP_GET_VARS[$key].'Controller.php' == $controller){\n\n $controllerObject = \"\\\\controller\\\\\".explode('.php', $controller)[0];\n $reflection = new ReflectionClass($controllerObject);\n if((!$reflection->isAbstract()) && (!$reflection->isInterface())) {\n\n $this->urlPath['task'] = new $controllerObject();\n }\n }\n }\n\n }\n else if($key == 'action'){\n\n if(array_key_exists('task', $this->urlPath)){\n\n $reflection = (method_exists($this->urlPath['task'], $this->HTTP_GET_VARS[$key]))? new ReflectionMethod($this->urlPath['task'], $this->HTTP_GET_VARS[$key]): null;\n\n if(is_object($this->urlPath['task']) && method_exists(get_class($this->urlPath['task']), $this->HTTP_GET_VARS[$key]) && ($reflection->isPublic())){\n $this->urlPath['task'] = $this->HTTP_GET_VARS['task'];\n $this->urlPath['action'] = $this->HTTP_GET_VARS['action'];\n }\n else{\n $this->urlPath['task'] = null;\n $this->urlPath['action'] = null;\n }\n }\n }\n else{\n $this->urlPath['args'][$key] = (!empty($this->HTTP_GET_VARS[$key]))?$this->HTTP_GET_VARS[$key]: null;\n }\n }\n return $this->urlPath;\n }",
"public function getActions(): array\n {\n return $this->actions;\n }",
"public function getRoutes()\n {\n\n $routes = array();\n\n array_push($routes, CoreControllerObject::buildAction('/admin/system/lessvariables', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n\n return $routes;\n\n }",
"public function getAction() {\n\t\t$id = filter_var($this->_request->getParam('id'), FILTER_SANITIZE_NUMBER_INT);\n if ($id) {\n $rule = Models_Mapper_Tax::getInstance()->find($id);\n if ($rule instanceof Models_Model_Tax){\n return $rule->toArray();\n }\n\t $this->_error(null, self::REST_STATUS_NOT_FOUND);\n }\n\n $rules = Models_Mapper_Tax::getInstance()->fetchAll();\n\n\t\treturn is_null($rules) ? null : array_map(function($rule){ return $rule->toArray(); }, $rules);\n\t}",
"public function getRoutes() : array;",
"public function getRoutes() : array;",
"public function getRouteAction(): ?string\n {\n return $this->routeAction;\n }",
"public function route($action) {\n\t\tswitch($action) {\n\n\t\t\tcase 'view':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->view($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'index':\n\t\t\t\t$this->index();\n\t\t\t\tbreak;\n\n\t\t\tcase 'add':\n\t\t\t\t$this->add();\n\t\t\t\tbreak;\n\n\t\t\tcase 'addProcess':\n\t\t\t\t$this->addProcess();\n\t\t\t\tbreak;\n\n\t\t\tcase 'addLifeEventProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->addLifeEventProcess($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'deleteProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->deleteProcess($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'edit':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->edit($id);\n\t\t\t\tbreak;\n\n\t\t\tcase 'editProcess':\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$this->editProcess($id);\n\t\t\t\tbreak;\n\t\t}\n\n\t}",
"public function getActions() {\n\t\treturn array(\n\t\t\t// Client Nav\n\t\t\tarray(\n\t\t\t\t'action'=>\"widget_client_home\",\n\t\t\t\t'uri'=>\"plugin/client_notices/client_widget/\",\n\t\t\t\t'name'=>Language::_(\"ClientNoticesPlugin.widget_client_home.index\", true)\n\t\t\t),\n\t\t\t// Staff Nav\n array(\n 'action' => \"nav_secondary_staff\",\n 'uri' => \"plugin/client_notices/admin_main/index/\",\n 'name' => Language::_(\"ClientNoticesPlugin.nav_secondary_staff.index\", true),\n 'options' => array(\n\t\t\t\t\t'parent' => \"clients/\"\n\t\t\t\t)\n ),\n\t\t\t// Client Profile Action Link\n\t\t\tarray(\n\t\t\t\t'action' => \"action_staff_client\",\n\t\t\t\t'uri' => \"plugin/client_notices/admin_main/add/\",\n\t\t\t\t'name' => Language::_(\"ClientNoticesPlugin.action_staff_client.add\", true),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'class' => \"invoice\"\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}",
"protected function get() : array\n {\n $barra = explode('/', $_SERVER[\"REQUEST_URI\"]);\n\n array_shift($barra);\n\n return $barra;\n }",
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public function route() {\n\n try {\n \n $obj = APIFactory::init($this->parsed_path[0]);\n echo $this->getAction($obj, $this->parsed_path);\n \n } catch(UndefinedActionException $e) { \n\n echo $e->getMessage();\n\n } catch(Exception $e) {\n\n echo $e->getMessage();\n\n }\n }",
"public function getActionParams() { return array_merge($_GET, $_POST); }",
"function collect() {\n $dispatcher = $this->di['dispatcher'];\n\t\t$router = $this->di['router'];\n\t\t$route = $router->getMatchedRoute();\n\t\tif ( !$route) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$uri = $route->getPattern();\n\t\t$paths = $route->getPaths();\n\t\t$result['uri'] = $uri ?: '-';\n\t\t$result['paths'] = $this->formatVar( $paths);\n\t\tif ( $params = $router->getParams()) {\n\t\t\t$result['params'] = $this->formatVar($params);\n\t\t}\n\t\t$result['HttpMethods'] = $route->getHttpMethods();\n\t\t$result['RouteName'] = $route->getName();\n\t\t$result['hostname'] = $route->getHostname();\n\t\tif ( $this->di->has('app') && ($app=$this->di['app']) instanceof Micro ) {\n\t\t\tif ( ($handler=$app->getActiveHandler()) instanceof \\Closure || is_string($handler) ) {\n\t\t\t\t$reflector = new \\ReflectionFunction($handler);\n\t\t\t}elseif(is_array($handler)){\n\t\t\t\t$reflector = new \\ReflectionMethod($handler[0], $handler[1]);\n\t\t\t}\n\t\t}else{\n\t\t\t$result['Moudle']=$router->getModuleName();\n\t\t\t$result['Controller'] = $dispatcher->getActiveController() != null ? get_class( $controller_instance = $dispatcher->getActiveController()) : $controller_instance =\"\";\n\t\t\t$result['Action'] = $dispatcher->getActiveMethod();\n\t\t\t$reflector = new \\ReflectionMethod($controller_instance, $result['Action']);\n\t\t}\n\n\t\tif (isset($reflector)) {\n\t\t\t$start = $reflector->getStartLine()-1;\n\t\t\t$stop = $reflector->getEndLine();\n\t\t\t$filename = substr($reflector->getFileName(),mb_strlen(realpath(dirname($_SERVER['DOCUMENT_ROOT']))));\n\t\t\t$code = array_slice( file($reflector->getFileName()),$start, $stop-$start );\n\t\t\t$result['file'] = $filename . ':' . $reflector->getStartLine() . '-' . $reflector->getEndLine() . \" [CODE]: \\n\". implode(\"\",$code);\n\t\t}\n\n\t\treturn array_filter($result);\n\t}",
"private function _getVariableMatch($uri, array $data) :array\n {\n if (empty($data['path']) || $data['path'] === '/') {\n return [];\n }\n\n $var = [];\n $regex = str_replace(['/', '___'], ['\\/', '+'], $data['path']);\n\n if (preg_match('|^' . $regex . '$|', $uri, $var)) {\n\n array_splice($var, 0, 1);\n\n if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) {\n\n return [\n $data['controller'],\n $data['action'] . 'Action',\n $data['permission'] ?? null,\n $var\n ];\n\n } else if ($this->requestType === 'api') {\n\n return [\n $data['controller'],\n $this->_getRestfulAction(),\n $data['permission'] ?? null,\n $var\n ];\n\n }\n\n }\n\n return [];\n }",
"private function extractRouteParams()\n {\n // Extract params\n $params = array_filter(explode('/', $_GET['url']));\n\n // First parameter is the controller\n $this->_controller = $params[0];\n\n // Second parameter is the action method\n\t\tif (isset($params[1]) && !empty($params[1])) {\n\t\t\t$this->_action = $params[1];\n\t\t}\n\n // Set additional parameters\n\t\tif (isset($params[2]) && !empty($params[2])) {\n\t\t\t$this->_urlParams = $params[2];\n\t\t}\n }",
"private function parseUrl()\n {\n $url = $_SERVER['REQUEST_URI'];\n if (!empty($url)) {\n // parse url\n $this->params = explode(\"/\", filter_var(rtrim($url, \"/\"), FILTER_SANITIZE_URL));\n }\n\n if(empty($this->params[0])) {\n unset($this->params[0]);\n\n $this->params = array_values($this->params);\n }\n\n $this->getController();\n $this->getAction();\n\n $this->params = array_values($this->params);\n }",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"public function getActionNames()\n {\n return $this->action_names;\n }",
"public function test_route_method_array() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}",
"public function actions(): array\n {\n return [\n new RateItAction(),\n // new Actions\\ChangePosAction(),\n new Actions\\Article\\CreateAction(),\n new Actions\\Article\\EditAction(),\n ];\n }",
"public function parse(&$segments)\n\t{\n\t\t$vars = array();\n\n\t\t// View is always the first element of the array\n\t\t$vars['view'] = array_shift($segments);\n\t\t$model = RestfulHelpersRestful::getModel($vars['view']);\n\n\t\twhile (!empty($segments)) {\n\t\t\t$segment = array_pop($segments);\n\n\t\t\t// If it's the ID, let's put on the request\n\t\t\tif (is_numeric($segment)) {\n\t\t\t\t$vars['id'] = $segment;\n\t\t\t} else {\n\t\t\t\t$vars['task'] = $vars['view'] . '.' . $segment;\n\t\t\t}\n\t\t}\n\n\t\treturn $vars;\n\t}",
"public function getRouteParams();",
"function getAction () {return $this->getFieldValue ('action');}",
"public function getActions();"
]
| [
"0.7384892",
"0.72717243",
"0.7149832",
"0.702776",
"0.67163837",
"0.6621345",
"0.6469768",
"0.63696015",
"0.6344577",
"0.6298685",
"0.62138253",
"0.620509",
"0.62005156",
"0.6173801",
"0.6165349",
"0.6141051",
"0.6096485",
"0.6072133",
"0.6064621",
"0.60623485",
"0.6050773",
"0.59965175",
"0.5983801",
"0.59521365",
"0.59082085",
"0.58869624",
"0.5880137",
"0.5871021",
"0.58299685",
"0.58197474",
"0.58138233",
"0.5800916",
"0.5783676",
"0.5768284",
"0.57570094",
"0.5750332",
"0.57351476",
"0.5670216",
"0.5662865",
"0.5652134",
"0.56480086",
"0.5637225",
"0.56262267",
"0.5625239",
"0.5619983",
"0.5602372",
"0.5595921",
"0.55942315",
"0.55848455",
"0.5584403",
"0.558214",
"0.55791456",
"0.55722547",
"0.5571505",
"0.5566063",
"0.5550414",
"0.55494106",
"0.5545118",
"0.55441314",
"0.55367976",
"0.55357045",
"0.55211395",
"0.55078256",
"0.55054736",
"0.54976344",
"0.5482377",
"0.54691374",
"0.54528326",
"0.5450611",
"0.54461217",
"0.5434719",
"0.5433549",
"0.5431705",
"0.5431512",
"0.54312825",
"0.54266626",
"0.5421538",
"0.5399804",
"0.5394699",
"0.5379987",
"0.5379987",
"0.53792465",
"0.5365762",
"0.5353715",
"0.5349773",
"0.53460336",
"0.5343042",
"0.5335776",
"0.5334512",
"0.53320533",
"0.52984285",
"0.52963966",
"0.52938706",
"0.52736026",
"0.5259312",
"0.52570647",
"0.5255253",
"0.5251226",
"0.52496576",
"0.5246918"
]
| 0.659931 | 6 |
Parse URI to regex pattern | public function parseUri()
{
return RouteMatch::uriToRegex($this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function regex_parse($uri) {\n\t\t\t// $regex = (\n\t\t\t// '/'.\n\t\t\t// '^(([a-z]+)?(\\:\\/\\/|\\:|\\/\\/))?'. // Scheme, Scheme Name, & Scheme Symbols\n\t\t\t// '(?:'. // Auth Start\n\t\t\t// '([a-z0-9$_\\.\\+!\\*\\'\\(\\),;&=\\-]+)'. // Username\n\t\t\t// '(?:\\:([a-z0-9$_\\.\\+!\\*\\'\\(\\),;&=\\-]*))?'. // Password\n\t\t\t// '@)?'. // Auth End\n\t\t\t// '('. // Host Start\n\t\t\t// '(?:\\d{3}.\\d{3}.\\d{3}.\\d{3})'. // IP Address\n\t\t\t// '|'. // -OR-\n\t\t\t// '(?:[a-z0-9\\-_]+(?:\\.[a-z0-9\\-_]+)*)'. // Domain Name\n\t\t\t// ')'. // Host End\n\t\t\t// '(?:\\:([0-9]+))?'. // Port\n\t\t\t// '((?:\\:|\\/)[a-z0-9\\-_\\/\\.]+)?'. // Path\n\t\t\t// '(?:\\?([a-z0-9$_\\.\\+!\\*\\'\\(\\),;:@&=\\-%]*))?'. // Query\n\t\t\t// '(?:#([a-z0-9\\-_]*))?'. // Fragment\n\t\t\t// '/i'\n\t\t\t// );\n\t\t\tpreg_match_all(self::REGEX, $uri, $parsed, PREG_SET_ORDER);\n\t\t\t\n\t\t\t// Host is required\n\t\t\tif (!isset($parsed[0][6])) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t// Return what was parsed, but make sure that each offset is set regardless\n\t\t\treturn $parsed[0] + array_fill(0, 11, '');\n\t\t}",
"public function regex() {\r\n // split uri\r\n $arr = preg_split('@/@', $this->uri, NULL, PREG_SPLIT_NO_EMPTY);\r\n\r\n $regex = null;\r\n foreach ($arr as $ar) {\r\n // Replace dynamic with regex\r\n $regex = $regex.'\\/'.preg_replace('/\\{(.*?)\\}/', '[0-9A-Za-z]++', $ar);\r\n }\r\n\r\n $this->regex = '/^'.$regex.'$/';\r\n }",
"static private function parseUrl($uri)\n {\n $parts = explode('/', $uri);\n unset($parts[0]);\n $parsed['pattern'] = '#^\\\\/'; // patttern est le motif\n $parsed['params'] = array(); // contien les arguments\n $parsed['par'] = ['needed' => array(), 'optional' => array()]; // par contient 2 tableau avec le nom des argument\n foreach ($parts as $part)\n if (strlen($part) < 3)\n $parsed['pattern'].= $part . '\\\\/';\n else\n {\n if ($part[0] != '{')\n $parsed['pattern'] .= $part . '\\\\/';\n else if ($part[1] != '?')\n $parsed['pattern'] .= '([\\w-]*)\\\\/';\n $parsed['params'][] = substr($part, 1, -1);\n $parsed['par'][$part[1] != '?' ? 'needed' : 'optional'][] = substr($part, 1 + ($part[1] != '?' ? 1 : 0), -1);\n }\n $parsed['pattern'] .= '$#';\n return $parsed;\n }",
"public static function getRegex($Name = 'uri-spec');",
"private static function _parseUri($uri, $expressions = [])\n {\n $pattern = explode('/', ltrim($uri, '/'));\n foreach ($pattern as $key => $val) {\n if(preg_match('/[\\[{\\(].*[\\]}\\)]/U', $val, $matches)) {\n foreach ($matches as $match) {\n $matchKey = substr($match, 1, -1);\n if (array_key_exists($matchKey, $expressions)) {\n $pattern[$key] = $expressions[$matchKey];\n }\n }\n }\n }\n\n return $pattern;\n }",
"public function getPatternForUri()\n {\n return '/' . preg_replace('/:[\\d\\w]+/i', '(' . $this->_paramPattern . ')', str_replace('/', '\\\\/', $this->_uri)) . '/i';\n }",
"function get_preg_expression($mode)\n{\n\tswitch ($mode)\n\t{\n\t\tcase 'url':\n\t\tcase 'url_inline':\n\t\t\t$inline = ($mode == 'url') ? ')' : '';\n\t\t\t$scheme = ($mode == 'url') ? '[a-z\\d+\\-.]' : '[a-z\\d+]'; // avoid automatic parsing of \"word\" in \"last word.http://...\"\n\t\t\t// generated with regex generation file in the develop folder\n\t\t\treturn \"[a-z]$scheme*:/{2}(?:(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})+|[0-9.]+|\\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\\])(?::\\d*)?(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\n\t\tcase 'www_url':\n\t\tcase 'www_url_inline':\n\t\t\t$inline = ($mode == 'www_url') ? ')' : '';\n\t\t\treturn \"www\\.(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})+(?::\\d*)?(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\n\t\tcase 'relative_url':\n\t\tcase 'relative_url_inline':\n\t\t\t$inline = ($mode == 'relative_url') ? ')' : '';\n\t\t\treturn \"(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\t}\n\n\treturn '';\n}",
"function massimport_convertspip_uri($str) {\n\t return eregi_replace('[^(->)\\'\\\"]http://([^[:space:]<]*)', ' [http://\\\\1->http://\\\\1]', $str); \n}",
"function validateUri($uri);",
"public function match( $pURI );",
"public static function uriToRegex(Route $route)\n {\n if($route->uri{0} == \"/\" && !empty($route->uri{1}))\n $route->uri = substr($route->uri, 1);\n\n $regexUri = '/^' . preg_replace('/\\//', '\\/', $route->uri) . '\\/?$/';\n\n if(preg_match_all('/\\{([a-z]+):(.*?)\\}/', $route->uri, $preg)){\n for($i = 0; $i < count($preg[0]); $i++) {\n $regexUri = str_replace($preg[0][$i], '(' . $preg[2][$i] . ')', $regexUri);\n }\n }\n\n return $regexUri;\n }\n\n /**\n * Parse URI parameter names to array\n *\n * @param Route $route\n *\n * @return array\n */\n public static function parseParameterNames(Route $route)\n {\n $params = [];\n\n preg_match_all('/\\{([a-z]+):(.*?)\\}/', $route->uri, $preg);\n\n for($i = 0; $i < count($preg[0]); $i++){\n $params[] = $preg[1][$i];\n }\n\n return $params;\n }\n\n /**\n * Parse URI parameter patterns to array\n *\n * @param Route $route\n *\n * @return array\n */\n public static function parseParameterPatterns(Route $route)\n {\n $params = [];\n\n preg_match_all('/\\{([a-z]+):(.*?)\\}/', $route->uri, $preg);\n\n for($i = 0; $i < count($preg[0]); $i++){\n $params[] = $preg[2][$i];\n }\n\n return $params;\n }\n\n /**\n * Check the pattern to reflect the current address\n *\n * @param Route $route\n * @param Request $request\n *\n * @return bool\n */\n public static function parseUri(Route $route, Request $request)\n {\n if(preg_match($route->regexUri, $request->path(), $preg)) {\n\n $route->addParameters(static::parseParameters($route, $preg));\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Retrieves all settings from the current address according to the pattern\n *\n * @param Route $route\n * @param array $preg\n *\n * @return array\n */\n public static function parseParameters(Route $route, array $preg)\n {\n $parameters = [];\n\n for($i = 1; $i < count($preg); $i++){\n $parameters[$route->parameterNames[$i - 1]] = $preg[$i];\n }\n\n return $parameters;\n }\n\n /**\n * Validate Route domain\n *\n * @param Route $route\n * @param Request $request\n * @return bool\n */\n public static function validateDomain(Route $route, Request $request)\n {\n if(!isset($route->action['domain']))\n return true;\n\n return self::parseDomain($route, $request);\n }\n\n /**\n * Check the pattern to reflect the current domain\n *\n * @param Route $route\n * @param Request $request\n * @return bool\n */\n public static function parseDomain(Route $route, Request $request)\n {\n $domain = $route->action['domain'];\n\n if($domain == $request->domain()) {\n return true;\n }\n\n $regex = '/' . preg_replace('/\\//', '\\/', $domain) . '/';\n $params = [];\n\n if(preg_match_all('/\\{([a-z]+):(.*?)\\}/', $domain, $preg)) {\n for($i = 0; $i < count($preg[0]); $i++){\n $params[] = $preg[1][$i];\n $regex = str_replace($preg[0][$i], '(' . $preg[2][$i] . ')', $regex);\n }\n\n if(!(preg_match($regex, $request->domain(), $preg))) {\n return false;\n }\n\n $parameters = [];\n\n for ($i = 0; $i < count($params); $i++) {\n $parameters[$params[$i]] = $preg[$i + 1];\n }\n\n $route->addParameters($parameters);\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Verify CSRF token to route, if verification needs\n *\n * @param Route $route\n * @param Request $request\n *\n * @return bool\n */\n public static function csrfVerify(Route $route, CsrfToken $csrfToken)\n {\n if(!$route->csrf_verify)\n return true;\n\n return $csrfToken->check();\n }\n}",
"public function getRegexurl() {\n }",
"function parseUrl($url)\n {\n $simple_url = \"/^(?:(?P<scheme>[^:\\/?#]+):\\/\\/)(?:(?P<userinfo>[^\\/@]*)@)?(?P<host>[^\\/?#]*)(?P<path>[^?#]*?(?:\\.(?P<format>[^\\.?#]*))?)?(?:\\?(?P<query>[^#]*))?(?:#(?P<fragment>.*))?$/i\";\n $url_parts = array();\n preg_match($simple_url, $url, $url_parts);\n return $url_parts;\n }",
"function name_and_representation_in_url() {\n preg_match(URI_REGEX, request_uri(), $request_matches);\n return array(\n (isset($request_matches[1]) ? $request_matches[1] : ''),\n (isset($request_matches[2]) ? $request_matches[2] : ''),\n );\n}",
"public function regex()\n {\n return 'https?://soundcloud.com/([a-zA-Z0-9-_]+)/([a-zA-Z0-9-_]+)';\n }",
"public function match($uri);",
"private static function parseUri($uri) \n {\n $path = str_replace(INDEX_PATH,\"\",$uri);\n $path = explode(\"?\",$path);\n $path = $path[0];\n $path = trim($path,'/');\n return explode('/',$path);\n }",
"public function match ($uri);",
"function vap_url_parse ($url) {\n $sp = null;\n $sp2 = null;\n $len = null;\n $absurl = null;\n $urllen = null;\n $urlparse = null;\n\n if ($url == null) {\n return false;\n }\n\n if (strncasecmp($url, \"http://\", 7) == 0) {\n $urlparse['protocol'] = \"http\";\n $absurl = substr($url, 7);\n } else\n if (strncasecmp($url, \"https://\", 8) == 0) {\n $urlparse['protocol'] = \"https\";\n $absurl = substr($url, 8);\n } else {\n return false;\n }\n\n $urllen = strlen($absurl);\n\n if (($sp = strstr($absurl, \":\")) == null) {\n\n if (($sp = strstr($absurl, \"/\")) == null) {\n $urlparse['host'] = $absurl;\n $urlparse['file'] = \"/\";\n } else {\n $len = strlen($absurl) - strlen($sp);\n $urlparse['host'] = substr($absurl, 0, $len);\n $urlparse['file'] = $sp;\n }\n\n $urlparse['port'] = \"80\";\n } else {\n $len = strlen($absurl) - strlen($sp);\n\n $urlparse['host'] = substr($absurl, 0, $len);\n\n if (($sp2 = strstr($sp, \"/\")) == null) {\n $urlparse['port'] = substr($sp, 1);\n $urlparse['file'] = \"/\";\n } else {\n $len = null;\n\n $len = strlen($sp) - strlen($sp2) - 1;\n\n $urlparse['port'] = substr($sp, 1, $len);\n\n if (strcmp($sp2, substr($absurl, $urllen - 1)) == 0) {\n\n $urlparse['file'] = \"/\";\n } else {\n $urlparse['file'] = $sp2;\n }\n }\n }\n\n if (! eregi(\n \"([a-zA-Z0-9][a-zA-Z0-9_\\-\\.]*[a-zA-Z0-9]+\\.)([a-zA-Z0-9][a-zA-Z0-9_\\-]*[a-zA-Z0-9]+)(\\.cn$|\\.com$|\\.net$|\\.name$|\\.org$|\\.com\\.cn$|\\.com\\.ru$|\\.net\\.cn$|\\.org\\.cn$|\\.gov\\.cn$|\\.info$|\\.biz$|\\.tv$|\\.cc$)\",\n $urlparse['host'])) {\n return false;\n }\n\n if (! eregi(\n \"\\.([a-zA-Z0-9][a-zA-Z0-9_\\-]*[a-zA-Z0-9]+)(\\.cn$|\\.com$|\\.net$|\\.name$|\\.org$|\\.com\\.cn$|\\.com\\.ru$|\\.net\\.cn$|\\.org\\.cn$|\\.gov\\.cn$|\\.info$|\\.biz$|\\.tv$|\\.cc$)\",\n $urlparse['host'], $ee)) {\n return false;\n }\n\n $urlparse['domain'] = substr($ee[0], 1);\n\n if (! eregi(\"^[0-9]+$\", $urlparse['port'])) {\n return false;\n }\n\n return $urlparse;\n }",
"function emr_get_match_url($url) {\n\t$url = emr_remove_scheme($url);\n\t$url = emr_maybe_remove_query_string($url);\n\t$url = emr_remove_size_from_filename($url, true); // and extension is removed.\n\t$url = emr_remove_domain_from_filename($url);\n\treturn $url;\n}",
"public static function getRegularExpression();",
"function parseUrl($origin) {\n preg_match('<http.+/post/\\d+>', $origin, $new);\n\n return $new[0];\n}",
"public function setRegexurl($regex);",
"protected function parseUrl(string $url)\n {\n $url_parts = Utils::multibyteParseUrl($url);\n\n if (isset($url_parts['scheme'])) {\n /** @var UniformResourceLocator $locator */\n $locator = Grav::instance()['locator'];\n\n // Special handling for the streams.\n if ($locator->schemeExists($url_parts['scheme'])) {\n if (isset($url_parts['host'])) {\n // Merge host and path into a path.\n $url_parts['path'] = $url_parts['host'] . (isset($url_parts['path']) ? '/' . $url_parts['path'] : '');\n unset($url_parts['host']);\n }\n\n $url_parts['stream'] = true;\n }\n }\n\n return $url_parts;\n }",
"public static function parserRegExp(): string\n {\n return '[0-9]{4}-[0-9]{2}-[0-9]{2}';\n }",
"function matchUrl( $url ) {\n\t\t$urlPattern = '/'.str_replace($this->urlPattern, '', $url);\n\t\t$aUrl = pathinfo( str_replace($this->urlPattern, '', $urlPattern) );\n\t\tif ( in_array($aUrl['filename'], Array('rss2', 'atom')) and $aUrl['extension'] == 'xml') {\n\t\t\treturn $aUrl;\n\t\t}\n\t\treturn Array();\n }",
"private function parse($uri)\n {\n $params = parse_url($uri);\n\n if (!isset($params['host']) || !isset($params['scheme']) || !isset($params['path'])) {\n throw new Exception\\InvalidUriException($uri);\n }\n\n $params['path'] = substr($params['path'], 1);\n\n return $params;\n }",
"public static function parseRoute($urlSegment) {\n $regEx = '/';\n $paramName = '';\n $urlLength = strlen($urlSegment);\n $parsingParam = false;\n $route = ['params' => []];\n\n //step through route string generating matching regex for static portions of route\n //and creating capturing groups for parameters\n for ($i = 0; $i < $urlLength; $i++) {\n if (!$parsingParam && $urlSegment[$i] != '@') {\n if ($urlSegment[$i] == '/') {\n $regEx .= '\\\\';\n }\n $regEx .= $urlSegment[$i];\n } elseif (!$parsingParam) {\n $parsingParam = true;\n } elseif ($urlSegment[$i] == '/') {\n $route['params'][] = $paramName;\n $paramName = '';\n $regEx .= '([^\\s\\/]+)\\\\/';\n $parsingParam = false;\n } else {\n $paramName .= $urlSegment[$i];\n }\n }\n if ($parsingParam) {\n $route['params'][] = $paramName;\n $regEx .= '([^\\s\\/]+)$';\n } else {\n $regEx .= '$';\n }\n $regEx .= '/';\n $route['regex'] = $regEx;\n\n return $route;\n }",
"public function analyseURI($uri)\n {\n $uriElements = '/' . implode('/', $this->getURIElements());\n if ($uri == $uriElements) {\n $uri = '';\n } elseif (strpos($uri, $uriElements) === 0) {\n $uri = mb_substr($uri, mb_strlen($uriElements));\n }\n\n return $uri;\n }",
"public function getPattern()\n {\n // file type\n $pattern = $this->getFileType() . ':';\n\n // schema (http, https)\n $pattern .= $this->uri->getScheme() . ':';\n\n // host\n $pattern .= $this->uri->getHost() . ':';\n\n $path = $this->uri->getPath() . '?' . $this->uri->getQuery();\n\n $pathNew = preg_replace(\"^[a-f0-9]{32}^\", \"<h>\", $path);\n $pathNew = preg_replace(\"^[a-z\\-\\_]{1,}^i\", \"<s>\", $pathNew);\n $pathNew = preg_replace(\"^[0-9]{1,}^\", \"<i>\", $pathNew);\n\n $pattern .= $pathNew;\n\n return $pattern;\n }",
"protected function testPattern($url) {\n if (preg_match($this->pattern, $url, $matches)) {\n $matched_part = $matches[0];\n\n $rule = array();\n\n foreach ($matches as $key => $value) {\n if (is_numeric($key)) continue;\n\n // If there is an empty match, the URL is not matched at all.\n if (empty($value)) {\n return false;\n }\n\n $rule[$key] = $value;\n }\n\n $rest = substr($url, strlen($matched_part));\n $rest = preg_replace('#^/|/$#', '', $rest);\n\n if (empty($rest)) {\n $params = array();\n } else {\n $params = preg_split('#[/]+#', $rest);\n }\n\n return array($rule, $params);\n } else {\n return false;\n }\n }",
"protected function pattern_to_regex($matches) {\n\t\tif ($matches[1] == '*') {\n\t\t\treturn '/?(.*)';\n\t\t} else if ($matches[1] != ':') {\n\t\t\treturn '/?('.$matches[2].')';\n\t\t}\n\t\treturn '/([^\\/]+)';\n\t}",
"function get_preg_expression($mode)\n{\n\tswitch ($mode)\n\t{\n\t\tcase 'email':\n\t\t\treturn '(?:[a-z0-9\\'\\.\\-_\\+\\|]++|&)+@[a-z0-9\\-]+\\.(?:[a-z0-9\\-]+\\.)*[a-z]+';\n\t\tbreak;\n\n\t\tcase 'bbcode_htm':\n\t\t\treturn array(\n\t\t\t\t'#<!\\-\\- e \\-\\-><a href=\"mailto:(.*?)\">.*?</a><!\\-\\- e \\-\\->#',\n\t\t\t\t'#<!\\-\\- l \\-\\-><a (?:class=\"[\\w-]+\" )?href=\"(.*?)(?:(&|\\?)sid=[0-9a-f]{32})?\">.*?</a><!\\-\\- l \\-\\->#',\n\t\t\t\t'#<!\\-\\- ([mw]) \\-\\-><a (?:class=\"[\\w-]+\" )?href=\"(.*?)\">.*?</a><!\\-\\- \\1 \\-\\->#',\n\t\t\t\t'#<!\\-\\- s(.*?) \\-\\-><img src=\"\\{SMILIES_PATH\\}\\/.*? \\/><!\\-\\- s\\1 \\-\\->#',\n\t\t\t\t'#<!\\-\\- .*? \\-\\->#s',\n\t\t\t\t'#<.*?>#s',\n\t\t\t);\n\t\tbreak;\n\n\t\t// Whoa these look impressive!\n\t\t// The code to generate the following two regular expressions which match valid IPv4/IPv6 addresses\n\t\t// can be found in the develop directory\n\t\tcase 'ipv4':\n\t\t\treturn '#^(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$#';\n\t\tbreak;\n\n\t\tcase 'ipv6':\n\t\t\treturn '#^(?:(?:(?:[\\dA-F]{1,4}:){6}(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:::(?:[\\dA-F]{1,4}:){5}(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:(?:[\\dA-F]{1,4}:):(?:[\\dA-F]{1,4}:){4}(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:(?:[\\dA-F]{1,4}:){1,2}:(?:[\\dA-F]{1,4}:){3}(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:(?:[\\dA-F]{1,4}:){1,3}:(?:[\\dA-F]{1,4}:){2}(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:(?:[\\dA-F]{1,4}:){1,4}:(?:[\\dA-F]{1,4}:)(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:(?:[\\dA-F]{1,4}:){1,5}:(?:[\\dA-F]{1,4}:[\\dA-F]{1,4}|(?:(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])\\.){3}(?:\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])))|(?:(?:[\\dA-F]{1,4}:){1,6}:[\\dA-F]{1,4})|(?:(?:[\\dA-F]{1,4}:){1,7}:))$#i';\n\t\tbreak;\n\n\t\tcase 'url':\n\t\tcase 'url_inline':\n\t\t\t$inline = ($mode == 'url') ? ')' : '';\n\t\t\t$scheme = ($mode == 'url') ? '[a-z\\d+\\-.]' : '[a-z\\d+]'; // avoid automatic parsing of \"word\" in \"last word.http://...\"\n\t\t\t// generated with regex generation file in the develop folder\n\t\t\treturn \"[a-z]$scheme*:/{2}(?:(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})+|[0-9.]+|\\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\\])(?::\\d*)?(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\n\t\tcase 'www_url':\n\t\tcase 'www_url_inline':\n\t\t\t$inline = ($mode == 'www_url') ? ')' : '';\n\t\t\treturn \"www\\.(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})+(?::\\d*)?(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\n\t\tcase 'relative_url':\n\t\tcase 'relative_url_inline':\n\t\t\t$inline = ($mode == 'relative_url') ? ')' : '';\n\t\t\treturn \"(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\t}\n\n\treturn '';\n}",
"private function getRegexForUri($PartialPagePath) {\r\n $string = '=~^(.)+(\\/.\\/)*(' . $PartialPagePath . '\\.html.*)$';\r\n return $string;\r\n }",
"function buildRegexFromParsed(array $parts)\n {\n $regex = '';\n\n // [0 => ['_literal_' => 'localhost'], 1=>['_optional' => ..] ..]\n foreach ($parts as $parsed) {\n $definition_name = key($parsed);\n $definition_value = $parsed[$definition_name];\n // $parsed can also have extra parsed data options\n // _parameter_ String(3) => tld \\\n // tld String(4) => .com\n switch ($definition_name) {\n case '_token_':\n case '_literal_':\n $regex .= preg_quote($definition_value);\n break;\n\n case '_parameter_':\n $groupName = '?P<' . $definition_value . '>';\n\n if (isset($parsed[$definition_value])) {\n // Delimiter: localhost:port{{\\d+}}\n $regex .= '(' . $groupName . $parsed[$definition_value] . ')';\n } else{\n $regex .= '(' . $groupName . '[^.]+)';\n }\n\n break;\n\n case '_optional_':\n $regex .= '(?:' . buildRegexFromParsed($definition_value) . ')?';\n break;\n }\n }\n\n return $regex;\n }",
"public function parse_uri() {\n $url = \"http://localhost\" . $this->uri;\n $parsed_url = parse_url($url);\n $this->path = $parsed_url['path'];\n @$this->query = $parsed_url['query'];\n }",
"function resolveURL($uri);",
"static public function parse($pattern)\n\t{\n\t\tif (isset(self::$parse_cache[$pattern]))\n\t\t{\n\t\t\treturn self::$parse_cache[$pattern];\n\t\t}\n\n\t\t$regex = '#^';\n\t\t$interleave = array();\n\t\t$params = array();\n\t\t$n = 0;\n\n\t\t$parts = preg_split('#(:\\w+|<(\\w+:)?([^>]+)>)#', $pattern, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\tfor ($i = 0, $j = count($parts); $i < $j ;)\n\t\t{\n\t\t\t$part = $parts[$i++];\n\n\t\t\t$regex .= $part;\n\t\t\t$interleave[] = $part;\n\n\t\t\tif ($i == $j)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$part = $parts[$i++];\n\n\t\t\tif ($part{0} == ':')\n\t\t\t{\n\t\t\t\t$identifier = substr($part, 1);\n\t\t\t\t$selector = '[^/]+';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$identifier = substr($parts[$i++], 0, -1);\n\n\t\t\t\tif (!$identifier)\n\t\t\t\t{\n\t\t\t\t\t$identifier = $n++;\n\t\t\t\t}\n\n\t\t\t\t$selector = $parts[$i++];\n\t\t\t}\n\n\t\t\t$regex .= '(' . $selector . ')';\n\t\t\t$interleave[] = array($identifier, $selector);\n\t\t\t$params[] = $identifier;\n\t\t}\n\n\t\t$regex .= '$#';\n\n\t\treturn self::$parse_cache[$pattern] = array($interleave, $params, $regex);\n\t}",
"abstract protected function buildRegex(): Matcher;",
"public function getPattern();",
"public function getPattern();",
"function url_parts($url) {\n if (!preg_match('/^(?P<protocol_domain>(?P<protocol>https?\\:\\/+)(?P<domain>([^\\/\\W]|[\\.\\-])+))(?P<request_uri>(?P<pathname>(?P<path>\\/(.+\\/)?)?(?P<file>[^\\?\\#]+?)?)?(?P<query_string>\\?[^\\#]*)?)(\\#(?P<hash>.*))?$/',$url,$url_parts)) {\n echo debug_backtrace();\n throw new Exception(\"Invalid url: $url\");\n }\n return $url_parts;\n}",
"private function checkURI()\n {\n // init vars\n $result = false;\n $uri = $this->getURI();\n $routesArray = $this->routes;\n\n // get existed rule for user requested uri\n foreach ($routesArray as $rulePattern => $path) {\n if (preg_match(\"~$rulePattern~i\", $uri)) {\n $result = [$rulePattern, $path];\n return $result;\n }\n }\n }",
"function match($uri, &$params) {\n\t\t$patterns = explode('/', $this->getPattern());\n\t\t$params = array();\n\t\t$cond = $this->getConditions();\n\n\t\t// For each subpattern\n\t\tfor ($i = 0; $i < sizeof($patterns); $i++)\n\t\t\t// check, if it starts with an '@'\n\t\t\tif (strlen($patterns[$i]) > 0 && $patterns[$i][0] == '@') {\n\t\t\t\t// The pattern name without the '@'\n\t\t\t\t$pattern_name = substr($patterns[$i], 1);\n\n\t\t\t\t// If a condition for the subpattern is set, use it\n\t\t\t\tif (isset($cond[$pattern_name]))\n\t\t\t\t\t$patterns[$i] = '('.$cond[$pattern_name].')';\n\t\t\t\telse\n\t\t\t\t// Otherwise use the general condition\n\t\t\t\t\t$patterns[$i] = '([^/]+)';\n\t\t\t\t\t// Matches every string, that does not contain a slash\n\n\t\t\t\t// Extend $params\n\t\t\t\t$params[$pattern_name] = NULL;\n\t\t\t}\n\n\t\t// Combine the subpatterns to the main pattern\n\t\t$pattern = ':^'.implode('/', $patterns).'$:';\n\n\t\t// Match it against $uri\n\t\tif (preg_match($pattern, $uri, $matches)) {\n\t\t\t// Create the associative $params array\n\t\t\t$i = 1;\n\t\t\tforeach ($params as &$value) {\n\t\t\t\t$value = $matches[$i++];\n\t\t\t}\n\t\t\t// Return TRUE on match\n\t\t\treturn TRUE;\n\t\t} else\n\t\t\t// Otherwise FALSE\n\t\t\treturn FALSE;\n\t}",
"public function parseUrl($url)\r\n {\r\n $route_found = null;\r\n $string = null; // Additional condition in the choice of regular expression\r\n $url = str_replace('/web', '', $url); // for not specified virt-hosts\r\n\r\n foreach(self::$map as $key => $route)\r\n {\r\n $pattern = $this -> preparePattern($route, $string = false);\r\n if(preg_match($pattern, $url, $params))\r\n {\r\n $pattern = $this -> preparePattern($route, $string = true);\r\n preg_match($pattern, str_replace(array('{','}'), '', $route['pattern']), $param_names);\r\n $params = array_combine($param_names, $params);\r\n array_shift($params); // Get rid of 0 element\r\n $route_found = $route;\r\n $route_found['params'] = $params;\r\n break;\r\n }\r\n }\r\n return $route_found;\r\n }",
"function preg($pattern){\n return new Parser(['_call_preg', [$pattern]]);\n}",
"private static function parseUrl($url)\n {\n //the valid url should be : http(s)://aaa.bbb.ccc/ddd/eee\n //so directly use / to explode:\n // http(s): / / aaa.bbb.ccc / ddd/eee\n // 0 1 2 3\n $splitArr = explode(\"/\", $url, 4);\n\n if (3 > sizeof($splitArr)) {\n return false;\n }\n\n $returnArr = array();\n\n $returnArr['protocol'] = substr($splitArr[0], 0, -1);\n\n //host may contain port number\n if (false !== strpos($splitArr[2], ':')) {\n $explodeHost = explode(':', $splitArr[2]);\n $returnArr['host'] = $explodeHost[0];\n $returnArr['port'] = (int)$explodeHost[1];\n } else {\n $returnArr['host'] = $splitArr[2];\n\n if ('http' === $returnArr['protocol']) {\n $returnArr['port'] = 80;\n } elseif ('https' === $returnArr['protocol']) {\n $returnArr['port'] = 443;\n } else {\n $returnArr['port'] = -1;\n }\n }\n\n if (isset($splitArr[3])) {\n $returnArr['resource'] = $splitArr[3];\n } else {\n $returnArr['resource'] = '';\n }\n\n if (\n '' === $returnArr['host'] or\n '' === $returnArr['protocol'] or\n '' === $returnArr['port']\n ) {\n return false;\n }\n\n return $returnArr;\n }",
"public function get_regex ($part) {\n\t\treturn '/' . \n\t\t\tpreg_quote($this->open(), '/') .\n\t\t\t\tpreg_quote($part, '/') .\n\t\t\t\t'(' .\n\t\t\t\t\tpreg_quote($this->fallback(), '/') .\n\t\t\t\t\t'(.*?)' .\n\t\t\t\t')?' .\n\t\t\tpreg_quote($this->close(), '/') .\n\t\t'/';\n\t}",
"public function parse($uri)\n {\n $this->reset();\n\n // Capture scheme\n if (($scheme = self::parseScheme($uri)) !== null) {\n $this->setScheme($scheme);\n $uri = substr($uri, strlen($scheme) + 1) ?: '';\n }\n\n // Capture authority part\n if (preg_match('|^//([^/\\?#]*)|', $uri, $match)) {\n $authority = $match[1];\n $uri = substr($uri, strlen($match[0]));\n\n // Split authority into userInfo and host\n if (strpos($authority, '@') !== false) {\n // The userInfo can also contain '@' symbols; split $authority\n // into segments, and set it to the last segment.\n $segments = explode('@', $authority);\n $authority = array_pop($segments);\n $userInfo = implode('@', $segments);\n unset($segments);\n $this->setUserInfo($userInfo);\n }\n\n $nMatches = preg_match('/:[\\d]{0,5}$/', $authority, $matches);\n if ($nMatches === 1) {\n $portLength = strlen($matches[0]);\n $port = substr($matches[0], 1);\n\n // If authority ends with colon, port will be empty string.\n // Remove the colon from authority, but keeps port null\n if ($port) {\n $this->setPort((int) $port);\n }\n\n $authority = substr($authority, 0, -$portLength);\n }\n\n $this->setHost($authority);\n }\n\n if (! $uri) {\n return $this;\n }\n\n // Capture the path\n if (preg_match('|^[^\\?#]*|', $uri, $match)) {\n $this->setPath($match[0]);\n $uri = substr($uri, strlen($match[0]));\n }\n\n if (! $uri) {\n return $this;\n }\n\n // Capture the query\n if (preg_match('|^\\?([^#]*)|', $uri, $match)) {\n $this->setQuery($match[1]);\n $uri = substr($uri, strlen($match[0]));\n }\n if (! $uri) {\n return $this;\n }\n\n // All that's left is the fragment\n if ($uri && 0 === strpos($uri, '#')) {\n $this->setFragment(substr($uri, 1));\n }\n\n return $this;\n }",
"protected function parseUri()\n {\n $path = rtrim(parse_url($this->request->uri, PHP_URL_PATH), '/');\n if (!is_null($this->basePath)) {\n if (strpos($path, $this->basePath) === 0) {\n $path = substr($path, strlen($this->basePath));\n }\n }\n foreach ($this->routes as $route => $controller) {\n if (ENABLE_CACHE && \\Unamed\\Cache::isHit('route:' . $route)) {\n $routeRegEx = \\Unamed\\Cache::get('route:' . $route);\n } else {\n $routeRegEx = $this->compileRoute($route);\n }\n if ($this->parse($path, $routeRegEx) === 1) {\n $this->setController($controller);\n if (isset($this->params['action'])) {\n $this->setAction($this->params['action']);\n }\n continue;\n }\n }\n return;\n }",
"public function getPattern() {}",
"private static function getUrlParams($regex, $requestedUrl)\n {\n preg_match($regex, $requestedUrl, $matches);\n return $matches;\n }",
"public static function parse($uri) {\n\t\t\tif (!is_string($uri)) {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\t$parsed = self::regex_parse($uri);\n\t\t\t\n\t\t\t// Could not be parsed correctly\n\t\t\tif (empty($parsed)) {\n\t\t\t\t$parsed = array_fill(1, 10, '');\n\t\t\t}\n\t\t\t\n\t\t\treturn (object) array(\n\t\t\t\t'scheme' => $parsed[1],\n\t\t\t\t'scheme_name' => $parsed[2],\n\t\t\t\t'scheme_symbols' => $parsed[3],\n\t\t\t\t'user' => $parsed[4],\n\t\t\t\t'pass' => $parsed[5],\n\t\t\t\t'host' => $parsed[6],\n\t\t\t\t'port' => $parsed[7],\n\t\t\t\t'path' => $parsed[8],\n\t\t\t\t'query' => $parsed[9],\n\t\t\t\t'fragment' => $parsed[10],\n\t\t\t);\n\t\t}",
"public static function parse($URI, array $baseURI = array('scheme' => '', 'path' => '', 'query' => array()));",
"abstract protected function regexp(): string;",
"public function convertMatchUrlsToRegexes($urls)\n\t{\n\t\tif (!$urls)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\t$urls = preg_split('/(\\r?\\n)+/', $urls, -1, PREG_SPLIT_NO_EMPTY);\n\t\t$regexes = array();\n\t\tforeach ($urls AS $url)\n\t\t{\n\t\t\t$url = preg_quote($url, '#');\n\t\t\t$url = str_replace('\\\\*', '.*', $url);\n\t\t\t$url = str_replace('\\{\\$id\\}', '(?P<id>[^\"\\'?&;/<>\\#\\[\\]]+)', $url);\n\t\t\t$url = str_replace('\\{\\$id\\:digits\\}', '(?P<id>[0-9]+)', $url);\n\n\t\t\t$regexes[] = '#' . $url . '#i';\n\t\t}\n\n\t\treturn $regexes;\n\t}",
"public function matchUrl($url) {\r\n // Wildcard or exact match\r\n if($this->pattern === '*' || $this->pattern === $url) {\r\n $this->setFixedNames();\r\n\r\n return TRUE;\r\n }\r\n\r\n $ids = array();\r\n $last_char = substr($this->pattern, -1);\r\n\r\n // Get splat\r\n if($last_char === '*') {\r\n $n = 0;\r\n $len = strlen($url);\r\n $count = substr_count($this->pattern, '/');\r\n\r\n for($i = 0; $i < $len; $i++) {\r\n if($url[$i] == '/') {\r\n $n++;\r\n }\r\n if($n == $count) {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n\r\n // Build the regex for matching\r\n $regex = str_replace(array(\r\n ')',\r\n '/*'\r\n ), array(\r\n ')?',\r\n '(/?|/.*?)'\r\n ), $this->pattern);\r\n\r\n $regex = preg_replace_callback('#@([\\w]+)(:\\{[^/\\(\\)]*?\\})?#', function($matches) use (&$ids) {\r\n $ids[$matches[1]] = NULL;\r\n if(isset($matches[3])) {\r\n return '(?P<' . $matches[1] . '>' . $matches[3] . ')';\r\n }\r\n\r\n return '(?P<' . $matches[1] . '>[^/\\?]+)';\r\n }, $regex);\r\n\r\n // Fix trailing slash\r\n if($last_char === '/') {\r\n $regex .= '?';\r\n } // Allow trailing slash\r\n else {\r\n $regex .= '/?';\r\n }\r\n\r\n // Attempt to match route and named parameters\r\n if(preg_match('#^' . $regex . '(?:\\?.*)?$#' . (($this->case_sensitive) ? '' : 'i'), $url, $matches)) {\r\n foreach($ids as $k => $v) {\r\n if(array_key_exists($k, $matches)) {\r\n $this->params[$k] = urldecode($matches[$k]);\r\n }\r\n }\r\n\r\n return TRUE;\r\n }\r\n\r\n return FALSE;\r\n }",
"public static function parseURL($url) {\n\t\t\t\t\n\t\t}",
"private function getPattern(){\n $pattern = strstr( substr($this->_requestUri,1) , '/', true) ;\n if( isset( $this->_config['pattern'] [$pattern] )){\n $this->_activePatern = $this->_config['pattern'][$pattern];\n\n $this->_cacheFolder = $pattern;\n\n $this->_requestUri = str_replace(\"/$pattern/\", \"/\", $this->_requestUri);\n }\n }",
"function parse_regex($s, $boundaryChars = '\\/#-') {\n\n $pattern = '/^([' . $boundaryChars . '])(.*)\\1([i]*)/i';\n\n if (preg_match($pattern, $s, $m)) {\n $result = array('pattern' => $m[2], 'flags' => strtolower($m[3]));\n return $result;\n }\n\n return false;\n }",
"private function parseUrl()\n {\n if (strpos($this->getDataByScrapeUrl(), $this->element)) {\n preg_match($this->pattern, $this->getDataByScrapeUrl(), $matches);\n } else {\n exit(\"[WARNING] : Neither css class name : .\");\n }\n return $matches[1];\n }",
"public function regex()\n {\n return 'https?://vine.co/v/(\\w+)';\n }",
"public function cleanUri(){\n return preg_replace('/[^\\da-z\\-\\/\\_]/i', '', filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL));\n }",
"function parser_host($url) {\n\t$server = strtr($url, array(\"youtu.be/\" => \"youtube.com/watch?v=\", \"my1.imgsmail.ru\" => \"video.mail.ru\", \"vkontakte.ru\" => \"vk.com\", \"kwimg.kz\" => \"kiwi.kz\", \"-\" => \"\", \"video.rutube.ru\" => \"rutube.ru\", \"video.meta.ua\" => \"video.metas.ua\"));\n\t$host1 = explode(\"/\", strtr($server, array(\"http://\" => \"\", \"https://\" => \"\")));\n\t$server = current($host1);\n\tpreg_match('/[a-zA-Z0-9]+\\.[a-zA-Z0-9]{1,3}\\.[a-zA-Z0-9]{2,4}$|[a-zA-Z0-9]{4,}\\.[a-zA-Z0-9]{2,4}$/', $server, $host);\n\tif(isset($host[0]) && !empty($host[0])) {\n\t\t$loc = $host[0];\n\t} else {\n\t\t$loc = $server;\n\t}\n\t$ret = str_replace(array(\".com\", \".ru\", \".at.ua\", \".ua\", \".kz\", \".tv\", \".pro\", \".to\", \".net\", \".uz\", \"www.\", \".info\", \".\"), \"\", $loc);\n\t$ret = str_replace(\"mail\", \"mailru\", $ret);\n\tif(preg_match(\"#([0-9]+)#\", $ret)) {\n\t\t$ret = \"v\".$ret;\n\t}\nreturn $ret;\n}",
"public function setRegexurl($regex) {\n }",
"public function matches(string $uri): array\n {\n $regex = $this->regex;\n $find = !!preg_match($regex, rawurldecode($uri), $matches);\n if ($find) {\n array_shift($matches);\n }\n return [$find, $matches];\n }",
"static function parseUrl($url) {\n\t\t$r = '!(?:(\\w+)://)?(?:(\\w+)\\:(\\w+)@)?([^/:]+)?(?:\\:(\\d*))?([^#?]+)?(?:\\?([^#]+))?(?:#(.+$))?!i';\n\t\tpreg_match ( $r, $url, $out );\n\t\treturn array(\n\t\t\t'full' => $out[0],\n\t\t\t'scheme' => $out[1],\n\t\t\t'username' => $out[2],\n\t\t\t'password' => $out[3],\n\t\t\t'domain' => $out[4],\n\t\t\t'host' => $out[4],\n\t\t\t'port' => $out[5],\n\t\t\t'path' => $out[6],\n\t\t\t'query' => $out[7],\n\t\t\t'fragment' => $out[8],\n\t\t);\n\t}",
"function getUri($string)\n{\n $string = stristr($string, ' ', false);\n $string = removeFirstChar($string);\n $string = stristr($string, ' ', true);\n return $string;\n}",
"public function getRegexp();",
"abstract function regex(): array;",
"public function parseUrl()\n { #Explode para transformar em array, seprando por /, rtrim para retirar os espaços vazios, filter_ sanitize_url fucao do php para retirar caractres ilegais \n return explode(\"/\",rtrim($_GET['url']),FILTER_SANITIZE_URL);\n }",
"private static function split_uri($input)\r\n\t{\r\n\t\t$pos = strpos($input, '/');\r\n\r\n\t\tif ($pos !== false)\r\n\t\t{\r\n\t\t\treturn explode('/', $input);\r\n\t\t}\r\n\r\n\t\treturn array($input);\r\n\t}",
"public function resolveUri($uri) {}",
"function core_github_parse($url){\n\tpreg_match(\"/https:\\/\\/([^\\/]+)\\/(.*)/is\", $url, $matches);\n\t$return = array();\n\t$return['domain'] = $matches[1];\n\t$return['url'] = $matches[2];\n\treturn $return;\n}",
"public function parse($url);",
"public function splitUri()\n\t{\n\t\tif ($this->uriString != '')\n\t\t{\n\t\t\tif (getConfigItem('switchToQueryString') == FALSE)\n\t\t\t{\n\t\t\t\t$_tempVal = explode('/', $this->uriString);\n\n\t\t\t\tforeach ($_tempVal as $val)\n\t\t\t\t{\n\t\t\t\t\t$val = $this->validateUri($val);\n\t\t\t\t\t\n\t\t\t\t\tif ($val != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->splittedUriString[] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"private static function getRegexUrl($route)\r\n {\r\n $route = self::quoteRegex($route);\r\n\r\n $route = preg_replace('/\\{:num\\}/', self::NUMBER, $route);\r\n $route = preg_replace('/\\{:alpha\\}/', self::ALPHA, $route);\r\n $route = preg_replace('/\\{[a-zA-Z0-9:$]+\\}/', self::ANY, $route);\r\n\r\n return $route;\r\n }",
"protected function parseUrl($url)\n {\n if (is_array($url)) return $url;\n\n $url = trim(ltrim($url, ' /@\\\\'));\n if (!preg_match('&^(?:([a-z][-+.a-z0-9]*):)&xis', $url, $matches)) {\n $url = 'http://' . $url;\n }\n $parsed = parse_url($url);\n\n if (!isset($parsed['scheme'])) {\n $parsed['scheme'] = 'http';\n }\n $parsed['scheme'] = strtolower($parsed['scheme']);\n\n if (isset($parsed['path']) && !isset($parsed['host'])) {\n $host = $parsed['path'];\n $path = '';\n if (strpos($parsed['path'], '/') !== false) {\n list($host, $path) = array_pad(explode('/', $parsed['path'], 2), 2, null);\n }\n $parsed['host'] = $host;\n $parsed['path'] = $path;\n }\n\n return $parsed;\n }",
"public function __construct(string $uri) {\n $parse = preg_replace(\"/#$/\", \"# \", urldecode($uri)); // Ensure empty frag parses to not null.\n $parse = parse_url($parse);\n if(isset($parse['fragment']) && $parse['fragment'] == \" \") {\n $parse['fragment'] = \"\";\n }\n if(!$parse) {\n throw new UriException(\"Could not parse URI '$uri'\");\n }\n foreach($parse as $part => $value) {\n $this->set($part, $value);\n }\n }",
"private function parseUrl($url): string {\n $splittedUrl = explode('/', $url);\n $newUrl = '';\n foreach ($splittedUrl as $partUrl) {\n if($partUrl !== '') {\n if($partUrl[0] === '{' && $partUrl[strlen($partUrl) - 1] === '}') {\n $newUrl.= '/VALUE';\n continue;\n }\n $newUrl .= '/' . $partUrl;\n }\n }\n return $newUrl;\n }",
"public function parseURL()\n {\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'], '/'); //menghapus tanda / di akhir url\n $url = filter_var($url, FILTER_SANITIZE_URL);//memfilter url dari karakter aneh (hack)\n $url = explode('/', $url); //memecah url yang diinput dengan delimiter / dan menjadikannya array\n return $url;\n }\n }",
"function parseRoutes($url_parts) {\n\n // turn the segment array into a URI string\n $uri = implode('/', $url_parts);\n\n // is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n return explode('/', $this->routes[$uri]);\n }\n\n // loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n // convert wild-cards to regex\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // does the regex match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return explode('/', $val);\n }\n }\n\n // match not found, default route returned\n return $url_parts;\n }",
"public function parseUrl()\n\t\t{\n\t\t\tif(isset($_GET['url']))\n\t\t\t{\n\t\t\t\t// explode(separator, string, limit);\n\t\t\t\treturn $url = explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n\t\t\t}\n\t\t}",
"public function compileRegex()\n {\n $route = $this->route->getUri();\n\n if (strpos($route, '?')) {\n $route = preg_replace('@\\/{([\\w]+)\\?}@', '(?:/{$1})?', $route);\n }\n\n $route = preg_replace('/{([a-z0-9_-]+)}/i', '(?P<$1>[^/]+)', $route);\n\n if(substr($route, -1) === '/') {\n $route .= '?';\n }\n\n return \"%^{$route}$%s\";\n }",
"function map_to_regex($matches) {\n\t\tif ($this->hasAllCapture) return '';\n\n\t\t$this->map[] = $matches[2];\n\t\tif ($matches[1] == '*') {\n\t\t\t$this->hasAllCapture = true;\n\t\t\treturn '/?(.*)';\n\t\t} else if ($matches[1] != ':') {\n\t\t\treturn '/?('.$matches[2].')';\n\t\t}\n\t\t\n\t\tif (array_key_exists($matches[2],$this->defaults) && is_null($this->defaults[$matches[2]])) {\n\t\t\treturn '/?([^\\/]*)';\n\t\t} else {\n\t\t\treturn '/([^\\/]+)';\n\t\t}\n\t}",
"public function match( $uri, & $args ){\n $args = array();\n if( $this->urls ){\n $buildRegex = function ( $pattern ){\n $params = array();\n $regex = preg_replace_callback(Resolver::param_match, function($match) use ( &$params ) {\n $params[] = $match[1];\n // only exclude line breaks from my match. this will let utf-8 sequences through.\n // older patterns below. \n // turns out I don't need to be super strict on my pattern matching.\n // php sapi does most of the work for me in giving me the url.\n return '([^\\n]+)'; \n //return '([[:graph:][:space:]]+)';\n //return '([a-z0-9\\.+\\,\\;\\'\\\\\\&%\\$\\#\\=~_\\-%\\s\\\"\\{\\}/\\:\\(\\)\\[\\]]+)';\n \n }, preg_quote($pattern, '#'));\n return array('#^' . $regex . '$#i', $params );\n };\n \n foreach( $this->urls as $pattern => $action ){\n list( $regex, $params ) = $buildRegex( $pattern );\n if( ! preg_match( $regex, $uri, $matches ) ) continue;\n $a = array_slice($matches, 1);\n foreach( $a as $i=>$v ){\n $args[ $params[$i] ] = $v;\n }\n \n return $action;\n \n }\n }\n $uri = strtolower(trim( $uri, '/'));\n if( ! $uri ) $uri = 'index';\n $res = $this->get( $uri, 'action', TRUE);\n if( $res ) return $uri;\n return '';\n }",
"private function guessURL($pattern)\n {\n $url = substr($pattern, 0, -1); // we remove the $\n $url = substr($url, 1); // we remove the ^\n \n return $url;\n }",
"protected function preparePatternAndBackReferenceIndexes () {\n\t\t$protocols = implode('|', $this->allowedSchemes);\n\t\tif (($this->allowProtocol & self::ALLOW_PROTOCOL_ABSOLUTE) != 0) {\n\t\t\t$protocol = '('.$protocols.')://';\n\t\t} else if (($this->allowProtocol & self::ALLOW_PROTOCOL_RELATIVE) != 0) {\n\t\t\t$protocol = '(?:('.$protocols.'):)?//';\n\t\t} else {\n\t\t\t$protocol = '(?:('.$protocols.')://)?';\n\t\t}\n\n\t\t$auth = '';\n\t\tif ($this->allowBasicAuth) {\n\t\t\t$auth = static::PATTERN_PART_AUTH;\n\t\t\t$this->backReferencePosHostname = 5;\n\t\t\t$this->backReferencePosPort = 9;\n\t\t} else {\n\t\t\t$this->backReferencePosHostname = 2;\n\t\t\t$this->backReferencePosPort = 6;\n\t\t}\n\t\t\n\n\t\t$hostname = '';\n\t\t$hostnameParts = [];\n\t\tif ($this->allowDomains)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_DOMAIN;\n\t\tif ($this->allowIPv4)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV4;\n\t\tif ($this->allowIPv6)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV6;\n\t\tif (count($hostnameParts) > 0) {\n\t\t\t$hostname = '(' . implode('|', $hostnameParts) . ')';\n\t\t} else {\n\t\t\t$hostname = '(' . implode('|', [\n\t\t\t\tstatic::PATTERN_PART_DOMAIN,\n\t\t\t\tstatic::PATTERN_PART_IPV4,\n\t\t\t\tstatic::PATTERN_PART_IPV6\n\t\t\t]) . ')';\n\t\t}\n\t\t\n\n\t\t$port = '';\n\t\tif (count($this->allowedPorts) > 0 || $this->allowPorts) {\n\t\t\t$port = static::PATTERN_PART_PORT;\n\t\t} else {\n\t\t\t$this->backReferencePosPort = NULL;\n\t\t}\n\n\n\t\t$this->pattern = str_replace([\n\t\t\t'{%protocol}', '{%auth}', '{%hostname}', '{%port}', \n\t\t\t'{%path}', '{%query}', '{%fragment}'\n\t\t], [\n\t\t\t$protocol, $auth, $hostname, $port, \n\t\t\tstatic::PATTERN_PART_PATH, static::PATTERN_PART_QUERY, static::PATTERN_PART_FRAGMENT\n\t\t], static::PATTERN_ALL);\n\t}",
"protected function __construct($scheme, $schemeSpecific = '')\n {\n // Setea el esquema\n $this->_scheme = $scheme;\n\n // Establecer reglas gramaticales para la validación a través de expresiones regulares.\n // Estos son para ser utilizado con barra delimitados por cadenas de expresiones regulares.\n\n // Caracteres especiales escapados (ej '%25' para '%')\n $this->_regex['escaped'] = '%[[:xdigit:]]{2}';\n\n // Caracteres no reservados\n $this->_regex['unreserved'] = '[' . self::CHAR_ALNUM . self::CHAR_MARK . ']';\n\n // Segmento puede utilizar escapado, sin reservas o un conjunto de caracteres adicionales\n $this->_regex['segment'] = '(?:' . $this->_regex['escaped'] . '|[' .\n self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_SEGMENT . '])*';\n\n // Path puede ser una serie de segmentos char strings seperated by '/'\n $this->_regex['path'] = '(?:\\/(?:' . $this->_regex['segment'] . ')?)+';\n\n // URI characters can be escaped, alphanumeric, mark or reserved chars\n $this->_regex['uric'] = '(?:' . $this->_regex['escaped'] . '|[' .\n self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_RESERVED .\n\n // Si se permiten caracteres imprudentes, agregarlos a la clase caracteres URI\n (self::$_config['allow_unwise'] ? self::CHAR_UNWISE : '') . '])';\n\n // Si no hay esquema específico. No hay nada que hacer\n if (strlen($schemeSpecific) === 0) {\n return;\n }\n\n // Analizar las el esquema específico\n $this->_parseUri($schemeSpecific);\n\n // Validar la URI\n if ($this->valid() === false) {\n throw new Exception('Url inválido');\n }\n }",
"public function parseURI() {\n $uri = explode(\"/\", $this->getRequestURI());\n $rootDIR = array_search($this->getProjectDIR(), $uri);\n\n return array_splice($uri, ($rootDIR+1));\n }",
"public function filter($uri) {\n if (strpos($uri, 'youtube.com') !== false || strpos($uri, 'youtu.be') !== false) {\n $type = self::$_youtube;\n } else if (preg_match(\"/\\bdailymotion\\b/i\", $uri)) {\n $type = self::$_dailymotion;\n } else if (preg_match(\"/\\bvimeo\\b/i\", $uri)) {\n $type = self::$_vimeo;\n } else {\n throw new Zend_Uri_Exception(\"L'uri donnée ne provient pas de youtube ni de dailymotion\");\n }\n $id = null;\n $title = null;\n $description = null;\n switch($type) {\n case self::$_youtube:\n if (preg_match('/http:\\/\\/youtu.be/', $uri)) {\n $id = str_replace('/', '', parse_url($uri, PHP_URL_PATH));\n } elseif (preg_match('/watch/', $uri)) {\n $url_vars = null;\n parse_str(parse_url($uri, PHP_URL_QUERY), $url_vars);\n $id = $url_vars['v'];\n } else {\n throw new Zend_Uri_Exception(\"Impossible de déterminer l'identifiant de cette vidéo\");\n }\n $yt = new Zend_Gdata_YouTube();\n $video = $yt->getVideoEntry($id);\n $title = $video->getTitleValue();\n $description = $video->getContent()->getText();\n break;\n case self::$_dailymotion:\n $id = strtok(basename($uri), '_');\n $url_video = 'http://www.dailymotion.com/video/'.$id;\n $xml = simplexml_load_file('http://www.dailymotion.com/services/oembed?url='.$url_video.'&format=xml');\n $tags = get_meta_tags('http://www.dailymotion.com/video/'.$id);\n $title = $xml->title;\n $description = $tags['description'];\n break;\n case self::$_vimeo:\n $result = preg_match('/(\\d+)/', $uri, $matches);\n if ($result == 0) {\n throw new Exception('Erreur lors de la récupération de l\\'identifiant de la vidéo Viméo');\n }\n $id = $matches[0];\n $hash = unserialize(file_get_contents('http://vimeo.com/api/v2/video/'.$id.'.php'));\n $title = $hash[0]['title'];\n $description = $hash[0]['description'];\n break;\n default:\n break;\n }\n return array(\n 'type' => $type,\n 'id' => $id,\n 'title' => $title,\n 'description' => $description,\n );\n }",
"function cms_url_decode_post_process($url_part)\n{\n if ((strpos($url_part, ':') !== false) && (can_try_url_schemes())) {\n $url_part = str_replace(array(':uhash:', ':amp:', ':slash:'), array('#', '&', '/'), $url_part);\n //$url_part = str_replace('(colon)', ':', $url_part);\n }\n return $url_part;\n}",
"function regexchecker($stringtocheck, $checkfor){\n\t$getsomething=FALSE;\n\tswitch($checkfor){\n\t case 'pagenumber':\n\t\t$getsomething=1;\n\t\t$regex=\"/^page0*([1-9][0-9]*)$/\";\n\t\tbreak;\n\t case 'username':\n\t\t\t$regex=\"/^[a-zA-Z0-9][a-zA-Z0-9_-]+[a-zA-Z0-9]$/\";\n\t\t\tbreak;\n\t\tcase 'id'://don't call this, just use is_numeric\n\t\t$regex=\"/^[1-9][0-9]*$/\";\n\t\tbreak;\n\t\tcase 'md5'://don't call this, just use is_numeric\n\t\t$regex=\"/^[a-f0-9]{32}$/i\";\n\t\tbreak;\n\t case 'internallink': //lcletter followed by lcletters, numbers, underscores and dashes\n\t\t$regex=\"/^[\\w-%]*$/\"; //doesn't check everything, just makes sure there are no extra odd characters % is for percent encoded chars\n\t\tbreak;\n\t\tcase 'taboo':\n\t\t\t$regex=\"/(fuck)|(viagra)|(cialis)(ass-*hole)|(cock-*sucker)|(god-*dam)|(shit[-\\s.!,?]+)|(cunt[-\\s.!,?]+)/i\";\n\t\t\treturn TRUE;\n\t\tbreak;\n\t\tcase 'url':\n\t\t\t//replace spaces at beginning or end\n\t\t\t$stringtocheck=preg_replace(\"/^\\s+|\\s+$/\", \"\", $stringtocheck);\n\t\t\t$stringtocheck=str_split($stringtocheck);\n\t\t\tforeach($stringtocheck as $key=>$value) $stringtocheck[$key]=(preg_match(\"/^[\\w\\.-~:\\/@\\?#%=,;]$/\", $value))? $value : rawurlencode($value);//originally had strings in non matching too\n\t\t\t$stringtocheck=implode($stringtocheck);\n\t\t\t$regex=\"/(?:(https?):\\/\\/)?(?:([^:@\\s]+)(?::([^:@\\s]+)?)?@)?((?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?)(?:\\.(?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?))+)(?::(\\d*))?(?:\\/((?:[\\w-\\._~:@!\\$\\^'\\(\\)\\*\\+,;=%]+\\/?)*)?)?(?:\\?([\\w-\\._~:@!\\$\\^'\\(\\)\\*\\+,;=%\\?\\/]*)?)?(?:#([\\w-\\._~:@!\\$\\^'\\(\\)\\*\\+,;=%\\?\\/]*)?)?/i\";\n\t\t\t$getsomething=\"all\";\n\t\t\tbreak;\n\t\tcase 'email':\n\t\t\t//replace spaces at beginning or end\n\t\t\t$stringtocheck=preg_replace(\"/^\\s+|\\s+$/\", \"\", $stringtocheck);\n\t\t\t$regex=\"/^(([^:@\\s]+)@((?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?)(?:\\.(?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?))+))$/i\"; //not perfect but should be good enough\n\t\t\t$getsomething=\"all\";\n\t\t\tbreak;\n\t\tcase 'urlpath':\n\t\t\t//test path ./../path././.info/goodby/../goodby/./../goodby/goodby/../../rmation\n\t\t\t//should return path./.info/rmation\n\t\t\t//replace runs of / with 1 / //there shouldn't be any if have valid url, but just double checking\n\t\t\t$stringtocheck=preg_replace(\"/\\/+/\", \"/\", $stringtocheck);\n\t\t\t//replace any runs of ../ and or ./ at beginning of path with\n\t\t\t$stringtocheck=preg_replace(\"/^(\\.?\\.\\/)+/\", \"\", $stringtocheck);\n\t\t\t//replace any /./ or runs of /././ with just /\n\t\t\t$stringtocheck=preg_replace(\"/\\/(\\.\\/)+/\", \"/\", $stringtocheck);\n\t\t\t//replace any pathinfo/../ with just \"\"\n\t\t\twhile(strrpos($stringtocheck, \"/../\")>0)$stringtocheck=preg_replace(\"/[^\\/]+\\/\\.\\.\\//\", \"\", $stringtocheck, 1);\n\t\t\t//replace runs of / with 1 / //there shouldn't be any, but just double checking\n\t\t\treturn preg_replace(\"/\\/+/\", \"/\", $stringtocheck);\n\t\tdefault :\n\t\treturn FALSE;//if we call this without a defined checkfor return false\n\t}\n\n\t//echo \"<p>We're in regexchecker checking $stringtocheck for $regex and get something is $getsomething.</p>\";\n\n\tif(preg_match($regex,$stringtocheck,$matches)==1){\n\t\t if($getsomething==\"all\")return $matches;\n\t\t elseif($getsomething)return $matches[$getsomething];\n\t else return TRUE;\n\t}\n\t//if we're here something went wrong so return FALSE\n\treturn FALSE;\n}",
"public function parseUrl(){\n\n if(isset($_GET['url'])){\n //echo $_GET['url'];\n\n return $url = explode('/',filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n }",
"function wp_parse_url($url, $component = -1)\n {\n }",
"function is_uri($uri){\n return (filter_var($uri, FILTER_VALIDATE_URL) !== false);\n}",
"public function getSearchPattern();",
"public function getSearchPattern();",
"abstract protected function isValidUri(): bool;",
"function regexmakecanonical($urlstring, $rule=''){\n\t//do a switch here based on rule to create regex patterns\n\t//outside of switch to a match\n\t//if match return match[1]\n\t//if not match return string\n\t//get rid of unneeded spaces\n\t$urlstring=regexspacecleaner($urlstring);\n\treturn $urlstring;\n}"
]
| [
"0.7223644",
"0.6834441",
"0.6448246",
"0.6418725",
"0.6281149",
"0.6222375",
"0.6152099",
"0.59788036",
"0.59070414",
"0.59012574",
"0.5870206",
"0.5860436",
"0.5787041",
"0.57342756",
"0.5731093",
"0.57167524",
"0.57047814",
"0.5698891",
"0.5688599",
"0.56696033",
"0.565761",
"0.5653125",
"0.5582997",
"0.5507754",
"0.5495895",
"0.5424408",
"0.54234296",
"0.5412865",
"0.5388156",
"0.53851527",
"0.53845555",
"0.53793216",
"0.53296155",
"0.53223073",
"0.5313306",
"0.53111947",
"0.52996916",
"0.52884156",
"0.52882373",
"0.52746713",
"0.52746713",
"0.5260895",
"0.52471006",
"0.52022815",
"0.5198628",
"0.51984525",
"0.51939154",
"0.5193467",
"0.51825315",
"0.51702523",
"0.5153558",
"0.51517355",
"0.5148272",
"0.5144865",
"0.51363075",
"0.5132119",
"0.51233417",
"0.5119057",
"0.51189387",
"0.51188624",
"0.5107008",
"0.51009816",
"0.50998104",
"0.5096398",
"0.50961894",
"0.50938535",
"0.5085198",
"0.5073097",
"0.5062697",
"0.5061851",
"0.50593895",
"0.50501305",
"0.5044243",
"0.50439644",
"0.5043161",
"0.5032577",
"0.49978852",
"0.49879307",
"0.49874637",
"0.4981636",
"0.49790308",
"0.4973686",
"0.4970035",
"0.49664333",
"0.49512944",
"0.49466392",
"0.49353862",
"0.49224928",
"0.49208102",
"0.49185908",
"0.49182543",
"0.49048018",
"0.48963675",
"0.4892189",
"0.4884747",
"0.48814285",
"0.48790407",
"0.48790407",
"0.48786807",
"0.48756775"
]
| 0.6865329 | 1 |
Parse URI parameter names to array | public function parseParameterNames()
{
return RouteMatch::parseParameterNames($this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function compileParameterNames()\n {\n preg_match_all('/\\{(.*?)\\}/', $this->getDomain() . $this->uri, $matches);\n\n return array_map(function ($m) {\n return trim($m, '?');\n }, $matches[1]);\n }",
"public function provideURIArgumentSchemeNames()\n {\n $schemeList = $this->getMalformedURISchemes();\n $parameters = array();\n\n foreach ($schemeList as $scheme) {\n $parameters[] = array($scheme);\n }\n\n return $parameters;\n }",
"private function parseParams() : array\n {\n $querySting = (parse_url($_SERVER['QUERY_STRING']))['path'];\n parse_str($querySting, $params);\n return $params;\n }",
"protected function getUriParams($uri)\n {\n $params = array();\n\n if (strpos($uri, '/:') !== false) {\n $params = explode('/:', $uri);\n unset($params[0]);\n }\n foreach ($params as $key => $value) {\n $params[$key] = str_replace('#', '', $value);\n }\n return $params;\n }",
"public function params($params) {\n if(is_array($params)) return $params;\n $result = array();\n foreach(explode('|', $params) as $param) {\n $pos = strpos($param, ':');\n $result[trim(substr($param, 0, $pos))] = trim(substr($param, $pos+1));\n }\n return $result;\n }",
"public function parameters(): array\n {\n $requestRoute = request()->route()->getName();\n $requestValues = Str::of($requestRoute)\n ->explode('.')\n ->toArray();\n\n return is_null($requestValues)\n ? []\n : $requestValues;\n }",
"public function getParamsNames() : array\n {\n\n // Lvd.\n $result = [];\n\n foreach ($this->params as $order => $param) {\n $result[$order] = $param['name'];\n }\n\n return $result;\n }",
"public static function parseUrl()\n {\n $route = trim($_SERVER['QUERY_STRING'], '/');\n $params = explode('/', $route);\n $params = array_slice($params, 2);\n\n return [$route, $params];\n }",
"public function getUriParams()\n {\n $values = array();\n $string = parse_url(filter_input(INPUT_SERVER, 'REQUEST_URI'));\n if (isset($string['query'])) {\n $exp = explode('&', $string['query']);\n $count = count($exp);\n for ($i = 0; $i < $count; $i++) {\n $value = explode('=', $exp[$i]);\n $values[$value[0]] = self::setAntiInjection($value[1]);\n }\n }\n return $values;\n }",
"public function getParamNames();",
"function parseGetParams()\n {\n $this->parameters = array();\n\n $uriParts = explode('?', $this->userURI);\n $itemCount = count($uriParts);\n if ($itemCount == 0)\n {\n return;\n }\n\n //remove last item if it's empty\n if (isset($uriParts[$itemCount - 1]) && $uriParts[$itemCount - 1] == '')\n {\n array_pop($uriParts);\n }\n \n //remove first item if it's empty\n if (isset($uriParts[0]) && $uriParts[0] == '')\n {\n array_shift($uriParts);\n }\n\n //if has no valid item then return\n if (count($uriParts) == 0)\n {\n return;\n }\n writeLog(print_r($uriParts, true));\n \n foreach($uriParts as $inputData)\n {\n $data = html_entity_decode($inputData);\n $pair = explode('=', $data);\n\n if (count($pair)>1)\n {\n $this->parameters[$pair[0]] = $pair[1];\n }\n }\n \n writeLog(\"params = \".print_r($this->parameters, true));\n }",
"public static function getUrlParameters(): array\n {\n $parameterString = isset($_SERVER['PATH_INFO']) ?\n // If not using an apache server (ie. VSCode PHP Server), need to use PATH_INFO and remove leading slash\n ltrim($_SERVER['PATH_INFO'], '/') :\n // Otherwise, use a QUERY_STRING passed on by an .htaccess rewrite rule\n $_SERVER['QUERY_STRING'];\n\n return explode('/', self::sanitize($parameterString));\n }",
"function processUriParams() {\n\t\t$params = array();\n\t\t$uriParams = explode('/', trim($this->_uri, '/'));\n\t\t$count = count($uriParams);\n\t\tif($count > 0) {\n\t\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\t\t$val = isset($uriParams[($i + 1)]) ? $uriParams[($i + 1)] : null;\n\t\t\t\t$params[$uriParams[$i]] = urldecode(is_numeric($val) ? (int) $val : $val);\n\t\t\t}\n\t\t\t$this->_uriParams = $params;\n\t\t}\n\t}",
"function getParameterNames();",
"function name_and_representation_in_url() {\n preg_match(URI_REGEX, request_uri(), $request_matches);\n return array(\n (isset($request_matches[1]) ? $request_matches[1] : ''),\n (isset($request_matches[2]) ? $request_matches[2] : ''),\n );\n}",
"public static function getAllURLParams()\n\t{\n\t\treturn explode('/', $_SERVER['REQUEST_URI']);\n\t}",
"protected function getRestParams() {\n\t\t$result = array();\n\t\tif (function_exists('mb_parse_str')) {\n\t\t\tmb_parse_str(file_get_contents('php://input'), $result);\n\t\t} else {\n\t\t\tparse_str(file_get_contents('php://input'), $result);\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getUriVars(): array;",
"public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}",
"public static function parse_parameters( $input ) {\n if (!isset($input) || !$input) return array();\n\n $pairs = explode('&', $input);\n\n $parsed_parameters = array();\n foreach ($pairs as $pair) {\n $split = explode('=', $pair, 2);\n $parameter = OAuthUtil::urldecode_rfc3986($split[0]);\n $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';\n\n if (isset($parsed_parameters[$parameter])) {\n // We have already recieved parameter(s) with this name, so add to the list\n // of parameters with this name\n\n if (is_scalar($parsed_parameters[$parameter])) {\n // This is the first duplicate, so transform scalar (string) into an array\n // so we can add the duplicates\n $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);\n }\n\n $parsed_parameters[$parameter][] = $value;\n } else {\n $parsed_parameters[$parameter] = $value;\n }\n }\n return $parsed_parameters;\n }",
"protected function getSubmittedParamList( $uri, $filename )\n {\n if ( $uri == '' )\n {\n return array();\n }\n\n if ( $uri[strlen( $uri ) - 1] != '/' )\n {\n $uri .= '/';\n }\n\n $moduleName = str_replace( $this->ModuleFileName, '', str_replace( $this->Dir . '/', '', $filename ) );\n $result = str_replace( $moduleName, '', $uri );\n if ( !$result )\n {\n return array();\n }\n\n $list = explode( '/', $result );\n array_pop( $list );\n\n return $list;\n }",
"private function parseParameters(): Collection\n {\n $offset = 0;\n $closePos = 0;\n $Parameters = new Collection();\n\n while ($openPos = strpos($this->uri, '{', $offset)) {\n if ($closePos = strpos($this->uri, '}', $openPos)) {\n $length = $closePos - $openPos - 1;\n $name = substr($this->uri, $openPos + 1, $length);\n $required = true;\n\n if (Str::endsWith($name, '?')) {\n $required = false;\n $name = rtrim($name, '?');\n }\n\n $Parameters->push(new RouteParameter($name, $required));\n $offset = $closePos;\n }\n }\n\n return $Parameters;\n }",
"public function getParams(){\n if( !empty($this->uri['query']) ):\n parse_str($this->uri['query'], $this->params);\n return $this->params;\n endif;\n }",
"static private function parseUrl($uri)\n {\n $parts = explode('/', $uri);\n unset($parts[0]);\n $parsed['pattern'] = '#^\\\\/'; // patttern est le motif\n $parsed['params'] = array(); // contien les arguments\n $parsed['par'] = ['needed' => array(), 'optional' => array()]; // par contient 2 tableau avec le nom des argument\n foreach ($parts as $part)\n if (strlen($part) < 3)\n $parsed['pattern'].= $part . '\\\\/';\n else\n {\n if ($part[0] != '{')\n $parsed['pattern'] .= $part . '\\\\/';\n else if ($part[1] != '?')\n $parsed['pattern'] .= '([\\w-]*)\\\\/';\n $parsed['params'][] = substr($part, 1, -1);\n $parsed['par'][$part[1] != '?' ? 'needed' : 'optional'][] = substr($part, 1 + ($part[1] != '?' ? 1 : 0), -1);\n }\n $parsed['pattern'] .= '$#';\n return $parsed;\n }",
"public function getParameters() {\n $matches = array();\n $regexp = '/:[a-zA-Z_][a-zA-Z0-9_]*/';\n $count = preg_match_all($regexp, $this->path, $matches);\n \n return $matches[0];\n }",
"public static function getParams(UriInterface $uri): array\n {\n $pairs = [];\n\n try {\n $pairs = Query::createFromUri($uri)->pairs();\n } catch (Throwable $exception) {\n // Ignore the exception.\n }\n\n $associatedPairs = [];\n\n foreach ($pairs as $key => $value) {\n $associatedPairs[$key] = $value;\n }\n\n return $associatedPairs;\n }",
"abstract public function parseRequestParameters();",
"public static function getParameters(string|array $name = \"\"):string|array|null {\n\n # Set result\n $result = null;\n\n # Check name\n if(!$name || empty($name))\n\n # Set result\n $result = self::get(\"routes.current.parameters\");\n\n # Check is string\n if(is_string($name))\n\n # Set result\n $result = self::get(\"routes.current.parameters.$name\");\n\n # If array\n else\n\n # Iteration of name\n foreach($name as $v)\n\n # Check v\n if($v)\n\n # Set result\n $result[$v] = self::get(\"routes.current.parameters.$v\");\n\n # Return result\n return $result;\n\n }",
"function queryStringToArray($string) {\n $url = explode('&', $string);\n /* Request variable to store all parameters */\n $request = array();\n foreach ($url as $value) {\n $new = explode('=', $value);\n $request[$new[0]] = $new[1];\n }\n return $request;\n}",
"private function getParams($accept=null)\n\t{\n\t\t$result = [];\n\t\t$arr = explode(';', $accept);\n\t\tforeach ($arr as $k=>$v)\n\t\t{\n\t\t\t$arr2 = explode('=', $v);\n\t\t\tif ($arr2[0]) $result[$arr2[0]] = $arr2[1];\n\t\t}\n\t\treturn $result;\n\t}",
"function urlQueryToArray($url) {\n $params = array();\n $query = explode('&', parse_url($url, PHP_URL_QUERY));\n foreach($query as $tok) {\n list($var, $val) = explode('=', $tok);\n $params[$var] = urldecode($val);\n }\n return $params;\n }",
"private function getParameters() {\n $raw_parameters = $this->routeMatch->getRawParameters();\n $parameters = $this->routeMatch->getParameters();\n\n $return_params = [];\n foreach ($parameters as $key => $value) {\n if ($raw_value = $raw_parameters->get($key)) {\n $return_params[$key] = $raw_value;\n continue;\n }\n\n $return_params[$key] = $parameters->get($key);\n }\n\n return $return_params;\n }",
"public function getQueryString(): array\n {\n\n $buffer = explode('?', $_SERVER[\"REQUEST_URI\"]);\n\n $variable = explode('&', array_pop($buffer));\n\n $array_variable = [];\n\n foreach ($variable as $value) {\n\n $items = explode('=', $value);\n $array_variable[array_shift($items)] = array_pop($items);\n }\n\n return $array_variable;\n }",
"private function getQueryString(): array\n {\n parse_str($this->request->getUri()->getQuery(), $queryString);\n\n if (isset($queryString['p'])) {\n unset($queryString['p']);\n }\n\n return $queryString;\n }",
"public function & extractParameters ($names)\n {\n\n $array = array();\n\n foreach ($this->parameters as $key => &$value)\n {\n\n if (in_array($key, $names))\n {\n\n $array[$key] =& $value;\n\n }\n\n }\n\n return $array;\n\n }",
"public function getQuery() : array\n {\n $result = [];\n parse_str($this->uri->getQuery() ?: '', $result);\n\n return $result;\n }",
"public static function parseArgs($args) {\n if (preg_match_all ( \"/([^\\\\[^\\\\]]+)/\", $args, $matches )) {\n $params = explode ( ',', $matches [1] [0] );\n $toReturn = array ( );\n foreach ( $params as $p ) {\n @list ( $key, $value ) = explode ( '=>', $p );\n $toReturn [preg_replace ( \"/[\\\\' ]+/\", \"\", $key )] = preg_replace ( \"/[\\\\' ]+/\", \"\", $value );\n }\n return $toReturn;\n }\n return $args;\n }",
"public static function getParamaters($query) {\n $params = [];\n foreach(explode('&', $query) as $param) {\n @list($key, $value) = explode('=', $param);\n $params[$key] = $value;\n }\n return $params;\n }",
"private function __parseUrl()\n {\n if (isset($_GET['url'])) {\n return explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n return [];\n }",
"final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }",
"public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }",
"public function getParams(): array;",
"private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }",
"function decode_custom_param_str($param_struct, $uri_string)\n {\n preg_match_all('#%(.*?)%#', $param_struct, $struct_matches);\n \n // Get the uri matches (param values)\n $match_str = '#'.$this->get_custom_forwarding_rule($param_struct).'#';\n preg_match($match_str, $uri_string, $uri_matches);\n \n $param_array = array();\n for($i = 0; $i < count($struct_matches[1]); $i++)\n $param_array[$struct_matches[1][$i]] = $uri_matches[$i+1];\n \n return $param_array;\n }",
"public function getQueryParams() {\n if ($pos = strpos ( $this->url, '?' )) {\n $queryStr = substr ( $this->url, $pos + 1 );\n $params = array ();\n parse_str ( $queryStr, $params );\n return $params;\n }\n return array ();\n }",
"public function getParams()\n {\n $params = explode('/', $this->getPath());\n array_shift($params);\n return $params;\n }",
"public static function getURLParams()\n\t{\n\t\t$params = [];\n\t\t$urlParams = self::getAllURLParams();\n\t\tfor ($i = contrlPos + 2; $i < count($urlParams); $i++) {\n\t\t\t$params[] = $urlParams[$i];\n\t\t}\n\t\treturn $params;\n\t}",
"protected function parseKeys($uri, $pageName) {\n $chunks = explode('?', $uri);\n $trimmedChunks = rtrim($chunks[0], '/');\n //this is based on URI\n $uriPieces = (explode('/', $trimmedChunks));\n\n\n //this is based on config file - remove array_filter as it was dropping last chunk\n $pagePieces = (explode('/', $pageName));\n\n if (count($uriPieces) != count($pagePieces) || count($pagePieces) < 1) {\n return false;\n }\n\n $retval = array();\n for ($i = 0; $i < count($uriPieces); $i++) {\n if (array_key_exists($i, $pagePieces)) {\n if (substr($pagePieces[$i], 0, 1) == '{') {\n $retval[preg_replace(\"/{(.*)}/\", \"$1\", $pagePieces[$i])] = $uriPieces[$i];\n continue;\n }\n\n if ($pagePieces[$i] != $uriPieces[$i]) {\n\n return false;\n }\n }\n }\n\n return $retval;\n }",
"public function parseParameterPatterns()\n {\n return RouteMatch::parseParameterPatterns($this);\n }",
"private function getUriSegments($name)\n {\n $uri = $this->getRouteByName($name)->uri();\n\n return array_filter(explode('/', $uri), function ($v) {\n return $v != '';\n });\n }",
"protected function _getParams()\n {\n $aResult = array();\n $aParams = (array)$this->_getContainer()->getConfig()->getRequestParameter('aParams');\n\n foreach ($aParams as $sKey => $sValue) {\n $aResult[html_entity_decode($sKey)] = html_entity_decode($sValue);\n }\n\n return $aResult;\n }",
"public static function getParamsFromURL($url)\n {\n $return = array();\n if (! empty($url)) {\n $params = explode(\"/\", $url);\n $params = Formatter::cleanData($params);\n \n if (count($params) != 0) {\n foreach ($params as $nr => $param) {\n if ((preg_match('/page-(?<number>\\d+)/', $param, $matches))) { // Page\n $return[self::PARAM_PAGE] = (int) $matches[1];\n } elseif ((preg_match('/lang-(?P<value>.+)/', $param, $matches))) { // Language\n $return[self::PARAM_LANG] = $matches['value'];\n } elseif (! isset($return[self::PARAM_CONTROLLER])) { // Module\n $return[self::PARAM_CONTROLLER] = $param;\n } elseif (! isset($return[self::PARAM_METHOD])) { // Method\n $return[self::PARAM_METHOD] = $param;\n } else { // Method argument\n if (! array_key_exists(self::PARAM_METHOD_ARGUMENTS, $return)) {\n $return[self::PARAM_METHOD_ARGUMENTS] = array();\n }\n $return[self::PARAM_METHOD_ARGUMENTS][] = $param;\n }\n }\n }\n }\n \n return $return;\n }",
"function getQueryParams()\n {\n $queryString = $_SERVER['QUERY_STRING'];\n $queryArray = explode('&', $queryString);\n $response = array();\n foreach ($queryArray as $query) {\n $query = explode('=', $query);\n $response[$query[0]] = $query[1];\n }\n return $response;\n }",
"private function getUrl() {\n $parameters = array();\n $url = parse_url($_SERVER['REQUEST_URI']);\n foreach (explode(\"/\", $url['path']) as $p)\n if ($p != '')\n $parameters[] = $p;\n\n return $parameters;\n }",
"private function parseParams(array $values): array\n {\n foreach ( $values as &$value )\n {\n if ( is_string($value) && str_starts_with($value, '%') && str_ends_with($value, '%') )\n {\n // remove first % and last %\n $key = substr($value, 1, -1);\n\n if ( $this->parameterBag->has($key) )\n {\n $value = $this->parameterBag->get($key);\n }\n }\n elseif ( is_array($value) )\n {\n $value = $this->parseParams($value);\n }\n }\n\n return $values;\n }",
"public function provideValidURISchemeNames()\n {\n $schemeList = $this->getWellformedURISchemes();\n $parameters = array();\n\n foreach ($schemeList as $scheme) {\n $parameters[] = array($scheme);\n }\n\n return $parameters;\n }",
"protected function getAllArgs()\n {\n $this->methodExpectsRequest(__METHOD__);\n $params = [];\n foreach ($this->getRequest()->getAllArgs() as $index => $value) {\n if (isset($this->argument_position_name[$index])) {\n $param_name = $this->argument_position_name[$index];\n $params[$param_name] = $value;\n }\n }\n return $params;\n }",
"private static function getParams(): array\n {\n $getParams = [];\n\n if (!empty($_GET)) {\n $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT);\n }\n\n return $getParams;\n }",
"public function getParameterNames ()\n {\n\n return array_keys($this->parameters);\n\n }",
"function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }",
"public static function http_parse_query(string $queryString, string $argSeparator = '&', int $decType = PHP_QUERY_RFC1738): array\n {\n if (empty($queryString)) { return []; }\n $result = [];\n $parts = explode($argSeparator, $queryString);\n\n foreach ($parts as $part) {\n list($paramName, $paramValue) = array_pad(explode('=', $part, 2), 2, '');\n\n switch ($decType) {\n case PHP_QUERY_RFC3986:\n $paramName = rawurldecode($paramName);\n $paramValue = rawurldecode($paramValue);\n break;\n\n case PHP_QUERY_RFC1738:\n default:\n $paramName = urldecode($paramName);\n $paramValue = urldecode($paramValue);\n break;\n }\n\n\n if (preg_match_all('/\\[([^\\]]*)\\]/m', $paramName, $matches)) {\n $paramName = substr($paramName, 0, intval(strpos($paramName, '[')));\n $keys = array_merge([$paramName], $matches[1]);\n } else {\n $keys = [$paramName];\n }\n\n $target = &$result;\n\n foreach ($keys as $index) {\n if ('' === $index) {\n if (isset($target)) {\n if (is_array($target)) {\n $intKeys = array_filter(array_keys($target), 'is_int');\n $index = count($intKeys) ? max($intKeys)+1 : 0;\n } else {\n $target = [$target];\n $index = 1;\n }\n } else {\n $target = [];\n $index = 0;\n }\n } elseif (isset($target[$index]) && !is_array($target[$index])) {\n $target[$index] = [$target[$index]];\n }\n\n $target = &$target[$index];\n }\n\n if (is_array($target)) {\n $target[] = $paramValue;\n } else {\n $target = $paramValue;\n }\n }\n\n return $result;\n }",
"function get_values_from_segs($form_field_names, $segs) {\n // Include app/Helpers/wildcard_conversion_helper.php\n //helper('wildcard_conversion');\n // NOTE: As of Dec. 19, 2022, all calling methods are already doing URL/special value decoding\n // Performing that again here ends up incorrectly converting '%xx' (from '__Wildcard__xx') into HTML entities\n\n $a = array();\n $seg_val = current($segs);\n foreach ($form_field_names as $field) {\n if ($seg_val === false) {\n break;\n }\n\n if ($seg_val != '-') {\n //$a[$field] = decode_special_values($seg_val); // see NOTE above\n $a[$field] = $seg_val;\n }\n $seg_val = next($segs);\n }\n return $a;\n}",
"protected function getArgs()\n {\n $uri = $_SERVER['REQUEST_URI'];\n $name = $_SERVER['SCRIPT_NAME'];\n\n if (substr($uri,0,strlen($name)) == $name) $args = substr($uri,strlen($name)+1);\n else $args = substr($uri,strlen(dirname($name)) + 1);\n\n // Need to pull out any thing after ?\n // $tmp = explode('?',$args);\n // $args = $tmp[0];\n\n // Convert to array\n $args = explode('/',$args);\n\n return $args;\n }",
"public function explodeRequestParts()\n {\n $requestParts = null;\n\n if ( isset($_GET['params']) && !empty($_GET['params']) ) {\n $requestParts = explode( '/', filter_var( rtrim( $_GET['params'], '/' ), FILTER_SANITIZE_URL ) );\n }\n\n return $requestParts;\n }",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"abstract public function parseNamedParameters($parameters);",
"public function parse_segments_to_params(array $segments)\n\t{\n\t\t$parameters = array();\n\t\t\n\t\t// format: /key/value/key2/value2/...\n\t\twhile($e = array_shift($segments))\n\t\t{\n\t\t\tif( ! empty($segments))\n\t\t\t{\n\t\t\t\t$parameters[$e] = array_shift($segments);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// no value, just add it to the array\n\t\t\t\t$parameters[] = $e;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $parameters;\n\t}",
"private function getParams()\n {\n $queryParams = $this->request->getQueryParams();\n\n $params = [\n 'openid.assoc_handle' => array_get($queryParams,self::OPENID_ASSOC_HANDLE),\n 'openid.signed' => array_get($queryParams,self::OPENID_SIGNED),\n 'openid.sig' => array_get($queryParams,self::OPENID_SIG),\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'check_authentication',\n ];\n\n $signedParams = explode(',', array_get($queryParams,self::OPENID_SIGNED));\n\n foreach ($signedParams as $item) {\n $value = array_get($queryParams,'openid_'.str_replace('.', '_', $item));\n $params['openid.'.$item] = $value;\n }\n\n return $params;\n }",
"function get_query_array() {\r\n\t\t\t$parts = parse_url( $this->get_current_url() );\r\n\t\t\tif ( isset( $parts['query'] ) ) {\r\n\t\t\t\tparse_str( $parts['query'], $query );\r\n\t\t\t\treturn $query;\r\n\t\t\t}\r\n\r\n\t\t\treturn array();\r\n\t\t}",
"public function processParams($params)\n {\n GeneralUtility::logDeprecatedFunction();\n $paramArr = [];\n $lines = GeneralUtility::trimExplode(LF, $params, true);\n foreach ($lines as $val) {\n $pair = explode('=', $val, 2);\n $key = trim($pair[0]);\n if ($key[0] !== '#' && $key[0] !== '/') {\n $paramArr[$key] = trim($pair[1]);\n }\n }\n return $paramArr;\n }",
"private function getQueryParams (): array\r\n {\r\n return $_GET;\r\n }",
"private function detectQueryParams()\n {\n $uri = new Uri('http://example.org'.$this->getRequestTarget());\n parse_str($uri->getQuery(), $params);\n return array_merge($_GET, $params);\n }",
"public function parseParams($params)\n {\n $toReturn = array();\n for ($i = 0; $i < count($params); $i+=2) {\n if (isset($params[$i+1])) {\n $toReturn[$params[$i]] = $params[$i+1];\n } else {\n $toReturn[] = $params[$i];\n }\n }\n return $toReturn;\n }",
"function parse_query($var)\n {\n $var = parse_url($var, PHP_URL_QUERY);\n $var = html_entity_decode($var);\n $var = explode('&', $var);\n $arr = array();\n\n foreach($var as $val)\n {\n $x = explode('=', $val);\n $arr[$x[0]] = $x[1];\n }\n unset($val, $x, $var);\n return $arr;\n }",
"public function parse(): array\n {\n unset($this->arguments[0]);\n $keyPairParams = [];\n foreach ($this->arguments as $argument) {\n $arguments = explode(self::CONSOLE_DELIMITER, strip_tags($argument));\n $parameterName = ltrim(reset($arguments), self::START_PARAMETER_WITH);\n $parameterValue = end($arguments);\n $keyPairParams[$parameterName] = $parameterValue;\n }\n return $keyPairParams;\n }",
"public function getRouteParams();",
"public function getQueryParameters(): array;",
"function getInputParams()\n {\n $params = array();\n parse_str( $this->getInput() , $params );\n return $params;\n }",
"public function getParams($name = '') {\n if($name) {\n return isset($this->params[$name]) ? $this->params[$name] : '';\n }\n else{\n return $this->params;\n }\n }",
"private function getVars($route) {\n if ( ! strstr($route, ':word') && ! strstr($route, ':num')) {\n return [];\n }\n $regex = str_replace(['(', ')', ':word', ':num'], [\"\", \"\", '([\\w_-]+)', '([\\d-]+)'], $route);\n $found = preg_match_all('~' . $regex . '~', $this->url, $matches, PREG_SET_ORDER);\n if ($found) {\n unset($matches[0][0]); // first match is the full url path\n return array_values($matches[0]);\n }\n\n return [];\n }",
"public function get_params(string $env): array {\n $generic_params = $this->_parse_content($this->_generic_content);\n $env_params = $this->_parse_content($this->_fetch_env_content($env));\n\n return f\\concat($generic_params, $env_params);\n }",
"function parsePath($url)\n{\n $vars = array();\n\n if (preg_match_all('#\\{(\\w+)\\}#', $url, $matches)) {\n // First we convert the action route with its {variable_name} format to a preg-able string...\n for ($i=0; $i<count($matches[0]); $i++) {\n $str = $matches[0][$i];\n $vars[] = $matches[1][$i]; // Get the list of variables in the route into a different array.\n }\n\n // // Match - assign the values to the assoc array for return.\n // $url_variables = array();\n // for($i=0; $i<count($vars); $i++) {\n // \t$url_variables[$vars[$i]] = $route_matches[$i+1][0];\n // }\n }\n\n return $vars;\n}",
"public function getParams() :array;",
"public function getParams() {\n\n parse_str($this->params, $return);\n return $return;\n }",
"public function params(): array;",
"private function explodeUri(): void\n {\n if (!isset($this->uri)) {\n return;\n }\n\n $path = $this->removePrefix($this->uri);\n $split = explode('?', $path);\n $this->segments = explode('/', rtrim(ltrim($split[0], '/'), '/'));\n\n if (isset($split[1])) {\n $list = explode('&', $split[1]);\n\n foreach ($list as $elem) {\n $pair = explode('=', $elem);\n\n if (isset($pair[1])) {\n $this->params[$pair[0]]\n = \\miniworx\\Application\\Utils\\Sanitation::sanitizeUrl(\n $pair[1]\n );\n }\n }\n }\n }",
"public static function availableParams(string $paramsPrefix, string $translatePrefix = '')\n\t{\n\t\t$constants = (new \\ReflectionClass(__class__))->getConstants();\n\n\t\tif (empty($constants) || !$paramsPrefix) {\n\t\t\treturn [];\n\t\t}\n\n\t\t$params = [];\n\n\t\t$paramsPrefix = strtoupper($paramsPrefix) . '_';\n\n\t\tforeach ($constants as $name => $value) {\n\t\t\tif (strpos($name, $paramsPrefix) !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$paramName = strtolower(substr($name, strlen($paramsPrefix)));\n\n\t\t\t$params[$value] = $translatePrefix\n ? __($translatePrefix . '_' .$paramName)\n : $paramName;\n\t\t}\n\n\t\treturn $params;\n\t}",
"protected function parseParameters(array $parameters): array\n {\n $routeParameter = $this->get('route')['parameters'];\n $matchedParameters = [];\n \n foreach ($routeParameter as $key => $value) {\n $matchedParameters[$key] = $parameters[$value];\n }\n\n return $matchedParameters;\n }",
"public function parse(Uri $uri): ? array\n {\n // Get path without possible file\n $path = $uri->getPath();\n\n // Build route pattern\n $pattern = $this->buildRoutePattern();\n\n if (preg_match($pattern, $path, $matches) === 1) {\n $variables = [];\n $length = sizeof($matches);\n\n for ($i = 1; $i < $length; $i++) {\n $variables[$this->parameter[$i - 1]] = urldecode($matches[$i]);\n }\n\n return $variables;\n }\n\n return null;\n }",
"function getParameters(): array;",
"function PKG_listParams($paramStr)\n{\n\t$params = explodeAssoc(\"?#*\",$paramStr);\n\n\t$out = \"\";\n\n\t$keys = array_keys($params);\n\n\tfor ($i=0; $i < count($keys); $i++)\n\t\tif ((strlen($keys[$i]) > 0) && (strlen($params[$keys[$i]]) > 0))\n\t\t$out.=wordwrap($keys[$i].\": \".$params[$keys[$i]].\"<br>\",60);\n\n\treturn($out);\n}"
]
| [
"0.7373466",
"0.70888084",
"0.7008693",
"0.690512",
"0.6853162",
"0.67972755",
"0.6770973",
"0.67646474",
"0.67563564",
"0.67072564",
"0.6672863",
"0.66492814",
"0.6615369",
"0.6606372",
"0.64763296",
"0.6465431",
"0.64409083",
"0.643821",
"0.6435055",
"0.6410947",
"0.63743865",
"0.63202137",
"0.6318315",
"0.6225234",
"0.6199475",
"0.6178109",
"0.6160725",
"0.61330515",
"0.6088127",
"0.60873955",
"0.6083174",
"0.60726285",
"0.60659635",
"0.60591763",
"0.60544264",
"0.6024585",
"0.6012644",
"0.6006464",
"0.6002295",
"0.5998219",
"0.5990791",
"0.5963451",
"0.596297",
"0.5950264",
"0.59303796",
"0.59244317",
"0.59079534",
"0.590746",
"0.58890826",
"0.5878719",
"0.5876803",
"0.58756894",
"0.5875391",
"0.58752084",
"0.5866196",
"0.5862244",
"0.58594584",
"0.5857497",
"0.58475006",
"0.58416826",
"0.58346707",
"0.58308184",
"0.5828068",
"0.582753",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5825426",
"0.5813485",
"0.58068454",
"0.58064103",
"0.58057904",
"0.5797464",
"0.5791526",
"0.5786882",
"0.5780085",
"0.57692164",
"0.5764942",
"0.576022",
"0.57567006",
"0.5754397",
"0.5752092",
"0.5737332",
"0.57200825",
"0.57050496",
"0.56991404",
"0.5696189",
"0.5693681",
"0.5692989",
"0.5691451",
"0.56903815",
"0.5688879",
"0.5686274",
"0.56842643"
]
| 0.71866304 | 1 |
Parse URI parameter patterns to array | public function parseParameterPatterns()
{
return RouteMatch::parseParameterPatterns($this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static private function parse(string $pattern): array\n\t{\n\t\t$catchall = false;\n\n\t\tif ($pattern[-1] == '*')\n\t\t{\n\t\t\t$catchall = true;\n\t\t\t$pattern = substr($pattern, 0, -1);\n\t\t}\n\n\t\t$pattern = strtr($pattern, self::EXTENDED_CHARACTER_CLASSES);\n\t\t$parts = preg_split('#(:\\w+|<(\\w+:)?([^>]+)>)#', $pattern, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\t[ $interleaved, $params, $regex ] = self::parse_parts($parts);\n\n\t\tif ($catchall)\n\t\t{\n\t\t\t$regex .= '(.*)';\n\t\t\t$params[] = 'all';\n\t\t}\n\n\t\t$regex .= '$#';\n\n\t\treturn [ $interleaved, $params, $regex ];\n\t}",
"public static function parseUrl()\n {\n $route = trim($_SERVER['QUERY_STRING'], '/');\n $params = explode('/', $route);\n $params = array_slice($params, 2);\n\n return [$route, $params];\n }",
"function processUriParams() {\n\t\t$params = array();\n\t\t$uriParams = explode('/', trim($this->_uri, '/'));\n\t\t$count = count($uriParams);\n\t\tif($count > 0) {\n\t\t\tfor($i = 0; $i < $count; $i++) {\n\t\t\t\t$val = isset($uriParams[($i + 1)]) ? $uriParams[($i + 1)] : null;\n\t\t\t\t$params[$uriParams[$i]] = urldecode(is_numeric($val) ? (int) $val : $val);\n\t\t\t}\n\t\t\t$this->_uriParams = $params;\n\t\t}\n\t}",
"private function parseParams() : array\n {\n $querySting = (parse_url($_SERVER['QUERY_STRING']))['path'];\n parse_str($querySting, $params);\n return $params;\n }",
"public function getUriParams()\n {\n $values = array();\n $string = parse_url(filter_input(INPUT_SERVER, 'REQUEST_URI'));\n if (isset($string['query'])) {\n $exp = explode('&', $string['query']);\n $count = count($exp);\n for ($i = 0; $i < $count; $i++) {\n $value = explode('=', $exp[$i]);\n $values[$value[0]] = self::setAntiInjection($value[1]);\n }\n }\n return $values;\n }",
"public function provideURIArgumentSchemeNames()\n {\n $schemeList = $this->getMalformedURISchemes();\n $parameters = array();\n\n foreach ($schemeList as $scheme) {\n $parameters[] = array($scheme);\n }\n\n return $parameters;\n }",
"static private function parseUrl($uri)\n {\n $parts = explode('/', $uri);\n unset($parts[0]);\n $parsed['pattern'] = '#^\\\\/'; // patttern est le motif\n $parsed['params'] = array(); // contien les arguments\n $parsed['par'] = ['needed' => array(), 'optional' => array()]; // par contient 2 tableau avec le nom des argument\n foreach ($parts as $part)\n if (strlen($part) < 3)\n $parsed['pattern'].= $part . '\\\\/';\n else\n {\n if ($part[0] != '{')\n $parsed['pattern'] .= $part . '\\\\/';\n else if ($part[1] != '?')\n $parsed['pattern'] .= '([\\w-]*)\\\\/';\n $parsed['params'][] = substr($part, 1, -1);\n $parsed['par'][$part[1] != '?' ? 'needed' : 'optional'][] = substr($part, 1 + ($part[1] != '?' ? 1 : 0), -1);\n }\n $parsed['pattern'] .= '$#';\n return $parsed;\n }",
"public static function getUrlParameters(): array\n {\n $parameterString = isset($_SERVER['PATH_INFO']) ?\n // If not using an apache server (ie. VSCode PHP Server), need to use PATH_INFO and remove leading slash\n ltrim($_SERVER['PATH_INFO'], '/') :\n // Otherwise, use a QUERY_STRING passed on by an .htaccess rewrite rule\n $_SERVER['QUERY_STRING'];\n\n return explode('/', self::sanitize($parameterString));\n }",
"protected function getUriParams($uri)\n {\n $params = array();\n\n if (strpos($uri, '/:') !== false) {\n $params = explode('/:', $uri);\n unset($params[0]);\n }\n foreach ($params as $key => $value) {\n $params[$key] = str_replace('#', '', $value);\n }\n return $params;\n }",
"private function __parseUrl()\n {\n if (isset($_GET['url'])) {\n return explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n }\n return [];\n }",
"public function getUriVars(): array;",
"function parseGetParams()\n {\n $this->parameters = array();\n\n $uriParts = explode('?', $this->userURI);\n $itemCount = count($uriParts);\n if ($itemCount == 0)\n {\n return;\n }\n\n //remove last item if it's empty\n if (isset($uriParts[$itemCount - 1]) && $uriParts[$itemCount - 1] == '')\n {\n array_pop($uriParts);\n }\n \n //remove first item if it's empty\n if (isset($uriParts[0]) && $uriParts[0] == '')\n {\n array_shift($uriParts);\n }\n\n //if has no valid item then return\n if (count($uriParts) == 0)\n {\n return;\n }\n writeLog(print_r($uriParts, true));\n \n foreach($uriParts as $inputData)\n {\n $data = html_entity_decode($inputData);\n $pair = explode('=', $data);\n\n if (count($pair)>1)\n {\n $this->parameters[$pair[0]] = $pair[1];\n }\n }\n \n writeLog(\"params = \".print_r($this->parameters, true));\n }",
"public static function getAllURLParams()\n\t{\n\t\treturn explode('/', $_SERVER['REQUEST_URI']);\n\t}",
"protected function compileParameterNames()\n {\n preg_match_all('/\\{(.*?)\\}/', $this->getDomain() . $this->uri, $matches);\n\n return array_map(function ($m) {\n return trim($m, '?');\n }, $matches[1]);\n }",
"function name_and_representation_in_url() {\n preg_match(URI_REGEX, request_uri(), $request_matches);\n return array(\n (isset($request_matches[1]) ? $request_matches[1] : ''),\n (isset($request_matches[2]) ? $request_matches[2] : ''),\n );\n}",
"public function params($params) {\n if(is_array($params)) return $params;\n $result = array();\n foreach(explode('|', $params) as $param) {\n $pos = strpos($param, ':');\n $result[trim(substr($param, 0, $pos))] = trim(substr($param, $pos+1));\n }\n return $result;\n }",
"public function getParameterRegex(): array\n {\n return $this->parameterRegex;\n }",
"public function parameters(): array\n {\n $requestRoute = request()->route()->getName();\n $requestValues = Str::of($requestRoute)\n ->explode('.')\n ->toArray();\n\n return is_null($requestValues)\n ? []\n : $requestValues;\n }",
"private function parseParameters(): Collection\n {\n $offset = 0;\n $closePos = 0;\n $Parameters = new Collection();\n\n while ($openPos = strpos($this->uri, '{', $offset)) {\n if ($closePos = strpos($this->uri, '}', $openPos)) {\n $length = $closePos - $openPos - 1;\n $name = substr($this->uri, $openPos + 1, $length);\n $required = true;\n\n if (Str::endsWith($name, '?')) {\n $required = false;\n $name = rtrim($name, '?');\n }\n\n $Parameters->push(new RouteParameter($name, $required));\n $offset = $closePos;\n }\n }\n\n return $Parameters;\n }",
"private static function _parseUri($uri, $expressions = [])\n {\n $pattern = explode('/', ltrim($uri, '/'));\n foreach ($pattern as $key => $val) {\n if(preg_match('/[\\[{\\(].*[\\]}\\)]/U', $val, $matches)) {\n foreach ($matches as $match) {\n $matchKey = substr($match, 1, -1);\n if (array_key_exists($matchKey, $expressions)) {\n $pattern[$key] = $expressions[$matchKey];\n }\n }\n }\n }\n\n return $pattern;\n }",
"public function getParameters() {\n $matches = array();\n $regexp = '/:[a-zA-Z_][a-zA-Z0-9_]*/';\n $count = preg_match_all($regexp, $this->path, $matches);\n \n return $matches[0];\n }",
"private function getParams($accept=null)\n\t{\n\t\t$result = [];\n\t\t$arr = explode(';', $accept);\n\t\tforeach ($arr as $k=>$v)\n\t\t{\n\t\t\t$arr2 = explode('=', $v);\n\t\t\tif ($arr2[0]) $result[$arr2[0]] = $arr2[1];\n\t\t}\n\t\treturn $result;\n\t}",
"private function _parseUrl() {\n if (($url = Utility\\Input::get(\"url\"))) {\n\n // Trim, sanitise and return a exploded URL string.\n return(explode(\"/\", filter_var(rtrim($url, \"/\"), FILTER_SANITIZE_URL)));\n }\n return [];\n }",
"private function getUrl() {\n $parameters = array();\n $url = parse_url($_SERVER['REQUEST_URI']);\n foreach (explode(\"/\", $url['path']) as $p)\n if ($p != '')\n $parameters[] = $p;\n\n return $parameters;\n }",
"private function explodeUri(): void\n {\n if (!isset($this->uri)) {\n return;\n }\n\n $path = $this->removePrefix($this->uri);\n $split = explode('?', $path);\n $this->segments = explode('/', rtrim(ltrim($split[0], '/'), '/'));\n\n if (isset($split[1])) {\n $list = explode('&', $split[1]);\n\n foreach ($list as $elem) {\n $pair = explode('=', $elem);\n\n if (isset($pair[1])) {\n $this->params[$pair[0]]\n = \\miniworx\\Application\\Utils\\Sanitation::sanitizeUrl(\n $pair[1]\n );\n }\n }\n }\n }",
"protected function getRestParams() {\n\t\t$result = array();\n\t\tif (function_exists('mb_parse_str')) {\n\t\t\tmb_parse_str(file_get_contents('php://input'), $result);\n\t\t} else {\n\t\t\tparse_str(file_get_contents('php://input'), $result);\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function parseUrl()\n { #Explode para transformar em array, seprando por /, rtrim para retirar os espaços vazios, filter_ sanitize_url fucao do php para retirar caractres ilegais \n return explode(\"/\",rtrim($_GET['url']),FILTER_SANITIZE_URL);\n }",
"public static function getParamsFromURL($url)\n {\n $return = array();\n if (! empty($url)) {\n $params = explode(\"/\", $url);\n $params = Formatter::cleanData($params);\n \n if (count($params) != 0) {\n foreach ($params as $nr => $param) {\n if ((preg_match('/page-(?<number>\\d+)/', $param, $matches))) { // Page\n $return[self::PARAM_PAGE] = (int) $matches[1];\n } elseif ((preg_match('/lang-(?P<value>.+)/', $param, $matches))) { // Language\n $return[self::PARAM_LANG] = $matches['value'];\n } elseif (! isset($return[self::PARAM_CONTROLLER])) { // Module\n $return[self::PARAM_CONTROLLER] = $param;\n } elseif (! isset($return[self::PARAM_METHOD])) { // Method\n $return[self::PARAM_METHOD] = $param;\n } else { // Method argument\n if (! array_key_exists(self::PARAM_METHOD_ARGUMENTS, $return)) {\n $return[self::PARAM_METHOD_ARGUMENTS] = array();\n }\n $return[self::PARAM_METHOD_ARGUMENTS][] = $param;\n }\n }\n }\n }\n \n return $return;\n }",
"public function searchParams($pattern, $delimitter = '/', $flags = null)\n {\n $params = array();\n $pattern = $delimitter . $pattern . $delimitter . $flags;\n foreach ($this->params as $name => $value) {\n if (preg_match($pattern, $name)) {\n $params[$name] = $value;\n }\n }\n return $params;\n }",
"private function match($uri, $method)\n\t{\n\t\tif(isset($this->routes[$method]) and !empty($this->routes[$method]))\n\t\t{\n\t\t\tforeach(array_keys($this->route[$method]) as $route)\n\t\t\t{\n\t\t\t\tforeach($this->choices as $search => $replace)\n\t\t\t\t{\n\t\t\t\t\t$route = str_replace($search, $replace, $route);\n\t\t\t\t}\n\n\t\t\t\tif($route == '(.+)')\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'parameters' => $uri,\n\t\t\t\t\t\t'before' => $this->routes[$method][$route]['before'],\n\t\t\t\t\t\t'callback' => $this->routes[$method][$route]['callback'],\n\t\t\t\t\t\t'after' => $this->routes[$method][$route]['after'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\telseif(preg_match('#^'.$route.'$#i', $uri, $matches))\n\t\t\t\t{\n\t\t\t\t\t$parameters = [];\n\n\t\t\t\t\tfor($i = 1, $count = count($matches); $i < $count; $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$parameters[] = $matches[$i];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'parameters' => $parameters,\n\t\t\t\t\t\t'before' => $this->routes[$method][$route]['before'],\n\t\t\t\t\t\t'callback' => $this->routes[$method][$route]['callback'],\n\t\t\t\t\t\t'after' => $this->routes[$method][$route]['after'],\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }",
"function parseRoutes($url_parts) {\n\n // turn the segment array into a URI string\n $uri = implode('/', $url_parts);\n\n // is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n return explode('/', $this->routes[$uri]);\n }\n\n // loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n // convert wild-cards to regex\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // does the regex match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return explode('/', $val);\n }\n }\n\n // match not found, default route returned\n return $url_parts;\n }",
"public function parse(Uri $uri): ? array\n {\n // Get path without possible file\n $path = $uri->getPath();\n\n // Build route pattern\n $pattern = $this->buildRoutePattern();\n\n if (preg_match($pattern, $path, $matches) === 1) {\n $variables = [];\n $length = sizeof($matches);\n\n for ($i = 1; $i < $length; $i++) {\n $variables[$this->parameter[$i - 1]] = urldecode($matches[$i]);\n }\n\n return $variables;\n }\n\n return null;\n }",
"public function getUriArray(){\n\t\t$this->prepareRuta();\n\t\treturn $this->uriArray;\n\t}",
"static public function parse($pattern)\n\t{\n\t\tif (isset(self::$parse_cache[$pattern]))\n\t\t{\n\t\t\treturn self::$parse_cache[$pattern];\n\t\t}\n\n\t\t$regex = '#^';\n\t\t$interleave = array();\n\t\t$params = array();\n\t\t$n = 0;\n\n\t\t$parts = preg_split('#(:\\w+|<(\\w+:)?([^>]+)>)#', $pattern, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\tfor ($i = 0, $j = count($parts); $i < $j ;)\n\t\t{\n\t\t\t$part = $parts[$i++];\n\n\t\t\t$regex .= $part;\n\t\t\t$interleave[] = $part;\n\n\t\t\tif ($i == $j)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$part = $parts[$i++];\n\n\t\t\tif ($part{0} == ':')\n\t\t\t{\n\t\t\t\t$identifier = substr($part, 1);\n\t\t\t\t$selector = '[^/]+';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$identifier = substr($parts[$i++], 0, -1);\n\n\t\t\t\tif (!$identifier)\n\t\t\t\t{\n\t\t\t\t\t$identifier = $n++;\n\t\t\t\t}\n\n\t\t\t\t$selector = $parts[$i++];\n\t\t\t}\n\n\t\t\t$regex .= '(' . $selector . ')';\n\t\t\t$interleave[] = array($identifier, $selector);\n\t\t\t$params[] = $identifier;\n\t\t}\n\n\t\t$regex .= '$#';\n\n\t\treturn self::$parse_cache[$pattern] = array($interleave, $params, $regex);\n\t}",
"public function getUriList();",
"function parsePath($url)\n{\n $vars = array();\n\n if (preg_match_all('#\\{(\\w+)\\}#', $url, $matches)) {\n // First we convert the action route with its {variable_name} format to a preg-able string...\n for ($i=0; $i<count($matches[0]); $i++) {\n $str = $matches[0][$i];\n $vars[] = $matches[1][$i]; // Get the list of variables in the route into a different array.\n }\n\n // // Match - assign the values to the assoc array for return.\n // $url_variables = array();\n // for($i=0; $i<count($vars); $i++) {\n // \t$url_variables[$vars[$i]] = $route_matches[$i+1][0];\n // }\n }\n\n return $vars;\n}",
"private function getUrlValues($url): array {\n $data = [];\n $splittedUrl = explode('/', $url);\n $splittedServerUrl = explode('/', $_SERVER['REQUEST_URI']);\n if(sizeof($splittedUrl) === sizeof($splittedServerUrl)) {\n for($i = 0; $i < sizeof($splittedUrl); $i++) {\n if($splittedUrl[$i] === $splittedServerUrl[$i]) {\n continue;\n } else {\n if($splittedUrl[$i][0] === '{' && $splittedUrl[$i][strlen($splittedUrl[$i]) - 1] === '}') {\n $data[substr($splittedUrl[$i], 1, strlen($splittedUrl[$i]) - 2)] = $splittedServerUrl[$i];\n }\n }\n }\n }\n return $data;\n }",
"public function getEndpointParams(){\n\t\t#Explode current endpoint into parts\n\t\t$currentEndpointParts = explode(\"/\", $this->endpointURL);\n\t\t#Iterate\n\t\tforeach ($this->availableEndpoints as $endpointItem) {\n\t\t\t#Explode the possible endpoint match\n\t\t\t$itemParts = explode(\"/\", $endpointItem);\n\t\t\t#Check if count parts match, skip otherwise\n\t\t\tif(count($currentEndpointParts) != count($itemParts)) continue;\n\t\t\t#Prepare parts match flag\n\t\t\t$partsMatched = true;\n\t\t\t#Prepare resulting associative array\n\t\t\t$returnArray = [];\n\t\t\t#Check for each part\n\t\t\tforeach ($itemParts as $partIDX => $partTag) {\n\t\t\t\t#Flag to check if part is argument\n\t\t\t\t$partIsArg = preg_match(\"/^{[a-zA-Z0-9_-]+}$/\", $partTag);\n\t\t\t\t#Update flag\n\t\t\t\t$partsMatched = $partsMatched && ($partIsArg ? 1 : ($partTag == $currentEndpointParts[$partIDX]));\n\t\t\t\t#Skip next checks if didn't matched\n\t\t\t\tif(!$partsMatched) break;\n\t\t\t\t#Insert into result\n\t\t\t\t$returnArray[str_replace([\"{\",\"}\"], \"\", $partTag)] = $currentEndpointParts[$partIDX];\n\t\t\t}\n\t\t\t#If matched return item data (an associative array with the named endpoint parts being the keys and the requested endpoint parts being the values)\n\t\t\tif($partsMatched) return $returnArray;\n\t\t}\n\t\t#Fallback return empty\n\t\treturn [];\n\t}",
"public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }",
"function decode_custom_param_str($param_struct, $uri_string)\n {\n preg_match_all('#%(.*?)%#', $param_struct, $struct_matches);\n \n // Get the uri matches (param values)\n $match_str = '#'.$this->get_custom_forwarding_rule($param_struct).'#';\n preg_match($match_str, $uri_string, $uri_matches);\n \n $param_array = array();\n for($i = 0; $i < count($struct_matches[1]); $i++)\n $param_array[$struct_matches[1][$i]] = $uri_matches[$i+1];\n \n return $param_array;\n }",
"public function getParams(){\n if( !empty($this->uri['query']) ):\n parse_str($this->uri['query'], $this->params);\n return $this->params;\n endif;\n }",
"public function splitUri()\n\t{\n\t\tif ($this->uriString != '')\n\t\t{\n\t\t\tif (getConfigItem('switchToQueryString') == FALSE)\n\t\t\t{\n\t\t\t\t$_tempVal = explode('/', $this->uriString);\n\n\t\t\t\tforeach ($_tempVal as $val)\n\t\t\t\t{\n\t\t\t\t\t$val = $this->validateUri($val);\n\t\t\t\t\t\n\t\t\t\t\tif ($val != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->splittedUriString[] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"public static function paramsRegex()\n {\n return '/\\/{1,}([^\\:\\#\\/\\?]*' . Grav::instance()['config']->get('system.param_sep') . '[^\\:\\#\\/\\?]*)/';\n }",
"public function pregMatch(string $url)\n {\n $values = [];\n $routeUri = $this->getUri();\n $pattern = '#^' . $routeUri;\n\n $this->getParameters()->each(function ($Parameter) use (&$pattern) {\n $parameterName = $Parameter->getName();\n $search = '';\n $replace = '';\n if ($Parameter->isRequired()) {\n $search = '{' . $parameterName . '}';\n $replace = '(?P<' . $parameterName . '>[a-z0-9_-]+)';\n } else {\n $search = '/{' . $parameterName . '?}';\n $replace = '(?:/(?P<' . $parameterName . '>[a-z0-9_-]+))?';\n }\n $pattern = str_replace($search, $replace, $pattern);\n });\n $pattern .= '$#i';\n\n if (preg_match_all($pattern, $url, $matches, PREG_OFFSET_CAPTURE | PREG_PATTERN_ORDER)) {\n $this->getParameters()->each(function (RouteParameter $Parameter) use ($matches, &$values) {\n foreach ($matches as $key => $match) {\n if ($key === $Parameter->getName() && strlen($match[0][0]) > 0) {\n $values[$key] = $match[0][0];\n }\n }\n });\n } else {\n return false;\n }\n\n return $values;\n }",
"public static function getURLParams()\n\t{\n\t\t$params = [];\n\t\t$urlParams = self::getAllURLParams();\n\t\tfor ($i = contrlPos + 2; $i < count($urlParams); $i++) {\n\t\t\t$params[] = $urlParams[$i];\n\t\t}\n\t\treturn $params;\n\t}",
"private static function split_uri($input)\r\n\t{\r\n\t\t$pos = strpos($input, '/');\r\n\r\n\t\tif ($pos !== false)\r\n\t\t{\r\n\t\t\treturn explode('/', $input);\r\n\t\t}\r\n\r\n\t\treturn array($input);\r\n\t}",
"public function getUrlAsArray(): array\n {\n return \\explode('/', $this->url);\n }",
"function queryStringToArray($string) {\n $url = explode('&', $string);\n /* Request variable to store all parameters */\n $request = array();\n foreach ($url as $value) {\n $new = explode('=', $value);\n $request[$new[0]] = $new[1];\n }\n return $request;\n}",
"private function getVars($route) {\n if ( ! strstr($route, ':word') && ! strstr($route, ':num')) {\n return [];\n }\n $regex = str_replace(['(', ')', ':word', ':num'], [\"\", \"\", '([\\w_-]+)', '([\\d-]+)'], $route);\n $found = preg_match_all('~' . $regex . '~', $this->url, $matches, PREG_SET_ORDER);\n if ($found) {\n unset($matches[0][0]); // first match is the full url path\n return array_values($matches[0]);\n }\n\n return [];\n }",
"public function provideValidURISchemeNames()\n {\n $schemeList = $this->getWellformedURISchemes();\n $parameters = array();\n\n foreach ($schemeList as $scheme) {\n $parameters[] = array($scheme);\n }\n\n return $parameters;\n }",
"private function _getVariableMatch($uri, array $data) :array\n {\n if (empty($data['path']) || $data['path'] === '/') {\n return [];\n }\n\n $var = [];\n $regex = str_replace(['/', '___'], ['\\/', '+'], $data['path']);\n\n if (preg_match('|^' . $regex . '$|', $uri, $var)) {\n\n array_splice($var, 0, 1);\n\n if ($this->requestType === 'default' && in_array($this->request->getMethod(), $data['method'])) {\n\n return [\n $data['controller'],\n $data['action'] . 'Action',\n $data['permission'] ?? null,\n $var\n ];\n\n } else if ($this->requestType === 'api') {\n\n return [\n $data['controller'],\n $this->_getRestfulAction(),\n $data['permission'] ?? null,\n $var\n ];\n\n }\n\n }\n\n return [];\n }",
"public function get_url(): array\n {\n // get the full url as an array\n $url['raw'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $url['array'] = explode(\"/\", $url['raw']);\n\n // shift the array to remove the first useless array key and remove blank values\n array_shift($url['array']);\n $url['array'] = array_filter($url['array']);\n\n // return the url array\n return $url['array'];\n }",
"abstract protected function getPatternsAndCallbacks(): array;",
"private function detect_args ()\n {\n\n $uri = $this->get_uri();\n\n if (!$uri) $this->usage();\n\n $segments = preg_split(\"|/|\", $uri, null, PREG_SPLIT_NO_EMPTY);\n\n $args = array();\n foreach ($segments as $k => $v)\n {\n // Check explicit argument form first\n if (strpos($v, ':') !== false)\n {\n $arg = explode(':', $v);\n $args[$arg[0]] = $arg[1];\n continue;\n }\n\n if ($v === 'js' || $v === 'css')\n {\n $args['type'] = $v;\n continue;\n }\n\n $args['files'] = $v;\n\n if (strpos($v, '.js') !== false || strpos($v, '.coffee') !== false)\n $args['type'] = 'js';\n\n else if (strpos($v, '.css') !== false || strpos($v, '.less') !== false)\n $args['type'] = 'css';\n }\n\n if (!isset($args['type'])) $this->error('Could not reliably determine request type (js or css)');\n if (!isset($args['files'])) $this->error('Did not specify any files');\n\n // $args['mini] will be false if $args['mini'] is 'false' or 'no', else true\n $args['mini'] = !isset($args['mini']) || !($args['mini'] === 'false' || $args['mini'] === 'no');\n\n return $args;\n }",
"function urlQueryToArray($url) {\n $params = array();\n $query = explode('&', parse_url($url, PHP_URL_QUERY));\n foreach($query as $tok) {\n list($var, $val) = explode('=', $tok);\n $params[$var] = urldecode($val);\n }\n return $params;\n }",
"public static function parse_parameters( $input ) {\n if (!isset($input) || !$input) return array();\n\n $pairs = explode('&', $input);\n\n $parsed_parameters = array();\n foreach ($pairs as $pair) {\n $split = explode('=', $pair, 2);\n $parameter = OAuthUtil::urldecode_rfc3986($split[0]);\n $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';\n\n if (isset($parsed_parameters[$parameter])) {\n // We have already recieved parameter(s) with this name, so add to the list\n // of parameters with this name\n\n if (is_scalar($parsed_parameters[$parameter])) {\n // This is the first duplicate, so transform scalar (string) into an array\n // so we can add the duplicates\n $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);\n }\n\n $parsed_parameters[$parameter][] = $value;\n } else {\n $parsed_parameters[$parameter] = $value;\n }\n }\n return $parsed_parameters;\n }",
"public function parseParameterNames()\n {\n return RouteMatch::parseParameterNames($this);\n }",
"private function extractArguments(string $expression)\n {\n // Separate expression to 2 parameters.\n [$url, $options] = array_merge(explode(',', $expression, 2), [collect([])]);\n\n if (is_string($options)) {\n // remove array brackets, trim trailing comma\n $options = collect(explode(',', trim(trim(str_replace(['[', ']'], ['', ''], $options)), ',')))\n // make each item as two array items\n ->map(fn ($item) => explode('=>', trim($item)))\n // remove quotation from array keys\n ->map(fn ($item) => [trim(trim($item[0]), '\\'\"'), trim($item[1])])\n // convert collection to associative array\n ->pluck('1', '0');\n }\n\n return [$url, $options->toArray()];\n }",
"static function split_query($pattern)\r\n {\r\n $matches = array();\r\n preg_match_all('/(?:\"([^\"]+)\"|\"\"|(\\S+))/', $pattern, $matches);\r\n $parts = array();\r\n for($i = 1; $i <= 2; $i ++)\r\n {\r\n foreach ($matches[$i] as $m)\r\n {\r\n if (! is_null($m) && strlen($m) > 0)\r\n $parts[] = $m;\r\n }\r\n }\r\n return (count($parts) ? $parts : null);\r\n }",
"public function getRouteParams();",
"public function getQueryString(): array\n {\n\n $buffer = explode('?', $_SERVER[\"REQUEST_URI\"]);\n\n $variable = explode('&', array_pop($buffer));\n\n $array_variable = [];\n\n foreach ($variable as $value) {\n\n $items = explode('=', $value);\n $array_variable[array_shift($items)] = array_pop($items);\n }\n\n return $array_variable;\n }",
"public function parseURL() : array\n {\n if ($GLOBALS['config']['useUrlParsing']) {\n \n /**\n * @todo Create a parsing of url when the index is switched off\n */\n $this->_routes = '';\n } else {\n try {\n $this->_routes = $this->parseParams();\n \n if (!$this->_routes) return $this->indexPage;\n \n $path = explode('/', $this->_routes['r']);\n $controller = 'App\\\\Controllers\\\\'.ucfirst($path[0]) . 'Controller';\n $action = 'action'. ucfirst($path[1]);\n return [$controller, $action];\n } catch (Exception $ex) {\n \n }\n }\n }",
"private function processURLtoArray($url) {\n #If the request isn't set then no url parameters have been used\n if (is_null($url)) {\n $this->exceptionWithResponseCode(400,$this->genericExceptionMessages[\"URLFormat\"]);\n }\n\n #Split the request into seperate parts, with the slash as a seperator\n #Note that apache will collapse multiple /'s into a single /)\n $requestArray = explode(\"/\",$url);\n\n #We should probably ignore trailing slashes, which will generate an empty array element\n #Using strlen so that '0' is not removed\n $requestArray = array_filter($requestArray, 'strlen');\n\n #The request url should have either 4 or 5 elements\n if(!in_array(count($requestArray),array(4,5))){\n $this->exceptionWithResponseCode(400,\n \"Request URL has the wrong number of elements. \" . $this->genericExceptionMessages[\"URLFormat\"]\n );\n }\n\n return $requestArray;\n }",
"private function parseParams(array $values): array\n {\n foreach ( $values as &$value )\n {\n if ( is_string($value) && str_starts_with($value, '%') && str_ends_with($value, '%') )\n {\n // remove first % and last %\n $key = substr($value, 1, -1);\n\n if ( $this->parameterBag->has($key) )\n {\n $value = $this->parameterBag->get($key);\n }\n }\n elseif ( is_array($value) )\n {\n $value = $this->parseParams($value);\n }\n }\n\n return $values;\n }",
"function parseURL($url){\r\n //Explodeo la url para convertirla en un array\r\n $urlExploded = explode('/' ,$_GET['action']);\r\n //Creo un nuevo array y en la posición 'action' le asigno la acción recibida\r\n $arrayReturn[ConfigApp::$ACTION] = $urlExploded[0];\r\n //Si esta seteado, llama al metodo array_slice(), lo que hace este metodo es crear un arrego a partir de una posición dada, en este caso desde la posición 1\r\n $arrayReturn[ConfigApp::$PARAMS] = isset($urlExploded[1]) ? array_slice($urlExploded, 1) : null;\r\n\r\n return $arrayReturn;\r\n }",
"static public function getUrlArray()\n {\n \tstatic $url_array = NULL;\n \tif( is_null( $url_array ) ) {\n\t\t\t$url_array = explode( '/', ltrim( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), '/' ) );\n\t\t\tforeach( $url_array as &$url_part ) {\n\t\t\t\t$url_part = ( $url_part !== \"\" ) ? strtolower( $url_part ) : \"index\";\n\t\t\t}\n\t\t}\n\t\treturn $url_array;\n }",
"public static function getParams(UriInterface $uri): array\n {\n $pairs = [];\n\n try {\n $pairs = Query::createFromUri($uri)->pairs();\n } catch (Throwable $exception) {\n // Ignore the exception.\n }\n\n $associatedPairs = [];\n\n foreach ($pairs as $key => $value) {\n $associatedPairs[$key] = $value;\n }\n\n return $associatedPairs;\n }",
"public function getParams()\n {\n $params = explode('/', $this->getPath());\n array_shift($params);\n return $params;\n }",
"public function getQuery() : array\n {\n $result = [];\n parse_str($this->uri->getQuery() ?: '', $result);\n\n return $result;\n }",
"public function extractParameters()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n\n if (preg_match(self::$routePattern, $request->get('_route'), $routeMatches)) {\n $searchEngine = $this->container->get('search.engine');\n\n $this->routePrefix = reset($routeMatches);\n $this->originalRouteParameterCount = (int)end($routeMatches);\n\n $activeModules = $searchEngine->getActiveModules();\n\n $dateFormatString = $this->container->get('languagehandler')->getDateFormat();\n $dateFormat = preg_replace(\"/[^\\w]/\", '-', $dateFormatString);\n\n for ($i = 0; $i < $this->originalRouteParameterCount; $i++) {\n $rawInput = strtolower($request->get(\"a{$i}\"));\n $parameterInformation = Utility::convertStringToArray($rawInput);\n\n if (!$this->hasKeywords() && $rawKeyword = $searchEngine->convertFromKeywordFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawKeyword);\n foreach ($parameterInformation as $parameter) {\n $this->addKeyword($parameter);\n }\n continue;\n }\n\n if (!$this->hasWheres() && $rawWhere = $searchEngine->convertFromWhereFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawWhere);\n foreach ($parameterInformation as $parameter) {\n $this->addWhere($parameter);\n }\n continue;\n }\n\n if (!$this->hasModules() && $modules = array_intersect($activeModules, $parameterInformation)) {\n foreach ($modules as $key => $value) {\n $this->addModule($key);\n }\n continue;\n }\n\n if (!$this->hasStartDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setStartDate($date);\n continue;\n }\n\n if (!$this->hasEndDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setEndDate($date);\n continue;\n }\n\n if (($elasticType = $searchEngine->getFriendlyUrlType($parameterInformation)) && (!$this->hasCategories() || !$this->hasLocations())) {\n switch ($elasticType) {\n case CategoryConfiguration::$elasticType:\n if (!$this->hasCategories()) {\n $categories = $searchEngine->categoryFriendlyURLSearch($parameterInformation);\n $this->setCategories($categories);\n !$this->hasModules() and array_map(function($category) {\n $this->addModule($category->getModule());\n }, $categories);\n }\n break;\n case LocationConfiguration::$elasticType:\n if (!$this->hasLocations()) {\n $this->setLocations($searchEngine->locationFriendlyURLSearch($parameterInformation));\n }\n break;\n }\n\n continue;\n }\n\n if (self::$exception) {\n throw new NotFoundHttpException();\n }\n }\n }\n\n foreach ($request->query->all() as $key => $value) {\n $this->queryParameters[$key] = Utility::convertStringToArray($value, '-');\n }\n }",
"public function processParams($params)\n {\n GeneralUtility::logDeprecatedFunction();\n $paramArr = [];\n $lines = GeneralUtility::trimExplode(LF, $params, true);\n foreach ($lines as $val) {\n $pair = explode('=', $val, 2);\n $key = trim($pair[0]);\n if ($key[0] !== '#' && $key[0] !== '/') {\n $paramArr[$key] = trim($pair[1]);\n }\n }\n return $paramArr;\n }",
"public function get_patterns()\n {\n }",
"protected function preparePattern()\n {\n $patterns = [];\n foreach ($this->routes as $route => $config) {\n $this->routeData[$route] = $config;\n $prepared = preg_replace('/\\{([^:]+):([^}]+)\\}/', '{$1}', $config['route']);\n\n $params = [];\n if (preg_match('/\\{([^}]+)\\}/', $prepared, $params)) {\n array_shift($params);\n }\n\n $this->routeData[$route]['params'] = $params;\n $pattern = preg_replace('/\\{([^:]+):([^}]+)\\}/', '($2)', $config['route']);\n $patterns[] = \"(?P<{$route}>{$pattern})\";\n }\n\n $pattern = implode(' | ', $patterns);\n $this->pattern = \"~^(?: {$pattern} )$~x\";\n }",
"public function parse_segments_to_params(array $segments)\n\t{\n\t\t$parameters = array();\n\t\t\n\t\t// format: /key/value/key2/value2/...\n\t\twhile($e = array_shift($segments))\n\t\t{\n\t\t\tif( ! empty($segments))\n\t\t\t{\n\t\t\t\t$parameters[$e] = array_shift($segments);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// no value, just add it to the array\n\t\t\t\t$parameters[] = $e;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $parameters;\n\t}",
"public function getPatternForUri()\n {\n return '/' . preg_replace('/:[\\d\\w]+/i', '(' . $this->_paramPattern . ')', str_replace('/', '\\\\/', $this->_uri)) . '/i';\n }",
"private function getParameters() {\n $raw_parameters = $this->routeMatch->getRawParameters();\n $parameters = $this->routeMatch->getParameters();\n\n $return_params = [];\n foreach ($parameters as $key => $value) {\n if ($raw_value = $raw_parameters->get($key)) {\n $return_params[$key] = $raw_value;\n continue;\n }\n\n $return_params[$key] = $parameters->get($key);\n }\n\n return $return_params;\n }",
"function get_query_array() {\r\n\t\t\t$parts = parse_url( $this->get_current_url() );\r\n\t\t\tif ( isset( $parts['query'] ) ) {\r\n\t\t\t\tparse_str( $parts['query'], $query );\r\n\t\t\t\treturn $query;\r\n\t\t\t}\r\n\r\n\t\t\treturn array();\r\n\t\t}",
"public function getQueryParams() {\n if ($pos = strpos ( $this->url, '?' )) {\n $queryStr = substr ( $this->url, $pos + 1 );\n $params = array ();\n parse_str ( $queryStr, $params );\n return $params;\n }\n return array ();\n }",
"function set_allowed_uri_params_list()\r\n{\r\n //allowed params disabled. All allowed\r\n//\tif ($ar_params = func_get_args())\r\n//\t{\r\n//\t\tglobal $tpl_allowed_uri_params_list;\r\n//\r\n//\t\tif (is_array($tpl_allowed_uri_params_list))\r\n//\t\t{\r\n//\t\t\tforeach ($ar_params as $val)\r\n//\t\t\t{\r\n//\t\t\t\t$tpl_allowed_uri_params_list[] = $val;\r\n//\t\t\t}\r\n//\t\t}\r\n//\t\telse\r\n//\t\t{\r\n//\t\t\t$tpl_allowed_uri_params_list = $ar_params;\r\n//\t\t}\r\n//\t}\r\n}",
"function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}",
"protected function testPattern($url) {\n if (preg_match($this->pattern, $url, $matches)) {\n $matched_part = $matches[0];\n\n $rule = array();\n\n foreach ($matches as $key => $value) {\n if (is_numeric($key)) continue;\n\n // If there is an empty match, the URL is not matched at all.\n if (empty($value)) {\n return false;\n }\n\n $rule[$key] = $value;\n }\n\n $rest = substr($url, strlen($matched_part));\n $rest = preg_replace('#^/|/$#', '', $rest);\n\n if (empty($rest)) {\n $params = array();\n } else {\n $params = preg_split('#[/]+#', $rest);\n }\n\n return array($rule, $params);\n } else {\n return false;\n }\n }",
"public function getUrlSegments(&$queryParameters) {\n\t\treturn array();\n\t}",
"public function getMediaTypeParams()\n {\n $contentType = $this->getContentType();\n $contentTypeParams = [];\n if ($contentType) {\n $contentTypeParts = preg_split('/\\s*[;,]\\s*/', $contentType);\n $contentTypePartsLength = count($contentTypeParts);\n for ($i = 1; $i < $contentTypePartsLength; $i++) {\n $paramParts = explode('=', $contentTypeParts[$i]);\n $contentTypeParams[strtolower($paramParts[0])] = $paramParts[1];\n }\n }\n\n return $contentTypeParams;\n }",
"public function parseUrl()\n\t\t{\n\t\t\tif(isset($_GET['url']))\n\t\t\t{\n\t\t\t\t// explode(separator, string, limit);\n\t\t\t\treturn $url = explode('/', filter_var(rtrim($_GET['url'], '/'), FILTER_SANITIZE_URL));\n\t\t\t}\n\t\t}",
"function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }",
"protected function createRegexPatterns($pattern)\n {\n $pattern = rtrim($pattern, ' /');\n $extra = $this->extractCatchAllPattern($pattern);\n $matchPattern = str_replace(\n static::QUOTED_PARAM_IDENTIFIER, static::REGEX_SINGLE_PARAM, preg_quote($pattern), $paramCount\n );\n $replacePattern = str_replace(static::PARAM_IDENTIFIER, '/%s', $pattern);\n $matchPattern = $this->fixOptionalParams($matchPattern);\n $matchRegex = \"#^{$matchPattern}{$extra}$#\";\n return array($matchRegex, $replacePattern);\n }",
"public static function parseRoute($urlSegment) {\n $regEx = '/';\n $paramName = '';\n $urlLength = strlen($urlSegment);\n $parsingParam = false;\n $route = ['params' => []];\n\n //step through route string generating matching regex for static portions of route\n //and creating capturing groups for parameters\n for ($i = 0; $i < $urlLength; $i++) {\n if (!$parsingParam && $urlSegment[$i] != '@') {\n if ($urlSegment[$i] == '/') {\n $regEx .= '\\\\';\n }\n $regEx .= $urlSegment[$i];\n } elseif (!$parsingParam) {\n $parsingParam = true;\n } elseif ($urlSegment[$i] == '/') {\n $route['params'][] = $paramName;\n $paramName = '';\n $regEx .= '([^\\s\\/]+)\\\\/';\n $parsingParam = false;\n } else {\n $paramName .= $urlSegment[$i];\n }\n }\n if ($parsingParam) {\n $route['params'][] = $paramName;\n $regEx .= '([^\\s\\/]+)$';\n } else {\n $regEx .= '$';\n }\n $regEx .= '/';\n $route['regex'] = $regEx;\n\n return $route;\n }",
"private static function parseUri($uri) \n {\n $path = str_replace(INDEX_PATH,\"\",$uri);\n $path = explode(\"?\",$path);\n $path = $path[0];\n $path = trim($path,'/');\n return explode('/',$path);\n }",
"public static function provideUris(): array\n {\n return [\n 'default' => [\n 'http://domain.com',\n 'http://domain.com',\n ],\n\n 'without scheme' => [\n 'domain.com/path',\n 'domain.com/path',\n ],\n\n 'with port' => [\n 'domain.com:8080/path',\n 'domain.com:8080/path',\n ],\n\n 'with query' => [\n 'https://domain.com:8081/path?key=value',\n 'https://domain.com:8081/path?key=value',\n ],\n\n 'with fragment' => [\n 'https://domain.com:8081/path?key=value#some',\n 'https://domain.com:8081/path?key=value#some',\n ],\n\n 'with username' => [\n 'https://username@domain.com/ping',\n 'https://username@domain.com/ping',\n ],\n\n 'with password' => [\n 'https://user:pass@domain.com/ping',\n 'https://user:***@domain.com/ping',\n ],\n ];\n }",
"public function urlarray($string = '') {\n $a = explode('/', strtolower($string));\n $array = array();\n $key = '';\n foreach($a as $k => $v){\n if($k % 2 == 0){\n $key = $v;\n } else {\n $array[$key] = $v;\n }\n }\n return $array;\n }",
"public function parse_path($uri) {\n\n\t\t/**\n\t\t * Strip away the GET string from the URI if it's around.\n\t\t * @todo Do something with the GET string here eventually, or completely deprecate it.\n\t\t */\n\t\tlist($path, $get) = explode('?', $uri);\n\n\t\t/**\n\t\t * trim the path to make sure there's not a hanging empty array item after exploding...\n\t\t * however the path string is expected to always start with / so we add it back\n\t\t */\n\t\t$path = explode(\"/\", '/'.trim($path,'/'));\n\n\t\t/**\n\t\t * Because the string starts with a \"/\", array[0] is empty. This is important because\n\t\t * we actually want array 1 to be the first var\n\t\t * @todo I think it would be better to have a proper array here and +1 to the pointer later\n\t\t */\n\t\tunset($path[0]);\t\t\n\n\t\t/**\n\t\t * Return the parsed array of segments.\n\t\t */\n\t\treturn $path;\n\t}",
"function getRequestParams(){\n $fullPath = removeTrailingSlash($_SERVER['REQUEST_URI']);\n $filePath = $_SERVER['SCRIPT_NAME'];\n\n if ($fullPath === $filePath){\n return array();\n }else{\n $paramString = substr($fullPath, strlen($filePath) + 1 , strlen($fullPath) - strlen($filePath) -1 );\n\n $params = explode(\"/\", $paramString);\n return $params;\n }\n\n\n}",
"protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}",
"function uri_safe_batch_decode($str, $delimiter = '|', $hexify = TRUE)\n{\n\t$str = uri_safe_decode($str, $hexify);\n\t$tmp = explode($delimiter, $str);\n\t$params = array();\n\tforeach($tmp as $val)\n\t{\n\t\t$key_val = explode('/', $val);\n\t\tif (count($key_val) >= 2)\n\t\t{\n\t\t\tif (strncmp($key_val[1], '??', 2) === 0)\n\t\t\t{\n\t\t\t\t$key_val[1] = unserialize(substr($key_val[1], 2));\n\t\t\t}\n\t\t\t$params[$key_val[0]] = $key_val[1];\n\t\t}\n\t}\n\treturn $params;\n}",
"private function getPatterns()\n {\n return array_keys($this->responsesByPattern);\n }",
"private static function getUrlParams($regex, $requestedUrl)\n {\n preg_match($regex, $requestedUrl, $matches);\n return $matches;\n }",
"private function getQueryString(): array\n {\n parse_str($this->request->getUri()->getQuery(), $queryString);\n\n if (isset($queryString['p'])) {\n unset($queryString['p']);\n }\n\n return $queryString;\n }",
"public function parse(Url $url) :? array\r\n\t{\r\n\t\t// Get path without possible file\r\n\t\t$path = $url->path();\r\n\r\n\t\t// Build route pattern\r\n\t\t$pattern = $this->buildRoutePattern();\r\n\r\n\t\tif (preg_match($pattern, $path, $matches) === 1) {\r\n\r\n\t\t\t$variables = [];\r\n\t\t\t$length = sizeof($matches);\r\n\r\n\t\t\tfor ($i = 1; $i < $length; $i++) {\r\n\t\t\t\t$variables[$this->parameter[$i - 1]] = $matches[$i];\r\n\t\t\t}\r\n\r\n\t\t\treturn $variables;\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}",
"private function parse_urlpatterns(array $urlpatterns) : array {\n $tmp_routes = array();\n foreach($urlpatterns as $url => $view) {\n //Parse group middlewares\n if(is_int($url)) {\n if(array_key_exists('view', $view)) {\n //Parse urlpatterns array\n $tmp_parsed_routes = $this->parse_urlpatterns($view['view']);\n //Add group middlewares to urls\n foreach($tmp_parsed_routes as $tmp_url => $tmp_view) {\n $route = $tmp_url;\n $tmp_routes[$route]['view'] = (is_array($tmp_view) ? $tmp_view['view'] : $tmp_view);\n if(isset($tmp_view['middleware'])) {\n if(is_array($tmp_view['middleware'])) {\n $tmp_routes[$route]['middleware'] = array_merge($tmp_view['middleware'], is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n } else {\n $tmp_routes[$route]['middleware'] = array_merge(array($tmp_view['middleware']), is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n }\n } else {\n $tmp_routes[$route]['middleware'] = $view['middleware'];\n }\n }\n } else {\n http_response_code(500);\n exit('Error : invalid urlpatterns format');\n }\n } else {\n //Parse urlpatterns array\n $url = ($url === '/' ? $url : '/'.ltrim($url, '/'));\n if(is_array($view)) {\n //Parse route middleware\n if(array_key_exists('view', $view)) {\n $route = $url;\n $tmp_routes[$route] = $view;\n } else {\n //Parse nested urlpatterns\n foreach($view as $nested_url => $view) {\n //Parse group middlewares\n if(is_int($nested_url)) {\n if(array_key_exists('view', $view)) {\n //Parse urlpatterns array\n $tmp_parsed_routes = $this->parse_urlpatterns($view['view']);\n //Add group middlewares to urls\n foreach($tmp_parsed_routes as $tmp_url => $tmp_view) {\n $tmp_url = ($tmp_url === '/' ? $tmp_url : '/'.ltrim($tmp_url, '/'));\n $route = ($url === '/' ? $tmp_url : rtrim($url, '/').$tmp_url);\n $tmp_routes[$route]['view'] = (is_array($tmp_view) ? $tmp_view['view'] : $tmp_view);\n if(isset($tmp_view['middleware'])) {\n if(is_array($tmp_view['middleware'])) {\n $tmp_routes[$route]['middleware'] = array_merge($tmp_view['middleware'], is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n } else {\n $tmp_routes[$route]['middleware'] = array_merge(array($tmp_view['middleware']), is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n }\n } else {\n $tmp_routes[$route]['middleware'] = $view['middleware'];\n }\n }\n } else {\n http_response_code(500);\n exit('Error : invalid urlpatterns format');\n }\n } else {\n $nested_url = ($nested_url === '/' ? $nested_url : '/'.ltrim($nested_url, '/'));\n if(is_array($view)) {\n //Parse route middlewares\n if(array_key_exists('view', $view)) {\n if(is_array($view['view'])) {\n exit('Error : invalid urlpatterns format');\n } else {\n $route = ($url === '/' ? $nested_url : rtrim($url, '/').$nested_url);\n $tmp_routes[$route] = $view;\n }\n } else {\n http_response_code(500);\n exit('Error : invalid urlpatterns format');\n }\n } else {\n $route = ($url === '/' ? $nested_url : rtrim($url, '/').$nested_url);\n $tmp_routes[$route] = $view;\n }\n }\n }\n }\n } else {\n $route = $url;\n $tmp_routes[$route] = $view;\n }\n }\n }\n return $tmp_routes;\n }"
]
| [
"0.68689877",
"0.68412745",
"0.6820534",
"0.67986566",
"0.67176884",
"0.6500366",
"0.6487441",
"0.648032",
"0.6441128",
"0.6411344",
"0.6356474",
"0.6311812",
"0.62678486",
"0.6246513",
"0.61844856",
"0.6178668",
"0.60688543",
"0.60613513",
"0.60481787",
"0.60109454",
"0.59962386",
"0.59822726",
"0.59641826",
"0.59325624",
"0.59011024",
"0.5899472",
"0.5888703",
"0.5883784",
"0.58557165",
"0.5845169",
"0.583103",
"0.583088",
"0.58131236",
"0.5812807",
"0.5809658",
"0.58049977",
"0.5804392",
"0.57980496",
"0.5797133",
"0.57916003",
"0.5784439",
"0.576817",
"0.5766",
"0.5754669",
"0.5742343",
"0.5739359",
"0.5737663",
"0.5730589",
"0.5729612",
"0.5685442",
"0.5679584",
"0.5678874",
"0.5671882",
"0.565583",
"0.5655056",
"0.5646231",
"0.5646228",
"0.564271",
"0.56304973",
"0.56291854",
"0.5624932",
"0.5624904",
"0.56239074",
"0.56070256",
"0.558649",
"0.5577295",
"0.5566007",
"0.55521834",
"0.55482584",
"0.554737",
"0.5546656",
"0.55333006",
"0.55317086",
"0.55311453",
"0.5529313",
"0.5523",
"0.55164427",
"0.550436",
"0.5502116",
"0.55000705",
"0.54943156",
"0.5493707",
"0.549236",
"0.5490223",
"0.5490195",
"0.5489247",
"0.5488903",
"0.54862916",
"0.54766554",
"0.54739416",
"0.5470163",
"0.5459224",
"0.5455993",
"0.54543483",
"0.54485136",
"0.5444574",
"0.5442799",
"0.54409504",
"0.5440521",
"0.5432582"
]
| 0.7287746 | 0 |
Get the URI associated with the route. | public function uri()
{
return $this->uri;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getURI()\t{\n\t\treturn $this->route;\n\t}",
"public function url()\n {\n return $this->routeObject->url['uri'];\n }",
"public function getUri($route = '') {\r\n\t\treturn $this->baseUrl.(($this->lang == $this->defLang) ? '' : ($this->lang.'/')).ltrim($route, '/');\r\n\t}",
"public function uri()\n {\n return $this->factory->getUri($this->handle);\n }",
"function route_uri(): string\n{\n return RouteController::getCurrentRoute()['uri'] ?? '';\n}",
"public function uri() {\n\t\treturn $this->getUri();\n\t}",
"public function getUri()\n {\n $server = provider::access('server');\n\n return ($server->isExist('REQUEST_URI') && $server->isValid('REQUEST_URI', validate::T_PRINTABLE)\n ? $server->getValue('REQUEST_URI')\n : '/');\n }",
"public function getUri()\n {\n if (strpos($this->uri, '/') === 0) {\n return $this->uri;\n }\n\n return $this->parent ? $this->parent->getUri() . '/' . $this->uri : $this->uri;\n }",
"public function getUri()\n {\n return $this->normalize($this->service->uri()) . '/' . $this->normalize($this->uri ?: '');\n }",
"private function getURI()\n {\n\n if (!empty($_SERVER['REQUEST_URI'])) {\n\n $routeRule = trim($_SERVER['REQUEST_URI'], '/');\n\n // Get part of uri without GET request if it exist (ignore GET)\n if (preg_match('/\\?/', $routeRule)) {\n // get rule for router which based on request uri\n $routeRule = explode('?', $routeRule);\n $routeRule = array_shift($routeRule);\n // normalize route rule\n $routeRule = trim($routeRule, '/');\n }\n return $routeRule;\n }\n }",
"public function getURI()\n {\n switch ($this->queriedContext) {\n case $this->i8n('context-keyword'):\n return $this->getSearchURI();\n break;\n case $this->i8n('context-group'):\n return $this->getGroupURI();\n break;\n case $this->i8n('context-talk'):\n return $this->getTalkURI();\n break;\n default: // Return default value\n return static::URI;\n }\n }",
"public function getUri() {\n return $this->request->getUri();\n }",
"public function getUri(): string\n {\n return $this->uri;\n }",
"public function uri()\r\n {\r\n return $this->server->get('REQUEST_URI', '/');\r\n }",
"function current_route_uri()\n {\n return RouteController::getCurrentRoute()['uri'] ?? '';\n }",
"public function getURI()\n {\n return $this->server['REQUEST_URI'];\n }",
"public function getURI()\n {\n return $this->uri;\n }",
"public static function getURI()\n {\n\t\tif(isset($_SERVER['PATH_INFO']))\n {\n\t\t\t$_path_info = $_SERVER['PATH_INFO'];\n\n\t\t}\n elseif(isset($_SERVER['ORIG_PATH_INFO']))\n {\n\t\t\t$_path_info = $_SERVER['ORIG_PATH_INFO'];\n \t\t}\n else\n {\n\t\t\t$_path_info = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($_path_info, 0, strlen(_app_path)) == _app_path) {\n \t\t\t$_path_info = substr($_path_info, strlen(_app_path));\n\t\t}\n\n if(substr($_path_info,0,9) == \"index.php\")\n {\n $_path_info = ltrim($_path_info, \"index.php\"); // index.php might be there, drop that too\n }\n\n\t\t$uri = (!isset($_path_info) || $_path_info == \"\" || $_path_info == \"public\") ? \"\" : ltrim($_path_info,\"/\");\n\t\treturn $uri;\n\n // depending on server configuration, you might need to do this instead\n // $_path_info = preg_split(\"/\\?|\\&/\",$_path_info); // check for ? or & in url\n // return (!isset($_path_info[0]) || $_path_info[0] == \"\") ? \"\" : ltrim($_path_info[0],\"/\");\n }",
"public function uri(): UriInterface\n {\n return $this->request()->getUri();\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public static function getUri()\n {\n if (isset($_SERVER['REQUEST_URI'])) {\n return $_SERVER['REQUEST_URI'];\n } else {\n return \"/\";\n }\n }",
"function getUri() {\n\t\tif($this->_uri === null) {\n\t\t\t$this->_uri = rtrim($_SERVER['REQUEST_URI'], '/') . '/';\n\t\t}\n\t\treturn $this->_uri;\n\n\t}",
"public function getUri()\n {\n return $this->_uri;\n }",
"public function uri()\n {\n return route('product.show', [\n 'product' => $this->id,\n 'alias' => $this->alias,\n ]);\n }",
"public function uri(): string\n {\n return $this->uri;\n }",
"public function getUri()\n\t{\n\t\treturn $this->uri;\n\t}",
"protected function getUri()\n {\n $uri = $this->request['REQUEST_URI'];\n $prefix = config('router', 'base_uri');\n if (substr($uri, 0, strlen($prefix)) == $prefix) {\n $uri = substr($uri, strlen($prefix));\n }\n\n $this->uri = rtrim($uri, \"/\");\n }",
"public function getUri() {\n\t\treturn $this->uri;\n\t}",
"public function getRoute() : string\n {\n return $this->route;\n }",
"public static function uri() {\n\t\treturn isset($_SERVER['REQUEST_URI'])\n\t\t\t? $_SERVER['REQUEST_URI']\n\t\t\t: null;\n\t}",
"public static function getURI()\n {\n if ($pos = strpos($_SERVER['REQUEST_URI'], '?')) {\n $uri = substr($_SERVER['REQUEST_URI'], 0, $pos);\n } else {\n $uri = $_SERVER['REQUEST_URI'];\n }\n return self::trim($uri);\n }",
"public function getUri() : string\n {\n $rtn = $this->data['uri'];\n\n return $rtn;\n }",
"public function uri()\n {\n return $this->_requestUri;\n }",
"public function uri() {\n\t\treturn isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/';\n\t}",
"public function uri()\n\t{\n\t\t$uri = $this->fullUri();\n\t\t$queryPos = strpos($uri, '?');\n\t\treturn substr($uri, 0, strpos($uri, '?') ? $queryPos : null);\n\t}",
"public function getUri()\n {\n return $this->getAttribute('uri');\n }",
"function getRoute()\n{\n\t// Get the requested uri from the server exluding the domain name.\n\t$uri = strtok($_SERVER['REQUEST_URI'], '?');\n\n\t// Remove the site path from the uri so we only get the segments\n\t// that we actually want.\n\t$uri = str_replace(SITE_PATH, '', $uri);\n\n\treturn $uri;\n}",
"public function uri()\n {\n $uri = '';\n if (isset($this->server['REQUEST_URI'])) {\n $uri = $this->server['REQUEST_URI'];\n }\n\n $uri = ltrim($uri, '/');\n\n if (!$this->hasQueryPart($uri)) {\n $uri = rtrim($uri, '/');\n }\n\n return $uri;\n }",
"public function uri() \n\t{\n\t\treturn $this->uri;\n\t}",
"public function getUriString()\n {\n if ($this->uri instanceof HttpUri) {\n return $this->uri->toString();\n }\n return $this->uri;\n }",
"private function getURI()\n {\n if (!empty($_SERVER['REQUEST_URI'])) {\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }",
"public function getUri()\n {\n $uri = $this->serverAttributes()['REQUEST_URI'];\n\n if (!$uri) {\n return false;\n }\n\n return $uri;\n }",
"public function URI()\n\t{\n\t\treturn $this->uri;\n\t}",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getUri();",
"public function getUri();",
"public function getUri();",
"public function getUri();",
"public function getRoute()\n {\n return $this->oauth_route;\n }",
"public function getURI() : string {\n return $this->URI;\n }",
"static function getURI() {\n return '/';\n }",
"public function getRoute(): string\n {\n return (string) $this->route;\n }",
"public static function uri()\n\t{\n\t\treturn trim(parse_url(str_replace(App::get('base_url') . '/', \"\", $_SERVER['REQUEST_URI']), PHP_URL_PATH), '/');\n\t}",
"public function getUri()\n {\n return $this->getUrl();\n }",
"public function getRoute()\r\n {\r\n return $this->route;\r\n }",
"private function getURI(): string\n {\n if (!empty($_SERVER['REQUEST_URI'])) {\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }",
"public function getRoute() {\n \n return $this->route;\n \n }",
"public function getUri()\n {\n $scheme = $this->getServer('REQUEST_SCHEME', 'http');\n $port = $this->getServer('SERVER_PORT', 80);\n $serveName = $this->getServer('SERVER_NAME');\n\n $uri = new Uri();\n\n return $uri->withScheme($scheme)\n ->withHost($serveName)\n ->withQuery($this->getServer('QUERY_STRING', ''))\n ->withPath($this->getBaseUrl())\n ->withPort($port);\n }",
"public function getUri() {}",
"public function getUri() {}",
"public function fullUri()\n\t{\n\t\treturn $_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : '/';\n\t}",
"public function getRoute()\n\t{\n\t\treturn $this->route;\n\t}",
"protected function routeToURI(){\n\t\t$args = func_get_args();\n\t\treturn call_user_func_array(array('Router', 'routeToURI'), $args);\n\t}",
"static public function getURI()\n {\n return explode('?', $_SERVER['REQUEST_URI'])[0] . '/';\n }",
"public function uri() {\n return $this->uri;\n }",
"public static function getRoute() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$route = (isset(self::$route_options['route'])) ? self::$route_options['route'] : null;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'return'));\n\n\t\treturn $route;\n\t}",
"public function getRoute() {\n\t\treturn $this->route;\n\t}",
"private function getURI() : string\n {\n if (!empty($_SERVER['REQUEST_URI'])){\n return trim($_SERVER['REQUEST_URI'], '/');\n }\n }",
"public function getUri():string{\n\t\treturn $this->full_uri;\t\t\n\t}",
"protected function route()\n {\n return route($this->uri, $this->params);\n }",
"public static function route()\n {\n return self::$route;\n }",
"public function getUri(){\n return $this->uri;\n }",
"public function path(): string\n {\n return str_replace('?', '', \"/{$this->route->uri()}\");\n }",
"public function getURI();",
"public function getUri()\n {\n if (!$this->hasBootstrap()) {\n return false;\n }\n return $this->bootstrap()->getUri();\n }",
"public function uri()\n {\n return '/foo/bar';\n }",
"public function getRequestUri()\n {\n if ( $this->uri === null )\n {\n $this->uri = UTIL_Url::getRealRequestUri(OW::getRouter()->getBaseUrl(), $_SERVER['REQUEST_URI']);\n }\n\n return $this->uri;\n }",
"public function get_uri()\n {\n }",
"public function actionUri()\n {\n return clone $this->_uri;\n }",
"public function getUri(): ?string\n {\n $uri = explode('?', $this->request->getUri());\n return is_array($uri) ? $uri[0] : null;\n }",
"function getRoute() {\n\t\treturn $this->config()->route;\n\t}",
"public function parseUri()\n {\n return RouteMatch::uriToRegex($this);\n }",
"public function uri()\n {\n $uri = $this->server->get('REQUEST_URI');\n\n if (str_contains((string) $this->server->get('SERVER_SOFTWARE', ''), 'nginx')) {\n return explode('?', (string) $uri, 2)[0];\n }\n\n return $this->server->get('REQUEST_URI');\n }",
"public function getUri()\n {\n }"
]
| [
"0.8407464",
"0.75316393",
"0.749395",
"0.74544793",
"0.73792833",
"0.7328007",
"0.72714114",
"0.72442997",
"0.7205925",
"0.7191812",
"0.7181042",
"0.71809185",
"0.71521705",
"0.7129767",
"0.71288013",
"0.7101746",
"0.7085627",
"0.7083484",
"0.7077368",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7068326",
"0.7063454",
"0.7059291",
"0.7052405",
"0.7033622",
"0.7025176",
"0.7017525",
"0.70114",
"0.70113444",
"0.70014733",
"0.6984209",
"0.69830966",
"0.6970887",
"0.69400847",
"0.6916492",
"0.69087905",
"0.6889299",
"0.6878498",
"0.6868264",
"0.6863031",
"0.6837646",
"0.68365234",
"0.682277",
"0.68053955",
"0.6801842",
"0.6801842",
"0.6801842",
"0.6801842",
"0.6801842",
"0.6801842",
"0.6801842",
"0.68015766",
"0.68015766",
"0.68015766",
"0.68015766",
"0.679168",
"0.6786322",
"0.6777986",
"0.6776179",
"0.67750376",
"0.6772794",
"0.6751233",
"0.6747998",
"0.67472523",
"0.67366195",
"0.67365867",
"0.67365867",
"0.6734516",
"0.67296094",
"0.6715022",
"0.6712872",
"0.6711859",
"0.6705804",
"0.6701647",
"0.67014503",
"0.67010295",
"0.6695771",
"0.66840017",
"0.6665644",
"0.6656975",
"0.66489357",
"0.6620613",
"0.6619627",
"0.6605921",
"0.6587909",
"0.65676296",
"0.655822",
"0.65481174",
"0.65386564",
"0.653156",
"0.65295535"
]
| 0.69039875 | 44 |
Set the URI that the route responds to. | public function setUri($uri)
{
$this->uri = $uri;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUri($uri) {}",
"private function setUri(): void\n {\n $this->uri = strtok($_SERVER['REQUEST_URI'],'?');\n }",
"public function setUri($uri);",
"public function setURI($uri) {\n $this->uri = $uri;\n }",
"public static function setUri(string $uri): void {\r\n $_SERVER['REQUEST_URI'] = $uri;\r\n }",
"public function setUri($uri) \n\t{\n\t\t$this->uri = $uri;\n\t}",
"public function setUri($uri)\n {\n $this->uri = $uri;\n }",
"public function testSetUri()\n {\n $this->_req->setUri('something/to/test');\n $this->assertEquals('something/to/test', $this->_req->getUri());\n }",
"public static function setRoute(string $uri = '') {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $uri);\n\n\t\t$uri = self::_applyFilter(get_class(), __FUNCTION__, $uri, array('event' => 'args'));\n\t\t\n\t\tif (empty($uri)) {\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($uri, strlen($uri) - 1) === '/') {\n\t\t\t$uri = substr_replace($uri, '', strlen($uri) - 1);\n\t\t}\n\n\t\t$routes = array();\n\n\t\t$pos = @strpos($uri, '?');\n\n\t\tif ($pos !== false) {\n\t\t\t$uri = substr_replace($uri, '', $pos, strlen($uri));\n\t\t}\n\n\t\t$uri_parts = explode('/', $uri);\n\n\t\tforeach ($uri_parts as $key => $value) {\n\t\t\tif (empty($uri_parts[$key])) {\n\t\t\t\tunset($uri_parts[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$uri_parts = array_values($uri_parts);\n\t\t$uri = '/' . implode('/', $uri_parts);\n\t\t\n\t\t$assigned_route = array();\n\t\t$default_route = array();\n\t\t$assigned_route_options = array('listen'=> '*');\n\t\t$default_route_options = array();\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tforeach (self::$routes as $route) {\n\t\t\t\n\t\t\tif(self::_isAllowRequest($route['listen'], $method)) {\n\t\t\t\t\n\t\t\t\t$reRule = preg_replace(self::$default_rule_replace, self::$default_route_replace, $route['rule']);\n\t\t\t\t$reRule = str_replace('/', '\\/', $reRule);\n\t\n\t\t\t\tif (preg_match('/' . $reRule . '/', $uri, $matches)) {\n\t\n\t\t\t\t\t$uri_match = '';\n\t\t\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t\t\tif (!Validator::isInteger($key)) {\n\t\t\t\t\t\t\t$uri_match .= '/' . $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end foreach\n\t\n\t\t\t\t\t$match_1 = str_replace($uri_match, '', $uri);\n\t\t\t\t\t$match_2 = str_replace($uri_match, '', $matches[0]);\n\t\n\t\t\t\t\tif ($match_1 === $match_2 && !empty($match_1)) {\n\t\t\t\t\t\t$assigned_route = $matches;\n\t\t\t\t\t\t$assigned_route_options = $route;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ($match_1 === $match_2 && empty($match_1)) {\n\t\t\t\t\t\t$default_route = $matches;\n\t\t\t\t\t\t$default_route_options = $route;\n\t\t\t\t\t}\n\t\t\t\t}//end if prgrack mage\n\t\t\t}\n\t\t}//end first for\n\n\t\tif (!empty($assigned_route)) {\n\t\t\t$final_route = $assigned_route;\n\t\t\t$route_options = $assigned_route_options;\n\t\t\tif (!isset($final_route['route'])) {\n\t\t\t\t$final_route['route'] = $default_route;\n\t\t\t}\n\t\t\tif (!isset($route_options['route'])) {\n\t\t\t\t$route_options['route'] = $default_route;\n\t\t\t}\n\t\t} else {\n\t\t\t$final_route = $default_route;\n\t\t\t$route_options = $default_route_options;\n\t\t}\n\n\t\tself::$route_parameters = $final_route;\n\t\tself::$route_options = $route_options;\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tif(!isset($route_options['listen']) || (isset($route_options['listen']) && $route_options['listen'] == '*')) {\n\t\t\tself::$correct_request_method = true;\n\t\t} else {\n\t\t\t$listen = strtoupper($route_options['listen']);\n\t\t\t\n\t\t\tif(strpos($listen, $method )!== false) {\n\t\t\t\tself::$correct_request_method = true;\n\t\t\t} else {\n\t\t\t\tself::$correct_request_method = false;\n\t\t\t}\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $final_route, $route_options);\n\n\t\tif(self::$correct_request_method) {\n\t\t\t\n\t\t\tif (!empty($route_options['activate_ssl']) && $route_options['activate_ssl'] && !self::isSecureConnection()) {\n\t\t\t\tself::activateSSL();\n\t\t\t} else if (!empty($route_options['deactivate_ssl']) && $route_options['deactivate_ssl'] && self::isSecureConnection()) {\n\t\t\t\tself::deactivateSSL();\n\t\t\t}\n\t\n\t\t\tif (!empty($route_options['redirect'])) {\n\t\t\t\tself::redirect($route_options['redirect']);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($route_options['callback'])) {\n\t\t\t\treturn call_user_func_array($route_options['callback'], array(new Request()));\n\t\t\t}\n\t\t}\n\n\t}",
"public function setUri($uri)\n {\n $this->uri = $uri;\n $parsed = parse_url($this->uri);\n $this->setPath($parsed['path']);\n }",
"public function setUri($uri)\n { // n.b. site-install needs to set the uri.\n $this->bootstrap()->setUri($uri);\n }",
"public function setUrl(string $uri): void\n {\n // Must add '/' to the end and front\n $this->uri = $uri === \"/\" ? \"/\"\n : Str::hay(trim($uri, \"/\"))->wrap(\"/\");\n }",
"function setUri() {\n\t\tif (env('HTTP_X_REWRITE_URL')) {\n\t\t\t$uri = env('HTTP_X_REWRITE_URL');\n\t\t} elseif(env('REQUEST_URI')) {\n\t\t\t$uri = env('REQUEST_URI');\n\t\t} else {\n\t\t\tif (env('argv')) {\n\t\t\t\t$uri = env('argv');\n\n\t\t\t\tif (defined('SERVER_IIS')) {\n\t\t\t\t\t$uri = BASE_URL . $uri[0];\n\t\t\t\t} else {\n\t\t\t\t\t$uri = env('PHP_SELF') . '/' . $uri[0];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$uri = env('PHP_SELF') . '/' . env('QUERY_STRING');\n\t\t\t}\n\t\t}\n\t\treturn $uri;\n\t}",
"protected function setUri($uriToSet)\n {\n $uri_parts = [];\n\n array_push($uri_parts, 'api');\n array_push($uri_parts, config('ckan_api.api_version'));\n array_push($uri_parts, trim($uriToSet, '/'));\n\n $uri_parts = array_filter($uri_parts);\n\n $this->uri = implode('/', $uri_parts);\n }",
"public function set($uri): UrlManipulatorInterface;",
"public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }",
"final public function setUri($uri) {\n // Accept a Zend_Uri object or decompose a URI string into a Zend_Uri.\n if ($uri instanceof Zend_Uri) {\n $this->_uri = $uri;\n } else {\n // $uri string will be validated automatically by Zend_Uri.\n $this->_uri = Zend_Uri::factory($uri);\n }\n\n // Explicitly set the port if it's not already.\n if (!$this->_uri->getPort() && $this->_uri->getScheme() == 'https') {\n $this->_uri->setPort(443);\n } else if (!$this->_uri->getPort()) {\n $this->_uri->setPort(80);\n }\n }",
"private function setRqueUri(){\n }",
"public function setBaseUri($uri) {}",
"protected function getUri()\n {\n $uri = $this->request['REQUEST_URI'];\n $prefix = config('router', 'base_uri');\n if (substr($uri, 0, strlen($prefix)) == $prefix) {\n $uri = substr($uri, strlen($prefix));\n }\n\n $this->uri = rtrim($uri, \"/\");\n }",
"public function setUri($value)\n {\n if (!is_string($value))\n throw new CException(Yii::t('EWebFeed', 'uri must be a string'));\n EWebFeed::validateUri($value);\n $this->uri = $value;\n }",
"private static function setUristr() {\n $uri_request = HttpHelper::getUri();\n if(WEB_DIR != \"/\") {\n self::$uri = str_replace(WEB_DIR, \"\", $uri_request);\n } else {\n self::$uri = substr($uri_request, 1);\n }\n }",
"public function setUri($value)\n {\n if (!is_string($value) || empty($value))\n throw new CException(Yii::t('EWebFeed', 'uri must be a non-empty string'));\n EWebFeed::validateURI($value);\n $this->uri = $value;\n }",
"public function setUrl()\n {\n $this->set('url', function() {\n $url = new Url();\n $url->setBaseUri('/');\n return $url;\n });\n }",
"public function uri($uri = null)\n {\n if ($uri === null) {\n // Act as a getter\n return empty($this->uri) ? '/' : $this->uri;\n }\n\n // Act as a setter\n $this->uri = $uri;\n\n return $this;\n }",
"public function setWebsite($uri);",
"function setRedirectUri($uri, $code = Codes::HTTP_FOUND);",
"public function setUri($uri)\n {\n $this->_uri = $uri;\n\n return $this;\n }",
"protected function routeToURI(){\n\t\t$args = func_get_args();\n\t\treturn call_user_func_array(array('Router', 'routeToURI'), $args);\n\t}",
"public function setUri($uri)\n {\n $this->uri = $uri;\n\n return $this;\n }",
"public function setUri(UriInterface $uri, $preserveHost = false);",
"public function setUri($uri)\n {\n $that = parent::setUri($uri);\n\n if($that){\n\n $this->getHeaders()->addHeaderLine(\"Host\",$this->getUri()->getHost());\n\n };\n\n return $that;\n\n }",
"public function setResource( $uri ) {\n\t\tif ( self::validateResource($uri) ) {\n\t\t\t$this->resource = TRUE;\n\t\t\t$this->setParameter( \"info\", htmlentities( $uri ) );\n\t\t}\n\t}",
"public function setCurrentURI( $uri )\n {\n $this->currentURI = $uri;\n }",
"public function uri()\n {\n return '/foo/bar';\n }",
"public function setUri(string $uri)\n {\n if (strpos($uri, '?') !== False)\n\n $this->_requestUri = substr($uri, 0, strpos($uri, '?'));\n\n else\n\n $this->_requestUri = $uri;\n\n return $this;\n }",
"public function uri($uri);",
"public function getUriOverride()\n {\n return $this->uri_override;\n }",
"protected function location($uri) {\n location($uri);\n }",
"public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }",
"public function set($str)\n\t{\t\t\n\t\t$str = removeFilteredChars($str, FAlSE);\n\t\t\n\t\t$this->uriString = ($str == '/') ? '' : $str;\n\t}",
"public function getURI()\t{\n\t\treturn $this->route;\n\t}",
"public function requestUri() {}",
"protected function _setPort($uri){\n if (!$this->_uri->getPort()) {\n $port = (parse_url($uri, PHP_URL_SCHEME) == 'https') ? 443 : 80;\n $this->_uri->setPort($port);\n }\n }",
"protected function _setSelfSubmitUri()\n {\n\t\t$uriSelfSubmit = preg_replace('/\\?.*/', '', $_SERVER['REQUEST_URI']);\n\t\t#$this->getEnv()->setUriSelfSubmit($uriSelfSubmit);\n }",
"function setRequestUri($inParamValue) {\n\t\treturn $this->setParam(self::PARAM_REQUEST_URI, $inParamValue);\n\t}",
"public function getUri(){\n return $this->uri;\n }",
"public function setUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->uri = $var;\n\n return $this;\n }",
"public function setUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->uri = $var;\n\n return $this;\n }",
"public function setUri($var)\n {\n GPBUtil::checkString($var, True);\n $this->uri = $var;\n\n return $this;\n }",
"public function fetchUriString()\n\t{\n\t\tif ($_tempUri = $this->getUriFromRequest())\n\t\t{\n\t\t\t$this->set(trim($_tempUri, '/'));\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"public function withUri(UriInterface $uri)\n {\n $this->uri = $uri;\n }",
"public function setRequestUri($uri = false){\n $this->reset();\n \n /**\n * remove the query string from the uri\n */\n $request_uri = $_SERVER['REQUEST_URI'];\n \n if(strpos($request_uri, '?') !== false){\n $parts = explode('?', $request_uri);\n\n if(count($parts)){\n array_pop($parts);\n }\n \n $request_uri = implode('?', $parts);\n } \n \n $this->_request_uri = pick($uri, $request_uri);\n \n $vars = explode(\"/\", trim($this->_request_uri, \"/\"));\n \n foreach($vars as $var) {\n self::$_request_vars[] = $var;\n }\n \n return $this;\n }",
"public function setCallbackUri($val)\n {\n $this->_propDict[\"callbackUri\"] = $val;\n return $this;\n }",
"public function uri() {\n return $this->uri;\n }",
"public function testGetSetUri()\n {\n $uri = 'http://localhost/test/test';\n $linkHeaderItem = new LinkHeaderItem($uri);\n\n $this->assertEquals($uri, $linkHeaderItem->getUri());\n\n $uri = $uri.'?test=true';\n $linkHeaderItem->setUri($uri);\n\n $this->assertEquals($uri, $linkHeaderItem->getUri());\n }",
"public function uri(){\n return $this->uri;\n }",
"public function setURI($uri)\n {\n $this->uri = (string) $uri;\n $this->entity = null;\n\n return $this;\n }",
"public function getUri()\n\t{\n\t\treturn $this->uri;\n\t}",
"public function set_base_uri($uri)\r\n\t{\r\n\t\t$this->base_uri = $uri;\r\n\t}",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function getUri()\n {\n return $this->uri;\n }",
"public function setRequestedUri(string $uri): bool {\n $requested = new Uri($uri);\n\n if ($this->compareUriPathHelper($requested)) {\n $this->requestedUri = $requested;\n\n return true;\n }\n\n return false;\n }",
"private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }",
"public function testGetSetUri($uri, $method)\n {\n $request = new Aspamia_Http_Request('TEST', '/test');\n $this->assertEquals('/test', $request->getUri());\n \n $request->setMethod($method);\n $request->setUri($uri);\n $this->assertEquals($uri, $request->getUri());\n }",
"public function getUri() {\n\t\treturn $this->uri;\n\t}",
"public function setMdmSettingUri($val)\n {\n $this->_propDict[\"mdmSettingUri\"] = $val;\n return $this;\n }",
"protected function route()\n {\n return route($this->uri, $this->params);\n }",
"public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}",
"public function set_route($route)\n {\n }",
"public function getUri(): string\n {\n return $this->uri;\n }",
"function setUriStyle( $style ) {\n $style = strtolower( $style );\n\n switch( $style ) {\n case 'multiviews' :\n $this->uristyle = \"multiviews\";\n break;\n case 'rewrite' :\n $this->uristyle = \"rewrite\";\n break;\n case 'get' :\n case '' :\n $this->uristyle = \"get\";\n break;\n default :\n log::Trace(\"Tuntematon uri hander style: $style\");\n $this->uristyle = \"get\";\n break;\n }\n }",
"public function setURI($uRI)\n {\n $this->uRI = $uRI;\n return $this;\n }",
"public function setURI($uRI)\n {\n $this->uRI = $uRI;\n return $this;\n }",
"public function setURI($uRI)\n {\n $this->uRI = $uRI;\n return $this;\n }",
"protected function get_uri()\n {\n }",
"public function getUri()\n {\n return $this->_uri;\n }",
"public function uri()\n {\n return $this->uri;\n }",
"public function uri()\n {\n return $this->uri;\n }",
"public function getURI()\n {\n return $this->uri;\n }",
"function getUri() {\n\t\tif($this->_uri === null) {\n\t\t\t$this->_uri = rtrim($_SERVER['REQUEST_URI'], '/') . '/';\n\t\t}\n\t\treturn $this->_uri;\n\n\t}",
"public function setEndpointUri($endpointUri)\n {\n $this->_endpointUri = $endpointUri;\n }",
"public static function setUrl(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$url = substr(static::$fullUrl, 0, strpos(static::$fullUrl, '?'));\n\t\t} else {\n\t\t\tstatic::$url = static::$fullUrl;\n\t\t}\n\n\t}",
"public function uri()\n {\n return $this->_requestUri;\n }",
"public function setUriOverride($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Tasks\\V2beta3\\UriOverride::class);\n $this->uri_override = $var;\n\n return $this;\n }",
"public function uri();",
"public function uri();",
"public function uri();",
"public function setUri(string $uri): Debug\n {\n $this->uri = $uri;\n\n return $this;\n }",
"public function setRouteResource($value)\n {\n return $this->set('RouteResource', $value);\n }",
"public function testSetPathUriTrim()\n {\n $this->_req->setUri('/something/to/test/');\n $this->assertEquals('something/to/test', $this->_req->getUri());\n }",
"public function setRoute($route) {\n\t\t$this->route = $route;\n\t}"
]
| [
"0.7522767",
"0.7345113",
"0.73402953",
"0.7220422",
"0.7131542",
"0.7093211",
"0.7064274",
"0.69339466",
"0.67835754",
"0.6750475",
"0.67267114",
"0.66576546",
"0.664938",
"0.6473995",
"0.64705545",
"0.6445113",
"0.6418965",
"0.63920695",
"0.6376263",
"0.6357403",
"0.6320509",
"0.63194877",
"0.62715346",
"0.62652534",
"0.6246392",
"0.6240362",
"0.62306637",
"0.620503",
"0.6162251",
"0.615362",
"0.61461055",
"0.61394393",
"0.6130914",
"0.61300975",
"0.6102116",
"0.6090725",
"0.60900253",
"0.60809165",
"0.6053335",
"0.6043416",
"0.6043242",
"0.60261726",
"0.6018673",
"0.599744",
"0.59530795",
"0.5941486",
"0.5936873",
"0.592832",
"0.592832",
"0.592832",
"0.59089744",
"0.5823209",
"0.5814185",
"0.5800275",
"0.57974297",
"0.577464",
"0.577068",
"0.5769809",
"0.5762015",
"0.5759561",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57595104",
"0.57421434",
"0.57412875",
"0.57318735",
"0.5716406",
"0.5707213",
"0.5703209",
"0.5697551",
"0.56952906",
"0.5693303",
"0.56875914",
"0.5683186",
"0.5683186",
"0.5683186",
"0.56830096",
"0.56796354",
"0.5642286",
"0.5642286",
"0.5625995",
"0.56175894",
"0.561378",
"0.5602595",
"0.56015813",
"0.55933404",
"0.55885345",
"0.55885345",
"0.55885345",
"0.55872303",
"0.55803007",
"0.55794996",
"0.5574216"
]
| 0.6293034 | 22 |
Get the name of the route instance. | public function getName()
{
return isset($this->action['as']) ? $this->action['as'] : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRouteName();",
"public function getRouteName()\n {\n return $this->routeName;\n }",
"public function getRouteName()\n {\n return $this->routeName;\n }",
"function getRouteName();",
"function getRouteName() {\n \treturn $this->route_name;\n }",
"protected function getRouteName()\n {\n if (is_null($this->routeName)) {\n $this->routeName = $this->getCurrentCallingControllerName();\n }\n\n return $this->routeName;\n }",
"public function name()\n {\n if ($name = $this->route->getName()) {\n return $name;\n }\n\n $name = $this->route->getActionName();\n\n if ($name === 'Closure') {\n return null;\n }\n\n $namespace = array_get($this->route->getAction(), 'namespace');\n\n return str_replace($namespace . '\\\\', '', $name);\n }",
"protected function getName()\n {\n return $this->slimInstance->router()->getCurrentRoute()->getName();\n }",
"public function name(): RouteNameInterface;",
"public function getRouteName()\n {\n $routeName = $this->getConfiguredRouteName();\n\n return trim($routeName, '/') . '/';\n }",
"public function getBaseRouteName(): string;",
"public function currentRouteName()\n {\n return $this->current() ? $this->current()->getName() : null;\n }",
"abstract public function routeName();",
"public function getRouteName(): string\n {\n $path = str_replace(\"app/site/controllers/\", \"\", str_replace(\"\\\\\", \"/\", strtolower(get_class($this))));\n return str_replace(\"/\", \".\", trim($path, \"/\"));\n }",
"public static function routeName() : string\n {\n return str_replace('app_http_actions_', '', snake_case(str_replace('\\\\', '', static::class)));\n }",
"public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName(): string\n {\n return 'name';\n }",
"public function getRouteKeyName();",
"public function getRouteKeyName();",
"public function getRouteKeyName()\n {\n return $this->getKeyName();\n }",
"private function getRouteName(Route $route)\n {\n return is_null($name = $route->getName()) ? $route->uri() : $name;\n }",
"public function getRoute() : string\n {\n return $this->route;\n }",
"public function getRoute(): string\n {\n return (string) $this->route;\n }",
"public function getName(): string\n {\n if ($this->_name === null) {\n $endpoint = namespaceSplit(static::class);\n $endpoint = substr(end($endpoint), 0, -8);\n\n $inflectMethod = $this->getInflectionMethod();\n $this->_name = Inflector::{$inflectMethod}($endpoint);\n }\n\n return $this->_name;\n }",
"public function name()\n {\n if (isset($this->attributes[self::NAME])) {\n return $this->attributes[self::NAME];\n }\n\n return $this->path();\n }",
"public function getRouteKeyName()\n {\n return 'key';\n }",
"public function getRouteKeyName()\n {\n /* используется для того чтобы можно было в маршруте \n * например таком: Route::get('products/{category}/{product}', 'ProductsController@index');\n * получить \n * нужную категорию не по колонке id, а по колонке slug\n */\n return 'slug';\n }",
"public function getRouteKeyName()\n {\n return 'name_ascii';\n }",
"private function getRouteName($route)\n {\n return (isset($route['action']['as'])) ? $route['action']['as'] : '';\n }",
"public function getConfiguredRouteName()\n {\n if (null === $this->_configuredRouteName) {\n $configuredRouteName = $this->getFrontendName();\n $this->_configuredRouteName = $configuredRouteName ? $configuredRouteName : self::DEFAULT_ROUTE_NAME;\n }\n return $this->_configuredRouteName;\n }",
"public static function currentRouteName()\n {\n $uri = explode('?', $_SERVER['REQUEST_URI'])[0];\n\n foreach (self::$routes as $key => $val) \n {\n if ($uri === $val['url']) \n {\n return $key;\n }\n }\n }",
"public function getRouteKeyName(){\n\t\treturn '';\n\t}",
"public function getRouteKeyName() {\n\t\t\t\n\t\t\treturn 'reference';\n\t\t}",
"public function getRouteKey()\n {\n return $this->getAttribute($this->getRouteKeyName());\n }",
"public function getCurrentRoute(){\n\n\t\t$route = $this->getRouter()->match();\n\t\tif($route){\n\t\t\treturn $route['name'];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getFormActionRouteName(): string\n {\n return $this->resource->getRouteName($this->getFormActionRouteSuffix());\n }",
"public function getRouteKeyName()\n {\n // get the category where the name column is equal to user input\n return 'name';\n }",
"protected function getRoutePrefix()\n {\n if ($this->routePrefix !== null) {\n return $this->routePrefix;\n }\n\n return str_plural(snake_case($this->getControllerName(), '-'));\n }",
"function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}",
"public function getRouteName($action);",
"public function getRouteKey()\n {\n $slug = $this->slugField();\n\n return $this->$slug;\n }",
"public static function route()\n {\n return self::$route;\n }",
"public function getName()\n {\n return $this->view;\n }",
"public function getName()\n {\n return $this->view;\n }",
"function route_name($url)\n {\n return Route::match([\n 'get', 'post', 'delete', 'patch', 'put'\n ], $url)->getName();\n }",
"function getName() {\n return $this->instance->getName();\n }",
"public function getRouteKey()\n {\n return $this->getTranslation('url', app()->getLocale());\n }",
"public static function uriKey()\n {\n return Str::singular(Str::snake(class_basename(get_called_class()), '-'));\n }",
"public function getRouteKey() {\n return $this->slug;\n }",
"public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}",
"public function getRouteKey()\n {\n return $this->slug;\n }",
"public static function uriKey()\n {\n return Str::plural(Str::snake(class_basename(get_called_class()), '-'));\n }",
"function route_name(): ?string\n{\n return RouteController::getCurrentRoute()['name'] ?? null;\n}",
"public function getInstanceName()\n {\n return $this->instanceName;\n }",
"public function getInstanceName()\n {\n return $this->instanceName;\n }",
"public function getRoute($name){ }",
"public function getRouteKeyName()\n\t{\n\t return request()->segment(1) === 'admin' ? 'id' : 'startdatetime';\n\t}",
"public function getRouteName()\n {\n return 'internal.show_new_family_with_children';\n }",
"protected function getRouteName($is_path = true)\n {\n $ret = '%s';\n\n if ($is_path) {\n $ret = 'Routes/%sRoutes.php';\n }\n\n return sprintf(\n $ret,\n studly_case(\n str_slug($this->input->getArgument('name'), '_')\n )\n );\n }",
"public function getRouteKeyName()\n {\n return 'abbreviation';\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRoute()\n {\n return $this->route;\n }",
"public function getRouteKeyName(): string\n {\n if (request()->expectsJson()) {\n return 'id';\n }\n return 'slug';\n }",
"public function get_resource_name();",
"public function getRoute()\r\n {\r\n return $this->route;\r\n }",
"public function getRoute() {\n \n return $this->route;\n \n }",
"public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }",
"public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }",
"public function getRouteKeyName()\n {\n return 'url';\n }",
"public function getInstanceName(): string\n {\n return $this->instanceName;\n }",
"public function getActiveRouteName($uri);",
"public function __construct()\n { \n $routeName = \\Route::currentRouteName(); \n \n }",
"public function getRouteKey()\n {\n \t$this->slug;\n }",
"public function name() {\n\t\treturn $this->name;\n\t}",
"public function getRoute()\n\t{\n\t\treturn $this->route;\n\t}",
"public function getRouteKey();",
"public function getRouteKey();",
"public function getRouteKeyName() {\n return 'url';\n }",
"public function getRouteKeyName()\n\t{\n\t return 'id';\n\t}",
"public function getRouteNameByClass($className)\n {\n $routeName = strtolower((new \\ReflectionClass($className))->getShortName());\n\n return $routeName;\n }",
"public function getRouteKeyName()\n\t{\n\t return 'token';\n\t}",
"public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}",
"public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}",
"public function getRoute() {\n\t\treturn $this->route;\n\t}",
"public function getName(){\n return $this->game->get_current_turn()->ReturnName();\n }",
"public function name() : string\n {\n return call_user_func([get_called_class(), 'resolveName']);\n }",
"public function getRouteKeyName()\n {\n return request()->segment(1) === 'admin' ? 'id' : 'account_code';\n }",
"public function getName() {\n\n list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);\n return $name;\n\n }",
"public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}",
"public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }"
]
| [
"0.8562265",
"0.8389877",
"0.8389877",
"0.8123409",
"0.8044389",
"0.8035438",
"0.79139197",
"0.777098",
"0.7627414",
"0.75618374",
"0.74428123",
"0.74418104",
"0.7423906",
"0.74192315",
"0.74158585",
"0.7371684",
"0.7371684",
"0.736018",
"0.736018",
"0.736018",
"0.73511916",
"0.7322516",
"0.7286395",
"0.7286395",
"0.7232603",
"0.7158215",
"0.7070538",
"0.7048998",
"0.7043118",
"0.70008045",
"0.69198877",
"0.6847683",
"0.6829758",
"0.6828403",
"0.68198764",
"0.6813017",
"0.6811097",
"0.67657334",
"0.6763552",
"0.67576873",
"0.6756244",
"0.6708635",
"0.6698693",
"0.6657651",
"0.66510755",
"0.6644118",
"0.66415596",
"0.6618233",
"0.6618233",
"0.66040933",
"0.6582607",
"0.653708",
"0.6513374",
"0.6502094",
"0.6486012",
"0.64820176",
"0.6474461",
"0.6456813",
"0.6450654",
"0.6450654",
"0.6449093",
"0.6447626",
"0.6444549",
"0.6419834",
"0.64031655",
"0.6398616",
"0.6398616",
"0.6398616",
"0.6398616",
"0.6398616",
"0.6398616",
"0.6398616",
"0.63981557",
"0.6397185",
"0.63903433",
"0.63870335",
"0.63849956",
"0.63849956",
"0.6382379",
"0.63796276",
"0.6378031",
"0.63779265",
"0.6374019",
"0.63733",
"0.63683146",
"0.636114",
"0.636114",
"0.634945",
"0.63458836",
"0.6342244",
"0.6338632",
"0.6330877",
"0.6330877",
"0.6326354",
"0.6320163",
"0.6317625",
"0.6306712",
"0.6305994",
"0.62995124",
"0.6299014"
]
| 0.6421623 | 63 |
Add or change the route name. | public function name($name)
{
$this->action['as'] = isset($this->action['as']) ? $this->action['as'].$name : $name;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function routeName();",
"public function testRouteSetsName()\n {\n $route = new \\Slim\\Route('/foo/bar', function () {});\n $route->name('foo');\n $this->assertEquals('foo', $route->getName());\n }",
"function getRouteName();",
"public function getRouteName();",
"protected function addRoute($name)\n {\n $plural = strtolower(Str::pluralStudly($name));\n $file_loc = base_path() . '/routes/web.php';\n $route = \"\\nRoute::resource('$plural', '{$name}Controller');\";\n\n $this->files->append($file_loc, $route);\n $this->info('Model resource route created successfully.');\n }",
"public function name(): RouteNameInterface;",
"public static function routeName() : string\n {\n return str_replace('app_http_actions_', '', snake_case(str_replace('\\\\', '', static::class)));\n }",
"public function getRouteKeyName(): string\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function setNameCorrectlySetsRouteName()\n {\n $this->route->setName('SomeName');\n\n self::assertSame('SomeName', $this->route->getName());\n }",
"public function getBaseRouteName(): string;",
"function getRouteName() {\n \treturn $this->route_name;\n }",
"public function getRouteKeyName()\n {\n return 'name_ascii';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteKeyName()\n {\n return 'name';\n }",
"public function getRouteName()\n {\n return $this->routeName;\n }",
"public function getRouteName()\n {\n return $this->routeName;\n }",
"public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"public function getRouteKeyName()\n\t{\n\t\treturn 'name';\n\t}",
"private function mergeName(string $name = '') : RouteInterface\n {\n $this->name = trim(implode('.', [$name, $this->name]), '.');\n return $this;\n }",
"function route_name($url)\n {\n return Route::match([\n 'get', 'post', 'delete', 'patch', 'put'\n ], $url)->getName();\n }",
"public static function customizeRouteNames( $name )\n {\n if ( ns()->store->isMultiStore() ) {\n return self::$routePrefix . $name;\n } \n\n return $name;\n }",
"public function getRouteKeyName();",
"public function getRouteKeyName();",
"public function addRoute($name, $route, $priority = null);",
"protected function prepareRouteName ($name)\n {\n return $this->allowMultiple && $this->rubric ?\n $this->moduleManager->getEntityRouter()->routeNameForRubricAction($this->rubric, $name) : $name;\n }",
"public function getRouteKeyName(){\n\t\treturn '';\n\t}",
"public static function bindNamedRoute(Route $route)\n {\n self::$_name_routes[$route->getName()] = $route;\n }",
"public function getRouteName()\n {\n $routeName = $this->getConfiguredRouteName();\n\n return trim($routeName, '/') . '/';\n }",
"public function addNamedRoute($name, $url, $controller, $method) {\n $this->pathes[$url] = ['controller' =>$controller, 'method' => $method, 'name' => $name ];\n }",
"public function urlToActionName($name){\n // just turn dash-format into upperCamelCaseFormat\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $name) . 'Action';\n }",
"function route($route_name)\n {\n global $router; \n return $router->generate($route_name);\n }",
"public function addRoute($name, \\Yaf\\Route_Interface $route){\r\n\t\t$this->_routes[$name]\t= $route;\r\n\t }",
"private function getRouteName($route)\n {\n return (isset($route['action']['as'])) ? $route['action']['as'] : '';\n }",
"public function getRouteName()\n {\n return 'internal.show_new_family_with_children';\n }",
"public function getRoute($name){ }",
"public function setRouteName($route, $parameters = [])\n {\n $complete_route = $route . '.index';\n\n if (!\\Route::has($complete_route)) {\n throw new \\Exception('There are no routes for this route name.', 404);\n }\n\n $this->route = route($complete_route, $parameters);\n }",
"private function getRouteName(Route $route)\n {\n return is_null($name = $route->getName()) ? $route->uri() : $name;\n }",
"public function getRouteName(): string\n {\n $path = str_replace(\"app/site/controllers/\", \"\", str_replace(\"\\\\\", \"/\", strtolower(get_class($this))));\n return str_replace(\"/\", \".\", trim($path, \"/\"));\n }",
"public function getRouteKeyName()\n {\n return 'key';\n }",
"private static function registerRoute($route)\n {\n global $Routes;\n $Routes[] = \"/\".$route;\n }",
"protected function getRouteName($is_path = true)\n {\n $ret = '%s';\n\n if ($is_path) {\n $ret = 'Routes/%sRoutes.php';\n }\n\n return sprintf(\n $ret,\n studly_case(\n str_slug($this->input->getArgument('name'), '_')\n )\n );\n }",
"public function getActiveRouteName($uri);",
"public function route($route)\n {\n return $this->options['default-prefix'] . $route;\n }",
"public function name ($name)\n {\n $this->name = $name;\n Route::name ($name, $this);\n return $this;\n }",
"public function getRouteKeyName()\n {\n // get the category where the name column is equal to user input\n return 'name';\n }",
"private static function registerRoute($route){\r\n global $Routes;\r\n $Routes[] = BASEDIR.$route;\r\n }",
"public function registerRoute($file_name)\n {\n //after the original registered route.\n $this->addLine('app/Providers/RouteServiceProvider.php', $file_name);\n }",
"protected function getRouteName()\n {\n if (is_null($this->routeName)) {\n $this->routeName = $this->getCurrentCallingControllerName();\n }\n\n return $this->routeName;\n }",
"public function name(string $name): self\n {\n if($this->cache_status){\n return $this;\n }\n if(!isset($this->routes[$this->id])){\n throw new RouterException('The route to add the name could not be found.');\n }\n if(isset($this->routes[$this->id]['options']['as'])){\n $name = $this->routes[$this->id]['options']['as'] . $name;\n }\n $name = \\trim($name);\n if(isset($this->names[$name])){\n throw new RouterException('The name \"' . $name . '\" is already in use by another route.');\n }\n $this->names[$name] = $this->id;\n return $this;\n }",
"public function getRouteKeyName()\n {\n return 'abbreviation';\n }",
"public function removeRoute($name);",
"public function name()\n {\n if ($name = $this->route->getName()) {\n return $name;\n }\n\n $name = $this->route->getActionName();\n\n if ($name === 'Closure') {\n return null;\n }\n\n $namespace = array_get($this->route->getAction(), 'namespace');\n\n return str_replace($namespace . '\\\\', '', $name);\n }",
"public function getRouteKeyName()\n {\n /* используется для того чтобы можно было в маршруте \n * например таком: Route::get('products/{category}/{product}', 'ProductsController@index');\n * получить \n * нужную категорию не по колонке id, а по колонке slug\n */\n return 'slug';\n }",
"public function getRouteKeyName(): string\n {\n return 'username';\n }",
"public function set_name($new_name) {\r\n\t\t$this->name = strtoupper($new_name);\r\n\t}",
"public function register_route($route_namespace, $route, $route_args, $override = \\false)\n {\n }",
"public function getRouteKeyName()\n {\n return 'url';\n }",
"public function getRouteName($action);",
"function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}",
"public function getMethodNameFromRouteName($routeName)\n {\n $explodedRouteName = explode('.', $routeName);\n return 'action' . ucfirst(end($explodedRouteName));\n }",
"public function set_route($route)\n {\n }",
"public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}",
"public function getRouteKeyName(): string\n\t{\n\t\treturn 'slug';\n\t}",
"private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }",
"public function testUrlGenerationNamedRoute(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/users',\n ['controller' => 'Users', 'action' => 'index'],\n ['_name' => 'users-index']\n );\n $routes->connect(\n '/users/{name}',\n ['controller' => 'Users', 'action' => 'view'],\n ['_name' => 'test']\n );\n $routes->connect(\n '/view/*',\n ['action' => 'view'],\n ['_name' => 'Articles::view']\n );\n\n $url = Router::url(['_name' => 'test', 'name' => 'mark']);\n $this->assertSame('/users/mark', $url);\n\n $url = Router::url([\n '_name' => 'test', 'name' => 'mark',\n '?' => ['page' => 1, 'sort' => 'title', 'dir' => 'desc', ],\n ]);\n $this->assertSame('/users/mark?page=1&sort=title&dir=desc', $url);\n\n $url = Router::url(['_name' => 'Articles::view']);\n $this->assertSame('/view/', $url);\n\n $url = Router::url(['_name' => 'Articles::view', '1']);\n $this->assertSame('/view/1', $url);\n\n $url = Router::url(['_name' => 'Articles::view', '_full' => true, '1']);\n $this->assertSame('http://localhost/view/1', $url);\n\n $url = Router::url(['_name' => 'Articles::view', '1', '#' => 'frag']);\n $this->assertSame('/view/1#frag', $url);\n }",
"public function getRouteKeyName() {\n return 'url';\n }",
"function admin_updatePathway( $path, $name )\n{\n\tglobal $g_admin_pathway;\n\n\t$new_pos = count($g_admin_pathway);\n\n\t$g_admin_pathway[$new_pos]['url' ] = $path;\n\t$g_admin_pathway[$new_pos]['name'] = $name;\n}",
"private static function registerRoute($route) {\n global $Routes;\n $Routes[] = $route;\n }",
"public function getRouteKeyName() {\n\t\t\t\n\t\t\treturn 'reference';\n\t\t}",
"public function add($key, $route){\n $this->routes[$key] = $route;\n }",
"public function setNameAdd($name = NULL ){\n\t\t$this->nameAddNew = $name ? $name : \"Adicionar \".$this->name;\n\t}",
"public function getRouteKeyName(): string\n {\n return 'slug';\n }",
"public function getRouteKeyName(): string\n {\n return 'slug';\n }",
"public function addRoute($name, Zend_Controller_Router_Route $route)\r\n {\r\n $this->_router->addRoute($name, $route);\r\n }",
"public function getRouteKeyName()\n {\n \treturn 'slug';\n }",
"public function getRouteKeyName(): string {\n\t\t\treturn 'slug';\n\t\t}",
"function addNameChange($from, $to)\r\n{\r\n\tglobal $A; // Activity object\r\n\t$A->changeName($from, $to);\r\n\r\n\tif (LACE_SHOW_NAME_CHANGE)\r\n\t{\r\n\t\t$message = array\r\n\t\t(\r\n\t\t\t'action' => true,\r\n\t\t\t'time' => time(),\r\n\t\t\t'name' => 'Lace',\r\n\t\t\t'text' => '<strong>'.$from.'</strong> is now <strong>'.$to.'</strong>',\r\n\t\t);\r\n\r\n\t\taddMessage($message);\r\n\t}\r\n}",
"public function __add(string $name, $value) \n {\n if (!property_exists($this, $name)) \n {\n $this->{Path::toCamelCase($name)} = $value;\n }\n }",
"public function SetName ($name);",
"public function nameCommand()\n {\n $userName = $this->getFromName();\n if (!empty($this->e->getParams())) {\n $newName = implode(' ', $this->e->getParams());\n $this->reply($userName . ' теперь известен как ' . $newName);\n } else {\n $newName = $userName;\n $this->reply($userName . ' теперь использует имя по-умолчанию');\n }\n $this->setUserName($this->getUserId(), $newName);\n }",
"public function getRouteKeyName()\n\t{\n\t return request()->segment(1) === 'admin' ? 'id' : 'startdatetime';\n\t}",
"private function resolveName($name)\n {\n if ($name !== null) {\n return $name;\n }\n\n if (!isset($this->defaults['route'])) {\n throw new RouterException('Unable to make \"self\" url - default route was not defined.');\n }\n\n return $this->defaults['route'];\n }",
"public function setNameView($name = NULL ){\n\t\t$this->nameView = $name ? $name : \"Ver \".$this->name;\n\t}",
"public function & SetName ($name) {\n\t\t/** @var $this \\MvcCore\\Route */\n\t\t$this->name = $name;\n\t\treturn $this;\n\t}",
"public function __construct()\n { \n $routeName = \\Route::currentRouteName(); \n \n }",
"public function getRouteKeyName()\n\t{\n\t\treturn 'ID_RequeCli';\n\t}",
"public function getRouteKeyName()\n {\n return 'hash';\n }",
"public function getRouteKeyName(): string\n {\n return 'token';\n }",
"function add_route($route, callable $closure)\n\n {\n// $route = self::APP_PREFIX.$route;\n// die($route);\n $this->routes[$route] = $closure;\n }",
"public static function set($name, $uri_callback = NULL, $regex = NULL)\n\t{\n\t\tif($uri_callback === TRUE)\n\t\t{\n\t\t\t$uri_callback = ___($name);\n\t\t}\n\t\t\n\t\treturn Route::$_routes[$name] = new Route($uri_callback, $regex);\n\t}",
"public function set_name($name);",
"public function name($name)\n {\n if (!array_key_exists($name, $this->router->namedRoutes))\n $this->router->namedRoutes[$name] = $this;\n\n return $this;\n }",
"function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }",
"public function addRoute (Cmf_Route $route) {\n $this->_routes[$route->getName()] = $route;\n }",
"protected function getAppRouteName()\n {\n return 'bump_frontend_default_index';\n }",
"public function getRouteKeyName()\n {\n return 'username';\n }",
"public function getRouteKeyName()\n {\n return 'username';\n }",
"public function getRouteKeyName()\n {\n return 'username';\n }",
"public function getConfiguredRouteName()\n {\n if (null === $this->_configuredRouteName) {\n $configuredRouteName = $this->getFrontendName();\n $this->_configuredRouteName = $configuredRouteName ? $configuredRouteName : self::DEFAULT_ROUTE_NAME;\n }\n return $this->_configuredRouteName;\n }"
]
| [
"0.7455183",
"0.70395416",
"0.6995413",
"0.6939294",
"0.66437274",
"0.6643695",
"0.66182494",
"0.65202963",
"0.6451872",
"0.64034635",
"0.6365591",
"0.63415134",
"0.6338549",
"0.63021547",
"0.63021547",
"0.63021547",
"0.62764055",
"0.62764055",
"0.6254458",
"0.6254458",
"0.6230861",
"0.6219337",
"0.6200476",
"0.6186459",
"0.6186459",
"0.61394095",
"0.61339724",
"0.6106211",
"0.6099535",
"0.6075383",
"0.6069298",
"0.60361665",
"0.6015467",
"0.60121536",
"0.59672546",
"0.5941468",
"0.5928595",
"0.5906841",
"0.59035105",
"0.5902178",
"0.58989036",
"0.5828226",
"0.58231324",
"0.57745475",
"0.57736534",
"0.57659465",
"0.57531315",
"0.5740775",
"0.57210076",
"0.57113516",
"0.56898785",
"0.5686322",
"0.5656208",
"0.5652846",
"0.56496817",
"0.56318295",
"0.56133556",
"0.5592996",
"0.55764204",
"0.55671656",
"0.5556795",
"0.5555357",
"0.5548188",
"0.552671",
"0.552671",
"0.55212754",
"0.5516677",
"0.5510643",
"0.5480183",
"0.54767656",
"0.54660475",
"0.5457446",
"0.5457374",
"0.5447828",
"0.5447828",
"0.5446864",
"0.5434415",
"0.5424658",
"0.54231596",
"0.5421096",
"0.54181165",
"0.5417915",
"0.5398469",
"0.539031",
"0.5370357",
"0.5361738",
"0.53560007",
"0.53531617",
"0.53380316",
"0.5334212",
"0.5332197",
"0.5330413",
"0.53221035",
"0.5321669",
"0.5319038",
"0.5318297",
"0.5312842",
"0.53029174",
"0.53029174",
"0.53029174",
"0.52983344"
]
| 0.0 | -1 |
Determine whether the route's name matches the given name. | public function named($name)
{
return $this->getName() === $name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasRoute(string $name): bool;",
"public function hasNamedRoute($name)\n {\n return isset($this->attributes[$name]) || $this->routes->hasNamedRoute($name);\n }",
"public function hasRoute(string $name): bool\n {\n return \\array_key_exists($name, $this->routes);\n }",
"public function hasRoute($name)\n {\n return array_key_exists($name, $this->routes);\n }",
"public function currentRouteNamed($name)\n {\n return $this->current() ? $this->current()->getName() == $name : false;\n }",
"public function has($name)\n {\n return isset($this->routes[$name]);\n }",
"public function hasRoute($name) {\n\t\treturn isset ( $this->_routes [$name] );\n\t}",
"public function routeExists($name)\n {\n $router = $this->container->get('router');\n $res = (null === $router->getRouteCollection()->get($name)) ? 0 : 1;\n return $res;\n\n }",
"public function existsRoute($name)\n {\n return null !== $this->router->getRouteCollection()->get($name);\n }",
"public function match(string $routeName): bool\n {\n $regex = $this->getRouteName();\n foreach ($this->getParametersNames() as $routeParam) {\n $routeParamName = trim($routeParam, '{\\}');\n $regex = str_replace($routeParam, '(?P<' . $routeParamName . '>[^/]++)', $regex);\n }\n\n if (preg_match('#^' . $regex . '$#sD', self::trimPath($routeName), $matches)) {\n $values = array_filter($matches, static function ($key) {\n return is_string($key);\n }, ARRAY_FILTER_USE_KEY);\n\n foreach ($values as $key => $value) {\n $this->parameters[$key] = $value;\n }\n\n return true;\n }\n return false;\n }",
"public function hasName($name)\n {\n if(strcasecmp($this->data['name'], $name ) == 0)\n return true;\n return false;\n }",
"function is_route(string $route): bool\n {\n return Route::currentRouteName() == $route;\n }",
"abstract public function routeName();",
"private static function routeExists(string $routeName): bool\n {\n return Route::has($routeName);\n }",
"public function checkRoute($name, $id = false)\n {\n if( $id ){\n return (boolean) (RouteModel::where('id', '<>', $id)->where('name', $name)->count() > 0);\n }else{\n return (boolean) (RouteModel::where(['name' => $name])->count() > 0);\n }\n }",
"protected function routeMatches(string $filter, Route $route): bool\n\t{\n\t\tif(str_contains($route->getRoute(), $filter))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif(str_contains($this->getNormalizedActionName($route), $filter))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif(str_contains((string) $route->getName(), $filter))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function isNameTake(string $name): bool;",
"public function matches(Route $route, Request $request)\n {\n global $current_screen;\n return $route->hookSuffix==$current_screen->id;\n }",
"function routeContain($wordForSearch)\n {\n $routeName = Request::route()->getName();\n $contains = Str::contains($routeName, $wordForSearch);\n return $contains;\n }",
"public function isCurrentRoute(string $name, ?string $adminCode = null): bool;",
"public function isNamed(...$patterns)\n {\n if (is_null($routeName = $this->getName())) {\n return false;\n }\n\n foreach ($patterns as $pattern) {\n if (PhandaStr::matchesPattern($pattern, $routeName)) {\n return true;\n }\n }\n\n return false;\n }",
"public function testRouteSetsName()\n {\n $route = new \\Slim\\Route('/foo/bar', function () {});\n $route->name('foo');\n $this->assertEquals('foo', $route->getName());\n }",
"public static function isValidName($name) {}",
"public function name(): RouteNameInterface;",
"public function getRoute($name){ }",
"private function _checkName($name)\n {\n if (!preg_match('/' . $this->_packet->question[0]->qname . '$/', $name)) {\n \n throw new Net_DNS2_Exception(\n 'name provided (' . $name . ') does not match zone name (' .\n $this->_packet->question[0]->qname . ')',\n Net_DNS2_Lookups::E_PACKET_INVALID\n );\n }\n \n return true;\n }",
"public function getRouteName();",
"public function hasNamed(string $name): bool;",
"function getRouteName();",
"public function hasRoute(): bool;",
"function route_group_exists(string $name, string $module): bool\n{\n foreach (Router::getRoutes() as $route) {\n if (isset($route['group']) &&\n strtolower($route['group']) == strtolower($name) &&\n strtolower($route['module']) == strtolower($module)) {\n\n return true;\n }\n }\n\n return false;\n}",
"public static function checkName($name)\n {\n if (strlen($name) >= 2) {\n return true;\n }\n return false;\n }",
"public function is()\n {\n foreach (\\func_get_args() as $pattern) {\n if (Str::is($pattern, $this->currentRouteName())) {\n return true;\n }\n }\n\n return false;\n }",
"public function named(string $name){\n return $this->porperty == $name ;\n }",
"public function hasAction(string $name): bool;",
"public function get(string $name){\n foreach($this->routes as $route){\n\t\t\tif($route->matchName($name))\n\t\t\t\treturn $route;\n\t\t}\n\t\treturn null;\n }",
"public function exists($name)\n {\n return $name === $this->_name || strpos($name, $this->_name . '#~#') === 0;\n }",
"private function matchRoute($route) {\n // Route match exactly with the url?\n if ($route === $this->url) {\n return true;\n }\n\n $regex = str_replace(['/', ')', ':word', ':num'], ['\\/', ')?', '[\\w_-]+', '[\\d-]+'], $route);\n if (preg_match('~^' . $regex . '$~', $this->url)) {\n return true;\n }\n return false;\n }",
"protected function nodeMatchesSymbol(Node $node, $name)\n {\n if (!isset($node->name)) {\n $nodeName = $this->getNodeName($node);\n } else {\n $nodeName = $node->name;\n\n // Don't resolve expressions e.g. $obj->{\"get\".$name}\n if ($nodeName instanceof Expr) {\n return false;\n }\n }\n\n return strcasecmp((string)$nodeName, $name) === 0;\n }",
"public function has($name)\r\n {\r\n foreach ($this->getAll() as $key => $value) {\r\n if (0 === strcmp(strtolower($key), strtolower($name))) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public function getNamed(string $name): Route|null;",
"public function name_exists($name, $viewid) {\n return $this->df->name_exists('views', $name, $viewid);\n }",
"function route_param(string $name)\n{\n $params = RouteController::getCurrentRoute()['params'];\n\n if ($params) {\n foreach ($params as $param) {\n if ($param['name'] == $name) {\n return $param['value'];\n }\n }\n }\n\n return null;\n}",
"public static function checkName($name)\r\n {\r\n if (strlen($name) >= 4) {\r\n return true;\r\n }\r\n return false;\r\n }",
"protected static function isValidName($name)\n {\n return '' === $name || null === $name || preg_match('/^[a-zA-Z0-9_][a-zA-Z0-9_\\-:]*$/D', $name);\n }",
"public function getCustomRoute($name)\n {\n foreach ($this->routes as $route => $content) {\n $extractor = explode(' ', $route);\n if($name === $extractor[0]){\n return $route;\n }\n }\n return null;\n }",
"public static function isValidName( $name ) {\n return TRUE;\n }",
"public function hasName()\n {\n return $this->get(self::NAME) !== null;\n }",
"public function hasRequest(string $name): bool {}",
"protected function prepareRouteName ($name)\n {\n return $this->allowMultiple && $this->rubric ?\n $this->moduleManager->getEntityRouter()->routeNameForRubricAction($this->rubric, $name) : $name;\n }",
"public function name(string $name) : bool\n\t{\n\t\tif (!preg_match(\"/^[a-zA-Z ]*$/\",$name)) {\n\t\t\t$this->errors[] = 'Only letters and white space allowed';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function checkAccessRoute($permissionName, $params, $allowCaching)\n {\n $route = explode('_', $permissionName);\n $routePermission = '';\n foreach ($route as $part) {\n $routePermission .= $part;\n if (\\Yii::$app->user->id) {\n $canRoute = parent::can($routePermission, $params, $allowCaching);\n } else {\n $canRoute = $this->canGuest($routePermission, $params, $allowCaching);\n }\n if ($canRoute) {\n return true;\n }\n $routePermission .= '_';\n }\n\n return false;\n }",
"private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"function isValidRoute($route) {\n \n return $route == 'campus' ||\n $route == 'extended' ||\n $route == 'nathanBisk' ||\n $route == 'downtown';\n}",
"public static function is_application_name($name)\r\n {\r\n return (preg_match('/^[a-z][a-z_]+$/', $name) > 0);\r\n }",
"public function appliesTo(string $name): bool\n {\n return $this->name === $name;\n }",
"private function isInIgnoredRouteNames(Route $route)\n {\n return $this->checkPatterns(\n $route->getName(), $this->getConfig('routes.ignore.names', [])\n );\n }",
"public function hasPermissionByName($name){\n\t\t\n\t\t$ok = false;\n\t\t\n\t\tforeach ($this->getPermissions() as $myPermission) {\n\t\t\t$ok = strtoupper($myPermission->getName()) == strtoupper($name);\n\t\t\tif( $ok )\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $ok;\n\t\t\n\t}",
"public function matches(Route $route, Request $request);",
"private function accept(?string $name): bool\n {\n if (null === $name || empty($name)) {\n return false;\n }\n\n foreach ($this->ignores as $ignore) {\n if (0 === strpos($name, $ignore)) {\n return false;\n }\n }\n\n foreach ($this->namespaces as $namespace) {\n if (0 === strpos($name, $namespace) || '*' === $namespace) {\n return true;\n }\n }\n\n return false;\n }",
"public function getActiveRouteName($uri);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"public function exists($name);",
"function find_route_by_name(string $name, string $module): ?array\n{\n foreach (Router::getRoutes() as $route) {\n if (isset($route['name']) &&\n strtolower($route['name']) == strtolower($name) &&\n strtolower($route['module']) == strtolower($module)) {\n \n return $route;\n }\n }\n\n return null;\n}",
"public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }",
"public static function validateName($name) {\n if (preg_match(\"/^[a-zA-Z]*$/\",$name))\n return true;\n else\n return false;\n }",
"function is_resource_route(string $resource): bool\n {\n $route = explode('.', Route::currentRouteName());\n array_pop($route);\n $resourceName = implode('.', $route);\n\n return $resourceName == $resource;\n }",
"public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }",
"public function setNameCorrectlySetsRouteName()\n {\n $this->route->setName('SomeName');\n\n self::assertSame('SomeName', $this->route->getName());\n }",
"public function hasValidNameArgument()\n {\n $name = $this->argument('name');\n\n if (! Str::contains($name, '/')) {\n $this->error(\"The name argument expects a vendor and name in 'Composer' format. Here's an example: `vendor/name`.\");\n\n return false;\n }\n\n return true;\n }",
"public static function hasAccess($routeName)\n {\n $routeId = common_route_master::select('id')->where('route_path', $routeName)->first();\n if (isset($routeId->id)) {\n $roleId = Auth::user()->role_id;\n $flag = permission_master::where(['route_id' => $routeId->id, 'role_id' => $roleId])->get();\n\n if ($flag->count() > 0) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"public static function event_name_is_valid( $name ) {\n\t\treturn preg_match( self::EVENT_NAME_REGEX, $name );\n\t}",
"public function hasName()\n {\n return $this->name !== null;\n }",
"public function exists(string $name): bool\n {\n return $this->blade->exists($name);\n }",
"public static function nameIsValid($name) {\r\n return ( is_string($name) && !empty($name) && strlen($name) >=2 ); \r\n }",
"public function match(): bool\n {\n $uri = $_SERVER['REQUEST_URI'];\n $parse = parse_url($uri);\n $url = trim($parse['path'] ?? '', '/');\n foreach ($this->routes as $route => $params) {\n if (preg_match($route, $url, $matches)) {\n $this->params = $params;\n return true;\n }\n }\n return false;\n }",
"public function getCurrentRoute(){\n\n\t\t$route = $this->getRouter()->match();\n\t\tif($route){\n\t\t\treturn $route['name'];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function prop_name_is_valid( $name ) {\n\t\treturn preg_match( self::PROP_NAME_REGEX, $name );\n\t}",
"public function hasHeader($name)\n {\n foreach ($this->headers as $k => $v) {\n if (strtolower($k) === strtolower($name)) {\n return true;\n }\n }\n return false;\n }",
"private static function hasNamespace($name)\n {\n return strpos($name, static::HINT_PATH_DELIMITER) > 0;\n }",
"public function testFindByName()\n {\n // Protect to search only first index\n $this->collection->get('first', '/first', 'action');\n $this->collection->get('second', '/second', 'action');\n // protect to search only in last index.\n $this->collection->get('third', '/third', 'action');\n\n\n $route = $this->collection->findByName('second');\n\n $this->assertInstanceOf('Requtize\\Routing\\Route', $route);\n\n $this->assertEquals('/second', $route->getSourceRoute());\n }",
"public function exists($name)\n {\n return ($this->isBasic($name) || $this->isDynamic($name));\n }",
"protected function isActiveByRoutesParts()\r\n {\r\n if (!$this->routes_parts) return false;\r\n\r\n $route_name = request()->route()->getName();\r\n\r\n foreach ($this->routes_parts as $group) {\r\n\r\n if (strpos($route_name, $group) !== false) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"public function has($name);",
"public function has($name);",
"public function has($name);",
"public function has($name);",
"public function has($name);",
"public function has($name);",
"public function has($name);",
"public function has($name);",
"public function match_route($http_verb, $uri) {\n return false;\n }",
"static public function has($name) {}",
"public function has(string $name): bool;",
"public function has(string $name): bool;",
"public function has(string $name): bool;"
]
| [
"0.81854236",
"0.7506855",
"0.7464996",
"0.74328256",
"0.7283617",
"0.71797156",
"0.7118348",
"0.68594813",
"0.67998886",
"0.6680176",
"0.6647607",
"0.6468595",
"0.6463471",
"0.6456164",
"0.6442487",
"0.64213073",
"0.63763016",
"0.63293326",
"0.6319344",
"0.63122845",
"0.62903917",
"0.62787944",
"0.61746514",
"0.6170573",
"0.6163363",
"0.6158589",
"0.6142621",
"0.6134611",
"0.6129466",
"0.61094517",
"0.60932845",
"0.6048135",
"0.6045719",
"0.60399824",
"0.601071",
"0.60020405",
"0.5993659",
"0.59630775",
"0.5955981",
"0.5945676",
"0.59338075",
"0.59327906",
"0.59250927",
"0.5911297",
"0.5905099",
"0.5903697",
"0.5880684",
"0.58805525",
"0.5862705",
"0.58525956",
"0.5846467",
"0.5840922",
"0.583358",
"0.5830647",
"0.58246946",
"0.58232933",
"0.5797847",
"0.57955575",
"0.5787966",
"0.5765207",
"0.57521325",
"0.5730888",
"0.5730888",
"0.5730888",
"0.5730888",
"0.5730888",
"0.5730888",
"0.57256335",
"0.57152253",
"0.5705698",
"0.5692015",
"0.5691077",
"0.56895286",
"0.56772834",
"0.56768554",
"0.5675786",
"0.56687874",
"0.5655352",
"0.5649337",
"0.5648584",
"0.5646417",
"0.5646062",
"0.56450903",
"0.56442726",
"0.563731",
"0.56316733",
"0.5629746",
"0.5622031",
"0.5622031",
"0.5622031",
"0.5622031",
"0.5622031",
"0.5622031",
"0.5622031",
"0.5622031",
"0.5617015",
"0.5614515",
"0.5611448",
"0.5611448",
"0.5611448"
]
| 0.6417111 | 16 |
Set the handler for the route. | public function uses($action)
{
$action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action;
return $this->setAction(array_merge($this->action, $this->parseAction([
'uses' => $action,
'controller' => $action,
])));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function SetRoute(string $reqMethod, string $path, callable $handler): void {\n $this->routes[$reqMethod][$path] = $handler;\n }",
"public function setHandler(\\Phalconry\\Mvc\\Application\\HandlerInterface $handler);",
"public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }",
"public function setHandler(callable $handler)\n {\n $this->handler = $handler;\n }",
"public function set_matched_handler($handler)\n {\n }",
"public function set($uri = null, $handler = null, $routeParams = array())\n {\n if (!isset($uri) || !isset($handler)) {\n return false;\n }\n\n // Check if passed handler is a Closure\n if ($handler instanceof Closure) {\n $this->routeTable[trim($uri)] = $handler;\n return true;\n }\n\n // Set default handle\n $handle = array(\n 'controller' => Configuration::SELF_CONTROLLER,\n 'action' => Configuration::DEFAULT_ACTION\n );\n\n // Check if passed parameter is an array\n if (is_array($handler)) {\n if (isset($handler['controller'])) {\n $handle['controller'] = $handler['controller'];\n }\n if (isset($handler['action'])) {\n $handle['action'] = $handler['action'];\n }\n if (isset($handler['segment'])) {\n $handle['segment'] = $handler['segment'];\n }\n // Else, string\n } else if (is_string($handler)) {\n $exploded = explode('.', $handler);\n if (count($exploded) > 1) {\n if (isset($exploded[0])) {\n $handle['controller'] = $exploded[0];\n }\n if (isset($exploded[1])) {\n $handle['action'] = $exploded[1];\n }\n } else {\n $handle['controller'] = $handler;\n }\n }\n\n $routeProperties = array_merge($handle, $routeParams);\n \n $this->routeTable[trim($uri)] = $routeProperties;\n }",
"public static function set ()\n {\n set_error_handler([__CLASS__, 'handle']);\n }",
"public function setDefaultHandler($handlerName);",
"public function setHandler(...$handlers)\n {\n $this->handlers = $handlers;\n }",
"public function setHandler($handler)\n {\n $this->handler = $handler;\n return $this;\n }",
"public function setHandlerName($handlerName);",
"public static function set($route) {\n self::registerRoute($route);\n }",
"public function setRequestOnHandler($request)\n {\n }",
"public function addHandler(Handler $handler);",
"public function setHandlerDefinition(HandlerDefinition $definition): void\n {\n $this->handlerDefinition = $definition;\n }",
"public function setRoute($routeTo) {\n $this->isDynamic = true;\n $xRouteTo = null;\n $type = gettype($routeTo);\n\n if (!is_callable($routeTo) && $type != 'object' && !class_exists($routeTo)) {\n $cleaned = str_replace('\\\\', DS, $routeTo);\n $xRouteTo = str_replace('/', DS, $cleaned);\n $explode = explode('.', $routeTo);\n $extension = $explode[count($explode) - 1];\n\n if ($extension != 'php') {\n $this->isDynamic = false;\n }\n } else if (is_callable($routeTo)) {\n $this->setType(Router::CLOSURE_ROUTE);\n $xRouteTo = $routeTo;\n } else if ($type == 'object') {\n $xRouteTo = get_class($routeTo);\n } else if (class_exists($routeTo)) {\n $xRouteTo = $routeTo;\n }\n\n $this->routeTo = $xRouteTo;\n }",
"public function setHandler($typeHandler = 'xml')\n {\n Assertion::keyIsset($this->handlers, $typeHandler);\n $this->currentHandler = app($this->handlers[$typeHandler]);\n return $this->currentHandler;\n }",
"public function setLogHandler(callable $handler)\n\t{\n\t\tself::$__handler = $handler;\n\t}",
"public function set_route($route)\n {\n }",
"public function setHandler($handler)\n {\n if (!class_exists($handler)) {\n throw new \\Exception('Class \"' . $handler . '\" does not exist!');\n }\n\n $this->handler = $handler;\n }",
"private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }",
"public function setHandler($handler)\n\t{\n\t\t$this->handler = $handler;\n\n\t\treturn $this;\n\t}",
"public function setHandler($handler)\n {\n if (!in_array('Rx_Json_Handler_Interface', class_implements($handler))) {\n throw new Rx_Json_Exception('JSON handler should implement Rx_Json_Handler_Interface interface');\n }\n $this->_handler = $handler;\n }",
"function setRoute(DynamicValue $p_route):void\n {\n $this->route=$p_route; \n }",
"public function setErrorHandler($handler)\n {\n }",
"protected function bindUriMiddleware()\n {\n return function (callable $handler) {\n return function (Request $request, array $options) use ($handler) {\n $tplPath = $request->getUri()->getPath();\n \n $query = [];\n parse_str($request->getUri()->getQuery(), $query);\n \n list($contentType) = preg_replace('/\\s*;.*/', '', $request->getHeader('Content-Type')) + [null];\n if ($contentType === 'multipart/form-data') {\n $data = static::parseMultipartFormData((string)$request->getBody());\n } elseif ($contentType === 'application/json') {\n $data = json_decode((string)$request->getBody());\n } elseif ($contentType === 'x-www-form-urlencoded') {\n $data = [];\n parse_str((string)$request->getBody(), $data);\n }\n \n $url = static::bindUri($tplPath, $query, isset($data) ? $data : null);\n $uri = $request->getUri()\n ->withPath(parse_url($url, PHP_URL_PATH))\n ->withQuery(parse_url($url, PHP_URL_QUERY) ?: '');\n \n return $handler($request->withUri($uri), $options);\n };\n };\n }",
"public static function put(string $route, string $handler, string $middleware = '');",
"public static function set($route, $closure) {\r\n if ($_SERVER['REQUEST_URI'] == BASEDIR.$route) {\r\n self::registerRoute($route);\r\n $closure->__invoke();\r\n } else if (explode('?', $_SERVER['REQUEST_URI'])[0] == BASEDIR.$route) {\r\n self::registerRoute($route);\r\n $closure->__invoke();\r\n } else if ($_GET['url'] == explode('/', $route)[0]) {\r\n self::registerRoute(self::dyn($route));\r\n $closure->__invoke();\r\n }\r\n }",
"public function get_handler()\n {\n }",
"public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }",
"public function register(Handler $handler) : void;",
"public function setHandler($type) {\n\t\n\t\tswitch ($type) {\n\t\t\tcase \"development\":\n\t\t\t\t$this->createDevelopmentHandler();\n\t\t\t\tbreak;\n\t\t\tcase \"production\":\n\t\t\t\t$this->createProductionHandler();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->createProductionHandler();\n\t\t}\n\t\n\t\t$this->init = true;\n\t\t$this->logBufferedMsgs();\n\t}",
"public function setHandler(callable $func): self{\n $this->_handler = $func;\n\n return $this;\n }",
"public function setRoute($route) {\n\t\t$this->route = $route;\n\t}",
"protected function setExceptionHandler()\n {\n new ExceptionHandler();\n }",
"public function setRoute(array $route): void;",
"public function setEndpointHandler(EndpointHandlerInterface $endpointHandler);",
"public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}",
"public function SetFilter ($handler, $direction = \\MvcCore\\IRoute::CONFIG_FILTER_IN);",
"public function setRoute($route)\n {\n $this->route = $route;\n }",
"public function setRoute($route)\n {\n $this->route = $route;\n }",
"public static function setRoute(string $uri = '') {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $uri);\n\n\t\t$uri = self::_applyFilter(get_class(), __FUNCTION__, $uri, array('event' => 'args'));\n\t\t\n\t\tif (empty($uri)) {\n\t\t\t$uri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\tif (substr($uri, strlen($uri) - 1) === '/') {\n\t\t\t$uri = substr_replace($uri, '', strlen($uri) - 1);\n\t\t}\n\n\t\t$routes = array();\n\n\t\t$pos = @strpos($uri, '?');\n\n\t\tif ($pos !== false) {\n\t\t\t$uri = substr_replace($uri, '', $pos, strlen($uri));\n\t\t}\n\n\t\t$uri_parts = explode('/', $uri);\n\n\t\tforeach ($uri_parts as $key => $value) {\n\t\t\tif (empty($uri_parts[$key])) {\n\t\t\t\tunset($uri_parts[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$uri_parts = array_values($uri_parts);\n\t\t$uri = '/' . implode('/', $uri_parts);\n\t\t\n\t\t$assigned_route = array();\n\t\t$default_route = array();\n\t\t$assigned_route_options = array('listen'=> '*');\n\t\t$default_route_options = array();\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tforeach (self::$routes as $route) {\n\t\t\t\n\t\t\tif(self::_isAllowRequest($route['listen'], $method)) {\n\t\t\t\t\n\t\t\t\t$reRule = preg_replace(self::$default_rule_replace, self::$default_route_replace, $route['rule']);\n\t\t\t\t$reRule = str_replace('/', '\\/', $reRule);\n\t\n\t\t\t\tif (preg_match('/' . $reRule . '/', $uri, $matches)) {\n\t\n\t\t\t\t\t$uri_match = '';\n\t\t\t\t\tforeach ($matches as $key => $value) {\n\t\t\t\t\t\tif (!Validator::isInteger($key)) {\n\t\t\t\t\t\t\t$uri_match .= '/' . $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end foreach\n\t\n\t\t\t\t\t$match_1 = str_replace($uri_match, '', $uri);\n\t\t\t\t\t$match_2 = str_replace($uri_match, '', $matches[0]);\n\t\n\t\t\t\t\tif ($match_1 === $match_2 && !empty($match_1)) {\n\t\t\t\t\t\t$assigned_route = $matches;\n\t\t\t\t\t\t$assigned_route_options = $route;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else if ($match_1 === $match_2 && empty($match_1)) {\n\t\t\t\t\t\t$default_route = $matches;\n\t\t\t\t\t\t$default_route_options = $route;\n\t\t\t\t\t}\n\t\t\t\t}//end if prgrack mage\n\t\t\t}\n\t\t}//end first for\n\n\t\tif (!empty($assigned_route)) {\n\t\t\t$final_route = $assigned_route;\n\t\t\t$route_options = $assigned_route_options;\n\t\t\tif (!isset($final_route['route'])) {\n\t\t\t\t$final_route['route'] = $default_route;\n\t\t\t}\n\t\t\tif (!isset($route_options['route'])) {\n\t\t\t\t$route_options['route'] = $default_route;\n\t\t\t}\n\t\t} else {\n\t\t\t$final_route = $default_route;\n\t\t\t$route_options = $default_route_options;\n\t\t}\n\n\t\tself::$route_parameters = $final_route;\n\t\tself::$route_options = $route_options;\n\t\t\n\t\t$method = (isset($_SERVER['REQUEST_METHOD'])) ? $method = $_SERVER['REQUEST_METHOD'] : null;\n\t\t\n\t\tif(!isset($route_options['listen']) || (isset($route_options['listen']) && $route_options['listen'] == '*')) {\n\t\t\tself::$correct_request_method = true;\n\t\t} else {\n\t\t\t$listen = strtoupper($route_options['listen']);\n\t\t\t\n\t\t\tif(strpos($listen, $method )!== false) {\n\t\t\t\tself::$correct_request_method = true;\n\t\t\t} else {\n\t\t\t\tself::$correct_request_method = false;\n\t\t\t}\n\t\t}\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $final_route, $route_options);\n\n\t\tif(self::$correct_request_method) {\n\t\t\t\n\t\t\tif (!empty($route_options['activate_ssl']) && $route_options['activate_ssl'] && !self::isSecureConnection()) {\n\t\t\t\tself::activateSSL();\n\t\t\t} else if (!empty($route_options['deactivate_ssl']) && $route_options['deactivate_ssl'] && self::isSecureConnection()) {\n\t\t\t\tself::deactivateSSL();\n\t\t\t}\n\t\n\t\t\tif (!empty($route_options['redirect'])) {\n\t\t\t\tself::redirect($route_options['redirect']);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($route_options['callback'])) {\n\t\t\t\treturn call_user_func_array($route_options['callback'], array(new Request()));\n\t\t\t}\n\t\t}\n\n\t}",
"public function addRoute($pattern, $handler)\n {\n $this->routes->append($pattern, $handler);\n }",
"private function registerRouteHandler($method, ...$args) {\n $route = '';\n\n if (is_string($args[0])) {\n $route = array_shift($args);\n } else {\n $route = '/*';\n }\n\n $routeHandler = array_pop($args);\n\n foreach($args as $arg) {\n $this->use($route, $arg);\n }\n\n $middleware = new Middleware();\n $middleware->method = $method;\n $middleware->route = $route;\n $middleware->closure = function($mountpath, $req, $res) use ($routeHandler, $route) {\n $req->params = Router::extractRouteParameters($mountpath . $route, $req->url);\n\n // execute callback function\n $routeHandler($req, $res);\n\n $res->end();\n };\n\n $this->queue[] = $middleware;\n }",
"public function setMethodNotAllowedHandler(RequestHandlerInterface $methodNotAllowedHandler): void {\n $this->methodNotAllowedHandler = $methodNotAllowedHandler;\n }",
"public function getHandler() {}",
"public function register(Handler $handler);",
"public function setNotFoundHandler(RequestHandlerInterface $notFoundHandler): void {\n $this->notFoundHandler = $notFoundHandler;\n }",
"public function __construct($handler)\n {\n $this->handler = $handler;\n }",
"public function set_matched_route($route)\n {\n }",
"public function handler(HandlerInterface $handler);",
"protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}",
"public static function handler()\n\t{\n\t\t$instance = self::get_instance() ;\n\n\t\t$type = LiteSpeed_Cache_Router::verify_type() ;\n\n\t\tswitch ( $type ) {\n\n\t\t\tdefault:\n\t\t\t\tbreak ;\n\t\t}\n\n\t\tLiteSpeed_Cache_Admin::redirect() ;\n\t}",
"protected function registerRouteBindings()\n {\n //\n }",
"public function post(string $path, array $handler): void\n {\n $this->routes['POST'][$path] = $handler;\n }",
"public function get(string $path, array $handler): void\n {\n $this->routes['GET'][$path] = $handler;\n }",
"public function setRoute($route)\r\n {\r\n // Handle images\r\n if (!$this->isImage($route) && !$this->isFile($route)) {\r\n // Route must follow a directory of a question inside the questions directory\r\n $curQuestionDir = $this->root.'/'.$route;\r\n if (!is_dir($curQuestionDir)) {\r\n throw new Exception('Question directory '.$curQuestionDir.' does not exists.');\r\n }\r\n if (!file_exists($curQuestionDir.'/bebras.js')) {\r\n throw new Exception('Question directory '.$curQuestionDir.' is not a task.');\r\n }\r\n \r\n // A question's route must end with a \"/\"\r\n if ($route[strlen($route) - 1] != '/') {\r\n throw new Exception('A question\\'s directory must end with a \"/\".');\r\n }\r\n $route = substr($route, 0, strlen($route) - 1);\r\n }\r\n \r\n $this->route = $route;\r\n }",
"public static function configure($closure) {\n self::$instance = $route = new Router();\n $closure($route);\n }",
"abstract public function setNextHandle(AbstractHandler $handler): void;",
"public function setHandler( ?\\Closure $handler = null, ?int $index = null ): Regex\n {\n\n $handlerCount = \\count( $this->handlers );\n\n if ( null === $index )\n {\n\n if ( 1 > $handlerCount )\n {\n $this->handlers[] = $handler;\n $this->assignHandlerIndexes();\n\n return $this;\n }\n\n $index = $this->_handlerIndexesReversed[ $handlerCount - 1 ] + 1;\n\n }\n\n $this->handlers[ $index ] = $handler;\n\n $this->assignHandlerIndexes();\n\n return $this;\n\n }",
"protected function getTargetHandler(): TargetHandlerInterface\n {\n return new Route();\n }",
"public function setCookieHandler($handler) {\n\t\t$this->cookie_handler = $handler;\n\t}",
"public function handler()\r\n\t{\r\n\t\treturn $this->handler;\r\n\t}",
"public function addHandler(string $command, string $handler);",
"public static function setExceptionHandler(){\n //Set the Pokelio exception handler\n set_exception_handler('Pokelio_Exception::PokelioExceptionHandler');\n }",
"public function any(string $pattern, $handler = null): Route\n {\n return $this->addRoute($pattern, Router::HTTP_METHODS_STANDARD, $handler);\n }",
"public function put(...$args) {\n $this->registerRouteHandler('PUT', ...$args);\n }",
"public function route() {\n\t\t// Set the user.\n\t\t$user = $this->Router->getCurrentRoute(3);\n\t\tif (!empty($user)) {\n\t\t\tif (!$this->userSet($user)) {\n\t\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t\t$_SESSION['data'] = array(\n\t\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t\t'link' => 'management/users'\n\t\t\t\t);\n\t\t\t\tredirect(ABSURL . 'error');\n\t\t\t}\n\t\t}\n\n\t\t// Get the function mapped to the route.\n\t\t$function = $this->Router->mappedFunction();\n\t\t$this->$function();\n\t}",
"public function getHandler()\n {\n }",
"protected function registerHandler()\n {\n if (!in_array($this->app->environment(), config('nodes.bugsnag.notify_release_stages', []))) {\n return;\n }\n\n if (!config('nodes.bugsnag.rebind_handler', true)) {\n return;\n }\n\n $this->app->singleton('Illuminate\\Contracts\\Debug\\ExceptionHandler', function ($app) {\n return app(BugsnagHandler::class);\n });\n }",
"public function handle($endpoint=true)\r\n {\r\n // we will record the path data for the route.\r\n // We set the routeMapper variables and the route path.\r\n self::setPath(function(){\r\n\r\n // we are sending\r\n // the controller and routes.php path.\r\n return [\r\n 'controllerPath' => path()->controller(),\r\n 'routePath' => path()->route(),\r\n ];\r\n },$endpoint);\r\n\r\n // in the paths data,\r\n // we run the route mapper values and the route files one by one.\r\n foreach (self::$paths as $mapper=>$controller){\r\n core()->fileSystem->callFile($mapper);\r\n }\r\n }",
"public static function post(string $route, string $handler, string $middleware = '');",
"public function get_matched_handler()\n {\n }",
"public static function registerRoutes(?\\Closure $handler = null)\n {\n RemoteAuth::$handler = $handler;\n\n Route::group([\n 'middleware' => ['web'],\n 'namespace' => '\\RemoteAuth\\Http\\Controllers'\n ], function ($router) {\n $router->get('/login/remoteauth', [\n 'uses' => 'AuthController@login',\n 'as' => 'remoteauth.auth.login',\n ]);\n\n $router->get('/login/remoteauth/callback', [\n 'uses' => 'AuthController@callback',\n 'as' => 'remoteauth.auth.callback',\n ]);\n });\n }",
"protected function get_handler() {\n\n\t\treturn $this->handler;\n\t}",
"protected function _setExceptionHandler($cls) {\n ExceptionProcessor::getInstance()->setHandler($cls);\n }",
"protected function configureHandler(Writer $log)\n {\n $this->{'configure'.ucfirst($this->handler()).'Handler'}($log);\n }",
"abstract protected function createHandler();",
"protected function handler ($SVC) {}",
"protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }",
"public function set_router( sn\\base\\routing\\I_Router $router );",
"public function testRouteHandler() {\n\t\tRouter::connect('/login', 'Users::login');\n\n\t\tRouter::connect('/users/login', [], function($request) {\n\t\t\treturn new Response([\n\t\t\t\t'location' => ['controller' => 'Users', 'action' => 'login']\n\t\t\t]);\n\t\t});\n\n\t\t$result = Router::process(new Request(['url' => '/users/login']));\n\t\t$this->assertInstanceOf('lithium\\action\\Response', $result);\n\n\t\t$headers = ['Location' => '/login'];\n\t\t$this->assertEqual($headers, $result->headers);\n\t}",
"function setHandle(string $handle);",
"function AddHandler(&$handler)\r\n\t{\r\n\t\t$this->handlers[] = $handler;\r\n\t}",
"public function handler(string $handler): self\n {\n return $this->state(['handler' => $handler]);\n }",
"public function getHandler();",
"public function getHandler();",
"public function setupErrorHandler()\n {\n $this->error_handler = set_error_handler(array($this, 'error_handler'));\n }",
"protected function addMap($method, string $routePattern, $handler, string $name = null): void\n {\n }",
"public function getDefaultHandler();",
"public function __construct(\n Handler $handler\n ) {\n $this->handler = $handler;\n }",
"private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }",
"public function handleUsing(callable $handler): self\n {\n $this->handler = $handler;\n\n return $this;\n }",
"public function setRoute($method, $route)\t{\n\t\t//Reset internal state\n\t\t$this->class = \"NoRoute\";\n\t\t$this->params = array();\n\t\t$this->method = $method;\n\t\t$route = explode(\"?\", $route);\n\t\tif (is_array($route)) $route = $route[0];\n\t\t\n\t\tif ($this->prefix != null) $route = preg_replace(\"|\". preg_quote($this->prefix) . \"|iA\", \"\", $route);\n\t\t$this->log->setRoute($method, $route);\n\t\t$this->route = $route;\n\t\t\n\t\t$routeParts = array_filter(explode(\"/\", $route), 'strlen');\n\t\t$uri = strtolower(array_shift($routeParts));\n\t\t\n\t\tif (isset($this->routeArray[$uri]))\t{\n\t\t\tforeach($this->routeArray[$uri] as $route)\t{\n\t\t\t\tif ($route['method'] == $method && count($route['params']) == count($routeParts))\t{\n\t\t\t\t\t$this->class = $route['class'];\n\t\t\t\t\tforeach ($route['params'] as $param)\t{\n\t\t\t\t\t\t$this->params[$param] = array_shift($routeParts);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function configureRoutes(callable $routeProvider): void\n\t{\n\t\t$this->dispatcher = \\FastRoute\\simpleDispatcher($routeProvider);\n\t}",
"protected function setResponseHandler(ResponseHandlerContract $responseHandler)\n {\n $this->responseHandler = $responseHandler;\n }",
"public function handle($uri = null);",
"public function handlerFor(Command $command);",
"abstract public function handler() : void;",
"protected function setupHandler(CommonHandler $handler): void\n {\n }",
"public function __construct(Contracts\\Handler $handler)\n {\n $this->handler = $handler;\n }"
]
| [
"0.6888977",
"0.6877743",
"0.6819277",
"0.674128",
"0.658154",
"0.6248475",
"0.6184057",
"0.60960644",
"0.60569596",
"0.6037398",
"0.602037",
"0.60048103",
"0.5987766",
"0.59784365",
"0.5940536",
"0.5937573",
"0.5923244",
"0.5860256",
"0.5858232",
"0.582658",
"0.5824799",
"0.57846546",
"0.5769186",
"0.57292855",
"0.57242227",
"0.5721165",
"0.5718708",
"0.5706612",
"0.5704264",
"0.5694024",
"0.5690017",
"0.567354",
"0.567258",
"0.5662775",
"0.5658183",
"0.56466025",
"0.5636858",
"0.5621142",
"0.5618118",
"0.561647",
"0.561647",
"0.56131905",
"0.5607738",
"0.5599551",
"0.5596639",
"0.55860704",
"0.5574192",
"0.5552943",
"0.55337656",
"0.5533563",
"0.55231637",
"0.552086",
"0.551231",
"0.54917306",
"0.5488115",
"0.5483319",
"0.545734",
"0.54515696",
"0.5448292",
"0.5443882",
"0.5435929",
"0.5418645",
"0.54172826",
"0.5411818",
"0.5396964",
"0.5375372",
"0.5375027",
"0.53745204",
"0.5374088",
"0.5370959",
"0.53700686",
"0.53686047",
"0.5366302",
"0.5362766",
"0.5360191",
"0.53582263",
"0.535446",
"0.53462845",
"0.534004",
"0.5338597",
"0.5336484",
"0.5329015",
"0.53258896",
"0.5324331",
"0.53199357",
"0.5319082",
"0.5319082",
"0.5312523",
"0.5306958",
"0.53044766",
"0.5304274",
"0.5292953",
"0.5287892",
"0.52875304",
"0.5275302",
"0.52706367",
"0.5267651",
"0.52667314",
"0.52640235",
"0.5260539",
"0.52565134"
]
| 0.0 | -1 |
Parse a string based action for the "uses" fluent method. | protected function addGroupNamespaceToStringUses($action)
{
$groupStack = last($this->router->getGroupStack());
if (isset($groupStack['namespace']) && strpos($action, '\\') !== 0) {
return $groupStack['namespace'].'\\'.$action;
}
return $action;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function uses($action)\n {\n $action = is_string($action) ? $this->addGroupNamespaceToStringUses($action) : $action;\n return $this->setAction(array_merge($this->action, $this->parseAction([\n 'uses' => $action,\n 'controller' => $action,\n ])));\n }",
"protected function parseAction($action) {\n if (is_string($action)) {\n return ['uses' => $action];\n } elseif (! is_array($action)) {\n return [$action];\n }\n\n return $action;\n }",
"public function setAction($str);",
"public function testStringActions() {\n\t\tRouter::connect('/login', ['controller' => 'sessions', 'action' => 'create']);\n\t\tRouter::connect('/{:controller}/{:action}');\n\n\t\t$result = Router::match(\"Sessions::create\");\n\t\t$this->assertIdentical('/login', $result);\n\n\t\t$result = Router::match(\"Posts::index\");\n\t\t$this->assertIdentical('/posts', $result);\n\n\t\t$result = Router::match(\"ListItems::archive\");\n\t\t$this->assertIdentical('/list_items/archive', $result);\n\t}",
"protected static function fromClassMethodString($uses)\n {\n list($class, $method) = Str::parseCallback($uses);\n\n if (! method_exists($class, $method) && Reflector::isCallable($class, $method)) {\n return [];\n }\n\n return (new ReflectionMethod($class, $method))->getParameters();\n }",
"function userAction( $actionKeyword, $actionRequest ) {\n\taddServerMessageToXML(\"ActionKeyword: $actionKeyword.\");\n\t$result = true;\n\tif( $actionKeyword == \"look\") {\n\t\tuserActionLook( $actionRequest );\n\t} else if( $actionKeyword == \"say\" || $actionKeyword == \"\\\\\\\"\" ) {\n\t\tuserActionSay( $actionRequest );\n\t} else if( $actionKeyword == \"go\" || $actionKeyword == \"goto\" ) {\n\t\tuserActionMove( $actionRequest);\n\t} else if( $actionKeyword == \"take\" ) {\n\t\tuserActionTake( $actionRequest );\n\t} else if( $actionKeyword == \"drop\" ) {\n\t\tuserActionDrop( $actionRequest );\n\t} else if( $actionKeyword == \"full-update\" ) {\n\t\tuserActionFullUpdate( $_SESSION['location'] );\n\t} else if( $actionKeyword == \"examine\" ) {\n\t\tuserActionExamine( $actionRequest );\n\t} else if( substr( $actionRequest, 0, 1) == \"@\" ) {\n\t\tuserBuildActions( $actionRequest );\n\t} else if( $actionKeyword == \"QUIT\" || $actionKeyword == \"SIGNOUT\" || $actionKeyword == \"LOGOUT\" ) {\n\t\t// Needs to be made case sensitive\n\t\tuserAccountSignOut();\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}",
"public function action(string $action): self;",
"public function parseAction($action)\n {\n return RouteAction::parse($this->uri, $action);\n }",
"public function testParsingCommandName()\n {\n $request = $this->parser->parse('foo');\n $this->assertEquals('foo', $request->getCommandName());\n $this->assertEquals([], $request->getArgumentValues());\n $this->assertEquals([], $request->getOptionValues());\n }",
"public function parseUse(&$arguments)\n {\n /* Set our action */\n $arguments['action'] = 'use database';\n\n /* Look for a valid db name */\n if (($arguments['db'] = $this->getNextWord()) === false || empty($arguments['db'])) {\n $this->throwSyntaxError($arguments);\n\n return false;\n }\n\n /* Return our arguments */\n return $arguments;\n }",
"protected function resolveActionMethodName() {}",
"public function uses()\n {\n foreach (\\func_get_args() as $pattern) {\n if (Str::is($pattern, $this->currentRouteAction())) {\n return true;\n }\n }\n\n return false;\n }",
"public function action($strAction = \"\") {\r\n if ($strAction == \"\")\r\n $strActionName = $this->getAction();\r\n else\r\n $strActionName = $strAction;\r\n\r\n $this->strOriginalAction = $strActionName;\r\n\r\n if(!$this->checkMethodExistsInConcreteClass(\"action\".ucfirst($strActionName))) {\r\n\r\n foreach(self::$arrActionNameMapping as $strAutoMatchAction => $strAnnotation) {\r\n $this->autoMatchAction($strAutoMatchAction, $strAnnotation, $strActionName);\r\n }\r\n }\r\n\r\n return parent::action($strActionName);\r\n }",
"public function testEmbeddedStringActions() {\n\t\tRouter::connect('/logout/{:id:[0-9]{5,6}}', [\n\t\t\t'controller' => 'sessions', 'action' => 'destroy', 'id' => null\n\t\t]);\n\t\tRouter::connect('/{:controller}/{:action}');\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}', ['id' => null]);\n\n\t\t$result = Router::match(\"Sessions::create\");\n\t\t$this->assertIdentical('/sessions/create', $result);\n\n\t\t$result = Router::match([\"Sessions::create\"]);\n\t\t$this->assertIdentical('/sessions/create', $result);\n\n\t\t$result = Router::match([\"Sessions::destroy\", 'id' => '03815']);\n\t\t$this->assertIdentical('/logout/03815', $result);\n\n\t\t$result = Router::match(\"Posts::index\");\n\t\t$this->assertIdentical('/posts', $result);\n\n\t\t$ex = \"No parameter match found for URL \";\n\t\t$ex .= \"`('controller' => 'Sessions', 'action' => 'create', 'id' => 'foo')`.\";\n\t\t$this->assertException($ex, function() {\n\t\t\tRouter::match([\"Sessions::create\", 'id' => 'foo']);\n\t\t});\n\t}",
"protected function getActionMethod(string $action): string\n {\n $sentence = preg_replace('/[\\W_]+/', ' ', $action);\n return lcfirst(str_replace(' ', '', ucwords($sentence)));\n }",
"public function route() {\n\t\t$action = $this->validateAction();\n\t\tif (method_exists($this, str_replace('-', '', $action))) {\n\t\t\t$this->$action();\n\t\t} else {\n\t\t\t$this->error($action);\n\t\t}\n\t}",
"public function getAction(): string;",
"public function getAction(): string;",
"public function currentRouteAction()\n {\n if (! $route = $this->current()) {\n return;\n }\n\n $action = $route->getAction();\n\n return \\is_string($action['uses']) ? $action['uses'] : null;\n }",
"protected function parseAction($actionName)\n {\n if (strpos($actionName, '-') !== false) {\n return camel_case($actionName);\n }\n\n return $actionName;\n }",
"function uses($uses=null)\n {\n if (isset($uses)) $this->uses = $uses;\n return $this->uses;\n }",
"public function action(Action $action);",
"function url_parse_controllerAction(&$value)\n{\n if (!$value) {\n return false;\n } else {\n return preg_match('/^[a-z][a-z\\_0-9]{1,30}$/i', (string)$value);\n }\n}",
"function userActionSay( $actionRequest ) {\n\t$actionKeyword = strtok( $actionRequest, \" \" );\n\t$message = trim( strtok('') );\n\t\n\tif( insertLog(\"user\", $_SESSION['userID'], $_SESSION['location'], $_SESSION['username'] .\" says \\\"<span class='speech'>\".$message.\"</span>\\\"\") ) {\n\t\taddNarrativeToXML(\"Said.\");\n\t} else {\n\t\taddNarrativeToXML(\"Said failed.\");\n\t}\n\treturn;\n}",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"protected function parseRoute()\n { \n $matches = explode(\"/\", $this->route);\n\n $pattern = '/^([a-zA-Z0-9_-])+$/';\n \n if (preg_match($pattern, $matches[0])) {\n $this->controller = ucfirst(strtolower($matches[0]));\n }\n\n if (!empty($matches[1]) && preg_match($pattern, $matches[1])) {\n $this->action = $this->convert($matches[1]);\n }\n }",
"function get_action() {\n \t\tglobal $argv;\n\t\treturn strtolower(trim($argv['1']));\n\t}",
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public function getAction(string $name): Action;",
"public function syllabus($action = '', $needle = '', $optional_arg = ''){\n $action = strtolower(clean_input($action));\n $needle = strtolower(clean_input($needle));\n $optional_arg = strtolower(clean_input($optional_arg));\n\n if($action === 'category' && $needle !== '' && $optional_arg === 'latest'){\n $syllabus_data = $this->syllabus_model->getSyllabusByCategory($needle, $optional_arg);\n $this->output->set_content_type('application/json')->set_output(json_encode($syllabus_data));\n }else if($action === 'id' && $needle !== ''){\n $syllabus_data = $this->syllabus_model->get_syllabus_by_id($needle);\n $this->output->set_content_type('application/json')->set_output(json_encode($syllabus_data));\n }else{\n return false;\n }\n }",
"public function parseAction($action) {\n if ( ! strstr($action, '@')) {\n return [$action, 'index'];\n }\n\n return [\n substr($action, 0, strpos($action, '@')),\n substr($action, strpos($action, '@') + 1),\n ];\n }",
"public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }",
"public function getAction($ucfirst=true){\r\n\t\tif(is_array($this->matchedRoute) && isset($this->matchedRoute['action_regex'])){\r\n\t\t\tif($this->matchedRoute['action_regex'] == true){\r\n\t\t\t\t$this->action = 'Reg'.sha1($this->matchedRoute['action']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($ucfirst){\r\n\t\t\t$o = ucfirst($this->action);\r\n\t\t} else {\r\n\t\t\t$o = strtolower($this->action);\r\n\t\t}\r\n\t\treturn $o;\r\n\t}",
"private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}",
"private function parseUseStatement() {\n\n\t\t$class = '';\n\t\t$alias = '';\n\t\t$statements = array();\n\t\t$explicitAlias = false;\n\t\twhile (($token = $this->next())) {\n\t\t\t$isNameToken = $token[0] === T_STRING || $token[0] === T_NS_SEPARATOR;\n\t\t\tif (!$explicitAlias && $isNameToken) {\n\t\t\t\t$class .= $token[1];\n\t\t\t\t$alias = $token[1];\n\t\t\t} else if ($explicitAlias && $isNameToken) {\n\t\t\t\t$alias .= $token[1];\n\t\t\t} else if ($token[0] === T_AS) {\n\t\t\t\t$explicitAlias = true;\n\t\t\t\t$alias = '';\n\t\t\t} else if ($token === ',') {\n\t\t\t\t$statements[$alias] = $class;\n\t\t\t\t$class = '';\n\t\t\t\t$alias = '';\n\t\t\t\t$explicitAlias = false;\n\t\t\t} else if ($token === ';') {\n\t\t\t\t$statements[$alias] = $class;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $statements;\n\t}",
"public function setActionName($actionName);",
"public function setAction(string $action) {\n $trimmed = trim($action);\n\n if (strlen($trimmed) != 0) {\n $this->action = $trimmed;\n }\n }",
"protected function addGroupNamespaceToStringUses($action)\n {\n $groupStack = end($this->router->getGroupStack());\n\n if (isset($groupStack['namespace']) && strpos($action, '\\\\') !== 0) {\n return $groupStack['namespace'] . '\\\\' . $action;\n }\n\n return $action;\n }",
"public function doAction($actionName);",
"public function getAction() {}",
"public function getAction() {}",
"public function getAction() {}",
"public function getAction() {}",
"public function getAction() : string{\n return $this->action;\n }",
"abstract function getAction() : string;",
"function class_to_event_str($str, $action, $uppercase = true) {\n if (!is_string($str)) {\n $str = get_class($str);\n }\n\n $str = $str.\"\\\\\".$action;\n\n $str = str_replace(\"\\\\\", \"_\", $str);\n\n if ($uppercase) {\n $str = strtoupper($str);\n }\n\n return $str;\n }",
"protected function getAction() {}",
"protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}",
"public function testConnectShortStringSyntax(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/articles/view', 'Admin/Articles::view');\n $result = Router::parseRequest($this->makeRequest('/admin/articles/view', 'GET'));\n unset($result['_route']);\n $expected = [\n 'pass' => [],\n 'prefix' => 'Admin',\n 'controller' => 'Articles',\n 'action' => 'view',\n 'plugin' => null,\n '_matchedRoute' => '/admin/articles/view',\n\n ];\n $this->assertEquals($result, $expected);\n }",
"private function parseActions()\n {\n // default controller actions\n $actions = array_keys($this->getObject()->actions());\n $actionMethods = array_filter($this->reflection->getMethods(),\n function ($method) {\n // should match all methods named actionSomeAction\n return preg_match('/action([A-Z]{1}[a-zA-Z]+)/', $method->name, $matches);\n });\n $actionMethods = array_map(function ($method) {\n return Inflector::slug(str_replace('action', '', $method->name));\n }, $actionMethods);\n $actionMethods = array_merge($actions, $actionMethods);\n\n return array_intersect(['index', 'view', 'create', 'update', 'delete', 'options'], $actionMethods);\n }",
"public function invoke($action);",
"function syntax($action, $args) {\n\tglobal $syntax;\n\tif (count($args) < count($syntax[$action]['argv'])) {\n\t\tdie(errout(\"Missing argument: $action \" . implode(' ', $syntax[$action]['argv'])));\n\t} else {\n\t\t$out = array();\n\t\tforeach ($syntax[$action]['argv'] as $k => $v) {\n\t\t\t$out[$v] = $args[$k];\n\t\t}\n\t\treturn $out;\n\t}\n}",
"function map_action($action) {\n return $action . '_action';\n }",
"function extract_action_and_args($string) {\n\n if ('' === $string) {\n return array('index', array(), NULL);\n }\n\n // find optional file extension\n $format = NULL;\n if (preg_match('/^(.*[^\\/.])\\.(\\w+)$/', $string, $matches)) {\n list($_, $string, $format) = $matches;\n }\n\n // TODO this should possibly remove empty tokens\n $args = explode('/', $string);\n $action = array_shift($args);\n return array($action, $args, $format);\n }",
"public function getAction($alias);",
"#[Pure]\n public function getAction() : Closure | string\n {\n return $this->action;\n }",
"public function getAction(): string\n {\n return $this->action;\n }",
"public function getAction(): string\n {\n return $this->action;\n }",
"public function parseFromRequest ($request, $params) {\n\n $conf = & jApp::config()->urlengine;\n if ($conf['enableParser']) {\n\n $sel = new jSelectorUrlCfgSig($conf['significantFile']);\n jIncluder::inc($sel);\n $snp = $conf['urlScriptIdenc'];\n $file = jApp::tempPath('compiled/urlsig/'.$sel->file.'.'.$snp.'.entrypoint.php');\n if (file_exists($file)) {\n require($file);\n $this->dataCreateUrl = & $GLOBALS['SIGNIFICANT_CREATEURL']; // given by jIncluder line 99\n $this->dataParseUrl = & $GLOBALS['SIGNIFICANT_PARSEURL'][$snp];\n $isHttps = ($request->getProtocol() == 'https://');\n return $this->_parse($request->urlScript, $request->urlPathInfo, $params, $isHttps);\n }\n }\n\n $urlact = new jUrlAction($params);\n return $urlact;\n }",
"public function parse()\n {\n /* Get the action */\n $action = $this->getNextWord(true);\n $arguments = array();\n $whitespace = \" \\t\\n\\r\\x0B\";\n\n /* Parse the right query */\n switch (strtolower($action)) {\n case 'select':\n {\n $this->parseSelect($arguments);\n\n break;\n }\n\n case 'insert':\n {\n $this->parseInsert($arguments);\n\n break;\n }\n\n case 'show':\n {\n $this->parseShow($arguments);\n\n break;\n }\n\n case 'create':\n {\n $this->parseCreate($arguments);\n\n break;\n }\n\n case 'drop':\n {\n $this->parseDrop($arguments);\n\n break;\n }\n\n case 'describe':\n {\n $this->parseDescribe($arguments);\n\n break;\n }\n\n case 'delete':\n {\n $this->parseDelete($arguments);\n\n break;\n }\n\n case 'update':\n {\n $this->parseUpdate($arguments);\n\n break;\n }\n\n case 'lock':\n {\n $this->parseLock($arguments);\n\n break;\n }\n\n case 'unlock':\n {\n $this->parseUnlock($arguments);\n\n break;\n }\n\n case 'is':\n {\n $this->parseIsLocked($arguments);\n\n break;\n }\n\n case 'use':\n {\n $this->parseUse($arguments);\n\n break;\n }\n\n case 'grant':\n {\n $this->parseGrant($arguments);\n\n break;\n }\n\n default:\n {\n /* Syntax error */\n if ($action == '') {\n $this->throwSyntaxError($arguments);\n }\n\n /* Invalid action */\n else {\n return txtSQL::_error(E_USER_ERROR, 'Action not supported: `' . $action . '`');\n }\n }\n }\n\n /* Return the arguments */\n if ($arguments !== false) {\n return $arguments;\n }\n\n return false;\n }",
"public function __construct(string $message, string $action, string $uri) {\n parent::__construct($message, $uri);\n $this->action = $action;\n }",
"public function setActionName($action) {\n\t\tif (!is_string($action))\n\t\t{\n\t\t\tthrow new Yaf_Request_Exception('Expect a string action name');\n\t\t}\n\t\t$this->action = $action;\n\t\tif (null === $action)\n\t\t{\n\t\t\t$this->setParam('action', $action);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function getActionName(){\n return $this->actionName;\n }",
"public function getActionName(){ }",
"protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }",
"protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }",
"public function action();",
"public function getActionMethod()\n {\n return array_last(explode('@', $this->getActionName()));\n }",
"public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}",
"public function setAction($action);",
"protected function getActionInput(): string\n\t{\n\t\treturn trim($this->option('action'));\n\t}",
"public function resolveAction(&$segments)\n {\n \n echo $this->action = array_shift($segments); //array_shift me devuelve el primer segmento del array\n \n if (empty($this->action))\n \t{\n \n $this->action = $this->defaultAction; //index\n\n \t}\n }",
"private function getActionName()\n {\n return strtolower($this->_request->getActionName());\n }",
"function setAction($action);",
"private function determineAction($url)\n {\n $matches = array();\n preg_match('/remove|add/', $url, $matches);\n\n switch ($matches[0]) {\n case 'remove':\n return new RemoveFromshortlistAction();\n case 'add':\n return new AddToshortlistAction();\n default:\n return null;\n }\n }",
"public function getActionName()\n\t{\n\t\t$explodedArray = explode('/', $_SERVER['REQUEST_URI']);\n\n\t\tif(array_key_exists(2, $explodedArray) && !empty($explodedArray[2])){\n\n\t\t\tif (strpos($explodedArray[2], '?')) {\n\t\t\t\t$localAction = explode('?', $explodedArray[2]);\n\t\t\t\t$this->actionName = $localAction[0];\n\t\t\t} else $this->actionName = $explodedArray[2];\n\n\t\t} else\n\t\t\t$this->actionName = 'index';\n\t}",
"public function usage(array $params = [])\n {\n $endpointBuilder = $this->endpoints;\n /** @var Xpack\\Usage $endpoint */\n $endpoint = $endpointBuilder('Xpack\\Usage');\n $endpoint->setParams($params);\n\n return $this->performRequest($endpoint);\n }",
"function setAction($action) {\r\r\n\t\t$this->action = strtolower($action);\r\r\n\t}",
"abstract public function getAction();",
"public function getAction(){\r\n return $this->sAction;\r\n }",
"public function getActionName();",
"public function getActionName();",
"public function hasAction($alias);",
"public function handleAction($actionName, array $values);",
"public function match( $uri, & $args ){\n $args = array();\n if( $this->urls ){\n $buildRegex = function ( $pattern ){\n $params = array();\n $regex = preg_replace_callback(Resolver::param_match, function($match) use ( &$params ) {\n $params[] = $match[1];\n // only exclude line breaks from my match. this will let utf-8 sequences through.\n // older patterns below. \n // turns out I don't need to be super strict on my pattern matching.\n // php sapi does most of the work for me in giving me the url.\n return '([^\\n]+)'; \n //return '([[:graph:][:space:]]+)';\n //return '([a-z0-9\\.+\\,\\;\\'\\\\\\&%\\$\\#\\=~_\\-%\\s\\\"\\{\\}/\\:\\(\\)\\[\\]]+)';\n \n }, preg_quote($pattern, '#'));\n return array('#^' . $regex . '$#i', $params );\n };\n \n foreach( $this->urls as $pattern => $action ){\n list( $regex, $params ) = $buildRegex( $pattern );\n if( ! preg_match( $regex, $uri, $matches ) ) continue;\n $a = array_slice($matches, 1);\n foreach( $a as $i=>$v ){\n $args[ $params[$i] ] = $v;\n }\n \n return $action;\n \n }\n }\n $uri = strtolower(trim( $uri, '/'));\n if( ! $uri ) $uri = 'index';\n $res = $this->get( $uri, 'action', TRUE);\n if( $res ) return $uri;\n return '';\n }",
"private static function toMethod( $action )\n {\n $actionString = str_replace( ' ', '', ucwords( str_replace( '-', ' ', $action ) ) );\n $actionString[0] = strtolower( $actionString[0] );\n \n return 'action_' . $actionString;\n }",
"protected function resolveActionMethodName(): string\n {\n switch ($this->request->getMethod()) {\n case 'HEAD':\n case 'GET':\n $actionName = ($this->request->hasArgument($this->resourceArgumentName)) ? 'show' : 'list';\n return $actionName . 'Action';\n\n // Not supported in Example\n case 'POST':\n case 'PUT':\n case 'DELETE':\n default:\n $this->throwStatus(400, null, 'Bad Request.');\n }\n $this->throwStatus(400, null, 'Bad Request.');\n return '';\n }",
"public function get_action() {\n\t\t$action\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (isset($_GET['action']))? preg_replace('@[^a-zA-Z0-9_]@', '', $_GET['action']) : $this->conf('default_action');\n\t\t\n\t\t# Return the Action\n\t\treturn $action;\n\t}",
"public static function getMethodOfActionName($actionName)\n {\n $parameters = explode(\"@\", $actionName);\n return $parameters[1];\n }",
"protected function getAction()\n {\n return self::ACTION_TYPE;\n }",
"public function getAction();",
"public function getAction();",
"public function getAction();",
"public function getAction();",
"public function getAction();",
"public function getAction();",
"public function getAction();",
"public function useRoute(){\n\t\t\t$routeParts = explode(\"@\", $this->matchingRoute->location);\n\t\t\treturn [\"controller\" => ucfirst($routeParts[0]), \"method\" => $routeParts[1]];\n\t\t}",
"public function ParseRequestUri(){\n $uri_arr = explode('/',$this->request_uri);\n $this->controller_name = empty($uri_arr[2]) ? 'top' : $uri_arr[2];\n $this->action_name = empty($uri_arr[3]) ? 'index' : $uri_arr[3];\n }",
"function userActionExamine( $actionRequest ) {\n\t$actionKeyword = strtok( $actionRequest, \" \" );\n\t$name = trim( strtok('') );\n\t\n\t$locations[]=$_SESSION['location'];\n\t$locations[]=$_SESSION['userID'];\n\t\n\tif( $name == \"here\" ) {\n\t\t$name = \"#\".$_SESSION['location'];\n\t}\n\t\n\t$entity = getEntity( $name );\n\t\n\tif( $entity ) {\n\t\t$response = $entity['name'] . \" (id #\" . $entity['id'] . \")\";\n\t\tforeach( $entity as $name=>$value ) {\n\t\t\tif( $name != \"id\" && $name != \"name\" ) {\n\t\t\t\t$response .= \"<br> \";\n\t\t\t\tif( empty($value) ) {\n\t\t\t\t\t$response.=$name;\n\t\t\t\t} else {\n\t\t\t\t\t$response.=$name.\" is \".$value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\taddNarrativeToXML($response);\n\t}\n\n}"
]
| [
"0.6237259",
"0.586083",
"0.5385933",
"0.5324952",
"0.50029325",
"0.5001862",
"0.5001839",
"0.49324903",
"0.49159852",
"0.48843056",
"0.48677373",
"0.4822476",
"0.48200464",
"0.4753055",
"0.47515443",
"0.46966955",
"0.4695239",
"0.4695239",
"0.46434906",
"0.4641213",
"0.4612242",
"0.46067375",
"0.45903042",
"0.4584242",
"0.45773745",
"0.45415327",
"0.45373753",
"0.4529903",
"0.44953406",
"0.44907677",
"0.44905594",
"0.4471745",
"0.44452265",
"0.44321352",
"0.44312567",
"0.4417861",
"0.44058537",
"0.44023323",
"0.4391882",
"0.43792894",
"0.43792894",
"0.43792894",
"0.43792894",
"0.43777636",
"0.43707183",
"0.4370131",
"0.43699124",
"0.4356125",
"0.4355604",
"0.43444508",
"0.43441176",
"0.43404916",
"0.43356666",
"0.43218845",
"0.43215275",
"0.43165275",
"0.43157685",
"0.43157685",
"0.43121526",
"0.43089265",
"0.428665",
"0.42786005",
"0.42613453",
"0.4257204",
"0.4254632",
"0.4254632",
"0.42503238",
"0.4249855",
"0.42447785",
"0.42421687",
"0.42414674",
"0.42244995",
"0.42225078",
"0.42214438",
"0.4218635",
"0.42171443",
"0.42104614",
"0.4206587",
"0.4204012",
"0.42036477",
"0.42025343",
"0.42025343",
"0.41937265",
"0.4190761",
"0.41869795",
"0.41788542",
"0.41714266",
"0.41689682",
"0.4168707",
"0.41571987",
"0.41461724",
"0.41461724",
"0.41461724",
"0.41461724",
"0.41461724",
"0.41461724",
"0.41461724",
"0.41430837",
"0.41423982",
"0.4140598"
]
| 0.4458716 | 32 |
Get the action name for the route. | public function getActionName()
{
return isset($this->action['controller']) ? $this->action['controller'] : 'Closure';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRouteName($action);",
"public function name()\n {\n if ($name = $this->route->getName()) {\n return $name;\n }\n\n $name = $this->route->getActionName();\n\n if ($name === 'Closure') {\n return null;\n }\n\n $namespace = array_get($this->route->getAction(), 'namespace');\n\n return str_replace($namespace . '\\\\', '', $name);\n }",
"public function getActionName() {\n\t\treturn $this->action;\n\t}",
"public function getActionName() {\n\n\t\treturn $this->_action;\n\t}",
"private function getActionName()\n {\n return strtolower($this->_request->getActionName());\n }",
"public function getActionName()\n {\n return $this->_action;\n }",
"public function getFormActionRouteName(): string\n {\n return $this->resource->getRouteName($this->getFormActionRouteSuffix());\n }",
"public function getActionName()\n {\n return $this->__get(\"action_name\");\n }",
"public function getActionName() {\n return $this->actionName;\n }",
"private function getRouteAction($route)\n {\n return ($this->isClosureRoute($route)) ? 'Closure' : 'Controller';\n }",
"public function getAction()\n\t{\n\t\t$action = strtolower($this->getParam(self::ACTION_PARAM));\n\t\tif ($action === '' or ! preg_match('/^[a-z0-9_-]+$/', $action)) {\n\t\t\treturn Controller::DEFAULT_ACTION;\n\t\t}\n\n\t\treturn $action;\n\t}",
"public function getRouteAction(): ?string\n {\n return $this->routeAction;\n }",
"public function getFullActionName()\n {\n return $this->request->getFullActionName();\n }",
"public function getFullActionName()\n\t{\n\t\treturn $this->request->getFullActionName();\n\t}",
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public static function routeName() : string\n {\n return str_replace('app_http_actions_', '', snake_case(str_replace('\\\\', '', static::class)));\n }",
"private function getRouteName($route)\n {\n return (isset($route['action']['as'])) ? $route['action']['as'] : '';\n }",
"public function getActionNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[2];\r\n }",
"public function getControllerActionName() {}",
"public function getActionName(){\n\t\tif ( !isset($_GET['action'])){\n\t\t\treturn 'defaultAction';\n\t\t}\n\t\telse{\n\t\t\treturn $_GET['action'];\n\t\t}\n\t}",
"public function getAction(): string\n {\n return $this->action;\n }",
"public function getAction(): string\n {\n return $this->action;\n }",
"protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}",
"protected function _getFullActionName()\n {\n if ($this->_fullActionName == null) {\n $this->_fullActionName = $this->_request->getFullActionName();\n }\n return $this->_fullActionName;\n }",
"public function getRouteName();",
"public function getName()\n\t{\n\t\treturn $this->actionName;\n\t}",
"protected function resolveActionMethodName(): string\n {\n switch ($this->request->getMethod()) {\n case 'HEAD':\n case 'GET':\n $actionName = ($this->request->hasArgument($this->resourceArgumentName)) ? 'show' : 'list';\n return $actionName . 'Action';\n\n // Not supported in Example\n case 'POST':\n case 'PUT':\n case 'DELETE':\n default:\n $this->throwStatus(400, null, 'Bad Request.');\n }\n $this->throwStatus(400, null, 'Bad Request.');\n return '';\n }",
"public function get_action() {\n\t\t$action\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (isset($_GET['action']))? preg_replace('@[^a-zA-Z0-9_]@', '', $_GET['action']) : $this->conf('default_action');\n\t\t\n\t\t# Return the Action\n\t\treturn $action;\n\t}",
"protected function getNormalizedActionName(Route $route): string\n\t{\n\t\t$action = $route->getAction();\n\n\t\tif($action instanceof Closure)\n\t\t{\n\t\t\treturn 'Closure';\n\t\t}\n\t\telseif(is_array($action))\n\t\t{\n\t\t\t[$class, $method] = $action;\n\n\t\t\treturn \"[{$class}::class, '{$method}']\";\n\t\t}\n\n\t\treturn $action;\n\t}",
"public function getActionName()\n\t{\n\t\t$explodedArray = explode('/', $_SERVER['REQUEST_URI']);\n\n\t\tif(array_key_exists(2, $explodedArray) && !empty($explodedArray[2])){\n\n\t\t\tif (strpos($explodedArray[2], '?')) {\n\t\t\t\t$localAction = explode('?', $explodedArray[2]);\n\t\t\t\t$this->actionName = $localAction[0];\n\t\t\t} else $this->actionName = $explodedArray[2];\n\n\t\t} else\n\t\t\t$this->actionName = 'index';\n\t}",
"public function currentRouteAction()\n {\n if (! $route = $this->current()) {\n return;\n }\n\n $action = $route->getAction();\n\n return \\is_string($action['uses']) ? $action['uses'] : null;\n }",
"public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}",
"public function getName()\n {\n return $this->action['name'] ?? null;\n }",
"private static function getAction() {\n $action = \"index\";\n if (isset($_GET['action']) && trim($_GET['action']) != \"\") $action = $_GET['action'];\n return $action;\n }",
"public function action($name = null)\n {\n if ($name) {\n $this->action = $name;\n }\n\n if ($this->action) {\n return $this->action;\n }\n\n // Wildcard\n return Route::currentRouteAction();\n }",
"function getRouteName();",
"public function getAction($strRoute)\n {\n $strTargetMethodName = 'action' . ucfirst($this->defaultAction);\n if (is_string($strRoute)) {\n $strTargetMethodName = 'action' . ucfirst($strRoute);\n }\n\n return $strTargetMethodName;\n }",
"public function action()\n {\n return $this->getAttribute('action');\n }",
"protected function resolveActionName(\\ArrayObject $route) : string\n {\n // map http method\n $httpMethod = strtolower($route->method);\n if(isset($this->httpMethodMapper[$httpMethod])) {\n $httpMethod = $this->httpMethodMapper[$httpMethod];\n }\n\n // handle default case, ie. path/ (GET request + no param passed)\n if(!count($route->params) && $httpMethod == 'get') {\n return $this->buildActionName($this->defaultAction);\n }\n\n // now check for standard restful methods\n $restMethod = $this->buildActionName($httpMethod);\n if(method_exists($this, $restMethod)) {\n return $restMethod;\n }\n\n // restful action method not found.\n // will attempt individual action method\n $action = $this->filterActionName(array_shift($route->params));\n $actionMethod = $restMethod . ucfirst($action);\n\n return $actionMethod;\n }",
"public function getActionMethod()\n {\n return array_last(explode('@', $this->getActionName()));\n }",
"public function getMethodNameFromRouteName($routeName)\n {\n $explodedRouteName = explode('.', $routeName);\n return 'action' . ucfirst(end($explodedRouteName));\n }",
"public function getAction()\n {\n $match = $this->_getMatch();\n return $match[1];\n }",
"public function getActionName(){\n return $this->actionName;\n }",
"public function getName()\n {\n return isset($this->action['as']) ? $this->action['as'] : null;\n }",
"public static function getActionName()\r\n\t{\r\n\t\treturn TRequest::getCmd('controller');\r\n\t}",
"protected function getRouteName()\n {\n if (is_null($this->routeName)) {\n $this->routeName = $this->getCurrentCallingControllerName();\n }\n\n return $this->routeName;\n }",
"public static function action()\n {\n return strtolower(static::name());\n }",
"public function get_action_view()\n {\n if (empty($this->uri)) {\n $uri = lcfirst($this->request->controller()) . '/' . $this->request->action();\n $dir = lcfirst($this->request->directory());\n\n if (!empty($dir))\n $uri = $dir . '/' . $uri;\n\n $this->uri = $uri;\n unset($uri, $dir);\n }\n return $this->uri;\n }",
"protected function resolveActionMethodName() {}",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"private function get_action() {\n\t\treturn $this->action;\n\t}",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"public function getAction()\n {\n if (is_null($this->_action)) {\n $action = $this->getConfiguration()\n ->get('router.action', 'index');\n if (isset($this->_params['action'])) {\n $action = $this->_params['action'];\n }\n $this->_action = $action;\n }\n return $this->_action;\n }",
"public function get_action() {\r\n\t\treturn $this->action;\r\n\t}",
"public function get_action() {\r\n\t\treturn esc_url_raw( $this->action ? $this->action : wp_unslash( $_SERVER['REQUEST_URI'] ) );\r\n\t}",
"public function get_action(): ?string {\n\t\treturn $this->action;\n\t}",
"protected function resolveActionMethodName()\n\t{\n\t\tif ($this->request->getHttpRequest()->getMethod() === 'OPTIONS') {\n\t\t\t$this->request->setControllerActionName('options');\n\t\t}\n\t\tif ($this->request->getControllerActionName() === 'index') {\n\t\t\t$actionName = 'index';\n\t\t\tswitch ($this->request->getHttpRequest()->getMethod()) {\n\t\t\t\tcase 'HEAD':\n\t\t\t\tcase 'GET':\n\t\t\t\t\t$actionName = ($this->request->hasArgument(static::$RESOURCE_ARGUMENT_NAME)) ? 'show' : 'list';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'POST':\n\t\t\t\t\t$actionName = 'create';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'PUT':\n\t\t\t\tcase 'PATCH':\n\t\t\t\t\t$actionName = 'update';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DELETE':\n\t\t\t\t\t$actionName = 'remove';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->request->setControllerActionName($actionName);\n\t\t}\n\n\t\treturn parent::resolveActionMethodName();\n\t}",
"public function action() {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getRouteKeyName();",
"public function getRouteKeyName();",
"public function getAction()\n {\n return $this->sAction;\n }",
"public function getAction() : string{\n return $this->action;\n }",
"public static function method()\n\t{\n\t\treturn self::$router->getAction();\n\t}",
"public function getFormActionRouteSuffix(): string\n {\n return $this->getConfig('form_action_route_suffix', $this->getName());\n }",
"public function action()\n {\n return $this->reqaction;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function GetControllerAction () {\n\t\treturn $this->controller . ':' . $this->action;\n\t}",
"public function getAction()\n {\n return $this->joUrl['ACTION'];\n }",
"public function getAction() {\n\t\treturn $this->action;\n\t}",
"public function action()\n {\n if (!$this->action) {\n return null;\n }\n return $this->action->getValue();\n }",
"public function getAction(): ?string\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->_action;\n }",
"public function getAction()\n {\n return $this->_action;\n }",
"public function getAction()\n\t{\n\t\treturn $this->action;\n\t}",
"public function getAction()\n\t{\n\t\treturn $this->action;\n\t}",
"public function getCurrentAction() {\n\t\treturn $this->request->get('action','undefined');\n\t}",
"public function getActionName();",
"public function getActionName();",
"public function get_action() {\n return $this->_action;\n }",
"public function Action()\n {\n return $this->action;\n }"
]
| [
"0.8321323",
"0.8040545",
"0.78337634",
"0.7821587",
"0.779699",
"0.77754474",
"0.777127",
"0.7760751",
"0.77305734",
"0.7657132",
"0.76450455",
"0.76212764",
"0.75891995",
"0.7560793",
"0.75528574",
"0.75444055",
"0.7514537",
"0.7507952",
"0.7483674",
"0.7466155",
"0.74579567",
"0.74579567",
"0.74360806",
"0.7416175",
"0.73963326",
"0.7342968",
"0.72709477",
"0.7251307",
"0.7235538",
"0.72351885",
"0.7227402",
"0.7204693",
"0.720334",
"0.7183952",
"0.71801245",
"0.7124007",
"0.7088744",
"0.70621186",
"0.7061285",
"0.7049634",
"0.7047982",
"0.70402104",
"0.70325667",
"0.7031448",
"0.69732404",
"0.6954388",
"0.6944578",
"0.6939899",
"0.69351506",
"0.69158554",
"0.69158554",
"0.69158554",
"0.69021314",
"0.6892137",
"0.68869275",
"0.688381",
"0.68734664",
"0.68689495",
"0.68637854",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6857497",
"0.6842922",
"0.6842922",
"0.68417394",
"0.6836485",
"0.68307567",
"0.68076545",
"0.68059534",
"0.6804164",
"0.6804164",
"0.6804164",
"0.6804164",
"0.6804164",
"0.6791057",
"0.6790276",
"0.67873126",
"0.6785726",
"0.6784126",
"0.6781187",
"0.6781187",
"0.6772696",
"0.6772696",
"0.6772482",
"0.675543",
"0.675543",
"0.67429477",
"0.6738414"
]
| 0.75999385 | 12 |
Get the method name of the route action. | public function getActionMethod()
{
return array_last(explode('@', $this->getActionName()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function method()\n\t{\n\t\treturn self::$router->getAction();\n\t}",
"private function getActionName()\n {\n return strtolower($this->_request->getActionName());\n }",
"public function getRouteName($action);",
"public function getActionName() {\n return $this->actionName;\n }",
"protected function resolveActionMethodName(): string\n {\n switch ($this->request->getMethod()) {\n case 'HEAD':\n case 'GET':\n $actionName = ($this->request->hasArgument($this->resourceArgumentName)) ? 'show' : 'list';\n return $actionName . 'Action';\n\n // Not supported in Example\n case 'POST':\n case 'PUT':\n case 'DELETE':\n default:\n $this->throwStatus(400, null, 'Bad Request.');\n }\n $this->throwStatus(400, null, 'Bad Request.');\n return '';\n }",
"public function getActionName() {\n\n\t\treturn $this->_action;\n\t}",
"public function getActionName() {\n\t\treturn $this->action;\n\t}",
"public function getActionName()\n {\n return $this->_action;\n }",
"public function getFormActionRouteName(): string\n {\n return $this->resource->getRouteName($this->getFormActionRouteSuffix());\n }",
"public function getActionName()\n {\n return $this->__get(\"action_name\");\n }",
"public function getFullActionName()\n {\n return $this->request->getFullActionName();\n }",
"protected function resolveActionMethodName()\n\t{\n\t\tif ($this->request->getHttpRequest()->getMethod() === 'OPTIONS') {\n\t\t\t$this->request->setControllerActionName('options');\n\t\t}\n\t\tif ($this->request->getControllerActionName() === 'index') {\n\t\t\t$actionName = 'index';\n\t\t\tswitch ($this->request->getHttpRequest()->getMethod()) {\n\t\t\t\tcase 'HEAD':\n\t\t\t\tcase 'GET':\n\t\t\t\t\t$actionName = ($this->request->hasArgument(static::$RESOURCE_ARGUMENT_NAME)) ? 'show' : 'list';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'POST':\n\t\t\t\t\t$actionName = 'create';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'PUT':\n\t\t\t\tcase 'PATCH':\n\t\t\t\t\t$actionName = 'update';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DELETE':\n\t\t\t\t\t$actionName = 'remove';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->request->setControllerActionName($actionName);\n\t\t}\n\n\t\treturn parent::resolveActionMethodName();\n\t}",
"public function getFullActionName()\n\t{\n\t\treturn $this->request->getFullActionName();\n\t}",
"public function getAction(): string\n {\n return $this->action;\n }",
"public function getAction(): string\n {\n return $this->action;\n }",
"protected function resolveActionMethodName() {}",
"public function getControllerActionName() {}",
"public function method() {\n\t\treturn strtoupper($this->getMethod());\n\t}",
"public function getMethodName()\n {\n return $this->method;\n }",
"public static function getMethod()\n {\n return ! empty(self::getInstance()->urlParams[self::PARAM_METHOD]) ? self::getInstance()->urlParams[self::PARAM_METHOD] : self::DEFAULT_CONTROLLER_ACTION;\n }",
"public function name()\n {\n if ($name = $this->route->getName()) {\n return $name;\n }\n\n $name = $this->route->getActionName();\n\n if ($name === 'Closure') {\n return null;\n }\n\n $namespace = array_get($this->route->getAction(), 'namespace');\n\n return str_replace($namespace . '\\\\', '', $name);\n }",
"public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}",
"public function getAction()\n\t{\n\t\t$action = strtolower($this->getParam(self::ACTION_PARAM));\n\t\tif ($action === '' or ! preg_match('/^[a-z0-9_-]+$/', $action)) {\n\t\t\treturn Controller::DEFAULT_ACTION;\n\t\t}\n\n\t\treturn $action;\n\t}",
"public function getActionName()\n {\n return isset($this->action['controller']) ? $this->action['controller'] : 'Closure';\n }",
"protected function resolveActionMethodName()\n {\n // sets correct $this->request actionMethodName:\n $actionMethodName = parent::resolveActionMethodName();\n // replace controllerContext sets which was set ini initializeController callec before actionMethod was replaced\n $this->controllerContext = new ControllerContext($this->request, $this->response, $this->arguments, $this->uriBuilder);\n return $actionMethodName;\n }",
"public function getMethodName() {\r\n\t\treturn($this->method_name);\r\n\t}",
"public function getName()\n\t{\n\t\treturn $this->actionName;\n\t}",
"protected function _getFullActionName()\n {\n if ($this->_fullActionName == null) {\n $this->_fullActionName = $this->_request->getFullActionName();\n }\n return $this->_fullActionName;\n }",
"function get_method() {\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 3) {\n return $parts[3];\n }\n return 'index';\n }",
"public function getMethod()\t{\n\t\tif ($this->class != \"NoRoute\")\t{\n\t\t\treturn $this->method;\n\t\t}\n\t\treturn \"invoke\";\n\t}",
"public function getActionName(){\n\t\tif ( !isset($_GET['action'])){\n\t\t\treturn 'defaultAction';\n\t\t}\n\t\telse{\n\t\t\treturn $_GET['action'];\n\t\t}\n\t}",
"protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}",
"public function method(): string\n {\n return \\strtoupper($this->request()->getMethod());\n }",
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public function method(): string\n {\n return $this->method;\n }",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"public function getRouteAction(): ?string\n {\n return $this->routeAction;\n }",
"public function getActionName(){\n return $this->actionName;\n }",
"public static function routeName() : string\n {\n return str_replace('app_http_actions_', '', snake_case(str_replace('\\\\', '', static::class)));\n }",
"public function getMethodName()\n {\n return $this->methodName;\n }",
"public function getMethodName()\n {\n return $this->methodName;\n }",
"public static function method(): string\n\t{\n\t\treturn strtoupper(Server::get('REQUEST_METHOD'));\n\t}",
"private function guessActionName(ReflectionMethod $method): string\n {\n $name = preg_replace('/(\\w+)Action/i', '$1', $method->getName());\n\n return Inflector::tableize($name);\n }",
"protected function getActionMethod(string $action): string\n {\n $sentence = preg_replace('/[\\W_]+/', ' ', $action);\n return lcfirst(str_replace(' ', '', ucwords($sentence)));\n }",
"public function method(): string\n {\n return $this->request->getMethod();\n }",
"public function method(): string\n {\n return $this->request->getMethod();\n }",
"public function method(): string\n {\n return $this->request->getMethod();\n }",
"public function getMethod(): string {\n\n return strtoupper($_SERVER['REQUEST_METHOD']);\n }",
"public function getMethodNameFromRouteName($routeName)\n {\n $explodedRouteName = explode('.', $routeName);\n return 'action' . ucfirst(end($explodedRouteName));\n }",
"public function method(): string\n {\n return $this->getMethod();\n }",
"protected function resolveActionName(\\ArrayObject $route) : string\n {\n // map http method\n $httpMethod = strtolower($route->method);\n if(isset($this->httpMethodMapper[$httpMethod])) {\n $httpMethod = $this->httpMethodMapper[$httpMethod];\n }\n\n // handle default case, ie. path/ (GET request + no param passed)\n if(!count($route->params) && $httpMethod == 'get') {\n return $this->buildActionName($this->defaultAction);\n }\n\n // now check for standard restful methods\n $restMethod = $this->buildActionName($httpMethod);\n if(method_exists($this, $restMethod)) {\n return $restMethod;\n }\n\n // restful action method not found.\n // will attempt individual action method\n $action = $this->filterActionName(array_shift($route->params));\n $actionMethod = $restMethod . ucfirst($action);\n\n return $actionMethod;\n }",
"public function getMethodName() {\n return $this->methodName;\n }",
"public static function getMethod()\n {\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n\n return $method;\n }",
"public function getMethodName() : string\n {\n\n return $this->methodName;\n }",
"function current_route_method()\n {\n return RouteController::getCurrentRoute()['method'] ?? '';\n }",
"public function getActionNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[2];\r\n }",
"public static function getRouteControllerMethod()\r\n {\r\n $route = self::getRouteResolve();\r\n\r\n if(isset($route['method'])){\r\n return $route['method'];\r\n }\r\n\r\n return null;\r\n }",
"public static function getMethodOfActionName($actionName)\n {\n $parameters = explode(\"@\", $actionName);\n return $parameters[1];\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->action;\n }",
"protected function getActionMethod($action)\n {\n// $method = implode('', $action_arr);\n $method = 'handle_' . $action;\n return $method;\n }",
"public function action()\n {\n return $this->getAttribute('action');\n }",
"public function get_action() {\r\n\t\treturn $this->action;\r\n\t}",
"public function method()\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public function getAction() : string{\n return $this->action;\n }",
"public function get_action() {\n\t\t$action\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (isset($_GET['action']))? preg_replace('@[^a-zA-Z0-9_]@', '', $_GET['action']) : $this->conf('default_action');\n\t\t\n\t\t# Return the Action\n\t\treturn $action;\n\t}",
"public function getAction()\n {\n return $this->sAction;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"public function getAction() {\n return $this->action;\n }",
"private static function getAction() {\n $action = \"index\";\n if (isset($_GET['action']) && trim($_GET['action']) != \"\") $action = $_GET['action'];\n return $action;\n }",
"protected function resolveActionMethodName()\n {\n $actionMethodName = $this->request->getControllerActionName() . 'Action';\n if (!is_callable([$this, $actionMethodName])) {\n throw new NoSuchActionException(sprintf('An action \"%s\" does not exist in controller \"%s\".', $actionMethodName, get_class($this)), 1186669086);\n }\n $publicActionMethods = static::getPublicActionMethods($this->objectManager);\n if (!isset($publicActionMethods[$actionMethodName])) {\n throw new InvalidActionVisibilityException(sprintf('The action \"%s\" in controller \"%s\" is not public!', $actionMethodName, get_class($this)), 1186669086);\n }\n return $actionMethodName;\n }",
"function route_method(): string\n{\n return RouteController::getCurrentRoute()['method'] ?? '';\n}",
"public function getRouteName();",
"public function method() {\n return $this->method;\n }",
"public function action() {\n return $this->action;\n }",
"public function getAction()\n {\n return $this->_action;\n }",
"public function getAction()\n {\n return $this->_action;\n }",
"public function get_action() {\n return $this->_action;\n }",
"public function get_action()\n {\n return $this->_action;\n }",
"public function getControllerMethod()\n {\n return $this->parseControllerCallback()[1];\n }",
"public function fetch_method()\n\t{\n\t\t$method = $this->route_stack[self::SEG_METHOD];\n\t\treturn ($method === $this->fetch_class()) ? 'index' : $method;\n\t}",
"private function get_action() {\n\t\treturn $this->action;\n\t}"
]
| [
"0.7939624",
"0.77832425",
"0.77680784",
"0.7753416",
"0.7734606",
"0.76520544",
"0.7637213",
"0.76368123",
"0.7564157",
"0.7507085",
"0.7499078",
"0.7473904",
"0.7463607",
"0.743906",
"0.743906",
"0.7410186",
"0.73896074",
"0.73430413",
"0.7334641",
"0.7304374",
"0.729054",
"0.7283936",
"0.72604233",
"0.7240507",
"0.7215605",
"0.72017896",
"0.7190044",
"0.71899825",
"0.7173473",
"0.71663535",
"0.7153604",
"0.71398497",
"0.71391946",
"0.7116875",
"0.71060675",
"0.70869285",
"0.708144",
"0.70809925",
"0.7070642",
"0.7069927",
"0.7069927",
"0.70605654",
"0.7044888",
"0.7043716",
"0.70261663",
"0.70261663",
"0.70261663",
"0.70256174",
"0.7018355",
"0.70066404",
"0.6989772",
"0.6983004",
"0.6974849",
"0.69715965",
"0.69689363",
"0.6963736",
"0.69608855",
"0.6950561",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.69394606",
"0.693917",
"0.693026",
"0.6928212",
"0.6924759",
"0.6924759",
"0.6924759",
"0.6923475",
"0.6916449",
"0.6913034",
"0.6905287",
"0.6905287",
"0.6905287",
"0.6905287",
"0.6905287",
"0.69032377",
"0.69000465",
"0.68996114",
"0.68974096",
"0.6895406",
"0.68930644",
"0.6882645",
"0.6882645",
"0.6865946",
"0.6854996",
"0.685381",
"0.68464434",
"0.68444896"
]
| 0.795082 | 0 |
Get the action array for the route. | public function getAction()
{
return $this->action;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getRoute() {\n $path = $_SERVER['PATH_INFO'];\n\n $parts = explode('/', trim($path, '/'));\n $action = array_shift($parts);\n $this->uri_params = $parts;\n\n if (!$action) $action = 'index';\n $action .= 'Action';\n return array($this, $action);\n }",
"public function get(): array\n {\n return $this->actions->toArray();\n }",
"public function getActionsForRoute($route_appears);",
"private function getActionRoutes() : array {\n return [\n 'session_entity.close',\n 'session_entity.download_answers',\n 'la_pills_timer.la_pills_timer_controller_sessionTimer',\n 'la_pills_timer.la_pills_timer_controller_stopAll',\n 'la_pills_timer.la_pills_timer_controller_exportTimers', // This produces two events one of those AJAX preflight and the other one POST download event if that is possible\n 'la_pills_timer.la_pills_timer_controller_ajaxTimerActiveInactive',\n 'la_pills_quick_feedback.la_pills_quick_feedback_controller_ajaxQuestionActiveInactive',\n ];\n }",
"public function getActions(): array\n {\n return $this->actions;\n }",
"public function getActions(): array;",
"public function actions(): array\n {\n /**\n * @var string\n */\n $cmd = request('cmd', '');\n\n return [\n // new Actions\\FullcalendarAction(),\n // new Actions\\TestAction(),\n new ArtisanAction($cmd),\n ];\n }",
"public function action()\n {\n return $this->_actions;\n }",
"public function actions(): array;",
"public static function getRoutes()\n {\n $a = array();\n $router = ROUTER::init();\n foreach ($router->assigns as $ass)\n {\n if (isset($ass['module']) and isset($ass['action']))\n {\n $a[] = array('route' => $ass['route'], 'execute' => $router->current_dir . '/' . $ass['module'] . '/' . $ass['action'] . '.action.php');\n }\n elseif (isset($ass['function']))\n {\n $a[] = array('route' => $ass['route'], 'function' => $ass['function']);\n }\n else\n {\n /*do nothing*/;\n }\n }\n return $a;\n }",
"public function get_actions() {\n $actions = get_post_meta( $this->post_id, '_wcs_actions', true );\n\n if ( ! $actions ) {\n return array();\n }\n\n return (array) $actions;\n }",
"public static function returnActions() {\n return array();\n }",
"function actions()\n {\n return[];\n }",
"public function getActions()\n {\n return self::$actionList;\n }",
"public function getRoutes(){\n return CoreArrayUtils::asArray(CoreControllerObject::buildAction('/^\\/email\\/activate\\/([^\\/]+)\\/?$/i', __CLASS__, CoreControllerObject::MATCH_TYPE_REGEX, CoreControllerObject::REQUEST_GET));\n }",
"public function getRoutes()\n\t{\n\t\t$routes = array();\n\t\tarray_push($routes, CoreControllerObject::buildAction('/login', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n\t\treturn $routes;\n\t}",
"static protected function get_resource_actions(): array\n\t{\n\t\treturn [\n\n\t\t\tself::ACTION_INDEX => [ '/{name}', Request::METHOD_GET ],\n\t\t\tself::ACTION_NEW => [ '/{name}/new', Request::METHOD_GET ],\n\t\t\tself::ACTION_CREATE => [ '/{name}', Request::METHOD_POST ],\n\t\t\tself::ACTION_SHOW => [ '/{name}/{id}', Request::METHOD_GET ],\n\t\t\tself::ACTION_EDIT => [ '/{name}/{id}/edit', Request::METHOD_GET ],\n\t\t\tself::ACTION_UPDATE => [ '/{name}/{id}', [ Request::METHOD_PUT, Request::METHOD_PATCH ] ],\n\t\t\tself::ACTION_DELETE => [ '/{name}/{id}', Request::METHOD_DELETE ]\n\n\t\t];\n\t}",
"public function getRoutes()\n {\n $routes = array();\n array_push($routes, CoreControllerObject::buildAction('/admin/performanceutils', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n return $routes;\n }",
"public function get_actions(): array;",
"public function getRoutes(): array\r\n {\r\n return [\r\n [\r\n 'name' => 'exclusive/json/messagetutor',\r\n 'path' => '/exclusive/json/mT',\r\n 'middleware' => Action\\Json\\MessageTutor::class,\r\n 'allowed_methods' => ['POST']\r\n ],\r\n [\r\n 'name' => 'exclusive/json/certificateprintfree',\r\n 'path' => '/exclusive/json/cPf',\r\n 'middleware' => Action\\Json\\CertificatePrintFree::class,\r\n 'allowed_methods' => ['POST']\r\n ]\r\n ];\r\n }",
"private function parseActions()\n {\n // default controller actions\n $actions = array_keys($this->getObject()->actions());\n $actionMethods = array_filter($this->reflection->getMethods(),\n function ($method) {\n // should match all methods named actionSomeAction\n return preg_match('/action([A-Z]{1}[a-zA-Z]+)/', $method->name, $matches);\n });\n $actionMethods = array_map(function ($method) {\n return Inflector::slug(str_replace('action', '', $method->name));\n }, $actionMethods);\n $actionMethods = array_merge($actions, $actionMethods);\n\n return array_intersect(['index', 'view', 'create', 'update', 'delete', 'options'], $actionMethods);\n }",
"protected function getActions()\n {\n $actions = [];\n\n if (method_exists($this, 'editAction')) {\n $actions['edit'] = [\n 'label' => 'bigfoot_core.crud.actions.edit.label',\n 'route' => $this->getRouteNameForAction('edit'),\n 'icon' => 'edit',\n 'color' => 'green',\n ];\n }\n\n if (method_exists($this, 'duplicateAction')) {\n $actions['duplicate'] = [\n 'label' => 'bigfoot_core.crud.actions.duplicate.label',\n 'route' => $this->getRouteNameForAction('duplicate'),\n 'icon' => 'copy',\n 'color' => 'green',\n ];\n }\n\n if (method_exists($this, 'deleteAction')) {\n $actions['delete'] = [\n 'label' => 'bigfoot_core.crud.actions.delete.label',\n 'route' => $this->getRouteNameForAction('delete'),\n 'icon' => 'trash',\n 'color' => 'red',\n 'class' => 'confirm-action',\n 'attributes' => [\n 'data-confirm-message' => $this->getTranslator()->trans(\n 'bigfoot_core.crud.actions.delete.confirm',\n ['%entity%' => $this->getEntityLabel()]\n ),\n ],\n ];\n }\n\n return $actions;\n }",
"public function getActions()\n {\n return $this->actions;\n }",
"public function getActions()\n {\n return $this->actions;\n }",
"public function getActions()\n {\n return $this->actions;\n }",
"public function getActions(){\r\n\t\t\r\n\t\t\treturn $this->_actions;\r\n\t\t}",
"public function getActions();",
"public function getActions();",
"private static function getActions()\n {\n // get the called class\n $calledClass\t\t= get_called_class();\n if (!$calledClass) {\n return array();\n }\n\n if (isset(self::$actions[$calledClass])) {\n return self::$actions[$calledClass];\n }\n\n self::$actions[$calledClass] = array();\n\n // reflect in and find all public static functions defined by that class\n $reflectionClass \t= new \\ReflectionClass($calledClass);\n foreach ($reflectionClass->getMethods() as $method) {\n if ($method->isStatic() && $method->isPublic() && $method->class == $calledClass) {\n self::$actions[$calledClass][] = $method->name;\n }\n }\n\n return self::$actions[$calledClass];\n }",
"public Function getActions(){\n\t\treturn $this->actions;\n\t}",
"protected function getActions() {}",
"public function getActionNames()\n {\n return $this->action_names;\n }",
"public function getActions() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'action'=>\"nav_primary_client\",\n\t\t\t\t'uri'=>\"plugin/knowledgebase/client_main/\",\n\t\t\t\t'name'=>Language::_(\"KnowledgebasePlugin.client_main\", true)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'action' => \"nav_secondary_staff\",\n\t\t\t\t'uri' => \"plugin/knowledgebase/admin_main/\",\n\t\t\t\t'name' => Language::_(\"KnowledgebasePlugin.admin_main\", true),\n\t\t\t\t'options' => array('parent' => \"tools/\")\n\t\t\t)\t\t\t\n\t\t);\n\t}",
"protected static function requestRoute() {\n $route = [];\n\n $currentUrlOptions = parse_url($_SERVER['REQUEST_URI']);\n $fullUri = $currentUrlOptions['path'];\n $prefixLen = strlen(self::$uriPrefix);\n if ($fullUri == self::$uriPrefix){ //all default\n $route['controller'] = '';\n $route['action'] = '';\n } elseif (substr($fullUri, 0, $prefixLen) === self::$uriPrefix) {\n $uri = substr($fullUri, $prefixLen);\n $parts = explode('/', rtrim($uri, '/'));\n $route['controller'] = ucfirst($parts[0]);\n $route['action'] = isset($parts[1]) ? ucfirst($parts[1]) : '';\n } else {\n //do nothing\n }\n\n return $route;\n }",
"public function getActions()\n\t{\n\t\treturn $this->actions;\n\t}",
"public function getActions() {\n\n\t}",
"public static function getRoute()\n {\n global $req;\n\n $route = [];\n $uri = trim($req->getPathInfo(), '/');\n $uri = explode('/', $uri);\n\n $route['base'] = $uri[0];\n $route['section'] = empty($uri[1]) ? '' : $uri[1];\n $route['action'] = empty($uri[2]) ? '' : $uri[2];\n $route['page'] = $uri[count($uri)-1];\n\n return $route;\n }",
"public static function returnActions() {\n ##return array();\n }",
"protected function getGlobalActions()\n {\n $globalActions = [];\n\n if ($this->generateExportCsvLink()) {\n $csvArray = $this->generateExportCsvLink();\n $globalActions['csv'] = [\n 'label' => 'bigfoot_core.crud.actions.csv.label',\n 'route' => $csvArray['route'],\n 'parameters' => $csvArray['parameters'],\n 'icon' => 'icon-table',\n ];\n }\n\n if (method_exists($this, 'newAction')) {\n $globalActions['new'] = [\n 'label' => 'bigfoot_core.crud.actions.new.label',\n 'route' => $this->getRouteNameForAction('new'),\n 'parameters' => [],\n 'icon' => 'icon-plus-sign',\n ];\n }\n\n return $globalActions;\n }",
"public function actions(): array\n {\n return [\n new RateItAction(),\n // new Actions\\ChangePosAction(),\n new Actions\\Article\\CreateAction(),\n new Actions\\Article\\EditAction(),\n ];\n }",
"public function getActions() {\n\t\treturn array(\n\t\t\t// Client Nav\n\t\t\tarray(\n\t\t\t\t'action'=>\"widget_client_home\",\n\t\t\t\t'uri'=>\"plugin/client_notices/client_widget/\",\n\t\t\t\t'name'=>Language::_(\"ClientNoticesPlugin.widget_client_home.index\", true)\n\t\t\t),\n\t\t\t// Staff Nav\n array(\n 'action' => \"nav_secondary_staff\",\n 'uri' => \"plugin/client_notices/admin_main/index/\",\n 'name' => Language::_(\"ClientNoticesPlugin.nav_secondary_staff.index\", true),\n 'options' => array(\n\t\t\t\t\t'parent' => \"clients/\"\n\t\t\t\t)\n ),\n\t\t\t// Client Profile Action Link\n\t\t\tarray(\n\t\t\t\t'action' => \"action_staff_client\",\n\t\t\t\t'uri' => \"plugin/client_notices/admin_main/add/\",\n\t\t\t\t'name' => Language::_(\"ClientNoticesPlugin.action_staff_client.add\", true),\n\t\t\t\t'options' => array(\n\t\t\t\t\t'class' => \"invoice\"\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}",
"public static function getAction() {\n\t return self::getPathParams()['action'];\n\t}",
"public function getActions(CakeRequest $cakeRequest)\n {\n return array();\n }",
"public function getListRoutes()\r\n {\r\n $result = array();\r\n \r\n if (count( $this->routes ))\r\n {\r\n foreach ( $this->routes as $act )\r\n {\r\n \r\n $route_str = '';\r\n if (isset( $this->default_params['url_prefix'] ) && ! empty( $this->default_params['url_prefix'] ))\r\n {\r\n $route_str = $this->default_params['url_prefix'];\r\n }\r\n \r\n if (is_array( $act['type'] ))\r\n {\r\n $route_str = implode( '|', $act['type'] ) . ' ' . $route_str;\r\n }\r\n else\r\n {\r\n $route_str = $act['type'] . ' ' . $route_str;\r\n }\r\n $route_str .= $act['route'];\r\n \r\n if (isset( $act['params']['ajax'] ) && (bool) ($act['params']['ajax']))\r\n {\r\n $route_str .= ' [ajax]';\r\n }\r\n \r\n $action_str = '';\r\n if (isset( $act['params']['namespace'] ) && ! empty( $act['params']['namespace'] ))\r\n {\r\n $action_str = (string) $act['params']['namespace'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['namespace'] ) && ! empty( $this->default_params['namespace'] ))\r\n {\r\n $action_str = $this->default_params['namespace'];\r\n }\r\n }\r\n $action_str .= '\\\\';\r\n \r\n if (isset( $act['params']['controller'] ))\r\n {\r\n $action_str .= (string) $act['params']['controller'];\r\n }\r\n else\r\n {\r\n if (isset( $this->default_params['controller'] ) && ! empty( $this->default_params['controller'] ))\r\n {\r\n $action_str .= $this->default_params['controller'];\r\n }\r\n }\r\n $action_str .= '->' . (string) $act['params']['action'];\r\n \r\n $kbps = $this->default_params['kbps'];\r\n if( isset( $act['params']['kbps'] ) ){\r\n \t$kbps = $act['params']['kbps'];\r\n }\r\n $ttl = $this->default_params['ttl'];\r\n if( isset( $act['params']['ttl'] ) ){\r\n \t$ttl = $act['params']['ttl'];\r\n }\r\n \r\n $route = new \\stdclass();\r\n $route->pattern = $route_str;\r\n $route->handler = $action_str;\r\n $route->ttl = $ttl;\r\n $route->kbps = $kbps;\r\n $result[] = $route;\r\n }\r\n }\r\n \r\n return $result;\r\n }",
"public function action()\n {\n if (!$this->action) {\n $this->action = array();\n foreach (monsterToAction::where('mid', '=', $this->id)->get() as $a) {\n $this->action[] = array(\n 'name' => $a->name,\n 'desc' => $a->description,\n 'dc' => array(\n 'attr' => $a->dc,\n 'beat' => $a->dcv,\n 'success' => $a->dc_success,\n ),\n 'damage' => array(\n 'type' => $a->damage_type,\n 'damage' => $a->damage,\n 'roll_bonus' => $a->bonus,\n ),\n 'legendery_action' => ($a->legendery) ? TRUE : FALSE,\n );\n }\n }\n return $this->action;\n }",
"public function getActions()\n {\n if (!$this->_actions) {\n $this->_resetActions();\n }\n\n // Load rule actions if it is applicable\n if ($this->hasActionsSerialized()) {\n $actions = $this->getActionsSerialized();\n if (!empty($actions)) {\n $actions = Mage::helper('core/unserializeArray')->unserialize($actions);\n if (is_array($actions) && !empty($actions)) {\n $this->_actions->loadArray($actions);\n }\n }\n $this->unsActionsSerialized();\n }\n\n return $this->_actions;\n }",
"public function getActions() {\n $translator = $this->getTranslator();\n\n $actions = array();\n if (!$this->isReadOnly) {\n $actions[self::ACTION_ADD] = $translator->translate($this->translationAdd);\n }\n $actions[''] = $translator->translate($this->translationOverview);\n\n return $actions;\n }",
"public function getRoutes()\n {\n\n $routes = array();\n\n array_push($routes, CoreControllerObject::buildAction('/admin/system/lessvariables', __CLASS__, CoreControllerObject::MATCH_TYPE_STRING));\n\n return $routes;\n\n }",
"public function actions()\r\n {\r\n return array(\r\n 'index' => array(\r\n 'class' => \\nizsheanez\\jsonRpc\\Action::class,\r\n ),\r\n );\r\n }",
"public function getMethodUrlPathArray(){\n\n $getAllKeys = array_keys($this->HTTP_GET_VARS);\n $dirControllers = $this->getDirFiles('controller/', self::FILE);\n foreach ($getAllKeys as $key) {\n if($key == 'task'){\n\n foreach ($dirControllers as $controller){\n\n if($this->HTTP_GET_VARS[$key].'Controller.php' == $controller){\n\n $controllerObject = \"\\\\controller\\\\\".explode('.php', $controller)[0];\n $reflection = new ReflectionClass($controllerObject);\n if((!$reflection->isAbstract()) && (!$reflection->isInterface())) {\n\n $this->urlPath['task'] = new $controllerObject();\n }\n }\n }\n\n }\n else if($key == 'action'){\n\n if(array_key_exists('task', $this->urlPath)){\n\n $reflection = (method_exists($this->urlPath['task'], $this->HTTP_GET_VARS[$key]))? new ReflectionMethod($this->urlPath['task'], $this->HTTP_GET_VARS[$key]): null;\n\n if(is_object($this->urlPath['task']) && method_exists(get_class($this->urlPath['task']), $this->HTTP_GET_VARS[$key]) && ($reflection->isPublic())){\n $this->urlPath['task'] = $this->HTTP_GET_VARS['task'];\n $this->urlPath['action'] = $this->HTTP_GET_VARS['action'];\n }\n else{\n $this->urlPath['task'] = null;\n $this->urlPath['action'] = null;\n }\n }\n }\n else{\n $this->urlPath['args'][$key] = (!empty($this->HTTP_GET_VARS[$key]))?$this->HTTP_GET_VARS[$key]: null;\n }\n }\n return $this->urlPath;\n }",
"public function actions()\n\t{\n\t\treturn array(\n\t\t\t'action1'=>'path.to.ActionClass',\n\t\t\t'action2'=>array(\n\t\t\t\t'class'=>'path.to.AnotherActionClass',\n\t\t\t\t'propertyName'=>'propertyValue',\n\t\t\t),\n\t\t);\n\t}",
"public function getAction()\n {\n if (is_null($this->_action)) {\n $action = $this->getConfiguration()\n ->get('router.action', 'index');\n if (isset($this->_params['action'])) {\n $action = $this->_params['action'];\n }\n $this->_action = $action;\n }\n return $this->_action;\n }",
"public function getRouteInfo()\r\n {\r\n $rawRoutes = $this->getRoutes();\r\n $routes = array();\r\n foreach ($rawRoutes as $route => $params){\r\n $defaults = $params->getDefaults();\r\n if (isset($defaults['_controller']))\r\n {\r\n $controllerAction = explode(':', $defaults['_controller']);\r\n $controller = $controllerAction[0];\r\n $action = isset($controllerAction[2]) ? $controllerAction[2] : $controllerAction[1];\r\n\r\n if (!isset($routes[$controller])) {\r\n $routes[$controller] = array();\r\n }\r\n\r\n $routes[$controller][$action] = array(\r\n 'route' => $route,\r\n 'controller' => $controller,\r\n 'action' => $action,\r\n );\r\n }\r\n }\r\n return $routes;\r\n }",
"public function Actions()\n {\n return $this->actions;\n }",
"private function getRootAuthorizedActions()\n\t{\n\t\t$moduleManager = $this->modelManager(Action::class);\n\t\t$builder = $moduleManager->builder();\n\t\t$request = $builder->select()\n\t\t\t->from('roles_actions')\n\t\t\t->where('roles_id', '=', 1);\n\t\t$authorizedActions = $builder->execute($request);\n\t\tif ($authorizedActions) {\n\t\t\t$authorizedActionsIds = array_column($authorizedActions, 'actions_id');\n\t\t} else {\n\t\t\t$authorizedActionsIds = [];\n\t\t}\n\n\t\t$installedActions = $moduleManager->findAll() ?: [];\n\t\t$actions = [];\n\t\tforeach ($installedActions as $installedAction) {\n\t\t\tif (in_array($installedAction->getId(), $authorizedActionsIds)) {\n\t\t\t\t$actions[$installedAction->getRouteName()] = $installedAction;\n\t\t\t}\n\t\t}\n\n\t\treturn $actions;\n\t}",
"public function sendAction()\n {\n return array();\n }",
"function getRouteArray()\n{\n\t// Get the current route as a string from the getRoute function.\n\t$route = getRoute();\n\n\t// Remove the first directory separator so we dont get an array with\n\t// an empty string as the first value in the route array when we\n\t// explode it.\n\t$route = ltrim($route, '/');\n\n\t// Divide the route into separate parts divided by the directory seperator\n\t// as the delimiter. The DIRECTORY_SEPARATOR is the same as typing '/' or\n\t// '\\' depending on the current filesystem.\n\t$route = explode(DIRECTORY_SEPARATOR, $route);\n\n\treturn $route;\n}",
"public function getFrontEndActions();",
"public function actions()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'action1'=>'path.to.ActionClass',\r\n\t\t\t'action2'=>array(\r\n\t\t\t\t'class'=>'path.to.AnotherActionClass',\r\n\t\t\t\t'propertyName'=>'propertyValue',\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function getAction() {\n return $this->_actionData;\n }",
"public static function getRoutes(): array\n {\n require(root_path('routes.php'));\n return self::$called;\n }",
"public function parseAction($action) {\n if ( ! strstr($action, '@')) {\n return [$action, 'index'];\n }\n\n return [\n substr($action, 0, strpos($action, '@')),\n substr($action, strpos($action, '@') + 1),\n ];\n }",
"public function getRoutes(): array\r\n {\r\n return [\r\n [\r\n 'name' => 'admin/post/admin',\r\n 'path' => '/admin',\r\n 'middleware' => 'Admin\\Action\\Post\\Admin',\r\n 'allowed_methods' => ['POST']\r\n ],\r\n [\r\n 'name' => 'admin/form/admin',\r\n 'path' => '/admin/form[/{id:\\d+}]',\r\n 'middleware' => 'Admin\\Action\\Form\\Admin',\r\n 'allowed_methods' => ['GET']\r\n ],\r\n [\r\n 'name' => 'admin/user/view/resultset',\r\n 'path' => '/admin/user/resultset',\r\n 'middleware' => 'Admin\\User\\Action\\View\\ResultSet',\r\n 'allowed_methods' => ['GET']\r\n ]\r\n ];\r\n }",
"public function getDashboardActions(): array;",
"public function getResourceActions()\n {\n if (array_key_exists(\"resourceActions\", $this->_propDict)) {\n return $this->_propDict[\"resourceActions\"];\n } else {\n return null;\n }\n }",
"public function getActionLists()\n {\n return $this->action_lists;\n }",
"public function getRouteAction(): ?string\n {\n return $this->routeAction;\n }",
"public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }",
"public function getOptionalAuthRoutes(): array\n {\n if (property_exists($this, 'optionalAuthRoutes')) {\n return $this->optionalAuthRoutes;\n }\n\n if (property_exists($this, 'onlyAuthRoutes')) {\n if (!empty($this->onlyAuthRoutes)) {\n $allControllerActions = [];\n foreach (get_class_methods(static::class) as $method) {\n if ($method != 'actions' && preg_match('/action*/', $method, $matches)) {\n $method = str_replace('action', '', $method);\n $allControllerActions[] = Inflector::camel2id($method);\n }\n }\n $allControllerActions = array_merge($allControllerActions, array_keys($this->actions()));\n\n return array_diff($allControllerActions, $this->onlyAuthRoutes);\n }\n }\n\n return ['*'];\n }",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"public static function routes()\r\n {\r\n return [\r\n [\"uri\" => \"/\", \"action\" => \"get\", \"uses\" => \"IndexController@index\"],\r\n [\"uri\" => \"/\", \"action\" => \"post\", \"uses\" => \"IndexController@handle\"],\r\n [\"uri\" => \"/api\", \"action\" => \"get\", \"uses\" => \"APIController@handle\"],\r\n ];\r\n }",
"public static function getActions()\n\t{\n\t\tif (empty(self::$actions))\n\t\t{\n\t\t\t$user = JFactory::getUser();\n\t\t\tself::$actions = new JObject;\n\n\t\t\t$actions = array(\n\t\t\t\t'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete'\n\t\t\t);\n\n\t\t\tforeach ($actions as $action)\n\t\t\t{\n\t\t\t\tself::$actions->set($action, $user->authorise($action, 'com_realtor'));\n\t\t\t}\n\t\t}\n\n\t\treturn self::$actions;\n\t}",
"public function all()\n {\n $routes = parent::all();\n\n // sort routes by names - move custom actions at the beginning,\n // default at the end\n uksort($routes, function($route1, $route2) {\n $route1Match = preg_match('/(_|^)(get|post|put|delete|patch|head)_/', $route1);\n $route2Match = preg_match('/(_|^)(get|post|put|delete|patch|head)_/', $route2);\n\n if ($route1Match && !$route2Match) {\n return 1;\n } elseif (!$route1Match && $route2Match) {\n return -1;\n } else {\n return strcmp($route1, $route2);\n }\n });\n\n return $routes;\n }",
"function get_actions_data() {\n\t\t$actions_data = $this->get_meta( 'actions' );\n\t\treturn is_array( $actions_data ) ? array_map( [ $this, 'format_action_fields' ], $actions_data ) : [];\n\t}",
"public function getAppRoutes()\n\t{\n\t\t$key = __METHOD__;\n\t\t$cache = Configs::instance()->cache;\n\t\tif ($cache === null || ($result = $cache->get($key)) === false) {\n\t\t\t$result = [];\n\t\t\t$this->getRouteRecrusive(Yii::$app, $result);\n\t\t\tif ($cache !== null) {\n\t\t\t\t$cache->set($key, $result, Configs::instance()->cacheDuration, new TagDependency([\n\t\t\t\t\t'tags' => self::CACHE_TAG\n\t\t\t\t]));\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}",
"#[Pure]\n public function getActionArguments() : array\n {\n return $this->actionArguments;\n }",
"public function getAction()\n {\n return $this->_action;\n }",
"public function getAction()\n {\n return $this->_action;\n }",
"protected function get_bulk_actions() {\n\n\t\t$actions = [];\n\n\t\tif ( current_user_can( wp_mail_smtp()->get_pro()->get_logs()->get_manage_capability() ) ) {\n\t\t\t$actions['delete'] = esc_html__( 'Delete', 'wp-mail-smtp-pro' );\n\t\t\t$actions['resend'] = esc_html__( 'Resend', 'wp-mail-smtp-pro' );\n\t\t}\n\n\t\treturn $actions;\n\t}",
"public static function getRoutes(): array\n {\n return self::$routes;\n }",
"public function getAction($key = null)\n {\n return PhandArr::get($this->action, $key);\n }",
"public function get(string $target = '*'): array\n\t{\n\t\t$segments = explode('.', $target);\n\n\t\tif (count($segments) === 1) {\n\t\t\tarray_unshift($segments, '*');\n\t\t}\n\n\t\tif (count($segments) === 2) {\n\t\t\tif ($this->isBounded()) {\n\t\t\t\tarray_unshift($segments, $this->class);\n\t\t\t} else {\n\t\t\t\tarray_unshift($segments, 'global');\n\t\t\t}\n\t\t}\n\n\t\t$actions = Data::get($this->actions, $segments, []);\n\n\t\tif (!is_array($actions)) {\n\t\t\t$actions = [$actions];\n\t\t} else if (!empty($actions)) {\n\t\t\t$actions = array_values(array_filter($actions));\n\t\t}\n\n\t\treturn $actions;\n\t}",
"public static function getActions()\r\n\t{\r\n\t\tif (empty(self::$actions))\r\n\t\t{\r\n\t\t\t$user = JFactory::getUser();\r\n\t\t\tself::$actions = new JObject;\r\n\r\n\t\t\t//dump(RSMembershipHelper::getUserSubscriptions($user->id), 'RSMembershipHelper::getUserSubscriptions');\r\n\t\t\t\r\n\t\t\t$actions = JAccess::getActions('com_ktbtracker');\r\n\r\n\t\t\tforeach ($actions as $action)\r\n\t\t\t{\r\n\t\t\t\tself::$actions->set($action->name, $user->authorise($action->name, 'com_ktbtracker'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn self::$actions;\r\n\t}",
"function action(string $method, string $path, callable ...$handlers): array {\n $regexp = '@^'.preg_replace('@:(\\w+)@', '(?<\\1>[^/]+)', $path).'$@';\n return [strtoupper($method), $regexp, $handlers];\n}",
"public function getRoutes() {\n return array();\n }",
"public function getBatchActions()\n {\n return array();\n }"
]
| [
"0.79912233",
"0.7210548",
"0.7143029",
"0.7133403",
"0.706075",
"0.6988175",
"0.69844913",
"0.6935091",
"0.68721056",
"0.6841687",
"0.6800823",
"0.67930484",
"0.6736625",
"0.67271996",
"0.6718017",
"0.6703692",
"0.67015976",
"0.6692192",
"0.66812766",
"0.6672448",
"0.6662252",
"0.6602065",
"0.65981984",
"0.65981984",
"0.65981984",
"0.6586377",
"0.65835965",
"0.65835965",
"0.65693635",
"0.6565624",
"0.6535771",
"0.6534404",
"0.6530143",
"0.65264297",
"0.6520535",
"0.65111184",
"0.6507245",
"0.6504985",
"0.6502633",
"0.6467128",
"0.6389053",
"0.6372995",
"0.63711333",
"0.6329397",
"0.6319505",
"0.6317778",
"0.6300124",
"0.6285758",
"0.6251931",
"0.6211935",
"0.61959666",
"0.6189539",
"0.6187111",
"0.61807024",
"0.61757624",
"0.6149757",
"0.61364317",
"0.613433",
"0.61324674",
"0.611885",
"0.6117983",
"0.6111384",
"0.61076736",
"0.6101279",
"0.609592",
"0.6069257",
"0.60692495",
"0.606425",
"0.60630786",
"0.60314435",
"0.6023563",
"0.6022387",
"0.6009632",
"0.6002968",
"0.5997877",
"0.5994978",
"0.59811807",
"0.59811807",
"0.5980787",
"0.59777707",
"0.5948341",
"0.5946575",
"0.5939878",
"0.59378713",
"0.5936933",
"0.59344304"
]
| 0.59662306 | 94 |
Set the action array for the route. | public function setAction(array $action)
{
$this->action = $action;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setActionArray(array $action)\n {\n $this->action = $action;\n return $this;\n }",
"protected function setAction()\n {\n $method = $this->request->method;\n $this->route->method = strtoupper($method);\n\n if ($this->route->method === 'POST') {\n $this->route->action = 'create';\n\n } elseif ($this->route->method === 'PUT') {\n $this->route->action = 'update';\n\n } elseif ($this->route->method === 'DELETE') {\n $this->route->action = 'delete';\n\n } else {\n $this->route->method = 'GET';\n $this->route->action = 'read';\n }\n\n $this->route->special_action = '';\n\n $this->valid_actions = $this->actions[$this->route->action];\n\n return $this;\n }",
"private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}",
"public function setAction($action);",
"function setAction($action);",
"protected function setFormActionUri() {}",
"public function setRoute(array $route): void;",
"public function assignRoute(array $route);",
"public function setAction($str);",
"function setAction($action) {\r\r\n\t\t$this->action = strtolower($action);\r\r\n\t}",
"public function setAction($action) {\n\t\t$this->action = $action;\n\t}",
"protected function initializeActionEntries() {}",
"public function setAction($value)\n {\n $this->action = $value;\n }",
"public function setAction(callable $action);",
"protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}",
"public function setAction($action) {\n $this->action = $action;\n }",
"public function setAction($action) {\n $this->action = $action;\n }",
"public function setActions()\n {\n $action = $this->parseActions();\n\n if (! isset($this->actions[$action])) {\n $action = 'home';\n }\n\n return $action;\n }",
"public function register_action_map($map)\n {\n if (is_array($map)) {\n foreach ($map as $idx => $val) {\n $this->action_map[$idx] = $val;\n }\n }\n }",
"public function setAction($action = '')\n {\n $this->action = $action;\n }",
"public function setAction($action)\n {\n if (is_string($action)) {\n $this->action = $action;\n }\n }",
"private function getRoute() {\n $path = $_SERVER['PATH_INFO'];\n\n $parts = explode('/', trim($path, '/'));\n $action = array_shift($parts);\n $this->uri_params = $parts;\n\n if (!$action) $action = 'index';\n $action .= 'Action';\n return array($this, $action);\n }",
"public function allow($action = null) {\n\t\t$args = func_get_args();\n\t\tif(empty($args) || $action === null) {\n\t\t\t$this->allowedActions = $this->_methods;\n\t\t} else {\n\t\t\tif(isset($args[0]) && is_array($args[0])) {\n\t\t\t\t$args = $args[0];\n\t\t\t}\n\t\t\t$this->allowedActions = array_merge($this->allowedActions, $args);\n\t\t}\n\t}",
"public function setFormAction($value) { $this->_formAction = $value; }",
"public function set_action($action) {\n $this->_action = (string)$action;\n }",
"public function addToActions($actionArray)\n {\n $this->_actions[] = $actionArray;\n }",
"public function addAction()\n {\n parent::addAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }",
"function setAllAction($action){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('UPDATE bot_action SET action = :action');\n\t\t$statement->execute(array(':action'=>$action));\n\t}",
"public function setAction($action)\n\t{\n\n\t\t$this->action = $action;\n\n\t}",
"public function setActions($val)\n {\n $this->_propDict[\"actions\"] = $val;\n return $this;\n }",
"public function actions()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'action1'=>'path.to.ActionClass',\r\n\t\t\t'action2'=>array(\r\n\t\t\t\t'class'=>'path.to.AnotherActionClass',\r\n\t\t\t\t'propertyName'=>'propertyValue',\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function actions()\n\t{\n\t\treturn array(\n\t\t\t'action1'=>'path.to.ActionClass',\n\t\t\t'action2'=>array(\n\t\t\t\t'class'=>'path.to.AnotherActionClass',\n\t\t\t\t'propertyName'=>'propertyValue',\n\t\t\t),\n\t\t);\n\t}",
"public function actions(): array;",
"public function setAction( $action )\n\t{\n\t\t$this->setAttribute( \"action\", $action );\n\t}",
"protected function setAfterSendRoute()\n {\n if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {\n $this->afterSendRouteUrl = array('action' => $this->routeAction);\n\n $keys = $this->model->getKeys();\n if (count($keys) == 1) {\n $key = reset($keys);\n if (isset($this->formData[$key])) {\n $this->afterSendRouteUrl[\\MUtil_Model::REQUEST_ID] = $this->formData[$key];\n }\n } else {\n $i = 1;\n foreach ($keys as $key) {\n if (isset($this->formData[$key])) {\n $this->afterSendRouteUrl[\\MUtil_Model::REQUEST_ID . $i] = $this->formData[$key];\n }\n $i++;\n }\n }\n\n $this->afterSendRouteUrl['controller'] = $this->request->getControllerName();\n\n $find['action'] = $this->afterSendRouteUrl['action'];\n $find['controller'] = $this->afterSendRouteUrl['controller'];\n\n if (null == $this->menu->find($find)) {\n $this->afterSendRouteUrl['action'] = 'index';\n $this->resetRoute = true;\n }\n }\n }",
"public function setAction($action)\n {\n $this->action = $action;\n $this->setAttributes(\"Action\");\n }",
"protected function setRequestAction()\n {\n $i = $this->setIndexAtMax();\n\n $special_action = $this->segments[$i];\n\n if (isset($this->valid_actions[$special_action])) {\n } else {\n return $this;\n }\n\n $this->route->special_action = $special_action;\n\n unset($this->segments[$i]);\n\n $this->setPath();\n\n return $this;\n }",
"public function actions(): array\n {\n /**\n * @var string\n */\n $cmd = request('cmd', '');\n\n return [\n // new Actions\\FullcalendarAction(),\n // new Actions\\TestAction(),\n new ArtisanAction($cmd),\n ];\n }",
"public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }",
"private function setAction($action) {\n if (is_int($action) || is_string($action)) {\n $this->action = $action;\n }\n }",
"public function resolveAction(&$segments)\n {\n \n echo $this->action = array_shift($segments); //array_shift me devuelve el primer segmento del array\n \n if (empty($this->action))\n \t{\n \n $this->action = $this->defaultAction; //index\n\n \t}\n }",
"private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }",
"public function test_route_method_array() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}",
"public function setExpectedAction($action);",
"public function setAllowedActions($allowedActions) {\n if ($allowedActions === '*')\n $this->_allowedActions = $allowedActions;\n else\n $this->_allowedActions = preg_split('/[\\s,]+/', $allowedActions, -1, PREG_SPLIT_NO_EMPTY);\n }",
"public function setAction($value)\n {\n if (isset($value) && !empty($value)){\n $this->_action = $value;\n $value = $this->_processActionName($value) .'Action';\n Config::getInstance()->set(\"CurrentMethod\",$value);\n $this->_action = $value;\n } else {\n $this->_action = $this->_processActionName($this->getDefaultAction()) .'Action';\n }\n }",
"public function register_actions() {\n\t\t}",
"static protected function get_resource_actions(): array\n\t{\n\t\treturn [\n\n\t\t\tself::ACTION_INDEX => [ '/{name}', Request::METHOD_GET ],\n\t\t\tself::ACTION_NEW => [ '/{name}/new', Request::METHOD_GET ],\n\t\t\tself::ACTION_CREATE => [ '/{name}', Request::METHOD_POST ],\n\t\t\tself::ACTION_SHOW => [ '/{name}/{id}', Request::METHOD_GET ],\n\t\t\tself::ACTION_EDIT => [ '/{name}/{id}/edit', Request::METHOD_GET ],\n\t\t\tself::ACTION_UPDATE => [ '/{name}/{id}', [ Request::METHOD_PUT, Request::METHOD_PATCH ] ],\n\t\t\tself::ACTION_DELETE => [ '/{name}/{id}', Request::METHOD_DELETE ]\n\n\t\t];\n\t}",
"public function setAction($val){\n\t\t$this->formElement->attr('action', $val);\n\t\treturn $this;\n\t}",
"private function setArguments()\n {\n $args = $this->data;\n $match = explode(\"/\", $this->routeMatch);\n\n // remove the domain part.\n foreach ($this->domains as $value) {\n // search for domain on url array.\n // array_search(needle, haystack)\n $index = array_search($value, $args);\n unset($args[$index]);\n\n // search for domain on matched route.\n $index = array_search($value, $match);\n unset($match[$index]);\n }\n\n // find the action part in url data and the matched route string.\n // preg_grep(pattern, input)\n $this->action = preg_grep(\"/^{$this->wildcards[':action']}$/\", $args);\n $matchAction = preg_grep(\"/^{$this->wildcards[':action']}$/\", $match);\n if ( !empty($this->action) )\n {\n // convert action from array to string.\n // find action in url data.\n // remove from url data.\n $this->action = array_shift($this->action);\n $index = array_search($this->action, $args);\n unset($args[$index]);\n\n $matchAction = array_shift($matchAction);\n $index = array_search($matchAction, $match);\n unset($match[$index]);\n }\n\n // get the arguments from url data\n // get the key from the wildcard. :id, :yyyy, :dd, etc.\n foreach ($args as $arg) {\n $key = $this->matchWildcard($match, $arg);\n $this->arguments[$key] = $arg;\n }\n }",
"public function set_action($_action)\n {\n $this->_action = $_action;\n\n return $this;\n }",
"protected function registerActionChain()\n\t{\n\t\t$this->actions['adapter'] = 'adapterAction';\n\t\t$this->actions['class'] = 'classLoaderAction';\n\t\t$this->actions['security'] = 'securityAction';\n\t\t$this->actions['exec'] = 'executionAction';\n\t}",
"public function setAction($name)\n {\n $this->_action = $name;\n }",
"public function setAction($val)\n {\n $this->_propDict[\"action\"] = $val;\n return $this;\n }",
"public function setRoutes(array $routes);",
"function setActionURL($url) {\n\t\t$this->actionURL = $url;\n\t}",
"public function setDefaultAction($actionName);",
"private function getActionRoutes() : array {\n return [\n 'session_entity.close',\n 'session_entity.download_answers',\n 'la_pills_timer.la_pills_timer_controller_sessionTimer',\n 'la_pills_timer.la_pills_timer_controller_stopAll',\n 'la_pills_timer.la_pills_timer_controller_exportTimers', // This produces two events one of those AJAX preflight and the other one POST download event if that is possible\n 'la_pills_timer.la_pills_timer_controller_ajaxTimerActiveInactive',\n 'la_pills_quick_feedback.la_pills_quick_feedback_controller_ajaxQuestionActiveInactive',\n ];\n }",
"public function registerAction($action){\r\n\t\t\t\t\r\n\t\t\t$this->_actions[] = $action;\r\n\t\t}",
"public function actions(): array\n {\n return [\n new RateItAction(),\n // new Actions\\ChangePosAction(),\n new Actions\\Article\\CreateAction(),\n new Actions\\Article\\EditAction(),\n ];\n }",
"public function get_actions() {\n $actions = parent::get_actions();\n $assignaction = new deepsight_action_usersetuser_assign($this->DB, 'usersetuserassign');\n $assignaction->endpoint = (strpos($this->endpoint, '?') !== false)\n ? $this->endpoint.'&m=action' : $this->endpoint.'?m=action';\n array_unshift($actions, $assignaction);\n return $actions;\n }",
"public function handles(Action $action)\n {\n $this->actions[] = $action;\n }",
"function actions()\n {\n return[];\n }",
"public function setAction(string $action) {\n $trimmed = trim($action);\n\n if (strlen($trimmed) != 0) {\n $this->action = $trimmed;\n }\n }",
"protected function initializeActionMethodArguments() {}",
"public function getActions(): array\n {\n return $this->actions;\n }",
"public function registerCpRoutes()\n {\n return array(\n 'amforms/forms' => array(\n 'action' => 'amForms/forms/index'\n ),\n 'amforms/forms/new' => array(\n 'action' => 'amForms/forms/editForm'\n ),\n 'amforms/forms/edit/(?P<formId>\\d+)' => array(\n 'action' => 'amForms/forms/editForm'\n ),\n\n 'amforms/submissions' => array(\n 'action' => 'amForms/submissions/index'\n ),\n 'amforms/submissions/edit/(?P<submissionId>\\d+)' => array(\n 'action' => 'amForms/submissions/editSubmission'\n ),\n\n 'amforms/submissions/edit/(?P<submissionId>\\d+)/notes' => array(\n 'action' => 'amForms/notes/displayNotes'\n ),\n\n 'amforms/fields' => array(\n 'action' => 'amForms/fields/index'\n ),\n 'amforms/fields/new' => array(\n 'action' => 'amForms/fields/editField'\n ),\n 'amforms/fields/edit/(?P<fieldId>\\d+)' => array(\n 'action' => 'amForms/fields/editField'\n ),\n\n 'amforms/exports' => array(\n 'action' => 'amForms/exports/index'\n ),\n 'amforms/exports/new' => array(\n 'action' => 'amForms/exports/editExport'\n ),\n 'amforms/exports/edit/(?P<exportId>\\d+)' => array(\n 'action' => 'amForms/exports/editExport'\n ),\n\n 'amforms/settings' => array(\n 'action' => 'amForms/settings/index'\n ),\n 'amforms/settings/exports' => array(\n 'action' => 'amForms/settings/exports'\n ),\n 'amforms/settings/antispam' => array(\n 'action' => 'amForms/settings/antispam'\n ),\n 'amforms/settings/recaptcha' => array(\n 'action' => 'amForms/settings/recaptcha'\n ),\n 'amforms/settings/templates' => array(\n 'action' => 'amForms/settings/templates'\n )\n );\n }",
"public function setResourceActions($val)\n {\n $this->_propDict[\"resourceActions\"] = $val;\n return $this;\n }",
"function set_action($action)\r\n {\r\n return $this->set_parameter(self :: PARAM_ACTION, $action);\r\n }",
"public function setActionName($actionName);",
"public function getRoutes(): array\r\n {\r\n return [\r\n [\r\n 'name' => 'exclusive/json/messagetutor',\r\n 'path' => '/exclusive/json/mT',\r\n 'middleware' => Action\\Json\\MessageTutor::class,\r\n 'allowed_methods' => ['POST']\r\n ],\r\n [\r\n 'name' => 'exclusive/json/certificateprintfree',\r\n 'path' => '/exclusive/json/cPf',\r\n 'middleware' => Action\\Json\\CertificatePrintFree::class,\r\n 'allowed_methods' => ['POST']\r\n ]\r\n ];\r\n }",
"public function setAction(CircuitAction $action)\n {\n $this->action = $action;\n }",
"function PreActions()\n {\n array_push($this->ActionPaths,\"../EventApp/System/Inscriptions\");\n }",
"public function getMethodUrlPathArray(){\n\n $getAllKeys = array_keys($this->HTTP_GET_VARS);\n $dirControllers = $this->getDirFiles('controller/', self::FILE);\n foreach ($getAllKeys as $key) {\n if($key == 'task'){\n\n foreach ($dirControllers as $controller){\n\n if($this->HTTP_GET_VARS[$key].'Controller.php' == $controller){\n\n $controllerObject = \"\\\\controller\\\\\".explode('.php', $controller)[0];\n $reflection = new ReflectionClass($controllerObject);\n if((!$reflection->isAbstract()) && (!$reflection->isInterface())) {\n\n $this->urlPath['task'] = new $controllerObject();\n }\n }\n }\n\n }\n else if($key == 'action'){\n\n if(array_key_exists('task', $this->urlPath)){\n\n $reflection = (method_exists($this->urlPath['task'], $this->HTTP_GET_VARS[$key]))? new ReflectionMethod($this->urlPath['task'], $this->HTTP_GET_VARS[$key]): null;\n\n if(is_object($this->urlPath['task']) && method_exists(get_class($this->urlPath['task']), $this->HTTP_GET_VARS[$key]) && ($reflection->isPublic())){\n $this->urlPath['task'] = $this->HTTP_GET_VARS['task'];\n $this->urlPath['action'] = $this->HTTP_GET_VARS['action'];\n }\n else{\n $this->urlPath['task'] = null;\n $this->urlPath['action'] = null;\n }\n }\n }\n else{\n $this->urlPath['args'][$key] = (!empty($this->HTTP_GET_VARS[$key]))?$this->HTTP_GET_VARS[$key]: null;\n }\n }\n return $this->urlPath;\n }",
"public function actions()\r\n {\r\n return array(\r\n 'index' => array(\r\n 'class' => \\nizsheanez\\jsonRpc\\Action::class,\r\n ),\r\n );\r\n }",
"public function setup_actions() {}",
"function addAction($action)\r\n {\r\n $this->_actions[] = $action;\r\n }",
"protected function getActions() {}",
"protected function actionParamsSets() {\n\t\treturn array();\n\t}",
"public function SetControllerAction ($controllerAction);",
"public function setAction(string $action, ...$args)\n {\n // CUSTOMIZE ADD 2012/04/22 ryuring\n // >>>\n $_action = $this->request->getParam('action');\n // <<<\n\n $this->request->withParam('action', $action);\n $args = func_get_args();\n unset($args[0]);\n\n // CUSTOMIZE MODIFY 2012/04/22 ryuring\n // >>>\n //return call_user_func_array(array($this, $action), $args);\n // ---\n $return = call_user_func_array([$this, $action], $args);\n $this->request->withParam('action', $_action);\n return $return;\n // <<<\n }",
"public function process() {\r\n if(!in_array($this->getRouter()->getAction(), $this->getAllowActions()) || $this->getRouter()->getAction() == null) {\r\n $this->defaultAction();\r\n } else {\r\n $customAction = $this->getRouter()->getAction().Globals::getConfig()->action->suffix;\r\n $this->$customAction();\r\n }\r\n }",
"private function parseActions()\n {\n // default controller actions\n $actions = array_keys($this->getObject()->actions());\n $actionMethods = array_filter($this->reflection->getMethods(),\n function ($method) {\n // should match all methods named actionSomeAction\n return preg_match('/action([A-Z]{1}[a-zA-Z]+)/', $method->name, $matches);\n });\n $actionMethods = array_map(function ($method) {\n return Inflector::slug(str_replace('action', '', $method->name));\n }, $actionMethods);\n $actionMethods = array_merge($actions, $actionMethods);\n\n return array_intersect(['index', 'view', 'create', 'update', 'delete', 'options'], $actionMethods);\n }",
"public function testMethodIndexAction()\n {\n $route = new Route();\n\n $route->set(null, null, null, \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n\n $route->set(null, null, \"\", \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n\n $route->set(null, \"\", null, \"Anax\\Route\\MockHandlerController\");\n $this->assertTrue($route->match(\"\"));\n $res = $route->handle(\"\");\n $this->assertEquals(\"indexAction\", $res);\n }",
"public function setActionRoute($route, $params = null)\n {\n // Store routename for later use\n $this->route = $route;\n\n // Compile route and set url as action url\n $this->attribute['action'] = Url::factory($route, $params)->getUrl();\n\n return $this;\n }",
"function action(string $method, string $path, callable ...$handlers): array {\n $regexp = '@^'.preg_replace('@:(\\w+)@', '(?<\\1>[^/]+)', $path).'$@';\n return [strtoupper($method), $regexp, $handlers];\n}",
"private function setGoalsArray($action) {\r\n $post_array = json_decode($this->requestParameters);\r\n $type = array_search($post_array->type, $this->type_array);\r\n $name = array_key_exists('name', $post_array) ? $post_array->name : '';\r\n $param = 'NA';\r\n\r\n if ($action == 'POST' && !$type) {\r\n throw new Exception('type: \"' . $post_array->type . '\"', 400004);\r\n }\r\n\r\n if (in_array($type, $this->param_types) && $this->projecttype != OPT_TESTTYPE_TEASER) {\r\n $param = array_key_exists('param', $post_array) ? $post_array->param : FALSE;\r\n if (!$param || trim($param) == '') {\r\n throw new Exception('For this goal type, the field \"param\" is mandatory.', 400600);\r\n }\r\n }\r\n\r\n return array(\r\n 'type' => $type,\r\n 'arg1' => $param,\r\n 'name' => $name,\r\n );\r\n }",
"public function defaultRouting($routeNameSpace = null)\n {\n //just call the parent\n $this->all('**', function($request, $response) use ($routeNameSpace) {\n //if there is already a body or action\n if($response->isKey('body') || $request->isKey('action')) {\n //do nothing\n return;\n }\n\n //determine the route namespace\n $routeNameSpace = $this->routeNameSpace;\n\n if(!$routeNameSpace) {\n $routeNameSpace = $this->rootNameSpace;\n }\n\n $prefix = $routeNameSpace . '\\\\Action';\n $root = $this->registry()->get('path', 'action');\n\n $path = $request['path']['string'];\n $path = substr($path, strlen($this->rootUrl));\n $array = explode('/', $path);\n\n $variables = array();\n $action = null;\n $buffer = $array;\n\n while(count($buffer) > 1) {\n $parts = ucwords(implode(' ', $buffer));\n\n //try to see if it's callable\n $file = $root.str_replace(' ', '/', $parts).'.php';\n\n if(file_exists($file)) {\n $contents = include($file);\n if(is_callable($contents)) {\n $action = $contents;\n break;\n }\n }\n\n //try to see if it's a class\n $class = $prefix.str_replace(' ', '\\\\', $parts);\n\n if(class_exists($class)) {\n $action = $class;\n break;\n }\n\n $variable = array_pop($buffer);\n array_unshift($variables, $variable);\n }\n\n if(!$action || !class_exists($action)) {\n $defaultAction = $this->registry()->get('config', 'default_action');\n\n if(!$defaultAction) {\n $defaultAction = 'index';\n }\n\n $defaultAction = ucwords($defaultAction);\n\n //try to see if it's callable\n $file = $root.'/'.$defaultAction.'.php';\n\n if(file_exists($file)) {\n $contents = include($file);\n if(is_callable($contents)) {\n $action = $contents;\n }\n }\n\n //try to see if it's a class\n $default = $prefix.'\\\\'.$defaultAction;\n\n if(class_exists($default)) {\n $action = $default;\n }\n }\n\n //set the variables if it has not been set\n if(!$request->isKey('variables')) {\n $request->set('variables', $variables);\n }\n\n //if we have an action\n if($action) {\n //set the action\n $response->set('action', $action);\n }\n });\n\n return $this;\n }",
"public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }",
"public function setAction()\n\t{\n\t\treturn $this;\n\t}",
"protected function _setForcedFormKeyActions($actionNames)\n {\n $actionNames = (is_array($actionNames)) ? $actionNames: (array)$actionNames;\n $actionNames = array_merge($this->_forcedFormKeyActions, $actionNames);\n $actionNames = array_unique($actionNames);\n $this->_forcedFormKeyActions = $actionNames;\n }",
"function addRedirectorAction(&$actionArray = [])\n{\n $actionArray['go'] = ['Mod-Redirector.php', 'showRedirectorPage'];\n}",
"public function getActions(): array;",
"private function actions()\n {\n }",
"protected function setAfterSaveRoute()\n {\n // Default is just go to the index\n if ($this->routeAction) {\n $this->afterSaveRouteUrl[$this->request->getActionKey()] = $this->routeAction;\n }\n $this->afterSaveRouteUrl['controller'] = $this->request->getControllerName();\n }",
"protected function _postConstruct()\n {\n parent::_postConstruct();\n $this->_uri = Solar::factory('Solar_Uri_Action');\n }",
"public function clearAction() {\n\t\t$this->actionlist = null;\n\t}",
"public function route($action) {\n\t\tswitch($action) {\n\t\t\tcase 'polls':\n\t\t\t\t$this->polls();\n\t\t\t\tbreak;\n\n\t\t\tcase 'editpoll':\n\t\t\t\t$this->editpoll();\n\t\t\t\tbreak;\n\t\t\tcase 'editpoll_submit':\n\t\t\t\t$this->editpoll_submit();\n\t\t\t\tbreak;\n\n\t\t\tcase 'newpoll':\n\t\t\t\t$this->newpoll();\n\t\t\t\tbreak;\n\t\t\tcase 'newpoll_submit':\n\t\t\t\t$this->newpoll_submit();\n\t\t\t\tbreak;\n\n\t\t\tcase 'deletepoll':\n\t\t\t\t$this->deletepoll();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected function init_view_actions() {\n\t\t$this->view_actions = array(\n\t\t\t'list' => array(\n\t\t\t\t'show_entry' => true,\n\t\t\t\t'page_title' => __( 'All Tables', 'iggogrid' ),\n\t\t\t\t'admin_menu_title' => __( 'All Tables', 'iggogrid' ),\n\t\t\t\t'nav_tab_title' => __( 'All Tables', 'iggogrid' ),\n\t\t\t\t'required_cap' => 'iggogrid_list_tables',\n\t\t\t),\n\t\t\t'add' => array(\n\t\t\t\t'show_entry' => true,\n\t\t\t\t'page_title' => __( 'Add New Table', 'iggogrid' ),\n\t\t\t\t'admin_menu_title' => __( 'Add New Table', 'iggogrid' ),\n\t\t\t\t'nav_tab_title' => __( 'Add New', 'iggogrid' ),\n\t\t\t\t'required_cap' => 'iggogrid_add_tables',\n\t\t\t),\n\t\t\t'edit' => array(\n\t\t\t\t'show_entry' => false,\n\t\t\t\t'page_title' => __( 'Edit Table', 'iggogrid' ),\n\t\t\t\t'admin_menu_title' => '',\n\t\t\t\t'nav_tab_title' => '',\n\t\t\t\t'required_cap' => 'iggogrid_edit_tables',\n\t\t\t),\n// \t\t\t'options' => array(\n// \t\t\t\t'show_entry' => true,\n// \t\t\t\t'page_title' => __( 'Plugin Options', 'iggogrid' ),\n// \t\t\t\t'admin_menu_title' => __( 'Plugin Options', 'iggogrid' ),\n// \t\t\t\t'nav_tab_title' => __( 'Plugin Options', 'iggogrid' ),\n// \t\t\t\t'required_cap' => 'iggogrid_access_options_screen',\n// \t\t\t),\n// \t\t\t'about' => array(\n// \t\t\t\t'show_entry' => true,\n// \t\t\t\t'page_title' => __( 'About', 'iggogrid' ),\n// \t\t\t\t'admin_menu_title' => __( 'About IggoGrid', 'iggogrid' ),\n// \t\t\t\t'nav_tab_title' => __( 'About', 'iggogrid' ),\n// \t\t\t\t'required_cap' => 'iggogrid_access_about_screen',\n// \t\t\t),\n\t\t);\n\n\t\t/**\n\t\t * Filter the available TablePres Views/Actions and their parameters.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $view_actions The available Views/Actions and their parameters.\n\t\t */\n\t\t$this->view_actions = apply_filters( 'iggogrid_admin_view_actions', $this->view_actions );\n\t}",
"private function add($key, array $value)\n {\n $method = $value['on'];\n unset($value['on']);\n $this->routes[] = [$method, $key, $value];\n }"
]
| [
"0.6876153",
"0.6710447",
"0.6499001",
"0.6424224",
"0.63546836",
"0.60172606",
"0.5990883",
"0.5979981",
"0.59760106",
"0.59729964",
"0.58517265",
"0.58485156",
"0.5847882",
"0.580437",
"0.57940024",
"0.5771328",
"0.5771328",
"0.57663715",
"0.57537097",
"0.5750952",
"0.57229847",
"0.57044005",
"0.5694918",
"0.5693355",
"0.5690652",
"0.5690597",
"0.5678138",
"0.56670743",
"0.56664836",
"0.56396097",
"0.56277615",
"0.56179374",
"0.5600033",
"0.5594619",
"0.5590241",
"0.5577518",
"0.5570102",
"0.5549766",
"0.55407286",
"0.55277985",
"0.55161554",
"0.55128205",
"0.55128145",
"0.551188",
"0.54996103",
"0.549406",
"0.5462207",
"0.5443249",
"0.54266995",
"0.54191554",
"0.54080266",
"0.5407855",
"0.5405518",
"0.5404683",
"0.53964275",
"0.53959286",
"0.5385997",
"0.53789043",
"0.5378441",
"0.5376208",
"0.53734773",
"0.533574",
"0.53242326",
"0.5312361",
"0.53122956",
"0.52982515",
"0.52961636",
"0.52858007",
"0.5265648",
"0.52411306",
"0.52385175",
"0.5231771",
"0.5227818",
"0.52254117",
"0.5224983",
"0.5222535",
"0.5211381",
"0.5203104",
"0.5195992",
"0.519577",
"0.5190104",
"0.5187744",
"0.51778126",
"0.5166681",
"0.51626605",
"0.5145749",
"0.51361686",
"0.51323617",
"0.51288426",
"0.5127473",
"0.51249254",
"0.5123281",
"0.51213455",
"0.51126564",
"0.5111913",
"0.5110961",
"0.509655",
"0.5086271",
"0.5085186",
"0.5078394"
]
| 0.6493624 | 3 |
Determine if the route has parameters. | public function hasParameters()
{
return isset($this->parameters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}",
"public function hasParameters()\n {\n return !empty($this->params);\n }",
"private function hasRouteParameters($route) {\n\n if (preg_match(\"/\\/:/\", $route)) {\n return true;\n }\n\n return false;\n }",
"public function hasParams(){\n return $this->_has(8);\n }",
"public function hasParameters()\n {\n return preg_match('/\\{/', $this->pattern) === 1;\n }",
"public function hasParameters()\n {\n return count($this->parameters) > 0;\n }",
"public function hasParameters()\n {\n return isset($this->parameters) && count($this->parameters) > 0;\n }",
"public function has_parameters() {\r\n\t\treturn (sizeof($this->parameters) > 0);\r\n\t}",
"public function hasParameters(){\n return $this->_has(2);\n }",
"public function testGetRouteParamWhenExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n $this->assertEquals('anderson', $route->getParam('last'));\n }",
"public function hasParameters() {\n $count = count($this->getParameters());\n \n return ($count > 0) ? $count : FALSE;\n }",
"public function hasRoute(): bool;",
"public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasSwitchParam(): bool\n {\n return $this->request && $this->request->query->has($this->switchParam);\n }",
"private function hasParams($request)\n {\n preg_match_all($this->regex, $this->uri, $uri_);\n\n if (count($uri_[0]) !== 0) {\n return $this->setParams($request);\n }\n return false;\n }",
"function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }",
"public function hasBodyParams()\n {\n if (!empty($this->bodyParams)) {\n return true;\n }\n return false;\n }",
"function getRouteParameters();",
"public function hasRoute(): bool\n {\n return isset($this->route);\n }",
"public function IsAccessParams ()\n {\n if (($this->token_type != null) && ($this->access_token != null)) {\n return TRUE;\n }\n return FALSE;\n }",
"public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }",
"public function getRouteParams();",
"public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }",
"function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }",
"public function hasParam($name);",
"function test_rest_route_query_var() {\n\t\trest_api_init();\n\t\t$this->assertTrue( in_array( 'rest_route', $GLOBALS['wp']->public_query_vars, true ) );\n\t}",
"function isTheseParametersAvailable($params){\n\t\t\n\t\t//traversing through all the parameters \n\t\tforeach($params as $param){\n\t\t\t//if the paramter is not available\n\t\t\tif(!isset($_POST[$param])){\n\t\t\t\t//return false \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\t//return true if every param is available \n\t\treturn true; \n\t}",
"private static function exist_required_vars() : bool\n\t{\n\t\tif(count(self::$RouteURI['VARS']['QUERY']['REQUIRED']) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function hasOptionalParameters()\n {\n foreach ($this->parameters as $parameter) {\n if (!$parameter->isRequired()) {\n return true;\n }\n }\n\n return false;\n }",
"public function testGetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->getParam('foo');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }",
"public function hasRequestParameter($name)\n {\n return $this->request_parameter_holder->has($name);\n }",
"public function hasRequiredParameters()\n {\n foreach ($this->parameters as $parameter) {\n if ($parameter->isRequired()) {\n return true;\n }\n }\n\n return false;\n }",
"public function testGetRouteParams()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get params\n $params = $route->getParams();\n $this->assertEquals(2, count($params));\n $this->assertEquals('mr', $params['first']);\n $this->assertEquals('anderson', $params['last']);\n }",
"private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function is_current_route() {\n\t\tforeach ( array_keys( $this->query_vars ) as $query_var ) {\n\t\t\tif ( get_query_var( $query_var, self::FALSE_HASH ) === self::FALSE_HASH ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public function paramExists (string $key)\n {\n if (array_key_exists($key, $this->getParams()))\n return true;\n\n return false;\n }",
"protected function verifyParams() {\n\t\t\treturn true;\n\t\t}",
"private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }",
"public function hasParam($name)\n {\n return (isset($this->params[$name]));\n }",
"public static function hasParams(UriInterface $uri, string ...$keys): bool\n {\n return [] === array_diff_key(array_flip($keys), self::getParams($uri));\n }",
"public function execute(Request $request, Route $route) : bool{\n\n $pattern = str_replace('{', '(?P<', str_replace('}', '>[a-zA-Z0-9-_.,:;()]+)', $route->getUrlPattern()));\n $matches = [];\n\n if(preg_match('#^'.$pattern.'$#', $request->getUrl()->getUri(), $matches)){\n foreach($matches as $key => $value){\n if(!is_int($key)){\n $request->getParameters()->add($key, $value);\n }\n }\n return true;\n }\n return false;\n }",
"public function hasParam($name)\n {\n return isset($this->params[$name]);\n }",
"private function verifyParams( Array $params ) {\r\n $slot_count = substr_count( $this -> query_string, '?' );\r\n $param_count = count( $params );\r\n return ($slot_count == $param_count) ? true : false;\r\n }",
"protected function has_parameter( $name ) {\n\t\treturn ! empty( $this->parameters[ $name ] );\n\t}",
"function check_required_param($param = array(),$method){\n //set up method\n if (strtolower($method) == \"post\"){\n $r = $_POST;\n }else if (strtolower($method) == \"get\"){\n $r = $_GET;\n }\n //check of required param\n foreach ($param as $par){\n if (!isset($r[$par]) || empty($r[$par])){\n return false;\n break;\n }\n }\n return true;\n}",
"public function hasParameter($name);",
"public function hasParameter($name);",
"public function match(): bool\n {\n $uri = $_SERVER['REQUEST_URI'];\n $parse = parse_url($uri);\n $url = trim($parse['path'] ?? '', '/');\n foreach ($this->routes as $route => $params) {\n if (preg_match($route, $url, $matches)) {\n $this->params = $params;\n return true;\n }\n }\n return false;\n }",
"function getParamInfo() {\n\t\treturn FALSE;\n\t}",
"public function hasMethod() : bool\n {\n return array_key_exists($this->request->getMethod(), $this->routes);\n }",
"public function has_param($key)\n {\n }",
"public function testRouteDoesNotMatchAndParamsNotExtracted()\n {\n $resource = '/foo/bar';\n $route = new \\Slim\\Route('/hello/:name', function () {});\n $result = $route->matches($resource);\n $this->assertFalse($result);\n $this->assertEquals(array(), $route->getParams());\n }",
"function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }",
"public function testGettingParametersFromRoute(): void\n {\n // setup\n $requestParams = $this->getRequestParamsMock();\n\n // test body\n /** @var int $param */\n $param = $requestParams->getParam('rparam');\n\n // assertions\n $this->assertEquals(111, $param);\n }",
"protected function checkParameters()\n\t{\n\t\t$this->dbResult['REQUEST'] = array(\n\t\t\t'GET' => $this->request->getQueryList()->toArray(),\n\t\t\t'POST' => $this->request->getPostList()->toArray(),\n\t\t);\n\n\t\t$this->arParams['PATH_TO_LOCATIONS_LIST'] = CrmCheckPath('PATH_TO_LOCATIONS_LIST', $this->arParams['PATH_TO_LOCATIONS_LIST'], '');\n\t\t$this->arParams['PATH_TO_LOCATIONS_EDIT'] = CrmCheckPath('PATH_TO_LOCATIONS_EDIT', $this->arParams['PATH_TO_LOCATIONS_EDIT'], '?loc_id=#loc_id#&edit');\n\t\t//$this->arParams['PATH_TO_LOCATIONS_ADD'] = CrmCheckPath('PATH_TO_LOCATIONS_ADD', $this->arParams['PATH_TO_LOCATIONS_ADD'], '?add');\n\t\t\n\t\t$this->componentData['LOCATION_ID'] = isset($this->arParams['LOC_ID']) ? intval($this->arParams['LOC_ID']) : 0;\n\n\t\tif($this->componentData['LOCATION_ID'] <= 0)\n\t\t{\n\t\t\t$locIDParName = isset($this->arParams['LOC_ID_PAR_NAME']) ? intval($this->arParams['LOC_ID_PAR_NAME']) : 0;\n\n\t\t\tif($locIDParName <= 0)\n\t\t\t\t$locIDParName = 'loc_id';\n\n\t\t\t$this->componentData['LOCATION_ID'] = isset($this->dbResult['REQUEST']['GET'][$locIDParName]) ? intval($this->dbResult['REQUEST']['GET'][$locIDParName]) : 0;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function getIsUrlParametersAccepted(): bool;",
"public function hasBodyParam($name)\n {\n if (isset($this->bodyParams[$name])) {\n return true;\n }\n return false;\n }",
"public static function route_exists($route){\n $route_parts = explode('/', trim($route, '/'));\n $total_size = count($route_parts);\n\n $possible_routes = array_filter(Router::$routes[$_SERVER['REQUEST_METHOD']], function ($route, $key) use ($total_size) {\n return $route['total_size'] === $total_size;\n }, ARRAY_FILTER_USE_BOTH);\n\n asort($possible_routes);\n\n foreach( $possible_routes as $key => $possible_route ){\n $new_key = explode('/', $key);\n $new_key = array_slice($new_key, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n $new_route = explode('/', $route);\n $new_route = array_slice($new_route, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n if( $new_key === $new_route ){\n if( $possible_route['params_number'] > 0 ){\n $possible_route['params'] = array_slice($route_parts, - $possible_route['params_number'] );\n } else {\n $possible_route['params'] = [];\n }\n return $possible_route;\n }\n }\n return false;\n }",
"public function hasParam($index): bool\n {\n return isset($this->params[$index]);\n }",
"public function test_param()\n\t{\n\t\t$uri = 'foo/bar/id';\n\t\t$request = Request::factory($uri, NULL, array($this->_get_inject_route()));\n\n\t\t$this->assertArrayHasKey('id', $request->param());\n\t\t$this->assertArrayNotHasKey('foo', $request->param());\n\t\t$this->assertEquals( (string) $request->uri(), $uri);\n\n\t\t// Ensure the params do not contain contamination from controller, action, route, uri etc etc\n\t\t$params = $request->param();\n\n\t\t// Test for illegal components\n\t\t$this->assertArrayNotHasKey('controller', $params);\n\t\t$this->assertArrayNotHasKey('action', $params);\n\t\t$this->assertArrayNotHasKey('directory', $params);\n\t\t$this->assertArrayNotHasKey('uri', $params);\n\t\t$this->assertArrayNotHasKey('route', $params);\n\n\t\t$route = new Route('(<uri>)', array('uri' => '.+'));\n\t\t$route->defaults(array('controller' => 'foobar', 'action' => 'index'));\n\t\t$request = Request::factory('foobar', NULL, array($route));\n\n\t\t$this->assertSame('foobar', $request->param('uri'));\n\t}",
"public function hasParameter($name)\n {\n return array_key_exists($name, $this->parameters);\n }",
"public function hasRoute(string $name): bool;",
"public function isEmpty()\n {\n return (!is_array($this->params) || count($this->params) == 0);\n }",
"public function hasParameter($param)\n {\n return array_key_exists($param, $this->params);\n }",
"public function hasParameter($name)\n {\n return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);\n }",
"public function hasQuery()\n {\n if (func_num_args() == 0) {\n return !empty($this->query);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->query, $key)) {\n return false;\n }\n }\n\n return true;\n }",
"public function testSetRouteParamWhenExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n $this->assertEquals('anderson', $route->getParam('last'));\n\n // Set param\n $route->setParam('last', 'smith');\n\n // Get new param\n $this->assertEquals('smith', $route->getParam('last'));\n }",
"function cpay_CheckGet($params) {\r\n $result = true;\r\n if (!empty($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty($_GET[$eachparam])) {\r\n $result = false;\r\n }\r\n } else {\r\n $result = false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n}",
"function isParam($name) {\r\n return ( getParam($name) != false );\r\n}",
"function isTheseParametersAvailable($params){\n //assuming all parameters are available \n $available = true; \n $missingparams = \"\"; \n \n foreach($params as $param){\n if(!isset($_POST[$param]) || strlen($_POST[$param])<=0){\n $available = false; \n $missingparams = $missingparams . \", \" . $param; \n }\n }\n \n //if parameters are missing \n if(!$available){\n $response = array(); \n $response['error'] = true; \n $response['message'] = 'Parameters ' . substr($missingparams, 1, strlen($missingparams)) . ' missing';\n \n //displaying error\n echo json_encode($response);\n \n //stopping further execution\n die();\n }\n }",
"private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function present(): bool\n {\n return ! is_null($this->route);\n }",
"public function hasParamValue(string $name): bool;",
"final public function hasParameter($name)\n {\n return isset($this->parameters[$name]);\n }",
"function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}",
"public function has_query_params( $url ) {\n\t\t$qpos = strpos( $url, '?' );\n\n\t\tif ( $qpos === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isMethodParameter() {}",
"public function getParameterIsRedirect() {\n $params_is_redirect_page = false;\n if (isset($_SERVER['REQUEST_URI'])) {\n $uri = $_SERVER['REQUEST_URI'];\n if (strpos($uri, IS_REDIRECT_PAGE) != false) {\n $params_is_redirect_page = true;\n }\n }\n return $params_is_redirect_page;\n }",
"private function _requestHasParam(string $key, array $request)\n {\n return array_key_exists($key, $request);\n }",
"public function match(Route $route, array $parameters): bool\n {\n $exceptions = $route->getParameterExceptions();\n\n // We will loop through all the matched parameters and\n // check if we have any exception value set for the parameter.\n $filtered = array_filter($parameters, function ($parameter, $value) use ($exceptions){\n return !$this->isParameterValueException($parameter, $value, $exceptions);\n },\n ARRAY_FILTER_USE_BOTH\n );\n\n return empty(array_diff($parameters, $filtered));\n }",
"public function hasParameter(string $name): bool\n {\n return isset($this->parameters[$name]);\n }",
"public function testRouteMatchesAndParamExtracted()\n {\n $resource = '/hello/Josh';\n $route = new \\Slim\\Route('/hello/:name', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('name' => 'Josh'), $route->getParams());\n }",
"public function hasArguments() {}",
"public static function isGet()\n {\n return !empty($_GET);\n }",
"public function hasParam($param)\n {\n return isset($this->params[$param]);\n }",
"protected function applies(Route $route) {\n // Check whether there is any entity revision parameter.\n $parameters = $route->getOption('parameters') ?: [];\n foreach ($parameters as $info) {\n if (isset($info['type']) && strpos($info['type'], 'entity_revision:') === 0) {\n return TRUE;\n }\n }\n return FALSE;\n }",
"public function hasPost()\n {\n if (func_num_args() == 0) {\n return !empty($this->post);\n }\n\n foreach (func_get_args() as $key) {\n if (!$this->hasParam($this->post, $key)) {\n return false;\n }\n }\n\n return true;\n }",
"public function testHasParameters0()\n{\n\n $actual = $this->route->hasParameters();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function hasParameter ($name)\n {\n\n return isset($this->parameters[$name]);\n\n }",
"public function has($key): bool\n {\n return array_key_exists($key, $this->params);\n }",
"public function hasParameter(string $id): bool\n {\n return isset($this->getParameters()[$id]);\n }",
"protected function isValidParams($uri, $routeParams, $uriParams)\n {\n $result = true;\n $isArray = false;\n\n if ($this->strict) {\n $requestParams = $this->request->getPath();\n $stems = explode('/', $uri);\n foreach ($stems as $stem) {\n if (($stem != '') && (in_array($stem, $requestParams))) {\n unset($requestParams[array_search($stem, $requestParams)]);\n }\n }\n\n // Handle trailing slash (last position empty)\n if (empty($requestParams[count($requestParams)])) {\n unset($requestParams[count($requestParams)]);\n }\n\n\n // If any parameter value is not set, null or empty, set to false\n foreach ($routeParams as $param) {\n if (is_array($uriParams[$param])) {\n $isArray = true;\n }\n if (is_array($uriParams[$param]) && (in_array(null, $uriParams[$param]))) {\n $result = false;\n } else if (!isset($uriParams[$param]) || empty($uriParams[$param])) {\n $result = false;\n }\n }\n\n // If the number of requested parameters do not match\n // the expected routed parameters, set to false\n if ((!$isArray) && (count($requestParams) != count($routeParams))) {\n $result = false;\n }\n }\n\n return $result;\n }",
"public function hasArguments(): bool;",
"public function matchesRequest()\n {\n return $this->event->get('AccountSid') && !(is_null($this->event->get('Latitude')) || is_null($this->event->get('Longitude')));\n }"
]
| [
"0.8160327",
"0.759903",
"0.7590689",
"0.74325216",
"0.73293805",
"0.7289803",
"0.7267398",
"0.7214958",
"0.72129273",
"0.7127522",
"0.7053506",
"0.7048757",
"0.7030774",
"0.69807875",
"0.69807875",
"0.69807875",
"0.69807875",
"0.69807875",
"0.6886911",
"0.67940414",
"0.67334694",
"0.6704089",
"0.6675781",
"0.66669",
"0.6666237",
"0.66467845",
"0.6603441",
"0.6590423",
"0.6585658",
"0.6565622",
"0.65619457",
"0.6541831",
"0.6519132",
"0.6511833",
"0.64854383",
"0.6472773",
"0.64639926",
"0.64429253",
"0.6441834",
"0.6398612",
"0.63916117",
"0.6383641",
"0.63791907",
"0.63565975",
"0.6352823",
"0.63420993",
"0.63292485",
"0.63237137",
"0.62877595",
"0.6277439",
"0.6259004",
"0.6217153",
"0.6217153",
"0.6214275",
"0.62086976",
"0.6201076",
"0.6187059",
"0.6163617",
"0.61585134",
"0.61283153",
"0.61256754",
"0.6100627",
"0.60999846",
"0.6092733",
"0.6087005",
"0.6078088",
"0.6076642",
"0.60755146",
"0.6071513",
"0.6061159",
"0.6060175",
"0.60527647",
"0.60321176",
"0.60281533",
"0.6017721",
"0.6013286",
"0.6009308",
"0.5998577",
"0.5996966",
"0.5991262",
"0.59661317",
"0.5961157",
"0.5950097",
"0.5930104",
"0.5906123",
"0.58886456",
"0.5880015",
"0.5878195",
"0.58727306",
"0.585711",
"0.58473504",
"0.5835039",
"0.5834847",
"0.58314323",
"0.58217674",
"0.58061934",
"0.57916236",
"0.57868606",
"0.57862127",
"0.57847255"
]
| 0.72284526 | 7 |
Determine a given parameter exists from the route. | public function hasParameter($name)
{
if ($this->hasParameters()) {
return array_key_exists($name, $this->parameters());
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetRouteParamWhenExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n $this->assertEquals('anderson', $route->getParam('last'));\n }",
"function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}",
"public function parameterExists($key);",
"public function parameterExist($parameterName) {\n $result = array_key_exists($parameterName, $this->params);\n return $result;\n }",
"public function paramExists (string $key)\n {\n if (array_key_exists($key, $this->getParams()))\n return true;\n\n return false;\n }",
"public function hasParam($name);",
"public function hasParameter($param)\n {\n return array_key_exists($param, $this->params);\n }",
"public function hasParameter($name);",
"public function hasParameter($name);",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam(){\n return $this->_has(2);\n }",
"public function hasParam($param)\n {\n return isset($this->params[$param]);\n }",
"public function hasRequestParameter($name)\n {\n return $this->request_parameter_holder->has($name);\n }",
"public function exists($parameter);",
"function route_param(string $name)\n{\n $params = RouteController::getCurrentRoute()['params'];\n\n if ($params) {\n foreach ($params as $param) {\n if ($param['name'] == $name) {\n return $param['value'];\n }\n }\n }\n\n return null;\n}",
"public function hasParam($name)\n {\n return isset($this->params[$name]);\n }",
"function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }",
"function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }",
"public function hasParam($name)\n {\n return (isset($this->params[$name]));\n }",
"public function hasParamValue(string $name): bool;",
"public function offsetExists($param)\n\t{\n\t\treturn isset($this->params[(string) $param]);\n\t}",
"private function hasParam(string $parameter): bool\n {\n return in_array($parameter, $this->queryParameters);\n }",
"private function hasRouteParameters($route) {\n\n if (preg_match(\"/\\/:/\", $route)) {\n return true;\n }\n\n return false;\n }",
"public function matchedParam($param)\n {\n if (! is_array($this->matches)) {\n return false;\n }\n return array_key_exists($param, $this->matches);\n }",
"public function hasParam($index): bool\n {\n return isset($this->params[$index]);\n }",
"public static function route_exists($route){\n $route_parts = explode('/', trim($route, '/'));\n $total_size = count($route_parts);\n\n $possible_routes = array_filter(Router::$routes[$_SERVER['REQUEST_METHOD']], function ($route, $key) use ($total_size) {\n return $route['total_size'] === $total_size;\n }, ARRAY_FILTER_USE_BOTH);\n\n asort($possible_routes);\n\n foreach( $possible_routes as $key => $possible_route ){\n $new_key = explode('/', $key);\n $new_key = array_slice($new_key, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n $new_route = explode('/', $route);\n $new_route = array_slice($new_route, 0 , $possible_route['total_size']-$possible_route['params_number']);\n\n if( $new_key === $new_route ){\n if( $possible_route['params_number'] > 0 ){\n $possible_route['params'] = array_slice($route_parts, - $possible_route['params_number'] );\n } else {\n $possible_route['params'] = [];\n }\n return $possible_route;\n }\n }\n return false;\n }",
"public function has_param($key)\n {\n }",
"public function __isset($param)\r\n {\r\n // Get all of our request params\r\n $params = $this->params();\r\n\r\n return isset($params[$param]);\r\n }",
"public function hasParameter($name)\n {\n return array_key_exists($name, $this->parameters);\n }",
"public function testGetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->getParam('foo');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }",
"public function hasSwitchParam(): bool\n {\n return $this->request && $this->request->query->has($this->switchParam);\n }",
"final public function hasParameter($name)\n {\n return isset($this->parameters[$name]);\n }",
"public function hasParameter($name)\n {\n return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);\n }",
"function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function testSetRouteParamWhenExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n $this->assertEquals('anderson', $route->getParam('last'));\n\n // Set param\n $route->setParam('last', 'smith');\n\n // Get new param\n $this->assertEquals('smith', $route->getParam('last'));\n }",
"public function has($param, $path = 'global')\n\t{\n\t\treturn array_key_exists($path, $this->data) && array_key_exists($param, $this->data[$path]);\n\t}",
"public function hasParameter($parameterName)\n {\n return isset($this->parameters[$parameterName]);\n }",
"public function hasParameter ($name)\n {\n\n return isset($this->parameters[$name]);\n\n }",
"public function has(string $parameterName)\n {\n return isset($this->parameters[$parameterName]);\n }",
"public function hasParameter($name)\n {\n return array_key_exists($name, $this->config);\n }",
"private function _requestHasParam(string $key, array $request)\n {\n return array_key_exists($key, $request);\n }",
"public function paramExists($param)\n {\n $result = (new Query())\n ->select(new Expression('1'))\n ->from('uuid_param')\n ->where([\n 'uuid' => $this->getUuid(),\n 'param' => $param,\n ])\n ->scalar();\n return $result;\n }",
"protected function has_parameter( $name ) {\n\t\treturn ! empty( $this->parameters[ $name ] );\n\t}",
"public function has($name)\r\n {\r\n return array_key_exists($name, $this->parameters);\r\n }",
"public function hasParameter(string $name): bool\n {\n return isset($this->parameters[$name]);\n }",
"public function has($name)\n {\n return array_key_exists($name, $this->params);\n }",
"public function has(String $name)\n {\n return isset($this->parameters[$name]);\n }",
"function resolve($route)\n{\n $path = $_SERVER['PATH_INFO'] ?? '/';\n\n $route = '/^' . str_replace('/', '\\/', $route) . '$/';\n\n if (preg_match($route, $path, $params)) {\n return $params;\n }\n return false;\n}",
"public function hasParameter(string $id): bool\n {\n return isset($this->getParameters()[$id]);\n }",
"public function hasRoute(): bool;",
"public function has($key): bool\n {\n return array_key_exists($key, $this->params);\n }",
"public static function getRouteVariable($parameter) {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $parameter);\n\n\t\t$parameter = self::_applyFilter(get_class(), __FUNCTION__, $parameter, array('event' => 'args'));\n\n\t\tif (isset(self::$route_parameters[$parameter])) {\n\t\t\tself::_notify(get_class() . '::' . __FUNCTION__, $parameter, self::$route_parameters[$parameter]);\n\t\t\t$found_parameter = self::_applyFilter(get_class(), __FUNCTION__, self::$route_parameters[$parameter], array('event' => 'return'));\n\n\t\t\treturn $found_parameter;\n\t\t}\n\t}",
"public function hasParameter($name)\n {\n if ($this->hasParameters()) {\n return array_key_exists($name, $this->getParameters());\n }\n\n return false;\n }",
"public function hasParameter($name, $ns = null)\r\n {\r\n return $this->parameterHolder->has($name, $ns);\r\n }",
"public function hasParameters()\n {\n return preg_match('/\\{/', $this->pattern) === 1;\n }",
"public function execute(Request $request, Route $route) : bool{\n\n $pattern = str_replace('{', '(?P<', str_replace('}', '>[a-zA-Z0-9-_.,:;()]+)', $route->getUrlPattern()));\n $matches = [];\n\n if(preg_match('#^'.$pattern.'$#', $request->getUrl()->getUri(), $matches)){\n foreach($matches as $key => $value){\n if(!is_int($key)){\n $request->getParameters()->add($key, $value);\n }\n }\n return true;\n }\n return false;\n }",
"function parse_param_exists($param_key, $data, $debug = false) {\n\n\n if ($debug) {\n echo __FUNCTION__ . \" \";\n print_r(compact('param_key', 'data'));\n }\n $chain = $this->parse_param_chain($param_key);\n switch (count($chain)) {\n case 1:\n return array_key_exists($param_key, $data);\n break;\n case 2:\n return\n array_key_exists($chain[0], $data) &&\n array_key_exists($chain[1], $data[$chain[0]]);\n break;\n case 3:\n return\n array_key_exists($chain[0], $data) &&\n array_key_exists($chain[1], $data[$chain[0]]) &&\n array_key_exists(\n $chain[2], $data[$chain[0]][$chain[1]]);\n break;\n case 4:\n return\n array_key_exists($chain[0], $data) &&\n array_key_exists($chain[1], $data[$chain[0]]) &&\n array_key_exists(\n $chain[2], $data[$chain[0]][$chain[1]]) &&\n array_key_exists(\n $chain[3], $data[$chain[0]][$chain[1]][$chain[2]]);\n break;\n }\n return false;\n }",
"public function hasParameter(string $id): bool\n {\n return $this->exists($id, self::DEFINITION_PARAMETER);\n }",
"public function checkParams()\n {\n if (!isset($_GET['params'])) {\n die($this->error('404'));\n } else {\n $id = $_GET['params'];\n }\n }",
"public function testSetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->setParam('foo', 'bar');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }",
"public function hasRoute(string $name): bool;",
"function isParam($name) {\r\n return ( getParam($name) != false );\r\n}",
"public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}",
"function hasParam($setting) {\n list($class, $param) = explode('::',$setting);\n if (class_exists($class, false)) {\n $class = new ReflectionClass($class);\n return $class->getConstant($param);\n }\n return false;\n}",
"public function hasNamedParameter($name)\n {\n return isset($this->namedParameters[strtolower($name)]);\n }",
"public function getExists($key) {\n return isset($_GET[$key]);\n }",
"public function getUriParameter($key) {\n $on_console = $this->getRequest() instanceof \\Zend\\Console\\Request;\n\n if( !$on_console and $this->params()->fromQuery($key) != null )\n return $this->params()->fromQuery($key);\n if( $this->getEvent()->getRouteMatch()->getParam($key) != null )\n return $this->getEvent()->getRouteMatch()->getParam($key);\n return false;\n }",
"public function hasDynamicParameter(string $parameter): bool\n {\n $this->buildDynamicParameters();\n\n return $this->dynamicParameters->offsetExists($parameter);\n }",
"public function routeExists($name)\n {\n $router = $this->container->get('router');\n $res = (null === $router->getRouteCollection()->get($name)) ? 0 : 1;\n return $res;\n\n }",
"public function key_exists($key) {\n return in_array($key, array_keys($this->params));\n }",
"private function _has($param)\n {\n return !empty($this->$param);\n }",
"public function __isset( $param ) {\n\t\treturn isset( $_REQUEST[ $param ] );\n\t}",
"public function hasParameter($parameters) {\n\t\ttry {\n\t\t\t$value = $this->getParameter($parameters);\n\t\t} catch (\\Exception $e) {\n\t\t\t$value = null;\n\t\t}\n\t\treturn isset($value);\n\t}",
"public function get_parameter($parameter) {\n\t if (isset($this->decodedWebhook['queryResult']['parameters'][$parameter])) {\n\t\t return $this->decodedWebhook['queryResult']['parameters'][$parameter];\n\t }\n\t\treturn false;\n }",
"function get_all_exists($parameters){\n foreach($parameters as $parameter){\n if(!get_exists($parameter)) return false;\n }\n return true;\n}",
"public function hasParam($name, $namespace = self::NAMESPACE_DEFAULT)\n {\n return isset($this->params[$namespace][$name]);\n }",
"public function has( $key )\n\t{\n\t\treturn $this->request->has($key);\n\t}",
"public function __isset($name)\n {\n return array_key_exists($name, $this->params);\n }",
"public static function parameterizedRouteExists($method, $url)\n {\n // Para saber si la URL que nos piden matchea con alguna URL\n // que tiene parámetros, tenemos que verificar:\n // 1. Que tengan la misma cantidad de \"partes\" (valores separados\n // por '/').\n // 2. Que las partes de la ruta que no son dinámicas (no están\n // entre llaves '{}') sea exactas entre la ruta y la URL que\n // me piden.\n // 3. Que las partes que no sean exactas, coincidan con algún\n // parámetro (entre {}). En el caso de que sea así, entonces\n // también debemos guardar el valor que corresponde a ese\n // parámetro.\n\n // Primero, explotamos la $url.\n $urlParts = explode('/', $url);\n // Ej:\n // [0] => peliculas\n // [1] => 1\n // [2] => eliminar\n\n // Recorremos todas las rutas para este\n // $method.\n foreach (self::$routes[$method] as $route => $controllerAction) {\n // Definimos una variable que guarde si la ruta matchea o no.\n // Por defecto, asumimos que sí.\n $routeMatches = true;\n\n // Explotamos la $route.\n $routeParts = explode('/', $route);\n // Ej:\n // [0] => peliculas\n // [1] => {id}\n // [2] => eliminar\n\n $urlData = [];\n\n // Verificamos que cuenten con la misma cantidad\n // de partes.\n if(count($routeParts) != count($urlParts)) {\n // Esta ruta no matchea la URL.\n $routeMatches = false;\n } else {\n // Como la ruta y la URL tienen la misma cantidad de\n // partes, entonces las recorremos y comparamos.\n foreach ($routeParts as $key => $part) {\n // Por cada parte, preguntamos si coincide la URL\n // con la ruta.\n if($routeParts[$key] != $urlParts[$key]) {\n // No son idénticas, así que hay una de dos\n // posibilidades:\n // a. Que no coinciden porque la parte de la ruta\n // es un parámetro ({}).\n // b. Que no coinciden porque la ruta no es para\n // esta URL.\n // Verificamos si es un parámetro, si tiene una {\n if(strpos($routeParts[$key], '{') === 0) {\n // En efecto esto es un parámetro.\n // Por lo tanto, debemos ir guardando la\n // parte de la URL como el parámetro de\n // la ruta.\n // Por ejemplo, para poder que el {id} de\n // la ruta coincide con el 1 de la URL.\n // Quitamos las llaves de la parte de la ruta\n // para así obtener el nombre.\n $parameterName = substr($routeParts[$key], 1, -1);\n\n // Guardamos el valor en el array de\n // $urlData.\n $urlData[$parameterName] = $urlParts[$key];\n } else {\n // No era un parámetro esta parte, ni tampoco\n // coincide con la URL, así que la ruta no\n // matchea :(\n $routeMatches = false;\n }\n }\n }\n }\n\n // Después de hacer el condicional, verificamos si la ruta\n // matchea.\n if($routeMatches) {\n // Genial, encontramos la ruta para la URL!\n // Guardamos los datos de la ruta.\n self::$controllerAction = $controllerAction;\n self::$urlParameters = $urlData;\n\n // Informamos que la encontramos.\n return true;\n }\n }\n\n // Si el bucle termina y no me fui por el true, entonces la URL\n // no matchea con ninguna ruta.\n return false;\n }",
"protected function hasAttribute(Route $route, $placeholder)\n {\n return false !== strpos($route->getPath(), $placeholder);\n }",
"public function hasParameters(){\n return $this->_has(2);\n }",
"public function has(string $name): bool\n {\n foreach ($this as $parameter) {\n if ($parameter->getName() === $name) {\n return true;\n }\n }\n\n return false;\n }",
"function get_has($key)\n{\n\treturn System::request()->getHas($key);\n}",
"public static function requireParam($name) {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET': $parameters = $_GET; break;\n\t\t\tcase 'POST': $parameters = $_POST; break;\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE': $parameters = static::getInputVars(); break;\n\t\t}\n\n\t\tif (isset($parameters[$name])) {\n\t\t\treturn $parameters[$name];\n\t\t} else {\n\t\t\tif (Application::inDevelopment()) {\n\t\t\t\tLog::debug(\"Missing {$name} parameter in {$_SERVER['REQUEST_METHOD']} request\");\n\t\t\t}\n\t\t\tApplication::error(400, 'Missing required parameter');\n\t\t}\n\t}",
"public function hasParameter($index)\n {\n return (\n isset($this->parameters[$index])\n && $this->parameters[$index] != ''\n );\n }",
"public static function checkRequest($request, $parameter)\n {\n $response = false;\n if($request->has($parameter) && $request->filled($parameter) && $request->query($parameter) != \"null\")\n {\n $response = true;\n return $response;\n };\n return $response;\n }",
"public static function hasGet($name) {\n\t\treturn isset($_GET) && isset($_GET[$name]);\n\t}",
"public function has($identifier) {\n\t\tif ($argument = $this->get($identifier)) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public function has($id): bool\n\t{\n\t\treturn array_key_exists($id, $this->params);\n\t}",
"function post_exists($parameter){\n return key_exists($parameter, $_POST) && strlen(trim($_POST[$parameter])) > 0;\n}",
"public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }",
"public function hasParameters()\n {\n return isset($this->parameters);\n }",
"public function query_exists($key) {\n\t\t\treturn \\uri\\query::exists($this->object, $key);\n\t\t}",
"public function hasRoute(): bool\n {\n return isset($this->route);\n }",
"public function hasParams(){\n return $this->_has(8);\n }",
"public function has($name)\n {\n return isset($this->routes[$name]);\n }",
"private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}"
]
| [
"0.7361733",
"0.7356438",
"0.7139996",
"0.6941192",
"0.6923943",
"0.6916978",
"0.6896284",
"0.6888483",
"0.6888483",
"0.68647563",
"0.68647563",
"0.68647563",
"0.68647563",
"0.68647563",
"0.6849074",
"0.68097657",
"0.6781514",
"0.6680295",
"0.6679921",
"0.66684955",
"0.66350406",
"0.663237",
"0.6599224",
"0.6583461",
"0.6567129",
"0.6527508",
"0.65014535",
"0.6485225",
"0.6477528",
"0.64763623",
"0.6462672",
"0.6434887",
"0.64224064",
"0.6413723",
"0.63932",
"0.63919884",
"0.6373983",
"0.6371634",
"0.63692087",
"0.6367221",
"0.6349265",
"0.633184",
"0.6326804",
"0.63264745",
"0.63201386",
"0.63164294",
"0.62956995",
"0.62649256",
"0.6244872",
"0.62296134",
"0.62000567",
"0.6196451",
"0.61930364",
"0.61763424",
"0.61427927",
"0.61058086",
"0.60934454",
"0.60823715",
"0.60769886",
"0.60737073",
"0.60334545",
"0.5995966",
"0.59738964",
"0.59515387",
"0.5946423",
"0.59418696",
"0.5937357",
"0.59349364",
"0.5933165",
"0.5920445",
"0.59144324",
"0.59068155",
"0.5903816",
"0.58984184",
"0.58709997",
"0.58708674",
"0.58565915",
"0.5811368",
"0.58066964",
"0.5805658",
"0.57878745",
"0.5781635",
"0.5749725",
"0.57484365",
"0.5747254",
"0.5743334",
"0.5738326",
"0.5737847",
"0.5728271",
"0.5723143",
"0.57102334",
"0.57096976",
"0.5694318",
"0.5688634",
"0.5677347",
"0.5677064",
"0.5667867",
"0.56617564",
"0.5659914",
"0.5659882"
]
| 0.61785346 | 53 |
Get a given parameter from the route. | public function parameter($name, $default = null)
{
return Arr::get($this->parameters(), $name, $default);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function route_param(string $name)\n{\n $params = RouteController::getCurrentRoute()['params'];\n\n if ($params) {\n foreach ($params as $param) {\n if ($param['name'] == $name) {\n return $param['value'];\n }\n }\n }\n\n return null;\n}",
"public function getParameter($name){\n\t\treturn Registry::get('router')->get($name);\n\t}",
"public static function getRouteParameter($parameter) {\n\t\treturn self::$route_parameters[self::$route_options['route'][$parameter]];\n\t}",
"public static function getRouteVariable($parameter) {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__, $parameter);\n\n\t\t$parameter = self::_applyFilter(get_class(), __FUNCTION__, $parameter, array('event' => 'args'));\n\n\t\tif (isset(self::$route_parameters[$parameter])) {\n\t\t\tself::_notify(get_class() . '::' . __FUNCTION__, $parameter, self::$route_parameters[$parameter]);\n\t\t\t$found_parameter = self::_applyFilter(get_class(), __FUNCTION__, self::$route_parameters[$parameter], array('event' => 'return'));\n\n\t\t\treturn $found_parameter;\n\t\t}\n\t}",
"public static function routeParam($name)\n\t{\n\t\tif($route = Router::getCurrentRoute()) {\n\t\t\treturn $route->getParam($name);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function getParam($param);",
"public function getParameter($param)\n {\n return $this->params[$param];\n }",
"public function get($param) {\n\t\treturn isset($_GET[$param]) ? $_GET[$param] : null;\n\t}",
"public function getParam (string $key)\n {\n return $this->params[$key];\n }",
"public function getParam(string $name)\n {\n if (! isset($this->getParameters()[$name])) {\n throw (new \\Exception('Parameter ' . $name . ' was not found in route', - 1));\n }\n\n return $this->getParameters()[$name];\n }",
"public function getParam($param)\n {\n if (isset($this->params[$param])) {\n return $this->params[$param];\n }\n }",
"protected function get_param($param) {\n if ($this->params !== null && isset($this->params[$param])) {\n return $this->params[$param];\n } else {\n $staticname = \"default$param\";\n assert(isset(static::$$staticname));\n return static::$$staticname;\n }\n }",
"function getParam($path, $variableName, $default=\"\", $remainingData=false) {\r\n\tif (isset($_GET[$variableName])) {\r\n\t\t$val = $_GET[$variableName];\r\n\t} else {\r\n\t\t$val = getParamFromPath($path, $variableName, $default, $remainingData);\r\n\t}\r\n\treturn $val!=\"\" ? $val : $default;\r\n}",
"public static function getParam() {\n\n\t}",
"function getUrlParameter($parameterName) {\n\n\t\t$parameter = null;\n\n\t\tif (isset($_GET[$parameterName]))\n\t\t\t$parameter = $_GET[$parameterName];\n\n\t\treturn $parameter;\n\n\t}",
"public function getParam($name) {\n return $this->app->getParam($name);\n }",
"public function getParam($param){\n\n if (property_exists($this, '_'.$param)){\n $param = '_'.$param;\n return $this->$param;\n } else\n return null;\n }",
"public function get($parameter)\n {\n return $this->request->input($parameter);\n }",
"public function get($parameter)\n {\n return $this->request->input($parameter);\n }",
"public function getParameter($parameter)\n {\n $params = $this->getParameters();\n\n return $params[$parameter] ?? null;\n }",
"public function get_parameter($parameter) {\n\t if (isset($this->decodedWebhook['queryResult']['parameters'][$parameter])) {\n\t\t return $this->decodedWebhook['queryResult']['parameters'][$parameter];\n\t }\n\t\treturn false;\n }",
"public function getParam($param)\n {\n return isset($this->_params[$param]) ? $this->_params[$param] : null;\n }",
"public function getParam($name) {\n return $this->params[$name];\n }",
"public function getParam($key);",
"public function getParam($key)\n {\n if (isset($this->params[$key])) {\n return $this->params[$key];\n }\n }",
"public function getParam($name);",
"function get_parameter($name)\r\n {\r\n if (array_key_exists($name, $this->parameters))\r\n return $this->parameters[$name];\r\n }",
"public function getParam($key) {\n if (isset($this->params[$key])) {\n return $this->params[$key];\n }\n return NULL;\n }",
"public static function getParam(\n UriInterface $uri,\n string $param,\n string $default = ''\n ): string {\n return self::getParams($uri)[$param] ?? $default;\n }",
"function getParam($name) {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n return null;\n }",
"function get_param($name) {\n \n if (isset($_REQUEST[$name])) return $_REQUEST[$name];\n else return \"\";\n}",
"public function getParam($name){\n\t\treturn array_key_exists($name, $this->params) ? $this->params[$name] : NULL;\n\t}",
"public function param($queryParam, $default = null) {\n return $this->getRequest()->get($queryParam,$default);\n }",
"public function getParam($key = 1)\n {\n $value = null;\n if (($key !== null) && (is_numeric($key))) {\n $value = self::setAntiInjection($this->joUrl[\"PARAM{$key}\"]);\n }\n return $value;\n }",
"function getParam($name) {\n\t\treturn isset($this->params[$name]) ? $this->params[$name] : null;\n\t}",
"function url_get_param($name) {\n\tparse_str(parse_url(curPageURL(), PHP_URL_QUERY), $vars);\t\t\n\treturn isset($vars[$name]) ? $vars[$name] : null;\t\n}",
"public function param(string $param): mixed\n {\n return !empty($this->params[$param]) ? $this->params[$param] : null;\n }",
"final public static function getParam($key) {\n $param = self::getParams();\n return $param[$key];\n }",
"public function get( $name )\n\t{\n\t\tif( isset( $this->params[ $name ] ) ) return $this->params[ $name ];\n\t\treturn null;\n\t}",
"public function getParameter($name);",
"public function getParameter($name);",
"public function getParameter($name);",
"public function getParam($key)\n {\n return $this->_params[$key];\n }",
"function get($var, $default = null) {\n\t\tif(empty($this->_uriParams)) {\n\t\t\t$this->processUriParams();\n\t\t}\n\t\tif(isset($_GET[$var])) {\n\t\t\treturn urldecode(is_numeric($var) ? (int) $var : $var);\n\t\t}\n\t\treturn isset($this->_uriParams[$var]) ? $this->_uriParams[$var] : $default;\n\t}",
"protected function get_parameter( $name ) {\n\t\treturn $this->has_parameter( $name ) ? $this->parameters[ $name ] : null;\n\t}",
"public static function route($param)\n {\n return static::$URL.$param;\n }",
"public static function route($param)\n {\n return static::$URL.$param;\n }",
"public static function route($param)\n {\n return static::$URL.$param;\n }",
"public static function route($param)\n {\n return static::$URL.$param;\n }",
"public static function route($param)\n {\n return static::$URL.$param;\n }",
"public static function route($param)\n\t{\n\t\treturn static::$URL.$param;\n\t}",
"public function getParam($param, $filters=null);",
"public function getParam($name, $default = null)\n {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n $name = str_replace('.', '_', $name);\n return $this->request->get($name, $default);\n }",
"public function getUriParameter($key) {\n $on_console = $this->getRequest() instanceof \\Zend\\Console\\Request;\n\n if( !$on_console and $this->params()->fromQuery($key) != null )\n return $this->params()->fromQuery($key);\n if( $this->getEvent()->getRouteMatch()->getParam($key) != null )\n return $this->getEvent()->getRouteMatch()->getParam($key);\n return false;\n }",
"public function getArgument($name, $default = null) {\n if (array_key_exists($name, $_GET)) {\n return $_GET[$name];\n }\n\n return $default;\n }",
"public function param ($pname)\n {\n return Yii::app()->request->getParam($pname);\n }",
"public static function route($param = '')\n {\n return static::$URL.$param;\n }",
"public function getParameter($key)\n {\n return isset($this->params[$key]) ? $this->params[$key] : null;\n }",
"private function getParameter($key)\n {\n return $this->parameters->get($key);\n }",
"private function _get_param( $index ) {\n\t\treturn ( isset( $this->_params[ $index ] ) ) ? $this->_params[ $index ] : null ;\n\t}",
"public function offsetGet($param)\n\t{\n\t\treturn isset($this->params[(string) $param]) ? $this->params[(string) $param] : null;\n\t}",
"function getParam($inKey = null) {\n\t\treturn $this->_getItem($inKey);\n\t}",
"public function getParam($name) {\n if (isset($this->parameter[$name])) {\n return $this->parameter[$name];\n }\n }",
"protected function getArgument(string $name)\n {\n $this->methodExpectsRequest(__METHOD__);\n $param_infos = $this->getArgumentInfos($name);\n\n if (null === $param_infos) {\n return null;\n }\n $arg = $this->getRequest()->getArg($param_infos['position']);\n return $this->getRequest()->getArg($param_infos['position']);\n }",
"public function getParam($param)\n {\n $result = (new Query())\n ->select('value')\n ->from('uuid_param')\n ->where([\n 'uuid' => $this->getUuid(),\n 'param' => $param,\n ])\n ->one();\n return $result ? $result['value'] : null;\n }",
"protected function get(string $parameter, $default = null) {\n\t\treturn $this->parameters[$parameter] ?? $default;\n\t}",
"function getRouteParameters();",
"public function getParameter()\n\t{\n\t\treturn $this->parameter;\n\t}",
"public function getParameter($name)\n {\n if (array_key_exists($name, $this->params)) {\n return $this->params[$name];\n }\n\n return null;\n }",
"public function param($key = null)\n {\n return isset($this->params[$key]) ? $this->params[$key] : null;\n }",
"public function getParam(string $name)\n {\n return $this->params[$name] ?? null;\n }",
"function get_param($param_name)\n{\n if($_POST[$param_name])\n\t\treturn $_POST[$param_name];\n\telse\n\t\treturn $_GET[$param_name];\n}",
"protected function parameter(string $parameter)\n {\n return $this->getContainer()->get(Config::class)->get($parameter);\n }",
"public function getParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n return $this->parameters[$name];\n }\n return null;\n }",
"public function getPathParameter($parameter){\n if(isset($this->parameters[$parameter])) {\n return $this->parameters[$parameter];\n }\n return null;\n }",
"public function get($parameterName) {\n return $this->getParameter($parameterName);\n }",
"public function getRoute($route) {\n return isset($this->routes[$route]) ? $this->routes[$route] : null;\n }",
"public function getParam()\n {\n return $this->param;\n }",
"public function getParam()\n {\n return $this->param;\n }",
"public function getParameter();",
"public function getParameter();",
"public static function getParameter($path = null)\n {\n if ($path) {\n $parts = explode('/', $path);\n $param = self::instance()->parameters;\n foreach ($parts as $part) {\n if (!isset($param[$part])) {\n return null;\n }\n $param = $param[$part];\n }\n return $param;\n } else {\n return self::instance()->parameters;\n }\n }",
"public function getParam($name)\n {\n return isset($_REQUEST[$name]) ? $_REQUEST[$name] : null;\n }",
"public function getParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n return $this->parameters[$name];\n }\n\n return null;\n }",
"function get_valueFromStringUrl($url_path_part , $parameter_name) {\n\t\t\t$parts = parse_url($_SERVER[\"REQUEST_URI\"]);\n\t\t\tif(isset($parts['query'])) {\n\t\t\t\tparse_str($parts['query'], $query);\n\t\t\t\tif(isset($query[$parameter_name])) {\n\t\t\t\t\treturn $query[$parameter_name];\n\t\t\t\t}\n\t\t\t\telse { return null; }\n\t\t\t}\n\t\t\telse { return null; }\n\t\t}",
"public function getParam($name)\n {\n if (isset($this->params[$name])) {\n return $this->params[$name];\n }\n return null;\n }",
"public function getParameter($key);",
"public function getParam($name)\n {\n return isset($this->params[$name]) ? $this->params[$name] : null;\n }",
"public function getParameter($name)\n {\n return $this->parameters[$name] ?? null;\n }",
"protected function getParameter($name)\n {\n return $this->container->getParameter($name);\n }",
"public static function getParam($name) {\n return isset(static::$_params[$name]) ? static::$_params[$name] : null;\n }",
"public function paramFromRoute($key) {\n $val = $this->params()->fromRoute($key);\n return str_replace('+',' ',$val);\n }",
"public function getArgument($index)\n\t{\n\t\treturn $this->router->getArgument($index);\n\t}",
"function UrlParmGet( $fld, $k )\r\n /******************************\r\n Get the value from an urlparm\r\n */\r\n {\r\n $ra = $this->UrlParmGetRA( $fld );\r\n return( @$ra[$k] ?? \"\" );\r\n }",
"function get_url_param( $variable, $default='' )\n {\n return !empty( $_GET[ $variable ] )?$_GET[ $variable ]:$default;\n }",
"protected function getParam($param, $default = null) {\n // set or encoding failed. Recover in these cases so we can perform\n // mail migrations, see T9251.\n if (!is_array($this->parameters)) {\n $this->parameters = array();\n }\n\n return idx($this->parameters, $param, $default);\n }",
"function findRoute($route = '') {\n $route = $route ? $route : FIRE_DEFAULT_ROUTE;\n return $this->_routes->get($route);\n }",
"public function getParam($name)\n {\n return Tools::getValue($name);\n }",
"function getParam( $key, $default = NULL ) {\n return Yii::app()->request->getParam( $key, $default );\n}",
"public static function getRoutingParam(string $routeName)\n {\n try {\n $value = self::getParam($routeName, 'routing');\n } catch (ConfigNotFound $e) {\n $value = false;\n }\n\n return $value;\n }",
"public function getParameter($name,$defaultValue=null){\n\t\treturn isset($_GET[$name])? $_GET[$name] : $defaultValue;\n\t}"
]
| [
"0.74918544",
"0.7435579",
"0.7381199",
"0.7180305",
"0.708427",
"0.70501095",
"0.6802776",
"0.67720383",
"0.67206526",
"0.66902846",
"0.6668433",
"0.6644409",
"0.6542314",
"0.6534328",
"0.6527651",
"0.65226245",
"0.65189266",
"0.6485776",
"0.6485776",
"0.640652",
"0.64004284",
"0.63922554",
"0.63908976",
"0.63746303",
"0.6368511",
"0.6355929",
"0.6352107",
"0.6332896",
"0.6332338",
"0.6327361",
"0.6313757",
"0.6310041",
"0.6308983",
"0.63054264",
"0.6295396",
"0.6280513",
"0.6274144",
"0.627187",
"0.62700516",
"0.62652624",
"0.62652624",
"0.62652624",
"0.6264452",
"0.6247598",
"0.62446684",
"0.6240668",
"0.6240668",
"0.6240668",
"0.6240668",
"0.6240668",
"0.623288",
"0.6225945",
"0.6223846",
"0.62209874",
"0.6211931",
"0.62112707",
"0.6198426",
"0.6194345",
"0.61878484",
"0.6182123",
"0.61809903",
"0.6154935",
"0.61526483",
"0.6152532",
"0.61437154",
"0.61381173",
"0.6129094",
"0.6128033",
"0.6124616",
"0.60994226",
"0.6096475",
"0.608502",
"0.60840815",
"0.60613567",
"0.60604364",
"0.60599524",
"0.60586137",
"0.6042983",
"0.6042983",
"0.6041243",
"0.6041243",
"0.60279983",
"0.6023815",
"0.60186905",
"0.6018508",
"0.60111064",
"0.60068977",
"0.6003283",
"0.5994593",
"0.5992024",
"0.59873265",
"0.59861666",
"0.5983749",
"0.59771323",
"0.59754395",
"0.59733033",
"0.59680223",
"0.59636384",
"0.5959857",
"0.5959519",
"0.5958375"
]
| 0.0 | -1 |
Set a parameter to the given value. | public function setParameter($name, $value)
{
$this->parameters();
$this->parameters[$name] = $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set($parameter, $value);",
"public function setParameter($name, $value);",
"public function setParam($param, $value);",
"public function setParam($name, $value);",
"public function setParameter($name, $value) {\n $this->parameters[$name]= $value;\n }",
"public function setParameter($param, $value)\n {\n $this->params[$param] = $value;\n }",
"public function setParameter($name, $value)\n {\n $this->getParameters();\n $this->parameters[$name] = $value;\n }",
"public function set_parameter($name, $value)\n {\n $this->_parameters[ $name ] = $value;\n }",
"public function setParameter(string $paramName, $paramValue = NULL);",
"public function setParam($key, $value);",
"public function setParameter($name, $value)\n {\n $this->params[$name] = $value;\n $this->processFilters();\n }",
"public function setParameter($name, $value) {\n $this->parameters[$name] = $value;\n }",
"public abstract function setParameter($parameter);",
"protected function setParameter($name, $value)\n {\n $this->parameters[$name] = $value;\n }",
"public function __set($param, $value)\r\n {\r\n $this->params_named->set($param, $value);\r\n }",
"public function setParam($name, $value) {\n $this->parameter[$name] = $value;\n }",
"public function setParameter($name, $value)\n {\n $this->parameters[$name] = $value;\n }",
"function set_parameter($name, $value)\r\n {\r\n //dump(get_class($this) . ' | ' . $name);\r\n $this->parameters[$name] = $value;\r\n }",
"public function setParameter ($name, $value)\n {\n\n $this->parameters[$name] = $value;\n\n }",
"public function __set($param, $value);",
"function setParameter($key, $value) {\n $this->parameters[$key] = $value;\n }",
"public function setter(string $paramName, $paramValue);",
"abstract protected function setParameter($key, $value);",
"public function setParam($name, $value){\n\t\t$this->params[(string)$name] = $value;\n\t}",
"public function setParam($param, $value)\n {\n $this->params[$param] = $value;\n }",
"function setParam($name, $value) {\n $this->params[$name] = $value;\n }",
"public function setParam($param, $value)\n {\n $this->_params[$param] = $value;\n }",
"public function set( $name, $value )\n\t{\n\t\t$this->_params[$name] = $value;\n\t}",
"public function setParam(string $name, $value): void\n {\n $this->params[$name] = $value;\n }",
"public function set_param($key, $value)\n {\n }",
"public function setParameter( $key, $value ) {\n\t\t$this->fields[ $this->parameterPrefix . trim( $key ) ] = $value;\n\t}",
"public function setParameter($name, $value, $ns = null)\r\n {\r\n $this->parameterHolder->set($name, $value, $ns);\r\n }",
"public function offsetSet($name, $value)\n {\n if (is_int($name)) {\n parent::offsetSet($name, $value);\n // @codeCoverageIgnoreStart\n // This will never be reached, because an exception is always\n // thrown.\n return;\n // @codeCoverageIgnoreEnd\n }\n\n $param = new Parameter($this->root, $name, $value);\n $this->parameters[$param->name] = $param;\n }",
"public function setParam($name, $value)\n\t{\n\t\treturn $this->_tpl->params->set($name, $value);\n\t}",
"public function setParameter($parameter, $value)\n {\n $this->setParameters(array_merge($this->getParameters(), [$parameter => $value]));\n }",
"public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }",
"public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }",
"public function __set($name, $value)\n {\n $this->params[$name] = $value;\n }",
"public function setParameter(string $name, $value): void\n {\n $this->config[$name] = $value;\n }",
"public function set( $name, $value )\n\t{\n\t\t$this->params[ $name ] = $value;\n\t\tif( $value === null ) unset( $this->params[ $name ] );\n\t\t\n\t\t$this->modified = true;\n\t}",
"public function offsetSet($param, $value)\n\t{\n\t\t$this->params[(string) $param] = $value;\n\t}",
"public function setParam($key, $value)\n\t{\n\t\treturn $this->_params->set($key, $value);\n\t}",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value)\n {\n $this->{$this->parameterMap[$var]} = $value;\n }",
"public function __set($var, $value)\n {\n $this->{$this->parameterMap[$var]} = $value;\n }",
"public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function setParam($name, $value){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}",
"public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }",
"public function __set($param, $value)\n\t{\n\t\tswitch($param)\n\t\t{\n\t\t\tcase 'type':\n\t\t\t\tif(in_array($type, array('data', 'xref') ) )\n\t\t\t\t\t$this->type = $type;\n\t\t\t\tbreak;\n\t\t\tcase 'caption':\n\t\t\tcase 'class':\n\t\t\tcase 'id':\n\t\t\tcase 'xref_x':\n\t\t\t\tif(is_string($value))\n\t\t\t\t\t$this->$param = $value;\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function setParameter( $key, $value ) {\n\t\tif ( array_key_exists( $key, $this->smoValues[\"simple\"] ) && !empty( $value ) ) {\n\t\t\t$this->smoValues[\"simple\"][$key] = $value;\n\t\t}\n\t}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public static function set(string $param, string $value) : string\n {\n return Params::$definitions[$param]['value'] = $value;\n }",
"public function setParam($name, $val) {\n $this->params[$name]= $val;\n }",
"public function setMinkParameter($name, $value)\n {\n $this->minkParameters[$name] = $value;\n }",
"public function setParam($key, $value)\r\n {\r\n $this->_frontController->setParam($key, $value);\r\n }",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"protected function setParam($name, $value) {\n if (!array_key_exists($name, $this->params)) {\n throw new \\Exception(E()->Utils->translate('ERR_DEV_NO_PARAM').': '.$name.' @'.$this->getName() , SystemException::ERR_DEVELOPER);\n }\n if ($name == 'active') {\n $value = (bool)$value;\n }\n if (is_scalar($value)) {\n $value = explode('|', $value);\n $this->params[$name] =\n (sizeof($value) == 1) ? current($value) : $value;\n } elseif (is_array($value)) {\n $this->params[$name] = $value;\n } else {\n $this->params[$name] = $value;\n }\n }",
"public function setParam($name, $value)\n {\n $name = (string) $name;\n $this->_invokeParams[$name] = $value;\n return $this;\n }",
"public function set_parameter(Application $application, $name, $value)\n {\n $parameters = &$this->determine_level($application);\n $parameters[$name] = $value;\n }",
"public function set($variable, $value);",
"protected function set(string $parameter, $value): self {\n\t\t$this->parameters[$parameter] = $value;\n\t\t\n\t\treturn $this;\n\t}",
"final public function setParameter($name, $value)\n {\n $this->parameters[$name] = $value;\n return $this;\n }",
"public function setParameter(int $parameter): void\n {\n $this->parameter = $parameter;\n }",
"public function param($id, $value)\n\t{\n\t\t$this->params[$id] = $value;\n\t}",
"public function setArgument($name, $value);",
"private function setParam($statemant, $key, $value){\n\t\t$statemant->bindParam($key, $value);\n\t}",
"public function setParam($param, $value)\n {\n if (strlen($param) > $this->paramLength) {\n throw new InvalidParamException('Param name is too long.');\n }\n\n if (!is_scalar($value) && !is_null($value)) {\n $value = serialize($value);\n } else if (is_bool($value)) {\n $value = (int) $value;\n }\n\n $columns = [\n 'uuid' => $this->getUuid(),\n 'param' => $param,\n 'value' => $value,\n 'datetime' => new Expression('NOW()'),\n ];\n\n if ($this->paramExists($param)) {\n Yii::$app->db->createCommand()->update('uuid_param', $columns, [\n 'uuid' => $this->getUuid(),\n 'param' => $param,\n ])->execute();\n } else {\n Yii::$app->db->createCommand()->insert('uuid_param', $columns)->execute();\n }\n }",
"function setValue($value) {\n $this->value = $value;\n }",
"public function SetValue($value)\n\t{\n\t\t$this->value = $value;\n\t}"
]
| [
"0.8557252",
"0.84533304",
"0.82316965",
"0.80341804",
"0.7904756",
"0.78378445",
"0.78170973",
"0.78085196",
"0.78004473",
"0.77891773",
"0.7766323",
"0.7763065",
"0.773583",
"0.7734753",
"0.76957214",
"0.76956266",
"0.7694644",
"0.76902896",
"0.7673982",
"0.76320827",
"0.75819796",
"0.7579176",
"0.7548645",
"0.7513868",
"0.74984956",
"0.7473573",
"0.7411691",
"0.7400095",
"0.7386745",
"0.73756576",
"0.7353761",
"0.7339853",
"0.7332383",
"0.73190904",
"0.73095596",
"0.7273568",
"0.7273568",
"0.7265651",
"0.7217179",
"0.7195929",
"0.71895766",
"0.71743083",
"0.7150774",
"0.7150774",
"0.7150774",
"0.7150774",
"0.7150774",
"0.7150774",
"0.7150774",
"0.7150774",
"0.7150774",
"0.70607716",
"0.7056119",
"0.7056119",
"0.7047153",
"0.7047153",
"0.70312345",
"0.70177406",
"0.70111275",
"0.70024705",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.69902414",
"0.6990058",
"0.6990058",
"0.6971464",
"0.69699955",
"0.69619614",
"0.6957518",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.693993",
"0.6938888",
"0.6908038",
"0.69008607",
"0.69007665",
"0.6875397",
"0.68632483",
"0.685639",
"0.68250984",
"0.68101",
"0.6783328",
"0.67631423",
"0.67598146",
"0.67567587"
]
| 0.7789668 | 9 |
Set a parameters to the given array. | public function setParameters(array $parameters)
{
$this->parameters = $parameters;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setParams(array $params);",
"public function setParams(array $params);",
"public function setParams(array $params);",
"public function setParameter(array $arr){\r\n $this->_parametros = $arr;\r\n\t\t// $this->_parametros = array_merge($this->_parametros, $arr);\r\n }",
"public function set(array $params)\n {\n $this->exchangeArray($params);\n }",
"public function setParameters(array $params)\n {\n $this->params = $params;\n }",
"public function setParameters(array $params) {\n foreach ($params as $pName => $pValue) {\n $this->setParameter($pName, $pValue);\n }\n }",
"public function setParams(array $params) :void;",
"public function setParams(array $params){\n\t\t$this->params = $params;\n\t}",
"public function setParameters(array $parameters)\n {\n $this->clearCachedValueIf($this->params != $parameters);\n $this->params = $parameters;\n }",
"function setParameters(array $parameters) {\n foreach ($parameters as $key => $value) {\n $this->setParameter($key, $value);\n }\n }",
"public function setParameters(array $params)\n {\n $this->params = array_filter($params);\n $this->processFilters();\n }",
"public function setParams(array $params) {\n\t\t$this->params = $params;\n\t}",
"public function setParams(array $params)\n {\n $this->params = $params;\n }",
"public function setParams(array $params)\n {\n $this->params = $params;\n }",
"final protected function _setParameters(array $params)\n\t{\n\t\tforeach ($params as $key => $value) {\n\t\t\t$this->setParameter($key, $value);\n\t\t}\n\t}",
"public function setParams(array $params)\n\t{\n\t\t$this->params = $params;\n\t}",
"public function setParams(array $params)\n {\n $this->_params = $params;\n }",
"public function setParams(array $params){\n \tif(is_array($params)){\n $this->_params = $this->filterParams($params);\n \treturn $this->_params;\n \t}\n\n }",
"public function setParams(array $params)\n\t{\n\t\t$this->_params = array_merge($this->_params, $params);\n\t}",
"function params( $array ) {\n\t\t$this->params_list = $array;\n\t\t}",
"public function setParams(array $params): void;",
"public function setParams(array $params, $reset = true) {}",
"public function setParameterValues(array $parameters): void\n {\n $this->parameterValues = $parameters;\n }",
"public function setParams($params);",
"public function setParams($params);",
"public function set($params) {}",
"public function setParameters(array $parameters): void;",
"public function setArray($array){\n $this->array=$array;\n }",
"function setParameters($parameters);",
"public function setParameter($params)\r\n\t{\r\n\t\tif (is_array($params))\r\n\t\t\t$this->params = array_merge($this->defaultParams(), $params);\r\n\t\telse\r\n\t\t\t$this->params = $this->defaultParams();\r\n\t}",
"public function setParams(array $params)\n\t{\n foreach ($params as $param => $value) {\n\t\t\t$this->_setSmartyParams($param, $value);\n }\n\t}",
"public function setParams(array $params = []): void\n {\n $this->params = $params;\n }",
"private function _setParams($params)\n {\n $this->_params = array();\n foreach ($params as $paramKey => $paramValue) {\n $this->_params[$paramKey] = $paramValue;\n }\n }",
"function setParams($param_array) {\n\t\tif ( count($param_array) > 0 ) {\n\t\t\t// read the existing component value(s)\n\t\t\t$db = JFactory::getDbo();\n\t\t\t$db->setQuery('SELECT params FROM #__extensions WHERE name = \"com_mapyandex\"');\n\t\t\t$params = json_decode( $db->loadResult(), true );\n\t\t\t// add the new variable(s) to the existing one(s)\n\t\t\tforeach ( $param_array as $name => $value ) {\n\t\t\t\t$params[ (string) $name ] = (string) $value;\n\t\t\t}\n\t\t\t// store the combined new and existing values back as a JSON string\n\t\t\t$paramsString = json_encode( $params );\n\t\t\t$db->setQuery('UPDATE #__extensions SET params = ' .\n\t\t\t\t$db->quote( $paramsString ) .\n\t\t\t\t' WHERE name = \"com_mapyandex\"' );\n\t\t\t\t$db->query();\n\t\t}\n\t}",
"public function set($parameters)\n {}",
"public function setFromArray(array $data);",
"public function setParameters(array $params)\n {\n $this->_parameters = $params;\n return $this;\n }",
"public function setParams(array $array)\n {\n $this->params = $this->params + (array)$array;\n\n foreach ($this->params as $key => $value) {\n if (null === $value) {\n unset($this->params[$key]);\n }\n }\n\n return $this;\n }",
"function set_params($params)\r\n\t{\r\n\t\t$this->parameters = $params;\r\n\t}",
"public function setParams($params) {\n\t\t$this->params = array();\n\t\t$this->addParams($params);\n\t}",
"public function setParameters(array $params)\n\t {\n\t \t foreach ($params as $key => $value)\n\t \t {\n\t \t\tswitch ($key)\n\t \t\t{\n\t \t\t\tcase \"identification\":\n\t \t\t\t\tforeach($value as $key => $value) {\n\t \t\t\t\t\t// validate section fields name\n\t \t\t\t\t\tif(!array_key_exists($key, $this->json['params']['identification'])) {\n\t \t\t\t\t\t\tthrow new InvalidArgumentException(\"$key is not valid for identification section\");\n\t \t\t\t\t\t}\n\t \t\t\t\t\t// if referenceId parameter is not set in the constructor\n\t \t\t\t\t\tif('' === $this->json['params']['identification']['referenceid'])\n\t \t\t\t\t\t\t$this->json['params']['identification'][$key] = $value; \n\t \t\t\t\t}\n\t \t\t\t\tbreak;\n\t \t\t\tdefault:\n\t \t\t\t\tthrow new OutOfBoundsException(\"You should set predefined parameter group!\");\n\t \t\t}\n\t \t }\t \t \n\t }",
"public function set_params( $params )\n\t{\n\t\tif ( ! is_array( $params ) ) {\n\t\t\tparse_str( $params, $params );\n\t\t}\n\n\t\t$this->params = $params;\n\t}",
"public function setArray(array $array)\n {\n $this->array = $array;\n }",
"function setArray($array) {\n\t\tif ($array['idSemesters'])\n\t\t\t$this->idSemesters = $array['idSemesters'];\n\t\tif ($array['date'])\n\t\t\t$this->date = $array['date'];\n\t\tif ($array['timeStart'])\n\t\t\t$this->timeStart = $array['timeStart'];\n\t\tif ($array['timeEnd'])\n\t\t\t$this->timeEnd = $array['timeEnd'];\n\n\t\t$this->_modified = true;\n\t}",
"public function set($arr)\n {\n $this->arr = $arr;\n }",
"function params(array $params) {\n\t\t$this->_params = $params;\n\t}",
"public function setValue(array $arr){\r\n $this->_valores = $arr;\r\n }",
"function set(array $array){\n foreach($this as $atributo => $valor){\n if(isset($array[$atributo])){\n $this->$atributo = $array[$atributo];\n }\n }\n }",
"function SetArray($arrWhere)\r\n\t{\r\n\t\t$this->_arrWhere = $arrWhere;\r\n\t}",
"public function setParams( $params )\n\t{\n\t\tif ( ! is_array( $params ) ) {\n\t\t\t$params = parse_str( $params );\n\t\t}\n\t\t$this->params = $params;\n\t}",
"public function set_parameters($value)\n\t{\n\t\t$this->parameters = array_merge($this->parameters, $value);\n\t}",
"public function setParams(array $params = array()) {\n \n foreach ($params as $key => $value) {\n $this->_params[$key] = $value;\n }\n return $this->_params;\n }",
"public function setFromArray(array &$_data);",
"public function parameters( Array $parameters=array() ) {\n foreach ($parameters as $name=>$value) {\n $this->params[$name]= $value;\n }\n }",
"public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }",
"public function setConfig(array $params);",
"public function setParameters ($parameters)\n {\n\n $this->parameters = array_merge($this->parameters, $parameters);\n\n }",
"public function setParams(array $params) {\n $this->params = $params;\n return $this;\n }",
"public function setParameters(mixed ...$parameters) : void\n {\n $this->parameters = $parameters;\n }",
"public function setParams(array $params)\n {\n $this->_params = $params;\n return $this;\n }",
"function setParams($param_array) {\n $db = JFactory::getDbo();\n \n \n if ( count($param_array) > 0 ) {\n // read the existing component value(s)\n $db = JFactory::getDbo();\n $db->setQuery('SELECT params FROM #__extensions WHERE name = \"joomleague\"');\n $params = json_decode( $db->loadResult(), true );\n // add the new variable(s) to the existing one(s)\n foreach ( $param_array as $name => $value ) {\n $params[ (string) $name ] = (string) $value;\n }\n // store the combined new and existing values back as a JSON string\n $paramsString = json_encode( $params );\n $db->setQuery('UPDATE #__extensions SET params = ' .\n $db->quote( $paramsString ) .\n ' WHERE name = \"joomleague\"' );\n $db->query();\n }\n \n }",
"public function setParams(array $params)\n {\n $this->params = $params;\n return $this;\n }",
"public function setParams(array $params)\n {\n $this->_invokeParams = array_merge($this->_invokeParams, $params);\n return $this;\n }",
"public function setAll($array) {\n $this->elements = $array;\n }",
"public function setValues(array $values);",
"private function setParams($statement, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) { ///percorrer as linhas rows\n\t\t\t$this->setParam($key,$value);///percorer as colunas ID\n\t\t}\n\t}",
"private function setParams()\n\t\t{\n\t\t\t/**\n\t\t\t* Remove do $this->_separetor os dois primeiros valores\n\t\t\t* referentes ao controller e action, deixando os demais valores\n\t\t\t* que serão usados para formarem os parametros, indices e valores\n\t\t\t*/\n\t\t\tunset($this->_separetor[1], $this->_separetor[2]);\n\t\t\t\n\t\t\t/**\n\t\t\t* Caso o ultimo item do $this->_separetor seja vazio\n\t\t\t* o mesmo é removido\n\t\t\t*/\n\t\t\tif ( end($this->_separetor) == null ) {\n\t\t\t\tarray_pop($this->_separetor);\n\t\t\t}\n\n\t\t\t\n\t\t\t/**\n\t\t\t* Se a $this->_separetor estivar vazia,\n\t\t\t* então os parametros serão definidos como vazios\n\t\t\t*/\n\t\t\tif ( !empty($this->_separetor) ) {\n\t\t\t\t/**\n\t\t\t\t* Percorre o array $this->_separetor, verificando os indices\n\t\t\t\t* se for impar, então seu valor será o indice do parametro.\n\t\t\t\t* Se for par, seu valor será o valor do paremetro\n\t\t\t\t*/\n\t\t\t\tforeach ($this->_separetor as $key => $value) {\n\t\t\t\t\tif ($key % 2 == 0) {\n\t\t\t\t\t\t$param_value[] = $value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$param_indice[] = $value;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$param_value = array();\n\t\t\t\t$param_indice = array();\n\t\t\t}\n\n\n\t\t\t/**\n\t\t\t* Verifica se os indices e valores dos parametros\n\t\t\t* não são vazios e possuem a mesma quantidade\n\t\t\t* Então vaz um \"array_combine\" para juntar os dois arrays\n\t\t\t* formando um indice->valor para o parametro\n\t\t\t*/\n\t\t\tif ( !empty($param_indice) \n\t\t\t\t&& !empty($param_value)\n\t\t\t\t&& count($param_indice)\n\t\t\t\t== count($param_value)\n\t\t\t) {\n\t\t\t\t$this->_params = array_combine($param_indice, $param_value);\n\t\t\t} else {\n\t\t\t\t$this->_params = array();\n\t\t\t}\n\t\t}",
"public function setAllParams($arrParams) {\n $this->arrParams = $arrParams;\n }",
"public function offsetSet($param, $value)\n\t{\n\t\t$this->params[(string) $param] = $value;\n\t}",
"public function setArray(array $list);",
"public function setParameters(array $servers)\n {\n $this->servers = $servers;\n }",
"public function setVariableArray(array $data = array())\n {\n }",
"public function arrayAssign($scope, $array);",
"public function setParameters($parameters){\n\t\tself::$_parameters[get_class($this)] = $parameters;\n\t}",
"public function setParameters()\n {\n $params = array();\n $associations = array();\n foreach ($this->datatablesModel->getColumns() as $key => $data) {\n // if a function or a number is used in the data property\n // it should not be considered\n if( !preg_match('/^(([\\d]+)|(function)|(\\s*)|(^$))$/', $data['data']) ) {\n $fields = explode('.', $data['data']);\n $params[$key] = $data['data'];\n $associations[$key] = array('containsCollections' => false);\n\n if (count($fields) > 1) {\n $this->setRelatedEntityColumnInfo($associations[$key], $fields);\n } else {\n $this->setSingleFieldColumnInfo($associations[$key], $fields[0]);\n }\n }\n }\n\n $this->parameters = $params;\n // do not reindex new array, just add them\n $this->associations = $associations + $this->associations;\n }",
"protected final function setParams ($params)\n\t{\n\t\t/// This method is restricted (cannot be used by descendants).\n\t}",
"public function setParams(array $params)\n {\n $this->params = array_merge($this->params, $params);\n\n return $this;\n }",
"public function setParams( $params )\r\n\t{\r\n\t\t$this->params = $params;\r\n\t}",
"function insertParamArray($array) {\n\t\tforeach ($array as $key => $param) {\n\t\t\t$name = $param['name'];\n\t\t\t$value = $param['value'];\n\t\t\t$type = $param['type'];\n\n\t\t\t$this->insertParam($name, $value, $type);\n\t\t}\n\t}",
"private function setParams($statemant, $parameters = array()){\n\t\tforeach ($parameters as $key => $value) {\n\t\t\t//Parametros da query.\n\t\t\t$this->setParam($statemant, $key, $value);\n\t\t}\n\t}",
"public function setParameters(array $parameters): self\n {\n $this->parameters = $parameters;\n return $this;\n }",
"private function setProperties($array)\n\t{\t\n\t\tif(is_array($array)){\n\t\t\tforeach($array as $key => $value)\n\t\t\t\t$this->$key = $value;\n\t\t}\n\t}",
"private function setParams($params)\n\t{\n\t\t$this->params = $params;\n\t}",
"protected function setParameters(array $parameters)\n { \n $parsedRequestUri = explode('/', substr($_SERVER['REQUEST_URI'], 1));\n\n foreach($parameters as $param) {\n $this->parameters[] = $parsedRequestUri[$param];\n }\n\n\n return $this->parameters;\n }",
"public function setPropArray($array)\n {\n $this->engine->assign($array);\n }",
"function setParams($params) {\n $this->params = $params;\n }",
"public function setParameters($params) {\n\t\t$defaultParams = $this->params;\n\t\t$allParams = array_merge($defaultParams, $params);\n\n\t\t$this->validateParameters($allParams);\n\n\t\t// Save parameters as they were\n\t\t$this->params = $allParams;\n\n\t\t// Update request URLs from the new parameters\n\t\t$this->urlRaw = $this->build();\n\t\t$this->url = $this->build(true);\n\t}",
"public function setParams($params = null)\n {\n self::clearParams();\n if($params && is_array($params)){\n foreach($params as $key => $value){\n if(!$key || trim($key) == ''){\n continue;\n }\n\n $this->params[$key] = $value;\n }\n }\n }",
"public function setParams($params)\n {\n $this->_params = $params;\n }",
"public function setParams($params)\n {\n $this->_params = $params;\n }",
"public function setParams($params)\n {\n $this->params = $params;\n }",
"public function setParams($params) {\n $this->params = $params;\n }",
"public function setParams($params) {\n\t\t$this->data['params'] = $params;\n\t}",
"function setValues($list) {\n global $params;\n if (count($list)) {\n\tforeach ($list as $k=>$v) {\n\t $params[$k] = $v;\n\t}\n }\n}",
"protected function setParams($params)\n {\n // endpoint\n if (isset($params['Endpoint'])) {\n $this->setEndPoint($params['Endpoint']);\n unset($params['Endpoint']);\n } else {\n $this->setEndPoint();\n }\n\n // service\n if (isset($params['Service'])) {\n $this->setService($params['Service']);\n unset($params['Service']);\n } else {\n $this->setService();\n }\n\n // remaining\n if (is_array($params)) {\n $this->params = array_merge($this->params, $params);\n }\n }",
"private function setParams(array $params) : array\n {\n if (count($params) === 1) {\n array_unshift($params, 'is');\n }\n\n return $params;\n }",
"public function setParameters(array $parameters)\n {\n $this->parameters = $parameters;\n return $this;\n }",
"public function setParams($params){\r\n $this->params=$params;\r\n }",
"public function setArguments(array $arguments);"
]
| [
"0.7890672",
"0.7890672",
"0.7890672",
"0.77871203",
"0.7589765",
"0.7510881",
"0.74238086",
"0.7403437",
"0.739103",
"0.73303115",
"0.73267996",
"0.7306511",
"0.73036575",
"0.7290923",
"0.7290923",
"0.7264037",
"0.7259303",
"0.72549057",
"0.7212387",
"0.7191058",
"0.71044374",
"0.71002805",
"0.7012452",
"0.6976783",
"0.6969458",
"0.6969458",
"0.69590944",
"0.69535536",
"0.68791455",
"0.686776",
"0.68567216",
"0.68455845",
"0.6835292",
"0.68082255",
"0.67992264",
"0.6699949",
"0.6697037",
"0.6691333",
"0.6670584",
"0.6626514",
"0.66248834",
"0.6620732",
"0.66023636",
"0.6591222",
"0.6589132",
"0.6571916",
"0.65480596",
"0.65360266",
"0.65291655",
"0.65193796",
"0.6506568",
"0.6503732",
"0.64942926",
"0.6490358",
"0.64894235",
"0.6484641",
"0.6476245",
"0.64733154",
"0.6472106",
"0.6466256",
"0.6442368",
"0.64293444",
"0.64190596",
"0.6415377",
"0.6404812",
"0.640412",
"0.63759375",
"0.63719857",
"0.63669664",
"0.63576764",
"0.6335334",
"0.63115984",
"0.6297706",
"0.629641",
"0.6267101",
"0.6266386",
"0.62659895",
"0.62649536",
"0.6262425",
"0.6251876",
"0.6251843",
"0.62514377",
"0.6249971",
"0.62460756",
"0.6244251",
"0.62378114",
"0.6235951",
"0.62311435",
"0.62283707",
"0.6209093",
"0.6209093",
"0.6206731",
"0.61860627",
"0.6185795",
"0.61762166",
"0.6165574",
"0.61559325",
"0.6149624",
"0.6148434",
"0.6147973"
]
| 0.7123474 | 20 |
Unset a parameter on the route if it is set. | public function forgetParameter($name)
{
$this->parameters();
unset($this->parameters[$name]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __unset($param)\r\n {\r\n $this->params_named->remove($param);\r\n }",
"public function offsetUnset($param)\n\t{\n\t\tunset($this->params[(string) $param]);\n\t}",
"public function testSetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->setParam('foo', 'bar');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }",
"public function unsetRequest(): void;",
"public function clear()\n {\n unset($this->_params);\n }",
"public function __unset($name)\n {\n if (! array_key_exists($name, $this->userParams)) {\n return;\n }\n\n unset($this->userParams[$name]);\n }",
"public function clear()\n {\n $this->_params = null;\n }",
"public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }",
"public function __unset($name)\n {\n unset($this->_params['args'][$name]);\n }",
"public function offsetUnset($offset)\n {\n unset($this->params[$offset]);\n }",
"public function unsetParam($param = false)\n\t{\n\t\tif (($param) && (array_key_exists($param, $_SESSION))) {\n\t\t\tunset($_SESSION[$param]);\n\t\t}\n\t\tExceptions::throwNew(\n\t\t\t__CLASS__,\n\t\t\t__FUNCTION__,\n\t\t\t'Not a valid session parameter.'\n\t\t);\n\t}",
"public function remove($parameter);",
"public function actionDelete($param)\n {\n $params = $this->getConfig($this->config);\n\n if (isset($params[$param])) {\n unset($params[$param]);\n $this->setConfig($this->config, $params);\n }\n }",
"private function clearParam($param) {\n return str_replace(self::REQUIRED_PARAM,\"\",$param);\n }",
"public function offsetUnset($name)\n {\n if (is_int($name)) {\n parent::offsetUnset($name);\n // @codeCoverageIgnoreStart\n // This will never be reached, because an exception is always\n // thrown.\n return;\n // @codeCoverageIgnoreEnd\n }\n\n unset($this->parameters[strtoupper($name)]);\n }",
"public function __unset($name)\n {\n return $this->removeParam($name);\n }",
"private function resetParams()\n {\n $this->id = null;\n }",
"public function parameterPassedByReference(&$param) {\n unset($param);\n }",
"public static function removeParam($paramName, $uri=null){\n if(is_null($uri)){\n $uri = $_SERVER['REQUEST_URI'];\n }\n\n $paramArr = [];\n parse_str( parse_url($uri, PHP_URL_QUERY), $paramArr);\n\n if( isset($paramArr[$paramName]) ){\n unset($paramArr[$paramName]);\n\n //rebuild the uri\n $uri = strtok($uri, '?');\n if (!empty($paramArr)) {\n $uri .= '?'.http_build_query($paramArr);\n }\n }\n\n return $uri;\n }",
"public function clear($part) {\n $allow = ['user', 'pass', 'path', 'query', 'fragment'];\n if(!in_array($part, $allow)) {\n throw new UriException(\"Can't unset $part.\");\n }\n if($part == 'path') {\n unset($this->parts['query']);\n unset($this->parts['fragment']);\n }\n unset($this->parts[$part]);\n }",
"public function removeRoute($name);",
"public function __unset($var) {\n\t\tif ( isset($this->defaults[$var]) ) {\n\t\t\t$this->args[$var] = $this->defaults[$var];\n\t\t}\n\t\telse {\n\t\t\tunset($this->args[$var]);\n\t\t}\n\t}",
"public function removeParameter($name)\n {\n $this->getParameters();\n unset($this->parameters[$name]);\n }",
"public function clearParameters ()\n {\n\n $this->parameters = null;\n $this->parameters = array();\n\n }",
"public function removeGetParameter($name)\n {\n if (isset($this->getParams[$name]))\n {\n unset($this->getParams[$name]);\n return true;\n }\n else return false;\n }",
"public function testSetRouteParamWhenExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n $this->assertEquals('anderson', $route->getParam('last'));\n\n // Set param\n $route->setParam('last', 'smith');\n\n // Get new param\n $this->assertEquals('smith', $route->getParam('last'));\n }",
"public function clearParams(){\n\t\t$this->params = $this->paramsDefaults;\n\t\treturn true;\n\t}",
"protected function clearParam($sVar)\n\t{\n\t\tif (isset(self::$_aParams[$sVar]))\n\t\t{\n\t\t\tunset(self::$_aParams[$sVar]);\t\n\t\t}\n\t}",
"public function resetParams();",
"public function clearParam($param, $prefix = \"\") {\n if (!empty($prefix)) {\n // need check ?\n if ($this->_rediska->existsInHash($prefix, $param)) {\n $this->_rediska->deleteFromHash($prefix, $param);\n }\n } else {\n $this->_rediska->delete($param);\n }\n return true;\n }",
"function remove_query( $key, $value ) {\r\n\t\t\t$this->current_url = remove_query_arg( $key, $this->current_url );\r\n\t\t\treturn $this->current_url;\r\n\t\t}",
"public function __unset($name) {\n\t\t\tif (isset($this->object->$name) && $name != 'host' && $name != 'authority') {\n\t\t\t\t\\uri\\actions::modify($this->object, 'replace', $name, '');\n\t\t\t\treturn TRUE;\n\t\t\t} elseif (isset($this->object->$name)) {\n\t\t\t\t$this->_err('FORBIDDEN', debug_backtrace(), $name);\n\t\t\t} else {\n\t\t\t\t$this->_err('UNDEFINED', debug_backtrace(), $name);\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}",
"public function removeParam($name)\n {\n if (isset($this->params[$name])) {\n unset($this->params[$name]);\n }\n return $this;\n }",
"public function destroy($parameter)\n\t{\n\t\t$parameter->delete();\n\t}",
"protected function __getPostRemoveEmpty(){\r\n if($this->request->isPost()){\r\n foreach($this->request->getPost() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_POST[$key]);\r\n }\r\n }\r\n }\r\n else{\r\n foreach($this->request->getQuery() as $key => $value){\r\n if(empty($value) || is_null($value)){\r\n unset($_GET[$key]);\r\n }\r\n }\r\n }\r\n }",
"public function testGetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->getParam('foo');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }",
"function remove_query_arg($key, $query = \\false)\n {\n }",
"static function unsetReporticoSessionParam($param)\n {\n if (isset($_SESSION[ReporticoApp::get(\"session_namespace_key\")][$param])) {\n unset($_SESSION[ReporticoApp::get(\"session_namespace_key\")][$param]);\n }\n }",
"public static function removeUrlParam($url, $varname) {\n list($urlpart, $qspart) = array_pad(explode('?', $url), 2, '');\n parse_str($qspart, $qsvars);\n unset($qsvars[$varname]);\n $newqs = http_build_query($qsvars);\n if(empty($newqs)) {\n return $urlpart;\n } else {\n return $urlpart . '?' . $newqs;\n }\n }",
"public function __unset($_name);",
"public function __unset($name)\n {\n $vars = $this->vars();\n if (! isset($vars[$name])) {\n return;\n }\n unset($vars[$name]);\n }",
"public function __construct()\n {\n $this->route = null;\n }",
"public function removeParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n unset($this->parameters[$name]);\n return true;\n }\n return false;\n }",
"public function unsetSetting(&$pref, $name)\n {\n if (!isset($pref[$name])) {\n return;\n } // if\n\n unset($pref[$name]);\n }",
"public function removeParameter($name)\n {\n $name = strtolower($name);\n if (isset($this->parameters[$name])) {\n unset($this->parameters[$name]);\n\n return true;\n }\n\n return false;\n }",
"public function reset()\n {\n $this->requestParameters = [];\n }",
"public function reset()\n {\n $this->values[self::_REQUEST] = null;\n $this->values[self::_CHANGE] = null;\n }",
"public function clear()\n {\n $this->parameters = [];\n }",
"public function query_remove($key) {\n\t\t\t\\uri\\query::remove($this->object, $key);\n\t\t}",
"public function testParamUnset()\n {\n $driverPassesEndpoint = new DriverPassesEndpoint(getenv('MRP_API_KEY'));\n $array = $driverPassesEndpoint->setClassId(1000)\n ->setClassId(1000)\n ->setScheduleId(5508)\n ->setScheduleId(5508)\n ->setDataOrder('nameAsc')\n ->setDataOrder('nameAsc')\n ->setDriverId(1023)\n ->setDriverId(1023)\n ->setEndDate('8/21/2016')\n ->setEndDate('8/21/2016')\n ->setStartDate('8/21/2015')\n ->setStartDate('8/21/2015')\n ->setEventId(2)\n ->setEventId(2)\n ->getUrlParams();\n\n $this->assertTrue(is_array($array));\n $this->assertEquals(7, count($array));\n }",
"public function destroy( $value = NULL, $field = 'id' );",
"public function __unset($name)\n {\n // Dont' allow to unset attributes Ruts\n }",
"public function unset()\n {\n unset($this->value);\n }",
"public function getRemoveUrl()\n {\n\n $request = $this->request;\n $currentValue = $this->getValue();\n $requestValue = $this->getFilter()->getRequestVar();\n\t $requestParam = $request->getParam($requestValue);\n\t $params = $request->getParams();\n unset($params['p']);\n $request->setParams($params);\n\t if(isset($requestParam)){\n\t // make requestParam to be an array if it is not null\n $requestParam = is_array($requestParam)?$requestParam:[$requestParam];\n $currentValue = is_array($currentValue)?$currentValue:[$currentValue];\n // consider the last id of currentValue to be the current attribute id\n $currentParam = [end($currentValue)];\n // compute the difference of the request against 2 arrays, and use the difference to be remove url\n $removeValue = array_diff($requestParam,$currentParam);\n $query = [$this->getFilter()->getRequestVar() => $removeValue];\n $params['_current'] = true;\n $params['_use_rewrite'] = true;\n $params['_query'] = $query;\n $params['_escape'] = true;\n return $this->_url->getUrl('*/*/*', $params);\n }else{\n\t return parent::getRemoveUrl();\n }\n }",
"public function __unset($name)\n\t{\n\t\tif(isset($this->_attributes[$name]))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}",
"public static function routeParam($name)\n\t{\n\t\tif($route = Router::getCurrentRoute()) {\n\t\t\treturn $route->getParam($name);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function removePostParameter($name)\n {\n if (isset($this->postParams[$name]))\n {\n unset($this->postParams[$name]);\n return true;\n }\n else return false;\n }",
"public function remove_query_var($name)\n {\n }",
"public function unset(): void\n\t{\n\t\t$this->_value = $this->_allowNull ? null : self::setType('', gettype($this->_value));\n\t}",
"function unset_var($name){ // unset the template variable\n\tif (isset($this->vars[$name])) unset($this->vars[$name]);\n}",
"protected function UNLINK($route)\n {\n return $this->REQUEST('UNLINK', $route, array());\n }",
"public function removeParameter($key) {\n\t\tunset($this->parameters[$key]);\n\t\treturn $this;\n\t}",
"function restoreUrlParameters() {\n $this->CI->config->set_item('parm_segment', $this->parameterSegment);\n $this->CI->uri->router->segments = $this->routerSegments;\n }",
"public function removeRoute($route)\r\n {\r\n if (is_string($route)) {\r\n if (isset($this->routes[$route])) {\r\n unset($this->routes[$route]);\r\n }\r\n }\r\n elseif (($key = array_search($route, $this->routes, true) !== false)) {\r\n unset($this->routes[$key]);\r\n }\r\n\r\n return $this;\r\n }",
"public /*void*/ function __unset(/*scalar*/ $key){}",
"public function __unset(string $name): void\n {\n $this->propertyHandler->unset($name);\n }",
"public static function URLClear() {\n $urlCourante = $_SERVER[\"REQUEST_URI\"];\n $urlGet = explode(\"?\", $urlCourante);\n return $urlGet[0];\n }",
"public function __unset($var)\n {\n if (isset($this->_vars[$var])) {\n unset($this->_vars[$var]);\n }\n }",
"protected function _remove($property): void {\n $property[0] = strtolower($property[0]);\n if (property_exists($this, $property)) {\n $this->$property = null;\n } elseif(array_key_exists($property, $this->_properties)) {\n unset($this->_properties[$property]);\n } else {\n trigger_error('Method \"unset' . ucfirst($property) . '() does not exist');\n }\n }",
"public function undef($_name) {\n\t\tif (array_key_exists($_name,$this->fields)) {\n\t\t\ttrigger_error(self::TEXT_AxonCantUndef);\n\t\t\treturn;\n\t\t}\n\t\tif (!array_key_exists($_name,$this->virtual)) {\n\t\t\tF3::$global['CONTEXT']=$_name;\n\t\t\ttrigger_error(self::TEXT_AxonNotMapped);\n\t\t\treturn;\n\t\t}\n\t\tunset($this->virtual[$_name]);\n\t}",
"abstract protected function propertyUnset($name);",
"function unsetInternalParams($params)\n{\n unset($params['_url']);\n unset($params['_token']);\n unset($params['_method']);\n\n return $params;\n}",
"public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }",
"public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }",
"public function removeRoute($route): ?TLogRoute\n\t{\n\t\tif (!is_array($route) && !is_object($route) && isset($this->_routes[$route])) {\n\t\t\t$removed = $this->_routes[$route];\n\t\t\tunset($this->_routes[$route]);\n\t\t\t$this->_routes = array_values($this->_routes);\n\t\t\treturn $removed;\n\t\t}\n\t\tif (($key = array_search($route, $this->_routes, true)) !== false) {\n\t\t\t$removed = $this->_routes[$key];\n\t\t\tunset($this->_routes[$key]);\n\t\t\t$this->_routes = array_values($this->_routes);\n\t\t\treturn $removed;\n\t\t}\n\t\treturn null;\n\t}",
"public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }",
"public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }",
"function UnsetRequest()\n {\n \n unset($_REQUEST[\"mco_proveedores__PVE_ID\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_NOMBRE\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_DIRECCION\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_TELEFONO\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_CELULAR\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_EMAIL\"]);\n }",
"public function clearParams($name = null)\n {\n if (null === $name) {\n $this->_invokeParams = [];\n } elseif (is_string($name) && isset($this->_invokeParams[$name])) {\n unset($this->_invokeParams[$name]);\n } elseif (is_array($name)) {\n foreach ($name as $key) {\n if (is_string($key) && isset($this->_invokeParams[$key])) {\n unset($this->_invokeParams[$key]);\n }\n }\n }\n\n return $this;\n }",
"private static function trimRoute($route){\n\n\t\t$route=explode('?', $route, 2);\n\n\t\treturn str_replace('//', '/', ltrim($route[0], '/').'/');\n\n\t}",
"public function __unset($_name) {\n\t\tif (array_key_exists($_name,$this->fields)) {\n\t\t\ttrigger_error(self::TEXT_AxonCantUnset);\n\t\t\treturn;\n\t\t}\n\t\tF3::$global['CONTEXT']=$_name;\n\t\ttrigger_error(self::TEXT_AxonNotMapped);\n\t}",
"public function __unset($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\tunset($this->_attributes[$name]);\n\t\telse\n\t\t\tparent::__unset($name);\n\t}",
"public function unsetPassword(){\n\t\t$this->password = null;\n\t}",
"public static function Remove($key)\n {\n unset($_REQUEST[$key]);\n }",
"public function __unset($name)\n {\n $this->var_holder->remove($name);\n }",
"public function __unset($name);",
"private function clearParams()\n {\n $this->params = new \\StdClass();\n }",
"public function init() {\n $root = $this->find_root( $this->context );\n\n // Key is a mandatory parameter\n if ( isset( $this->params->key ) ) {\n $key = $this->params->key;\n } else {\n return $this->chunk->write( 'DustPress unset helper error: No key specified.' );\n }\n\n // It also must be a string\n if ( ! is_string( $key ) ) {\n return $this->chunk->write( 'DustPress unset helper error: Key is not a string.' );\n }\n\n if ( is_array( $root->head->value ) ) {\n unset( $root->head->value[ $key ] );\n }\n else if ( is_object( $root->head->value ) ) {\n unset( $root->head->value->{$key} );\n }\n \n return $this->chunk;\n }",
"public function __unset($name)\n {\n return $this->delete($this->uri, $name);\n }",
"public function __unset($name)\n {\n if (array_key_exists($name, $this->_attributes)) {\n unset($this->_attributes[$name]);\n }\n }",
"public function __unset(string $property)\n {\n $this->unset($property);\n }",
"function setRoute(DynamicValue $p_route):void\n {\n $this->route=$p_route; \n }",
"function __unset( $name ) {\n\t\tunset( $this->$name );\n\t}",
"public function __unset($prop)\r\n {\r\n unset($this->wrappedObj->$prop);\r\n }",
"public function __unset($name)\n {\n if (is_array($this->resource)) {\n\n unset($this->resource[$name]);\n\n return;\n }\n\n unset($this->resource->$name);\n }",
"private function undef(string $name): void\n {\n $path = $name !== '' ? explode('/', $name) : [];\n if (!$path) {\n return;\n }\n\n $var = array_pop($path);\n $current = &$this->items;\n\n foreach ($path as $field) {\n if (!is_array($current) || !isset($current[$field])) {\n return;\n }\n $current = &$current[$field];\n }\n\n unset($current[$var]);\n $this->updated = true;\n }",
"public function offsetUnset(mixed $key): void\n {\n if ($this->hasArgument($key)) {\n unset($this->arguments[$key]);\n }\n }",
"public function withoutValue();",
"public function remove($property);",
"function route_param(string $name)\n{\n $params = RouteController::getCurrentRoute()['params'];\n\n if ($params) {\n foreach ($params as $param) {\n if ($param['name'] == $name) {\n return $param['value'];\n }\n }\n }\n\n return null;\n}"
]
| [
"0.70764345",
"0.64789015",
"0.6235475",
"0.61707926",
"0.6006236",
"0.5923776",
"0.5909116",
"0.5861169",
"0.5861169",
"0.58548206",
"0.58530664",
"0.5818353",
"0.57895267",
"0.5745508",
"0.5685839",
"0.5672413",
"0.5664246",
"0.5629639",
"0.5626213",
"0.5623637",
"0.5623297",
"0.5599552",
"0.55350876",
"0.5516962",
"0.5503147",
"0.54535097",
"0.54366046",
"0.53959465",
"0.5365763",
"0.5358758",
"0.5348174",
"0.5343332",
"0.532431",
"0.53108",
"0.528416",
"0.5256355",
"0.52524024",
"0.5239341",
"0.5229579",
"0.5196262",
"0.51898146",
"0.5166043",
"0.5129172",
"0.5115907",
"0.5097165",
"0.50890404",
"0.5086143",
"0.50844955",
"0.5071569",
"0.50647604",
"0.50631994",
"0.5019354",
"0.5019233",
"0.50185055",
"0.50173146",
"0.50148714",
"0.5013135",
"0.5005669",
"0.49953303",
"0.4991871",
"0.49861458",
"0.49809614",
"0.49806228",
"0.49792904",
"0.49785167",
"0.4967281",
"0.49646017",
"0.49644947",
"0.4960764",
"0.49523893",
"0.49361598",
"0.4928273",
"0.49232432",
"0.49232432",
"0.4922878",
"0.4922491",
"0.4922491",
"0.4919911",
"0.4918033",
"0.49102032",
"0.49083334",
"0.4907145",
"0.49045905",
"0.48965678",
"0.48877764",
"0.4886738",
"0.48778754",
"0.48755643",
"0.4872916",
"0.4862427",
"0.48611504",
"0.48568025",
"0.48550975",
"0.4853022",
"0.4851343",
"0.48392975",
"0.48386145",
"0.48374498",
"0.48354614",
"0.48351124"
]
| 0.55974996 | 22 |
Get the key / value list of parameters for the route. | public function parameters()
{
if (isset($this->parameters)) {
return $this->parameters;
}
throw new LogicException('Route is not bound.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRouteParams();",
"function getRouteParameters();",
"private function getParameters() {\n $raw_parameters = $this->routeMatch->getRawParameters();\n $parameters = $this->routeMatch->getParameters();\n\n $return_params = [];\n foreach ($parameters as $key => $value) {\n if ($raw_value = $raw_parameters->get($key)) {\n $return_params[$key] = $raw_value;\n continue;\n }\n\n $return_params[$key] = $parameters->get($key);\n }\n\n return $return_params;\n }",
"public function parameters(): array\n {\n $requestRoute = request()->route()->getName();\n $requestValues = Str::of($requestRoute)\n ->explode('.')\n ->toArray();\n\n return is_null($requestValues)\n ? []\n : $requestValues;\n }",
"public function getRouteParameters()\n {\n return $this->routeParameters;\n }",
"public function getRouteParameters()\n {\n return $this->routeParameters;\n }",
"public function parameters(): array\n {\n return $this->route->parameters();\n }",
"public function routerParams()\n {\n /* @var Router $router */\n $router = $this->container->get('router');\n $request = $this->container->get('request_stack')->getCurrentRequest();\n\n $routeName = $request->attributes->get('_route');\n $routeParams = $request->query->all();\n $routeCollection = $router->getRouteCollection();\n /* @var CompiledRoute $compiledRouteConnection */\n $compiledRouteConnection = $routeCollection->get($routeName)->compile();\n foreach ($compiledRouteConnection->getVariables() as $variable) {\n $routeParams[$variable] = $request->attributes->get($variable);\n }\n\n return $routeParams;\n }",
"public static function params()\n\t{\n\t\treturn self::$router->getParams();\n\t}",
"protected function getRouteParams(): array {\n return [];\n }",
"public function getParams()\n {\n return $this->getEvent()->getRouteMatch()->getParams();\n }",
"public function getParamKeys()\n {\n $array = array(\n \"controller\" => array(\n \"def_value\" => null,\n \"allow_null\" => false,\n \"filter\" => new PHPFrame_StringFilter(array(\n \"min_length\" => 2,\n \"max_length\" => 50\n ))\n ),\n \"action\" => array(\n \"def_value\" => null,\n \"allow_null\" => true,\n \"filter\" => new PHPFrame_StringFilter(array(\n \"min_length\" => 2,\n \"max_length\" => 50\n ))\n ),\n \"params\" => array(\n \"def_value\" => null,\n \"allow_null\" => true,\n \"filter\" => new PHPFrame_StringFilter()\n )\n );\n\n return array_merge(parent::getParamKeys(), $array);\n }",
"private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }",
"public function getRoutingParameters()\n {\n return $this->routing_parameters;\n }",
"public function url_parameters()\n {\n return $this->_params;\n }",
"function getAdditionalParams() {\n return array(\n 'route' => $this->getRouteName(),\n ); // array\n }",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"function route_params(): array\n{\n return RouteController::getCurrentRoute()['params'] ?? [];\n}",
"protected function getViewArgumentsFromRoute() {\n // The code of this function is taken in part from the view page controller\n // method (Drupal\\views\\Routing\\ViewPageController::handle()).\n $route = $this->routeMatch->getRouteObject();\n $map = $route->hasOption('_view_argument_map') ? $route->getOption('_view_argument_map') : [];\n\n $args = [];\n foreach ($map as $attribute => $parameter_name) {\n $parameter_name = isset($parameter_name) ? $parameter_name : $attribute;\n if (($arg = $this->routeMatch->getRawParameter($parameter_name)) !== NULL) {\n $args[] = $arg;\n }\n }\n return $args;\n }",
"protected function getParameterPairs($search_for = array())\n {\n $route_parameters = array();\n\n $i = $this->setIndexAtMax();\n\n while ($i > 0) {\n\n $results = $this->getParameterPair($i, $search_for, $route_parameters);\n if ($results === false) {\n break;\n }\n\n $route_parameters = $results;\n $i = $i - 2;\n }\n\n $this->setPath();\n\n return $route_parameters;\n }",
"public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }",
"public function getParams()\n {\n $params = explode('/', $this->getPath());\n array_shift($params);\n return $params;\n }",
"function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lessonpageid);;\n }",
"public function getParametersList(){\n return $this->_get(2);\n }",
"public function getParams() {}",
"public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}",
"public function get_url_get_parameters() {\r\n\t\treturn $this->url_get_parameters;\r\n\t}",
"public function getArgs(){\n\t\t\treturn $this->matchingRoute->getParam($this->url->getLastPartOfUrl());\n\t\t}",
"public function getParameters(/* ... */)\n {\n return $this->_params;\n }",
"private static function getParams(): array\n {\n $getParams = [];\n\n if (!empty($_GET)) {\n $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT);\n }\n\n return $getParams;\n }",
"public function getParams($key)\n {\n $params = (array_key_exists($key, $this->params)) ? $this->params[$key] : array();\n return $params;\n }",
"public static function getRouteVariables() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$data = self::$route_parameters;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $data);\n\t\t$data = self::_applyFilter(get_class(), __FUNCTION__, $data, array('event' => 'return'));\n\n\t\treturn $data;\n\n\t}",
"private function parseParameters(): Collection\n {\n $offset = 0;\n $closePos = 0;\n $Parameters = new Collection();\n\n while ($openPos = strpos($this->uri, '{', $offset)) {\n if ($closePos = strpos($this->uri, '}', $openPos)) {\n $length = $closePos - $openPos - 1;\n $name = substr($this->uri, $openPos + 1, $length);\n $required = true;\n\n if (Str::endsWith($name, '?')) {\n $required = false;\n $name = rtrim($name, '?');\n }\n\n $Parameters->push(new RouteParameter($name, $required));\n $offset = $closePos;\n }\n }\n\n return $Parameters;\n }",
"public function parameters()\n {\n $this->isSecured();\n\n return [\n 'original' => $this->getUri(),\n 'hash' => $this->getHash(),\n 'secured' => $this->getIsSecured(),\n\n 'uri' => $this->getIdentifier(),\n 'url' => $this->getLocator(),\n 'urn' => $this->getName(),\n\n 'scheme' => $this->getScheme(),\n 'protocol' => $this->getProtocol(),\n 'user' => $this->getUser(),\n 'pass' => $this->getPass(),\n\n 'host' => $this->getHost(),\n 'registrable_domain' => $this->getRegistrableDomain(),\n 'subdomain' => $this->getSubdomain(),\n 'hostname' => $this->getHostname(),\n 'tld' => $this->getTld(),\n 'isValidDomain' => $this->getIsValidDomain(),\n 'isIp' => $this->getIsIp(),\n\n 'port' => $this->getPort(),\n 'path' => $this->getPath().$this->getFile(),\n 'segments' => $this->getSegments(),\n 'file' => $this->getFile(),\n 'dirname' => $this->getDirname(),\n 'filename' => $this->getFilename(),\n 'extension' => $this->getExtension(),\n // 'segment_1' => $this->getSegment(1),\n // 'segment_2' => $this->getSegment(2),\n // 'segment_4' => $this->getSegment(4),\n\n 'query' => $this->getQuery(),\n 'parameters' => $this->getParameters(),\n // 'parameters_p2' => $this->getParameter('p2'),\n\n 'fragment' => $this->getFragment(),\n 'fragments' => $this->getFragments(),\n // 'fragmentsParameter_p2' => $this->getFragmentsParameter('p2'),\n ];\n }",
"public function parseParameterNames()\n {\n return RouteMatch::parseParameterNames($this);\n }",
"public function params()\n {\n if (empty($this->params)) {\n return null;\n }\n\n $params = isset($this->params) ? $this->params : array();\n\n $many = $this->hasMany('params');\n\n return array(\n 'title' => $many ? 'Options' : 'Option',\n 'txt' => $many\n ? 'The following request parameters are available:'\n : 'The following request parameter is available:',\n 'items' => array_values($params)\n );\n }",
"public static function getParams()\n {\n return self::$params;\n }",
"public function getParams() {\n\t\treturn $this -> v_params;\n\t}",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParamNames();",
"public function getParameters()\n {\n return $this->params;\n }",
"public function getParameters()\n {\n return $this->params;\n }",
"public function getParameters()\n {\n return $this->params;\n }",
"public function getParameters()\n {\n return $this->params;\n }",
"public function getParameters() {\n $matches = array();\n $regexp = '/:[a-zA-Z_][a-zA-Z0-9_]*/';\n $count = preg_match_all($regexp, $this->path, $matches);\n \n return $matches[0];\n }",
"public function getParameters()\n {\n return $this->parameters->all();\n }",
"public function parameters()\n {\n return array_merge($this->get, $this->post);\n }",
"public function getParams()\n {\n return $this->getAttribute('params', false, null);\n }",
"public function getRouteAndParams()\n {\n $request = $this->get('request_stack')->getCurrentRequest();\n $routing = $request->attributes->all();\n\n $ret = new \\stdClass();\n\n $ret->route = $routing['_route'];\n $ret->params = array_merge($routing['_route_params'], $request->query->all());\n\n return $ret;\n }",
"public function parameters()\n {\n return [\n 'dir' => $this->input('dir'),\n 'hash' => $this->input('hash', ''),\n 'data' => $this->input('data'),\n 'name' => $this->input('name'),\n 'type' => $this->input('type'),\n 'offset' => $this->input('offset'),\n 'eof' => $this->input('eof'),\n ];\n }",
"public function getParams()\r\n\t{\r\n\t\treturn $this->params;\r\n\t}",
"private function getParameters()\n {\n $inputParametersStr = \"\";\n\n foreach ($_GET as $key => $input) {\n\n if(empty($input)){\n continue ; //ignore empty field \n }\n $inputParametersStr .= \"$key=\" . urlencode($input) . \"&\"; // convert string into url syntax.\n\n }\n $inputParametersStr = trim($inputParametersStr, '&'); // separate parameters by \"&\" .\n\n return $inputParametersStr ;\n }",
"public function get_params() {\n\t\treturn $this->params;\n\t}",
"public function getRequestParams()\n {\n return $this->getKey('RequestParams');\n }",
"public function getParams(string $key = \"\") {\n if ($key != \"\") {\n return $this->params[$key];\n }\n\n return $this->params;\n }",
"protected function getOptionalParameters(): array\n {\n preg_match_all('/\\{(\\w+?)\\?\\}/', $this->route->message(), $matches);\n\n return isset($matches[1]) ? array_fill_keys($matches[1], null) : [];\n }",
"protected function getAllArgs()\n {\n $this->methodExpectsRequest(__METHOD__);\n $params = [];\n foreach ($this->getRequest()->getAllArgs() as $index => $value) {\n if (isset($this->argument_position_name[$index])) {\n $param_name = $this->argument_position_name[$index];\n $params[$param_name] = $value;\n }\n }\n return $params;\n }",
"public function queryParams();",
"public function getParameters() {}",
"public function getParams()\n {\n return $this->_params;\n }",
"public function getParams()\n {\n return $this->_params;\n }",
"public function getParams()\n {\n return $this->_params;\n }",
"public function getParams()\n {\n return $this->_params;\n }",
"public function getParams()\n {\n // TODO: Implement getParams() method.\n }",
"public function getParameters()\n {\n return array();\n }",
"public function getParams()\n\t{\n\t\treturn $this->params;\n\t}",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams()\n {\n return $this->params;\n }",
"public function getParams(): array;",
"public static function getURLParams()\n\t{\n\t\t$params = [];\n\t\t$urlParams = self::getAllURLParams();\n\t\tfor ($i = contrlPos + 2; $i < count($urlParams); $i++) {\n\t\t\t$params[] = $urlParams[$i];\n\t\t}\n\t\treturn $params;\n\t}"
]
| [
"0.81544757",
"0.7986946",
"0.77681196",
"0.7619929",
"0.7612942",
"0.7612942",
"0.7562226",
"0.75297177",
"0.71225554",
"0.706051",
"0.70486593",
"0.69634765",
"0.6956096",
"0.6953415",
"0.69475913",
"0.6915139",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68954706",
"0.68897706",
"0.68462515",
"0.6826357",
"0.68239623",
"0.67942756",
"0.6791282",
"0.6773272",
"0.6755",
"0.6741266",
"0.6738381",
"0.6709369",
"0.6693443",
"0.6662478",
"0.6661073",
"0.6655312",
"0.66538805",
"0.6642615",
"0.66251767",
"0.6623819",
"0.6614424",
"0.6611572",
"0.6610245",
"0.6610245",
"0.6610245",
"0.6610245",
"0.6610245",
"0.6610245",
"0.6610245",
"0.6610245",
"0.6585042",
"0.65723884",
"0.65723884",
"0.65723884",
"0.65723884",
"0.65702474",
"0.6556505",
"0.6543676",
"0.65297717",
"0.65232176",
"0.6510271",
"0.650477",
"0.6501594",
"0.6499589",
"0.6496002",
"0.64952236",
"0.64893717",
"0.64889216",
"0.6469317",
"0.6466913",
"0.64663637",
"0.64663637",
"0.64663637",
"0.64663637",
"0.6458749",
"0.64558053",
"0.64514",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.64487326",
"0.6444961",
"0.6444668"
]
| 0.0 | -1 |
Get the key / value list of parameters without null values. | public function parametersWithoutNulls()
{
return array_filter($this->parameters(), function ($p) {
return ! is_null($p);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParametersWithoutNulls()\n {\n return array_filter($this->getParameters(), function ($p) {\n return !is_null($p);\n });\n }",
"public function getParameterValues()\n {\n $values = array();\n\n foreach ($this->parameters as $name => $parameter) {\n if (!$parameter->isRequired()) {\n $values[$name] = $parameter->getDefaultValue();\n }\n }\n\n return $values;\n }",
"private function getParameterSet() // {{{\n {\n $parameters = array();\n foreach ($this->m_entries as $bibtex_name => $bibtex_entry)\n {\n $entry_params = array_keys($bibtex_entry);\n $parameters = array_merge($parameters, $entry_params);\n }\n $unique_parameters = array_unique($parameters);\n return $unique_parameters;\n }",
"public function getParamKeys()\n {\n $array = array(\n \"controller\" => array(\n \"def_value\" => null,\n \"allow_null\" => false,\n \"filter\" => new PHPFrame_StringFilter(array(\n \"min_length\" => 2,\n \"max_length\" => 50\n ))\n ),\n \"action\" => array(\n \"def_value\" => null,\n \"allow_null\" => true,\n \"filter\" => new PHPFrame_StringFilter(array(\n \"min_length\" => 2,\n \"max_length\" => 50\n ))\n ),\n \"params\" => array(\n \"def_value\" => null,\n \"allow_null\" => true,\n \"filter\" => new PHPFrame_StringFilter()\n )\n );\n\n return array_merge(parent::getParamKeys(), $array);\n }",
"public function getParameters(): array\n {\n if (\n $this->comparator === ComparatorEnum::NOT_NULL\n || $this->comparator === ComparatorEnum::IS_NULL\n ) {\n return [];\n }\n\n if (!is_array($this->value)) {\n return [$this->value];\n }\n\n return $this->value;\n }",
"public function getValidParameters()\n {\n return null;\n }",
"public function getParams($key = null)\t{\n\t\tif ($key == null) \n\t\t\treturn $this->params;\n\t\telse if (!isset($this->params[$key])) \n\t\t\treturn null;\n\t\telse \n\t\t\treturn $this->params[$key];\n\t}",
"protected function getOptionalParameters(): array\n {\n preg_match_all('/\\{(\\w+?)\\?\\}/', $this->route->message(), $matches);\n\n return isset($matches[1]) ? array_fill_keys($matches[1], null) : [];\n }",
"public function params()\n\t{\n\t\t$r = array();\n\t\tforeach (func_get_args() as $name)\n\t\t\t$r[] = @$this->params[$name];\n\t\treturn $r;\n\t}",
"public static function parameters()\n {\n $fields = array('name', 'amount');\n return array_intersect_key(self::fields(), array_flip($fields));\n }",
"public function getParametersList(){\n return $this->_get(2);\n }",
"public function getOptionalParameters();",
"public function getUnfilteredParameters()\n {\n return array_merge($this->get('postData'), $this->get('getData'));\n }",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"public function getParams();",
"function get_list_params()\n\t{\n\t\treturn '';\n\t}",
"public function getParameterValues(): array\n {\n return $this->parameterValues;\n }",
"public function getParamNames();",
"public function getParameters()\n {\n return array();\n }",
"private static function ParamList ()\n {\n return array (\n \"a\" => array (\n \"charset\", \"coords\", \"href\",\n \"hreflang\", \"name\", \"rel\",\n \"rev\", \"shape\", \"target\",\n \"style\",\n ),\n \"button\" => array (\n \"disabled\", \"name\", \"type\",\n \"value\", \"accesskey\", \"class\",\n \"dir\", \"id\", \"lang\", \"style\",\n \"tabindex\", \"title\", \"xml:lang\",\n ),\n );\n }",
"private static function getParams(): array\n {\n $getParams = [];\n\n if (!empty($_GET)) {\n $getParams = filter_input_array(INPUT_GET, FILTER_DEFAULT);\n }\n\n return $getParams;\n }",
"private function getParameters() {\n $raw_parameters = $this->routeMatch->getRawParameters();\n $parameters = $this->routeMatch->getParameters();\n\n $return_params = [];\n foreach ($parameters as $key => $value) {\n if ($raw_value = $raw_parameters->get($key)) {\n $return_params[$key] = $raw_value;\n continue;\n }\n\n $return_params[$key] = $parameters->get($key);\n }\n\n return $return_params;\n }",
"public function getParamKeys()\n {\n $array = array(\n \"posts_per_page\" => array(\n \"def_value\" => 10,\n \"allow_null\" => false,\n \"filter\" => new PHPFrame_IntFilter()\n )\n );\n\n return array_merge(parent::getParamKeys(), $array);\n }",
"public function getParameterNames ()\n {\n\n return array_keys($this->parameters);\n\n }",
"private function collectRequiredParams() {\n $dst = array();\n foreach ($this->getAllOptions() as $param) \n {\n if ($this->paramIsRequired($param) === true) \n {\n $dst[] = $this->clearParam($param); \n }\n \n }\n\n return $dst;\n }",
"public function getAllParam()\n {\n return isset($this->params) ? $this->params : null;\n }",
"public function getParams($key = '') {\n if($key === '') {\n return $this->params;\n } else {\n if(isset($this->params[$key])) {\n return $this->params[$key];\n } else {\n return '';\n }\n }\n }",
"public function getParams()\n {\n $shift = array('CONTROLLER', 'ROUTE_CONTROLLER', 'ACTION', 'ROUTE_ACTION');\n $values = array();\n foreach ($this->joUrl as $key => $value) {\n if (!in_array($key, $shift)) {\n $values[] = self::setAntiInjection($value);\n }\n }\n return $values;\n }",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"public function getParameters();",
"#[Pure] public function getParameters(): array\n {\n $array = [];\n foreach ($this->parameters as $name => $parameter) {\n $array[$this->dbc->makeParameterLabel($name)] = $parameter;\n }\n return $array;\n }",
"public function getParams() {}",
"function getParameters(): array;",
"final public static function getParams()\n {\n $param = self::getUrl();\n\n $y=0;while($y <= 2){\n unset($param[$y]);\n $y++;\n }\n\n foreach($param as $t ){\n $p[] = array($t);\n }\n\n $r=0;\n while($r <= count($p)){\n\n $par[$p[$r][0]] = $p[$r + 1][0];\n\n $r += 2;\n }\n\n return array_filter($par);\n }",
"public function getParams($key = '')\n {\n if (is_numeric($key))\n {\n return isset($this->params[$key]) ? $this->params[$key] : null;\n }\n\n return $this->params;\n }",
"private function getAllInputParameters () {\n// \t\t$params = $this->getInputParameters();\n\t\t$params = array();\n\t\t$catalogId = $this->session->getCourseCatalogId();\n\t\tif (!$catalogId->isEqual($this->session->getCombinedCatalogId()))\n\t\t\t$params[':catalog_id'] = $this->session->getCatalogDatabaseId($catalogId);\n\t\t\n\t\t$params[':subj_code'] = $this->session->getSubjectFromCourseId($this->courseId);\n\t\t$params[':crse_numb'] = $this->session->getNumberFromCourseId($this->courseId);\n\t\t\n\t\treturn $params;\n\t}",
"public function params()\n {\n if (empty($this->params)) {\n return null;\n }\n\n $params = isset($this->params) ? $this->params : array();\n\n $many = $this->hasMany('params');\n\n return array(\n 'title' => $many ? 'Options' : 'Option',\n 'txt' => $many\n ? 'The following request parameters are available:'\n : 'The following request parameter is available:',\n 'items' => array_values($params)\n );\n }",
"public function getDefinedParameters();",
"public function parameters(): array\n {\n $requestRoute = request()->route()->getName();\n $requestValues = Str::of($requestRoute)\n ->explode('.')\n ->toArray();\n\n return is_null($requestValues)\n ? []\n : $requestValues;\n }",
"public function keys()\n {\n return array_keys($this->parameters);\n }",
"public function getParams(): array;",
"protected function getQueryParameters(): array\n {\n return [\n // not hidden.\n 'H' => false,\n // add, not only generate hash.\n 'n' => false,\n // no progress.\n 'p' => false,\n // pin file\n 'pin' => true,\n // not recursive (single file).\n 'r' => false,\n // no tickle\n 't' => false,\n // no wrap.\n 'w' => false,\n ];\n }",
"public function getParameters(): array;",
"protected function forbiddenValues()\n\t{\n\t\treturn (array) $this->params->get('forbiddenValues', [null, '']);\n\t}",
"public function getParameters(/* ... */)\n {\n return $this->_params;\n }",
"public function getParameters()\n {\n return $this->parameters->all();\n }",
"public function getRequestParameters() {\n return array();\n }",
"public function getParameters() {}",
"function getParamaters() {\n\t\treturn $this->preparedvalues;\n\t}",
"public function getParams(string $key = \"\") {\n if ($key != \"\") {\n return $this->params[$key];\n }\n\n return $this->params;\n }",
"private function getParameters()\n {\n $inputParametersStr = \"\";\n\n foreach ($_GET as $key => $input) {\n\n if(empty($input)){\n continue ; //ignore empty field \n }\n $inputParametersStr .= \"$key=\" . urlencode($input) . \"&\"; // convert string into url syntax.\n\n }\n $inputParametersStr = trim($inputParametersStr, '&'); // separate parameters by \"&\" .\n\n return $inputParametersStr ;\n }",
"public function getEmptyValues();",
"function getParameterNames();",
"public function getOptionalParameters(): array\n {\n return $this->optionalParameters;\n }",
"public function GetAll()\n {\n return $this->_keyValPairs;\n }",
"public function getParams($key)\n {\n $params = (array_key_exists($key, $this->params)) ? $this->params[$key] : array();\n return $params;\n }",
"function getParams($input) {\n\n $filterParams = [];\n\n foreach($input as $param => $value) {\n $filterParams[] = \"$param=:$param\";\n }\n \n return implode(\", \", $filterParams);\n\t}",
"function getParams($input)\n {\n $filterParams = [];\n foreach($input as $param => $value)\n {\n $filterParams[] = \"$param=:$param\";\n }\n return implode(\", \", $filterParams);\n }",
"public function parameters()\n {\n return array_merge($this->get, $this->post);\n }",
"public function getParams()\n {\n return $this->getAttribute('params', false, null);\n }",
"public function getMandatoryParameters($by_name = true)\n\t{\n\t\t$parameters = [];\n\t\tforeach ($this->getParameters($by_name) as $key => $parameter) {\n\t\t\tif (!$parameter->isOptional()) {\n\t\t\t\t$parameters[$key] = $parameter;\n\t\t\t}\n\t\t}\n\t\treturn $parameters;\n\t}",
"public function getParams() :array;",
"private function prepareParameters($data)\r\n {\r\n // Parameters are sorted by name, using lexicographical byte value\r\n // ordering. Ref: Spec: 9.1.1 (1).\r\n uksort($data, 'strcmp');\r\n\r\n foreach ($data as $key => $value) {\r\n if ($value === null) {\r\n unset($data[$key]);\r\n }\r\n }\r\n\r\n return $data;\r\n }",
"public function params( $mask = null ) {\n\t\t$params = $_REQUEST;\n\t\tif ( null !== $mask ) {\n\t\t\tif ( ! is_array( $mask ) ) {\n\t\t\t\t$mask = func_get_args();\n\t\t\t}\n\t\t\t$params = array_intersect_key( $params, array_flip( $mask ) );\n\t\t\t// Make sure each key in $mask has at least a null value\n\t\t\tforeach ( $mask as $key ) {\n\t\t\t\tif ( ! isset( $params[ $key ] ) ) {\n\t\t\t\t\t$params[ $key ] = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}",
"public function getParameters()\n {\n $parameters = \"\";\n \n foreach($this->params as $param => $value)\n {\n $parameters .= urlencode($param.\"=\".$value).\";\"; \n }\n \n $parameters = trim($parameters, \";\");\n \n return($parameters);\n }",
"public function getFilterKeys() {\n\t\t$keyList = $this->typoScriptConfiguration->getSetting('filters', 'string');\n\t\t$keys = explode(\",\", $keyList);\n\t\tif (FALSE === is_array($keys) || sizeof($keys) < 1) {\n\t\t\treturn array();\n\t\t}\n\t\t$filterKeys = array();\n\t\tforeach ($keys as $key) {\n\t\t\t$filterKeys[] = trim($key);\n\t\t}\n\t\treturn $filterKeys;\n\t}",
"public function getParamsNames() : array\n {\n\n // Lvd.\n $result = [];\n\n foreach ($this->params as $order => $param) {\n $result[$order] = $param['name'];\n }\n\n return $result;\n }",
"public function getAllParameters()\n\t{\n\t\t// Collect parameters used in template\n\t\t$params = [];\n\t\tforeach ($this->configurator->tags as $tag)\n\t\t{\n\t\t\tif (isset($tag->template))\n\t\t\t{\n\t\t\t\tforeach ($tag->template->getParameters() as $paramName)\n\t\t\t\t{\n\t\t\t\t\t$params[$paramName] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Merge defined parameters and those collected from templates. Defined parameters take\n\t\t// precedence\n\t\t$params = iterator_to_array($this->parameters) + $params;\n\n\t\t// Sort parameters by name for consistency\n\t\tksort($params);\n\n\t\treturn $params;\n\t}",
"public function params() : DeepList {\n return $this->_params;\n }",
"private function compileParameters()\n {\n $params = [\n 'queueName' => property_exists($this, 'queueName') ? $this->queueName : null,\n 'exchangeName' => property_exists($this, 'exchangeName') ? $this->exchangeName : null,\n 'exchangeType' => property_exists($this, 'exchangeType') ? $this->exchangeType : null,\n 'passive' => property_exists($this, 'passive') ? $this->passive : null,\n 'durable' => property_exists($this, 'durable') ? $this->durable : null,\n 'autoDelete' => property_exists($this, 'autoDelete') ? $this->autoDelete : null,\n 'deliveryMode' => property_exists($this, 'deliveryMode') ? $this->deliveryMode : null,\n ];\n\n return array_filter($params);\n }",
"protected function determineOptionsFromParameters()\n {\n $params = $this->reflection->getParameters();\n if (empty($params)) {\n return [];\n }\n $param = end($params);\n if (!$param->isDefaultValueAvailable()) {\n return [];\n }\n if (!$this->isAssoc($param->getDefaultValue())) {\n return [];\n }\n return $param->getDefaultValue();\n }",
"public function getParams()\n {\n // TODO: Implement getParams() method.\n }",
"public function getParameterConditions(): array\n {\n return $this->parameterConditions;\n }",
"public function getParameters() : array\n {\n return $this->parameters;\n }",
"protected function getParametros(){\n\t\t\n\t\t$parametros = array();\t\t\t\n\t\t\n\t\t$parametros[\":nickname\"] \t\t= $this->nickName;\n\t\t$parametros[\":nombrecompleto\"] \t= $this->nombreCompleto;\n\t\t$parametros[\":apellidos\"] \t\t= $this->apellidos;\n\t\t$parametros[\":email\"] \t\t\t= $this->email;\n\t\t$parametros[\":password\"] \t\t= $this->password;\n\t\t$parametros[\":fkGrupoUsuario\"] \t= $this->fkGrupoUsuario;\n\n\t\treturn $parametros;\n\t}",
"public static function getRequiredParams();",
"public function getParameters($includeGET = true)\n {\n return ($includeGET) ?\n $this->parameters :\n array_diff_assoc($this->parameters, $this->request->query->all())\n ;\n }",
"public function getParameters()\n {\n return get_object_vars($this->record);\n }",
"public function getParams()\n {\n $data = $this->_data['params'];\n $data = unserialize($data);\n return $data;\n }",
"function allowed_get_params($allowed_params = []){\r\n //$allowed_array will contain only allowed url parameters\r\n $allowed_array = [];\r\n foreach($allowed_params as $param){\r\n if(isset($_GET[$param])){\r\n $allowed_array[$param] = $_GET[$param];\r\n }else{\r\n $allowed_array[$param] = NULL;\r\n }\r\n }\r\n return $allowed_array;\r\n\r\n}",
"function getParams()\n {\n }",
"function PKG_listParams($paramStr)\n{\n\t$params = explodeAssoc(\"?#*\",$paramStr);\n\n\t$out = \"\";\n\n\t$keys = array_keys($params);\n\n\tfor ($i=0; $i < count($keys); $i++)\n\t\tif ((strlen($keys[$i]) > 0) && (strlen($params[$keys[$i]]) > 0))\n\t\t$out.=wordwrap($keys[$i].\": \".$params[$keys[$i]].\"<br>\",60);\n\n\treturn($out);\n}",
"public function getQueryParameters(): array;",
"public function getParameters(): array\n {\n return $this->parameters;\n }",
"public function getParameters(): array\n {\n return $this->parameters;\n }",
"public function getParameters(): array\n {\n return $this->parameters;\n }"
]
| [
"0.7749759",
"0.7053408",
"0.6737644",
"0.6717645",
"0.6683586",
"0.6669722",
"0.6647701",
"0.65983206",
"0.6530449",
"0.64587",
"0.6454216",
"0.64248884",
"0.6347097",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.6336481",
"0.63315046",
"0.6323573",
"0.63114655",
"0.6299534",
"0.6293681",
"0.6273616",
"0.62716824",
"0.6265198",
"0.6264578",
"0.6238787",
"0.6217353",
"0.61928594",
"0.61845464",
"0.6142822",
"0.6142822",
"0.6142822",
"0.6142822",
"0.6142822",
"0.6142822",
"0.6142822",
"0.6142822",
"0.61239374",
"0.61218834",
"0.60955584",
"0.6092561",
"0.6088913",
"0.6085266",
"0.6080268",
"0.6080034",
"0.60720193",
"0.6054186",
"0.6045905",
"0.60323083",
"0.6026376",
"0.60186785",
"0.60157377",
"0.59787714",
"0.5975725",
"0.5963687",
"0.59634644",
"0.59474295",
"0.5942489",
"0.59424293",
"0.59206903",
"0.591851",
"0.59070337",
"0.5885931",
"0.58835363",
"0.58763534",
"0.58690506",
"0.58651376",
"0.58518624",
"0.5834076",
"0.5833882",
"0.58257765",
"0.5820536",
"0.58142173",
"0.5802575",
"0.58010834",
"0.5788706",
"0.578721",
"0.5784558",
"0.578434",
"0.57819533",
"0.57715005",
"0.5768053",
"0.5760867",
"0.5759757",
"0.5745513",
"0.57452303",
"0.5743926",
"0.5742469",
"0.5736461",
"0.57354647",
"0.57322997",
"0.57322997",
"0.57322997"
]
| 0.7646405 | 1 |
Determine if the route only responds to HTTP requests. | public function httpOnly()
{
return in_array('http', $this->action, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest();",
"public function canHandleRequest();",
"function canHandleRequest() ;",
"public function matches(lib_routing_route $route, lib_http_request $request)\n\t{\n\t\tif ($route->httpOnly())\n\t\t{\n\t\t\treturn ! $request->secure();\n\t\t}\n\t\telseif ($route->secure())\n\t\t{\n\t\t\treturn $request->secure();\n\t\t}\n\n\t\treturn true;\n\t}",
"private function usesNonStandardHttpPort(): bool\n {\n return 'http' === $this->getScheme() && '80' != $this->router->getContext()->getHttpPort();\n }",
"private function _isResource() {\n $Info = explode('.', $_SERVER[\"REQUEST_URI\"]);\n $rVal = false;\n\n if ( count($Info) > 1 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }",
"public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}",
"function qa_is_http_get()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn $_SERVER['REQUEST_METHOD'] === 'GET';\n}",
"public static function isAllowedRouteRequest() {\n\t\treturn self::$correct_request_method;\n\t}",
"public function hasRoute(): bool;",
"public function hasHttpMethod()\n {\n return $this->http_method !== null;\n }",
"function ajan_is_get_request() {\n\treturn (bool) ( 'GET' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );\n}",
"public function isHttpRequest()\n {\n return ! $this->isCli();\n }",
"public function canHandleRequest(\\Eeno\\Http\\Request $request)\n {\n if( strcasecmp($request->method() , $this->method() ) == 0 &&\n strcasecmp($this->url() , $request->url() ) == 0)\n return true;\n return false; \n }",
"public function checkRoute()\n\t{\n\t\tif(!self::$load):\n\t\t\thttp_response_code(404);\n\t\t\tdie('No route found');\n\t\tendif;\n\t}",
"public function serverSupportsPartialRequests(): bool\n {\n $this->logger->info('Preparing to check server supports to partial requests');\n\n $response = $this->client->head('/');\n\n if (!array_key_exists('Accept-Ranges', $response->getHeaders())) {\n $this->logger->warning(\"Server doesn't support partial requests\");\n $this->logger->debug(\"Header 'Accept-Ranges' there isn't in response\");\n\n return false;\n }\n\n $headerAcceptRanges = $response->getHeaderLine('Accept-Ranges');\n if (!in_array($headerAcceptRanges, $this->acceptRanges)\n || strtolower($headerAcceptRanges) === \"none\") {\n $this->logger->warning(\"Server doesn't support partial requests\");\n $this->logger->debug(\"Header 'Accept-Ranges' return '{$headerAcceptRanges}' value\");\n\n return false;\n }\n\n /**\n * This is an optional header\n */\n if (array_key_exists('Content-Length', $response->getHeaders())) {\n $this->logger->debug(\"Header 'Content-Length' there is in response\");\n\n $contentLength = (int)$response->getHeaderLine('Content-Length');\n if ($contentLength) {\n $this->contentLength = $contentLength;\n $this->logger->debug(\"Header 'Content-Length' return '{$this->contentLength} value\");\n }\n }\n\n return true;\n }",
"function canProcessRequests()\n\t{\n\t\tif ($this->getRequestMode() != -1) return true;\n\t\treturn false;\n\t}",
"public function isHttpLoggingOn() {\n\t\treturn $this->httpLoggingOn;\n\t}",
"public function shouldCheckHttpHost()\n {\n return !Director::is_cli() && isset($_SERVER['HTTP_HOST']);\n }",
"private function isAliveRequest() : bool {\n return\n $_SERVER['REQUEST_METHOD'] === \"GET\"\n &&\n $_SERVER['DOCUMENT_URI'] === '/status';\n }",
"public function validate( IHTTPRouteRequest $request, IHTTPRoute $route ) : bool\n {\n if ( !in_array( self::COMMAND, $route->getOptions()))\n return true;\n \n return ( $request->getHeader( self::REQUESTED_WITH ) == self::REQUESTED_WITH_XHR );\n }",
"public function isHttpOnly()\n {\n return in_array('http', $this->action, true);\n }",
"public function hasRequestBeenHandled() : bool\n {\n return $this->requestHandled;\n }",
"public static function is_request()\n\t{\n\t\treturn self::$is_server;\n\t}",
"public function isHttponly(): bool\n {\n return $this->httponly;\n }",
"private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function hasRequest(): bool;",
"public function hasRequest(): bool;",
"public function allowRequest(): bool\n {\n return true;\n }",
"public function isRequest();",
"function is_get_request()\n{\n return $_SERVER['REQUEST_METHOD'] === 'GET';\n}",
"public function testHttpMethods()\n {\n //Case A\n $r = new \\Slim\\Route('/foo', function () {});\n $this->assertEmpty($r->getHttpMethods());\n //Case B\n $r->setHttpMethods('GET');\n $this->assertEquals(array('GET'), $r->getHttpMethods());\n //Case C\n $r->appendHttpMethods('POST', 'PUT');\n $this->assertEquals(array('GET', 'POST', 'PUT'), $r->getHttpMethods());\n //Case D\n $this->assertTrue($r->supportsHttpMethod('GET'));\n $this->assertFalse($r->supportsHttpMethod('DELETE'));\n //Case E\n $viaResult = $r->via('DELETE');\n $this->assertTrue($viaResult instanceof \\Slim\\Route);\n $this->assertTrue($r->supportsHttpMethod('DELETE'));\n }",
"public function handles(Request $request)\n {\n return preg_match($this->methodRegex, $request->method())\n && preg_match($this->urlRegex, $request->url());\n }",
"function request_is_get() {\n\treturn $_SERVER['REQUEST_METHOD'] === 'GET';\n}",
"function isListening() {\n\t\treturn !empty($this->data['INFO_REMOTE_METHOD']) && !empty($this->data['INFO_REMOTE_URI']);\n\t}",
"public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }",
"public function GetRouteGetRequestsOnly ();",
"public function shouldPassThrough(Request $request) : bool\n {\n if (empty($this->http_method) && empty($this->http_path)) {\n return true;\n }\n\n $method = $this->http_method;\n\n $matches = array_map(function ($path) use ($method) {\n $path = trim(config('backend.prefix'), '/').$path;\n\n if (Str::contains($path, ':')) {\n list($method, $path) = explode(':', $path);\n $method = explode(',', $method);\n }\n\n return compact('method', 'path');\n }, explode(\"\\r\\n\", $this->http_path));\n\n foreach ($matches as $match) {\n if ($this->matchRequest($match, $request)) {\n return true;\n }\n }\n\n return false;\n }",
"public function is_needed() {\n\t\tif ( is_404() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isPreflightRequest(Request $request);",
"public function matches(Request $request)\n {\n return $this->isPreflightRequest($request);\n }",
"public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }",
"public function isHttpProxyTunnelUsed();",
"public function isRespond()\n {\n return null !== $this->accepted;\n }",
"protected function requestIsConditional()\n {\n return $this->getCurrentRoute()->requestIsConditional();\n }",
"public function testCanSendRoute()\n {\n $this->assertEmpty([]);\n\n $routes = $this->app->getRoutes();\n\n foreach ($routes as $route) {\n if ($route->getName() == 'api.oauth') {\n $this->assertContains('POST', $route->getAllowedMethods());\n $this->assertEquals('/api/oauth', $route->getPath());\n }\n }\n }",
"private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"function isGetRequest() {\r\n return ( filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'GET' );\r\n}",
"public function match_route($http_verb, $uri) {\n return false;\n }",
"private static function shouldUsePlainText(): bool {\n $route = $_REQUEST['route'] ?? '';\n return str_contains($route, '/api/v2/') || str_contains($route, '/queries/') || isset($_SERVER['HTTP_X_REQUESTED_WITH']);\n }",
"public function testGetSpecificRouteHttpServer(): void\n {\n $this->get('/get/request_action/test_request_action');\n $this->assertResponseOk();\n $this->assertSame('This is a test', (string)$this->_response->getBody());\n }",
"public function handles($source): bool\n {\n return $this->isEndpoint($source);\n }",
"protected function hasStandardPort()\n {\n return (!$this->port || $this->port === 80 || $this->port === 443);\n }",
"public function isPreflightRequest(): bool;",
"public function hasMethod() : bool\n {\n return array_key_exists($this->request->getMethod(), $this->routes);\n }",
"public function testHttpTestServerAvailable() {\n\t\t$this->assertTrue(\\REQUESTS_TEST_SERVER_HTTP_AVAILABLE);\n\t}",
"public function isXhr()\n {\n return $this->getHeaderLine('X-Requested-With') === 'XMLHttpRequest';\n }",
"public function isPreflight(): bool\n {\n return $this->getMethod() === 'OPTIONS'\n && $this->hasAccessControlRequestMethod();\n }",
"public function shouldPassThrough(Request $request)\n {\n if (empty($this->http_method) && empty($this->http_path)) {\n return true;\n }\n\n $method = $this->http_method;\n\n $matches = array_map(function ($path) use ($method) {\n // $path = trim(config('route.prefix'), '/').$path;\n\n if (Str::contains($path, ':')) {\n list($method, $path) = explode(':', $path);\n $method = explode(',', $method);\n }\n\n return compact('method', 'path');\n }, explode(\"\\r\\n\", $this->http_path));\n\n foreach ($matches as $match) {\n if ($this->matchRequest($match, $request)) {\n return true;\n }\n }\n\n return false;\n }",
"protected function shouldRedirect(): bool\n\t{\n\t\tif($this->session === null || $this->viewFactory === null || in_array($this->request->getMethod(), ['GET', 'HEAD']))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ($this->input === null || $this->input->shouldRedirect()) && $this->respondWithJson() === false && $this->respondWithXml() === false;\n\t}",
"public function hasRequest()\n {\n return $this->request ? true : false;\n }",
"public function isAPI(){\n $paths = explode(\"/\", $this->path);\n if(isset($paths[0]) && strtolower($paths[0])==\"api\"){\n return true;\n }\n return false;\n }",
"public function isProtocolLess()\n {\n if (preg_match('~^\\/\\/~i', $this->url)) {\n return true;\n } else {\n return false;\n }\n }",
"public static function should_set_route()\n\t{\n\t\treturn Kohana::$environment !== Kohana::PRODUCTION;\n\t}",
"static public function isApi() {\n return\n isset($_SERVER['REQUEST_URI'])\n && strpos($_SERVER['REQUEST_URI'], \"/passage/\") !== false;\n }",
"public function isCapable(){\n\t\tif(function_exists('apache_get_modules')){\n\t\t\t$mods = apache_get_modules();\n\t\t\tif(!in_array('mod_rewrite', $mods))\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"private function usesNonStandardHttpsPort(): bool\n {\n return 'https' === $this->getScheme() && '443' != $this->router->getContext()->getHttpsPort();\n }",
"public function makeRequest(EventHttpRequest $req, int $type, string $uri): bool {}",
"private function canKeepAlive() {\n\t\t// Get method, version and code\n\t\t$method = $this->req->getMethod();\n\t\t$version = $this->getVersion();\n\t\t$code = $this->getCode();\n\n\t\t// If https connect with a valid http status code\n\t\tif ($method == \"connect\" && $code >= 200 && $code < 300) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Check if keep-alive header is set or ommitted but with http 1.1\n\t\tif ($version == \"1.1\" && strtolower($this->getHeader(\"connection\", \"keep-alive\")) !== \"keep-alive\") {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Chunked and body is empty or not read\n\t\tif ($this->transferEncoding == \"chunked\" && $this->contentLength == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Content length is known or request is head\n\t\tif (!($this->transferEncoding == \"chunked\" || $this->contentLength > 0 || $method == \"head\" || $code == 204 || $code == 304)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Keep it alive\n\t\treturn true;\n\t}",
"public function IsError()\n {\n if($this->_correctHttpLine != null)\n {\n preg_match(\"|^HTTP/[\\d\\.x]+ (\\d+)|\", $this->_correctHttpLine, $m);\n if (isset($m[1]))\n {\n $floorVal = floor((int)$m[1] / 100);\n return ($floorVal == 4 || $floorVal == 5);\n }\n }\n\n return false;\n }",
"abstract public function shouldHandle(): bool;",
"public function sniff_requests() {\r\n global $wp;\r\n\r\n if(isset($wp->query_vars['__api'])){\r\n $this->handle_request();\r\n exit;\r\n }\r\n }",
"public function checkhttp() {\n\t\tif ($_SESSION['started'] == 1) {\n\t\t\t$headers = @get_headers($_SESSION['next_page'], 1);\n\t\t\t\tif(!preg_match('/(200|202|300|301|302)/', $headers[0]) && !preg_match('/(html)/', $headers['Content-Type'][0])){\n\t\t\t\t\t$_SESSION['next_page'] = $_SESSION['page_list'][0];\n\t\t\t\t\t$_SESSION['page_list_done'][] = $_SESSION['page_list'][0] . ' ----- FAIL TO CONNECT. Debug purpose : ' . $headers[0] . $headers['Content-Type'];\n\t\t\t\t\tarray_splice($_SESSION['page_list'], 0, 1);\n\t\t\t\t\tforeach ($_SESSION['page_list_done'] as $value) {\n\t\t\t\t\t\techo $value . '<br />';\n\t\t\t\t\t}\n\t\t\t\t\techo $headers[0] . '<br />';\n\t\t\t\t\tvar_dump($headers);\n\t\t\t\t\theader( \"refresh:2;url=\" . $_SERVER['PHP_SELF'] );\n\t\t\t\t\t//exit();\n\t\t\t\t} elseif (preg_match('/^.*(geolocalisation)$/i', $_SESSION['next_page'])) {\n\t\t\t\t\techo 'We skip that one <br /><br />';\n\t\t\t\t\theader( \"refresh:2;url=\" . $_SERVER['PHP_SELF'] );\n\t\t\t\t}\n\t\t}\n\t}",
"public function isGet() : bool {\n return 'GET' === $_SERVER['REQUEST_METHOD'];\n }",
"public function isRequest(): bool {\n return $this->options['request'] ?? false;\n }",
"public function hasRoute(): bool\n {\n return isset($this->route);\n }",
"function wp_http_supports($capabilities = array(), $url = \\null)\n {\n }",
"function requestIsGet()\n{\n return $_SERVER['REQUEST_METHOD'] == 'GET';\n}",
"public function hasRoute(string $name): bool;",
"public function isAcceptable() {\n return !$this->isWip() && !$this->hasConflicts();\n\n }",
"private function checkrequest()\n {\n // This method checks if there is user input, and returns the request_method if evaluated to be true\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $this->request = \"post\";\n return true;\n } elseif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n $this->request = \"get\";\n return true;\n } else {\n $this->request = false;\n }\n }",
"public function isRedirect(): bool\n {\n return $this->code >= 300 && $this->code < 400;\n }",
"public function isRedirection(): bool\n {\n return $this->code >= CODE_BAD_REQUEST &&\n $this->code < CODE_INTERNAL_SERVER_ERROR;\n }",
"public function isRedirect(): bool\n {\n $statusCode = $this->getStatusCode();\n\n return $statusCode >= 300 && $statusCode < 400;\n }",
"public function getIsGetRequest()\n\t{\n\t\treturn ($this->getRequestType() == 'GET');\n\t}",
"public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }",
"function urlOK($url)\n{\n $headers = @get_headers($url);\n if(strpos($headers[0],'200')===false){return false;}else{return true;}\n}",
"public function testHttp()\n {\n $request = Request::create('http://example.com/test');\n $response = $this->app->handle($request);\n $this->assertEquals(301, $response->getStatusCode());\n $this->assertTrue($response->isRedirect('https://example.com/test'));\n }",
"protected function isXhr(): bool {\n\t\treturn $this->request->isXhr();\n\t}",
"public function hasRequest(string $name): bool {}",
"public function testProtocolDetect() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTP right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('http');\n\n\t\t$_SERVER['HTTPS'] = true;\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTPS right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('https');\n\n\t\treturn;\n\t}",
"public function is_xhr() {\n return $this->method == 'xhr';\n }",
"protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }",
"public function isAllowed()\n {\n if ($this->appState->getAreaCode() == self::AREA_BACKEND) {\n return false;\n }\n\n $userAgentList = $this->helperData->getUserAgentList();\n $userAgent = $this->geoipHelperHttp->getHttpUserAgent();\n if (!empty($userAgentList) && $userAgent) {\n foreach ($userAgentList as $agent) {\n $agent = str_replace(['*', '/'], ['.*', '\\/'], $agent);\n if (preg_match(\"/{$agent}$/i\", $userAgent)) {\n return false;\n }\n }\n }\n\n $request = $this->request;\n $exceptionUrls = $this->helperData->getExceptionUrls();\n if (!empty($exceptionUrls)) {\n $requestString = $request->getRequestString();\n foreach ($exceptionUrls as $url) {\n $url = str_replace('*', '.*?', $url);\n if (preg_match('!^' . $url . '$!i', $requestString)) {\n return false;\n }\n }\n }\n\n return true;\n }",
"private function usesNonStandardPort(): bool\n {\n return $this->usesNonStandardHttpPort() || $this->usesNonStandardHttpsPort();\n }",
"public function isRequest(): bool\n {\n return $this->form->getMethod() == $this->request->getMethod();\n }"
]
| [
"0.69742155",
"0.69742155",
"0.69742155",
"0.69742155",
"0.6935973",
"0.6935973",
"0.67570734",
"0.64056456",
"0.63894737",
"0.6340071",
"0.6319001",
"0.6293548",
"0.62486696",
"0.6235004",
"0.6198327",
"0.61537105",
"0.6075107",
"0.60499054",
"0.60395616",
"0.60106754",
"0.60044044",
"0.5997755",
"0.5993126",
"0.5950605",
"0.59414667",
"0.59267247",
"0.59027004",
"0.585288",
"0.5852338",
"0.5845638",
"0.5823921",
"0.5823921",
"0.5800833",
"0.57839084",
"0.5762261",
"0.57347",
"0.5726126",
"0.5701987",
"0.5700714",
"0.5697063",
"0.5696733",
"0.5688335",
"0.5670399",
"0.5633985",
"0.56236786",
"0.5612941",
"0.5598492",
"0.55974203",
"0.55908275",
"0.5585324",
"0.5579019",
"0.55771476",
"0.5570501",
"0.556887",
"0.556583",
"0.5563511",
"0.5554912",
"0.5547654",
"0.5545912",
"0.55444336",
"0.5540369",
"0.5533951",
"0.5529857",
"0.55225676",
"0.55184716",
"0.5515152",
"0.54956645",
"0.54835296",
"0.5477492",
"0.5473843",
"0.5471673",
"0.5469149",
"0.54362756",
"0.54329646",
"0.5426639",
"0.5424911",
"0.54205936",
"0.54186237",
"0.54141283",
"0.5411255",
"0.54072106",
"0.54066664",
"0.5398579",
"0.5395976",
"0.5392696",
"0.5390008",
"0.5388755",
"0.5381951",
"0.5378601",
"0.53735775",
"0.5363792",
"0.536343",
"0.5361259",
"0.53541976",
"0.53504175",
"0.53479344",
"0.5345598",
"0.5344341",
"0.5344038",
"0.533523"
]
| 0.66989875 | 7 |
Determine if the route only responds to HTTPS requests. | public function httpsOnly()
{
return $this->secure();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isHttps() {\n $request = $this->requestStack->getCurrentRequest();\n return $request->getScheme() === 'https';\n }",
"public function isHttps() {\n global $is_https;\n\n return $is_https;\n }",
"public function isHttps(): bool {\n\t\treturn $this->getScheme() === 'https' ? TRUE : FALSE;\n\t}",
"public function isHttpsOnly()\n {\n return in_array('https', $this->action, true);\n }",
"public function isSSL(): bool\n {\n return\n strtolower($this->headers->get('X-Forwarded-Https', '')) == 'on' ||\n $this->headers->get('X-Forwarded-Https') == 1 ||\n strtolower($this->headers->get('X-Forwarded-Proto', '')) == 'https' ||\n strtolower($this->server->get('HTTPS', '')) == 'on' ||\n $this->server->get('HTTPS') == 1;\n }",
"public static function isHttps() {\n\t\treturn (\n\t\t\t(isset($_SERVER['HTTP_X_REMOTE_PROTOCOL']) && !empty($_SERVER['HTTP_X_REMOTE_PROTOCOL'])) ||\n\t\t\t(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ||\n\t\t\t(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ||\n\t\t\t(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']==443));\n\t}",
"public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}",
"private function isHttps() {\r\n\t\treturn (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'\r\n\t\t\t\t|| isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)\r\n\t\t\t\t|| isset($_SERVER['HTTP_X_HTTPS']) && ($_SERVER['HTTP_X_HTTPS'] == 'on' || $_SERVER['HTTP_X_HTTPS'] == 1)\r\n\t\t\t\t|| isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443\r\n\t\t\t\t|| isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] == 'https'\r\n\t\t\t\t|| isset($_SERVER['SERVER_PROTOCOL']) && preg_match('#https#i', $_SERVER['SERVER_PROTOCOL']));\r\n\t}",
"public function isUsingHttps() {\r\n\t\treturn $this->useHttps;\r\n\t}",
"public static function isHttps(): bool\n\t{\n\t\tif (!isset(self::$httpsCache)) {\n\t\t\tself::$httpsCache = (!empty($_SERVER['HTTPS']) && 'off' !== strtolower($_SERVER['HTTPS']))\n\t\t\t\t|| (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']));\n\t\t}\n\t\treturn self::$httpsCache;\n\t}",
"public function isSecure(){\n if(array_key_exists('HTTPS', $this->server)){\n return true;\n }\n return false;\n }",
"public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }",
"private function isSsl()\n {\n if (!empty($_SERVER['https'])) {\n return true;\n }\n\n if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {\n return true;\n }\n\n return false;\n }",
"public function isSecure()\r\n {\r\n return ($this->server->get('HTTPS') == true);\r\n }",
"public function isSSL(){\n\n if( !empty( $_SERVER['HTTPS'] ) && ($_SERVER['HTTPS'] != 'off') )\n return true;\n\n if( !empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )\n return true;\n\n return false;\n\n }",
"public function secure()\n {\n return $this->server()->is('HTTPS', 'on');\n }",
"function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}",
"public function hasUseHttps()\n {\n return $this->use_https !== null;\n }",
"public function usesHttps()\n {\n return $this->useHttps;\n }",
"public function isSecure(): bool\n {\n //Double check though attributes?\n return $this->request()->getUri()->getScheme() === 'https';\n }",
"private function usesNonStandardHttpsPort(): bool\n {\n return 'https' === $this->getScheme() && '443' != $this->router->getContext()->getHttpsPort();\n }",
"function isSSL()\n{\n\treturn (isset($_SERVER[\"HTTPS\"]) && ($_SERVER[\"HTTPS\"] == \"on\")) || (isset($_SERVER[\"HTTP_X_FORWARDED_PROTO\"]) && $_SERVER[\"HTTP_X_FORWARDED_PROTO\"] == \"https\");\n}",
"public static function isSSL()\n {\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 1) {\n return true;\n } elseif ($_SERVER['HTTPS'] == 'on') {\n return true;\n }\n } elseif ($_SERVER['SERVER_PORT'] == HTTPS_PORT) {\n return true;\n }\n\n return false;\n }",
"public function IsSecure() {\n\n $Srv= $this->GetRequestContext()->SERVER;\n\n return $this->UrlParts['scheme'] === 'https'\n || (isset($Srv['HTTPS']) && (in_array($Srv['HTTPS'], array('1','on')) || intval($Srv['SERVER_PORT']) === 443));\n }",
"public function isSecure()\n {\n return (\n (!empty($this->server['HTTPS']) && $this->server['HTTPS'] != 'off') || \n (!empty($this->server['HTTP_HTTPS']) && $this->server['HTTP_HTTPS'] != 'off') || \n $this->server['REQUEST_SCHEME'] == 'https' || $this->server['SERVER_PORT'] == 443\n );\n }",
"public function isSecure()\n {\n return (prent::isSecure()\n || $this->getServer('X_FORWARDED_PROTO') === parent::SCHEME_HTTPS);\n }",
"public function isSsl()\n {\n if (!is_null($is = &$this->staticKey('isSsl'))) {\n return $is; // Already cached this.\n }\n if (!empty($_SERVER['SERVER_PORT'])) {\n if ((integer) $_SERVER['SERVER_PORT'] === 443) {\n return $is = true;\n }\n }\n if (!empty($_SERVER['HTTPS'])) {\n if (filter_var($_SERVER['HTTPS'], FILTER_VALIDATE_BOOLEAN)) {\n return $is = true;\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n if (strcasecmp((string) $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0) {\n return $is = true;\n }\n }\n return $is = false;\n }",
"public function isSecure()\n {\n $server = $this->getServerParams();\n\n if (! empty($server['HTTPS']) && strtolower($server['HTTPS']) !== 'off') {\n return true;\n } elseif (isset($server['HTTP_X_FORWARDED_PROTO']) && $server['HTTP_X_FORWARDED_PROTO'] === 'https') {\n return true;\n } elseif (! empty($server['HTTP_FRONT_END_HTTPS']) && strtolower($server['HTTP_FRONT_END_HTTPS']) !== 'off') {\n return true;\n }\n return false;\n }",
"public static function isSSL() {\n\t\treturn isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';\n\t}",
"function is_ssl()\n{\n\tif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO']) {\n\t\treturn true;\n\t}\n\tif (!empty($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS'] || 443 === $_SERVER['SERVER_PORT']) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"public function isSecure()\n {\n $server = $this->request->getServerParams();\n if (!empty($server['HTTPS'])) {\n return strtolower($server['HTTPS']) !== 'off';\n }\n return false;\n }",
"public function secure () {\n return ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] === 443)) ? true : false;\n }",
"public function secure()\n {\n return in_array('https', $this->action, true);\n }",
"final protected function is_secure() {\n\t\tif ((!empty($_SERVER['HTTPS'])) && ((strtolower($_SERVER['HTTPS']) === 'on') || (intval($_SERVER['HTTPS']) == 1)))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['HTTP_HTTPS'])) && ((strtolower($_SERVER['HTTP_HTTPS']) === 'on') || (intval($_SERVER['HTTP_HTTPS']) == 1)))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https'))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['HTTP_X_FORWARDED_SSL'])) && ((strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) === 'on') || (intval($_SERVER['HTTP_X_FORWARDED_SSL']) == 1)))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['SERVER_PORT'])) && (intval($_SERVER['SERVER_PORT']) == 443))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"public function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"function isHttps()\n{\n //Not work in all servers\n /*\n if ($_SERVER['HTTPS'] !== \"on\") { \n return false;\n }else{\n return true;\n }\n */\n return false;\n}",
"function wp_is_site_url_using_https()\n {\n }",
"public static function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"public function isSsl()\n {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n return true;\n }\n return false;\n }",
"private function checkSecureUrl()\n {\n $custom_ssl_var = 0;\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 'on') {\n $custom_ssl_var = 1;\n }\n } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $custom_ssl_var = 1;\n }\n if ((bool) Configuration::get('PS_SSL_ENABLED') && $custom_ssl_var == 1) {\n return true;\n } else {\n return false;\n }\n }",
"public function testIsSSLA() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's off, it should not show ssl\n $_SERVER['HTTPS'] = 'off';\n\n // Should NOT be SSL\n $this->assertFalse( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }",
"function is_ssl()\n {\n }",
"static public function checkSSL() {\n\t\treturn ($_SERVER['SERVER_PORT'] == self::ssl_port);\n\t}",
"public function testIsSSLE() {\n // If it's HTTPS is not set, no SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTP';\n\n $this->assertFalse( security::is_ssl() );\n }",
"public function isSecure() : bool\n\t{\n\t\tif ($this->isUsingTrustedProxy() && $protoString = $this->getHeaderLine(self::$trustedHeaderNames[self::CLIENT_PROTO])) {\n\t\t\t$protoArray = explode(',', $protoString);\n\n\t\t\treturn count($protoArray) > 0 && in_array(strtolower($protoArray[0]), ['https', 'ssl', 'on']);\n\t\t}\n\t\t\n\t\t$https = 'off';\n\t\t\n\t\tif (isset($this->getServerParams()['HTTPS'])) {\n\t\t\t$https = $this->getServerParams()['HTTPS'];\n\t\t}\n\t\t\n\t\treturn $https !== 'off';\n\t}",
"public function testIsSSLD() {\n // If it's HTTPS is set, SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTPS';\n\n $this->assertTrue( security::is_ssl() );\n }",
"public function isSsl(): bool\n {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n return true;\n }\n\n return false;\n }",
"public function secure()\n\t{\n\t\treturn (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')\n\t\t\t|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO']\n\t\t\t\t&& $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');\n\t}",
"private function isSecure()\n\t{\n\t\tif ((! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')\n\t\t\t|| $_SERVER['SERVER_PORT'] == '443')\n\t\t{\n\t\t\treturn TRUE;\n}\n\n\t\treturn FALSE;\n\t}",
"function _is_url_https( string $url ) {\n\t\treturn IMFORZA_Utils::is_url_https( $url );\n\t}",
"function ensureHTTPS()\r\n {\r\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' && $_SERVER['HTTPS'] !== 'off')\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n // Get current page url and query string\r\n $host = strlen($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n // Redirect to the secure url \r\n redirectToURL(\"https://${host}${uri}\");\r\n }\r\n }",
"public function isSsl();",
"public static function isSecureConnection() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\tif ($_SERVER['HTTPS'] != 'on')\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"public function isSecure(Request $request){\n return $request->headers->get('x-forwarded-proto') == 'https' ? true : $request->secure();\n }",
"function wp_is_https_supported()\n {\n }",
"function url_is_accessable_via_ssl($url)\n {\n }",
"public function isSecure()\n\t{\n\t\tif( !empty( $_SERVER['HTTPS'] ) AND mb_strtolower( $_SERVER['HTTPS'] ) == 'on' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if( !empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) AND mb_strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) == 'https' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if ( !empty( $_SERVER['HTTP_X_FORWARDED_HTTPS'] ) AND mb_strtolower( $_SERVER['HTTP_X_FORWARDED_HTTPS'] ) == 'https' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if( !empty( $_SERVER['HTTP_FRONT_END_HTTPS'] ) AND mb_strtolower( $_SERVER['HTTP_FRONT_END_HTTPS'] ) == 'on' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if( !empty( $_SERVER['HTTP_SSLSESSIONID'] ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public static function isSSL($url = false)\n {\n return self::getProtocol($url) === 'https';\n }",
"public function testSchemeIsHttpsIfHttpsValueIsOn()\n {\n $server = ['HTTPS' => 'on'];\n $request = new Request($this->config, $server);\n\n $this->assertEquals('https://', $request->scheme);\n $this->assertEquals('https://', $request->getScheme());\n }",
"public function checkSslBackendAndRedirectIfNeeded() {}",
"public function isSecure(): bool\n {\n $secureStatus = $this->getProtocolName();\n\n if (!$secureStatus) {\n return false;\n }\n\n return true;\n }",
"public function testGenerateWithHttpsInHttps(): void\n {\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'environment' => ['HTTP_HOST' => 'app.test', 'HTTPS' => 'on'],\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Images',\n 'action' => 'index',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n }",
"public function testGenerationWithHttpsOption(): void\n {\n Router::fullBaseUrl('http://app.test');\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n ],\n 'environment' => ['HTTP_HOST' => 'localhost'],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n }",
"public function testIsSSLC() {\n // To revert\n $original_port = ( isset( $_SERVER['SERVER_PORT'] ) ) ? $_SERVER['SERVER_PORT'] : NULL;\n\n // If it's HTTPS is not set, but the port is, SSL\n $_SERVER['SERVER_PORT'] = 443;\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['SERVER_PORT'] = $original_port;\n }",
"public function testHttpsTestServerAvailable() {\n\t\t$this->assertTrue(\\REQUESTS_TEST_SERVER_HTTPS_AVAILABLE);\n\t}",
"public function testIfRequestIsntHTTPSReturnsFalse()\n {\n $config = array_merge($this->config, ['mode' => 'production']);\n $request = new Request($config, []);\n $request->setScheme('http://');\n $this->assertFalse($request->identifyUser('This is a bad header'));\n }",
"protected function isSSLEnabled()\n {\n return GeneralUtility::getIndpEnv('TYPO3_SSL');\n }",
"public static function is_url_https( string $url ) {\n\t\t\t$scheme = wp_parse_url( $url, PHP_URL_SCHEME );\n\t\t\treturn ( 'https' === $scheme ) ? true : false;\n\t\t}",
"function trigger_https()\n\t{\n\t\t$exclude_url_list = array();\n\t\t//$exclude_url_list[] = '/(.*)js$/';\n\t\tforeach ($exclude_url_list as $exclude_url) {\n\t\t\tif(preg_match($exclude_url, uri_string()))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t \n\t\t// switch to HTTPS for these urls\n\t\t$ssl_url_list = array();\n\t\t$ssl_url_list[] = '/(.*)contact(.*)$/';\n\t \n\t\tforeach ($ssl_url_list as $ssl_url) {\n\t\t\tif(preg_match($ssl_url, uri_string()))\n\t\t\t{\n\t\t\t\tforce_ssl();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t \n\t\t// still here? switch to HTTP (if necessary)\n\t\tremove_ssl();\n\t}",
"function secure_connection() {\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"public function isVerifySsl()\n {\n return $this->verify_ssl;\n }",
"public function getSSL() \n {\n return (bool)$this->_ssl;\n }",
"function wp_is_home_url_using_https()\n {\n }",
"public function isSecure(): bool\n {\n return $this->secure;\n }",
"public function __https()\n{\n\tif(strpos($_SERVER['HTTP_HOST'],'www') === false or !isset($_SERVER['HTTPS']))\n\t{\n\t\theader('Location: '._https);\n\t\texit(0);\n\t}\n}",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"protected function is_https_domain($domain)\n {\n }",
"public function testIsSSLB() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's on, it should be ssl\n $_SERVER['HTTPS'] = 'on';\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }",
"private function is_ssl_capable(){\r\n\t\treturn defined('OPENSSL_VERSION_NUMBER') && is_numeric(OPENSSL_VERSION_NUMBER);\r\n\t}",
"public function requireHttps(): Route\n {\n $this->setSchemes('https');\n\n return $this;\n }",
"protected function sslRedirection()\n {\n return;\n }",
"protected function sslCheck()\n {\n $ssl_port = '443'; // default\n if(\n isset($_SERVER['OPENSSL_CONF'])\n || isset($_SERVER['SSL_PROTOCOL'])\n || preg_match('~SSL~',$_SERVER['SERVER_SOFTWARE']))\n {\n try {\n $context = stream_context_create();\n stream_context_set_option($context, \"ssl\", \"verify_peer\", false);\n $SSL_Check = @stream_socket_client( 'ssl://'.$_SERVER['SERVER_NAME'].':'.$ssl_port, $errno, $errstr, ini_get(\"default_socket_timeout\"), STREAM_CLIENT_CONNECT , $context);\n if (!$SSL_Check) {\n return false;\n } else {\n fclose($SSL_Check);\n return true;\n }\n } catch( Exception $e ) {\n return false;\n }\n }\n }",
"public function getUseSsl()\n {\n return $this->use_ssl;\n }",
"private static function httpOrHttps()\n {\n if(isset($_SERVER['HTTPS'])) {\n return 'https://';\n }\n return 'http://';\n }",
"function force_ssl() {\n\t global $psts;\n return (bool)$psts->get_setting('stripe_ssl', false);\n\t}",
"private function usesNonStandardHttpPort(): bool\n {\n return 'http' === $this->getScheme() && '80' != $this->router->getContext()->getHttpPort();\n }",
"public function getSsl() {\n return @$this->attributes['ssl'];\n }",
"public function test_https_status()\n {\n }",
"public function matches(lib_routing_route $route, lib_http_request $request)\n\t{\n\t\tif ($route->httpOnly())\n\t\t{\n\t\t\treturn ! $request->secure();\n\t\t}\n\t\telseif ($route->secure())\n\t\t{\n\t\t\treturn $request->secure();\n\t\t}\n\n\t\treturn true;\n\t}",
"function wp_schedule_https_detection()\n {\n }",
"public function isSecure()\n {\n return $this->secure;\n }",
"public function getSecureTunnelUrl()\n {\n return false;\n }",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function secureSsl()\n {\n return $this->secureSsl;\n }",
"public function isSecure()\r\n\t{\r\n\t\treturn $this->secure;\r\n\t}",
"function redirect_to_https() {\n\tif ($_SERVER['HTTPS'] !== \"on\") {\n\t\t$url = \"https://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\tredirect($url);\n\t}\n}",
"public function testProtocolDetect() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTP right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('http');\n\n\t\t$_SERVER['HTTPS'] = true;\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTPS right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('https');\n\n\t\treturn;\n\t}",
"function http() {\n\treturn !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https':'http';\n}",
"public function isSecure()\n {\n return $this->_secure;\n }"
]
| [
"0.81256074",
"0.8063501",
"0.8053586",
"0.8016566",
"0.80097693",
"0.79408777",
"0.7920208",
"0.79194415",
"0.7917628",
"0.78496957",
"0.7849052",
"0.77761304",
"0.7774335",
"0.7765935",
"0.7757385",
"0.77525175",
"0.7751579",
"0.77489233",
"0.7748903",
"0.77465004",
"0.7744206",
"0.7740854",
"0.77070403",
"0.7668838",
"0.7629775",
"0.76292115",
"0.75966203",
"0.7568179",
"0.75668013",
"0.7557114",
"0.7496177",
"0.74684733",
"0.7446617",
"0.7439966",
"0.74125516",
"0.7396846",
"0.73781836",
"0.73494244",
"0.7329377",
"0.73095673",
"0.7297691",
"0.72798526",
"0.7272668",
"0.7269666",
"0.72665554",
"0.7248681",
"0.72445637",
"0.72415376",
"0.7208259",
"0.71773005",
"0.7130772",
"0.7117971",
"0.70672226",
"0.70608705",
"0.70576334",
"0.70518476",
"0.70188427",
"0.6932968",
"0.6909598",
"0.6883645",
"0.6842603",
"0.68238693",
"0.6783206",
"0.67181265",
"0.6688336",
"0.6686236",
"0.665957",
"0.66499317",
"0.65468264",
"0.6513411",
"0.6469677",
"0.6466398",
"0.6420841",
"0.6414882",
"0.6376283",
"0.63683647",
"0.6348573",
"0.63395476",
"0.6326563",
"0.63177323",
"0.6305083",
"0.6249956",
"0.6245567",
"0.62407184",
"0.62350714",
"0.6222369",
"0.62160176",
"0.62121445",
"0.62104046",
"0.6209473",
"0.62056154",
"0.6162911",
"0.6150637",
"0.6150637",
"0.61401176",
"0.6139575",
"0.61282694",
"0.6116836",
"0.610939",
"0.6104077"
]
| 0.70365256 | 56 |
Determine if the route only responds to HTTPS requests. | public function secure()
{
return in_array('https', $this->action, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function isHttps() {\n $request = $this->requestStack->getCurrentRequest();\n return $request->getScheme() === 'https';\n }",
"public function isHttps() {\n global $is_https;\n\n return $is_https;\n }",
"public function isHttps(): bool {\n\t\treturn $this->getScheme() === 'https' ? TRUE : FALSE;\n\t}",
"public function isHttpsOnly()\n {\n return in_array('https', $this->action, true);\n }",
"public function isSSL(): bool\n {\n return\n strtolower($this->headers->get('X-Forwarded-Https', '')) == 'on' ||\n $this->headers->get('X-Forwarded-Https') == 1 ||\n strtolower($this->headers->get('X-Forwarded-Proto', '')) == 'https' ||\n strtolower($this->server->get('HTTPS', '')) == 'on' ||\n $this->server->get('HTTPS') == 1;\n }",
"public static function isHttps() {\n\t\treturn (\n\t\t\t(isset($_SERVER['HTTP_X_REMOTE_PROTOCOL']) && !empty($_SERVER['HTTP_X_REMOTE_PROTOCOL'])) ||\n\t\t\t(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ||\n\t\t\t(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on') ||\n\t\t\t(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT']==443));\n\t}",
"public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}",
"private function isHttps() {\r\n\t\treturn (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'\r\n\t\t\t\t|| isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)\r\n\t\t\t\t|| isset($_SERVER['HTTP_X_HTTPS']) && ($_SERVER['HTTP_X_HTTPS'] == 'on' || $_SERVER['HTTP_X_HTTPS'] == 1)\r\n\t\t\t\t|| isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443\r\n\t\t\t\t|| isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] == 'https'\r\n\t\t\t\t|| isset($_SERVER['SERVER_PROTOCOL']) && preg_match('#https#i', $_SERVER['SERVER_PROTOCOL']));\r\n\t}",
"public function isUsingHttps() {\r\n\t\treturn $this->useHttps;\r\n\t}",
"public function isSecure(){\n if(array_key_exists('HTTPS', $this->server)){\n return true;\n }\n return false;\n }",
"public static function isHttps(): bool\n\t{\n\t\tif (!isset(self::$httpsCache)) {\n\t\t\tself::$httpsCache = (!empty($_SERVER['HTTPS']) && 'off' !== strtolower($_SERVER['HTTPS']))\n\t\t\t\t|| (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']));\n\t\t}\n\t\treturn self::$httpsCache;\n\t}",
"public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }",
"private function isSsl()\n {\n if (!empty($_SERVER['https'])) {\n return true;\n }\n\n if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {\n return true;\n }\n\n return false;\n }",
"public function isSecure()\r\n {\r\n return ($this->server->get('HTTPS') == true);\r\n }",
"public function isSSL(){\n\n if( !empty( $_SERVER['HTTPS'] ) && ($_SERVER['HTTPS'] != 'off') )\n return true;\n\n if( !empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )\n return true;\n\n return false;\n\n }",
"public function secure()\n {\n return $this->server()->is('HTTPS', 'on');\n }",
"function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}",
"public function usesHttps()\n {\n return $this->useHttps;\n }",
"public function hasUseHttps()\n {\n return $this->use_https !== null;\n }",
"public function isSecure(): bool\n {\n //Double check though attributes?\n return $this->request()->getUri()->getScheme() === 'https';\n }",
"private function usesNonStandardHttpsPort(): bool\n {\n return 'https' === $this->getScheme() && '443' != $this->router->getContext()->getHttpsPort();\n }",
"function isSSL()\n{\n\treturn (isset($_SERVER[\"HTTPS\"]) && ($_SERVER[\"HTTPS\"] == \"on\")) || (isset($_SERVER[\"HTTP_X_FORWARDED_PROTO\"]) && $_SERVER[\"HTTP_X_FORWARDED_PROTO\"] == \"https\");\n}",
"public static function isSSL()\n {\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 1) {\n return true;\n } elseif ($_SERVER['HTTPS'] == 'on') {\n return true;\n }\n } elseif ($_SERVER['SERVER_PORT'] == HTTPS_PORT) {\n return true;\n }\n\n return false;\n }",
"public function IsSecure() {\n\n $Srv= $this->GetRequestContext()->SERVER;\n\n return $this->UrlParts['scheme'] === 'https'\n || (isset($Srv['HTTPS']) && (in_array($Srv['HTTPS'], array('1','on')) || intval($Srv['SERVER_PORT']) === 443));\n }",
"public function isSecure()\n {\n return (prent::isSecure()\n || $this->getServer('X_FORWARDED_PROTO') === parent::SCHEME_HTTPS);\n }",
"public function isSecure()\n {\n return (\n (!empty($this->server['HTTPS']) && $this->server['HTTPS'] != 'off') || \n (!empty($this->server['HTTP_HTTPS']) && $this->server['HTTP_HTTPS'] != 'off') || \n $this->server['REQUEST_SCHEME'] == 'https' || $this->server['SERVER_PORT'] == 443\n );\n }",
"public function isSsl()\n {\n if (!is_null($is = &$this->staticKey('isSsl'))) {\n return $is; // Already cached this.\n }\n if (!empty($_SERVER['SERVER_PORT'])) {\n if ((integer) $_SERVER['SERVER_PORT'] === 443) {\n return $is = true;\n }\n }\n if (!empty($_SERVER['HTTPS'])) {\n if (filter_var($_SERVER['HTTPS'], FILTER_VALIDATE_BOOLEAN)) {\n return $is = true;\n }\n }\n if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) {\n if (strcasecmp((string) $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0) {\n return $is = true;\n }\n }\n return $is = false;\n }",
"public function isSecure()\n {\n $server = $this->getServerParams();\n\n if (! empty($server['HTTPS']) && strtolower($server['HTTPS']) !== 'off') {\n return true;\n } elseif (isset($server['HTTP_X_FORWARDED_PROTO']) && $server['HTTP_X_FORWARDED_PROTO'] === 'https') {\n return true;\n } elseif (! empty($server['HTTP_FRONT_END_HTTPS']) && strtolower($server['HTTP_FRONT_END_HTTPS']) !== 'off') {\n return true;\n }\n return false;\n }",
"public static function isSSL() {\n\t\treturn isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';\n\t}",
"function is_ssl()\n{\n\tif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO']) {\n\t\treturn true;\n\t}\n\tif (!empty($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS'] || 443 === $_SERVER['SERVER_PORT']) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"public function isSecure()\n {\n $server = $this->request->getServerParams();\n if (!empty($server['HTTPS'])) {\n return strtolower($server['HTTPS']) !== 'off';\n }\n return false;\n }",
"public function secure () {\n return ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || ($_SERVER['SERVER_PORT'] === 443)) ? true : false;\n }",
"final protected function is_secure() {\n\t\tif ((!empty($_SERVER['HTTPS'])) && ((strtolower($_SERVER['HTTPS']) === 'on') || (intval($_SERVER['HTTPS']) == 1)))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['HTTP_HTTPS'])) && ((strtolower($_SERVER['HTTP_HTTPS']) === 'on') || (intval($_SERVER['HTTP_HTTPS']) == 1)))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https'))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['HTTP_X_FORWARDED_SSL'])) && ((strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) === 'on') || (intval($_SERVER['HTTP_X_FORWARDED_SSL']) == 1)))\n\t\t\treturn true;\n\t\tif ((!empty($_SERVER['SERVER_PORT'])) && (intval($_SERVER['SERVER_PORT']) == 443))\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"public function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"function isHttps()\n{\n //Not work in all servers\n /*\n if ($_SERVER['HTTPS'] !== \"on\") { \n return false;\n }else{\n return true;\n }\n */\n return false;\n}",
"function wp_is_site_url_using_https()\n {\n }",
"public static function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"public function isSsl()\n {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n return true;\n }\n return false;\n }",
"private function checkSecureUrl()\n {\n $custom_ssl_var = 0;\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 'on') {\n $custom_ssl_var = 1;\n }\n } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $custom_ssl_var = 1;\n }\n if ((bool) Configuration::get('PS_SSL_ENABLED') && $custom_ssl_var == 1) {\n return true;\n } else {\n return false;\n }\n }",
"public function testIsSSLA() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's off, it should not show ssl\n $_SERVER['HTTPS'] = 'off';\n\n // Should NOT be SSL\n $this->assertFalse( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }",
"function is_ssl()\n {\n }",
"static public function checkSSL() {\n\t\treturn ($_SERVER['SERVER_PORT'] == self::ssl_port);\n\t}",
"public function testIsSSLE() {\n // If it's HTTPS is not set, no SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTP';\n\n $this->assertFalse( security::is_ssl() );\n }",
"public function isSecure() : bool\n\t{\n\t\tif ($this->isUsingTrustedProxy() && $protoString = $this->getHeaderLine(self::$trustedHeaderNames[self::CLIENT_PROTO])) {\n\t\t\t$protoArray = explode(',', $protoString);\n\n\t\t\treturn count($protoArray) > 0 && in_array(strtolower($protoArray[0]), ['https', 'ssl', 'on']);\n\t\t}\n\t\t\n\t\t$https = 'off';\n\t\t\n\t\tif (isset($this->getServerParams()['HTTPS'])) {\n\t\t\t$https = $this->getServerParams()['HTTPS'];\n\t\t}\n\t\t\n\t\treturn $https !== 'off';\n\t}",
"public function testIsSSLD() {\n // If it's HTTPS is set, SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTPS';\n\n $this->assertTrue( security::is_ssl() );\n }",
"public function isSsl(): bool\n {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n return true;\n }\n\n return false;\n }",
"public function secure()\n\t{\n\t\treturn (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')\n\t\t\t|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO']\n\t\t\t\t&& $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https');\n\t}",
"private function isSecure()\n\t{\n\t\tif ((! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')\n\t\t\t|| $_SERVER['SERVER_PORT'] == '443')\n\t\t{\n\t\t\treturn TRUE;\n}\n\n\t\treturn FALSE;\n\t}",
"function _is_url_https( string $url ) {\n\t\treturn IMFORZA_Utils::is_url_https( $url );\n\t}",
"function ensureHTTPS()\r\n {\r\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' && $_SERVER['HTTPS'] !== 'off')\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n // Get current page url and query string\r\n $host = strlen($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n // Redirect to the secure url \r\n redirectToURL(\"https://${host}${uri}\");\r\n }\r\n }",
"public function isSsl();",
"public static function isSecureConnection() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\tif ($_SERVER['HTTPS'] != 'on')\n\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"public function isSecure(Request $request){\n return $request->headers->get('x-forwarded-proto') == 'https' ? true : $request->secure();\n }",
"function wp_is_https_supported()\n {\n }",
"function url_is_accessable_via_ssl($url)\n {\n }",
"public function httpsOnly()\n {\n return $this->secure();\n }",
"public function isSecure()\n\t{\n\t\tif( !empty( $_SERVER['HTTPS'] ) AND mb_strtolower( $_SERVER['HTTPS'] ) == 'on' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if( !empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) AND mb_strtolower( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) == 'https' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if ( !empty( $_SERVER['HTTP_X_FORWARDED_HTTPS'] ) AND mb_strtolower( $_SERVER['HTTP_X_FORWARDED_HTTPS'] ) == 'https' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if( !empty( $_SERVER['HTTP_FRONT_END_HTTPS'] ) AND mb_strtolower( $_SERVER['HTTP_FRONT_END_HTTPS'] ) == 'on' )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse if( !empty( $_SERVER['HTTP_SSLSESSIONID'] ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"public static function isSSL($url = false)\n {\n return self::getProtocol($url) === 'https';\n }",
"public function testSchemeIsHttpsIfHttpsValueIsOn()\n {\n $server = ['HTTPS' => 'on'];\n $request = new Request($this->config, $server);\n\n $this->assertEquals('https://', $request->scheme);\n $this->assertEquals('https://', $request->getScheme());\n }",
"public function checkSslBackendAndRedirectIfNeeded() {}",
"public function isSecure(): bool\n {\n $secureStatus = $this->getProtocolName();\n\n if (!$secureStatus) {\n return false;\n }\n\n return true;\n }",
"public function testGenerateWithHttpsInHttps(): void\n {\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'environment' => ['HTTP_HOST' => 'app.test', 'HTTPS' => 'on'],\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Images',\n 'action' => 'index',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n }",
"public function testGenerationWithHttpsOption(): void\n {\n Router::fullBaseUrl('http://app.test');\n Router::createRouteBuilder('/')->connect('/{controller}/{action}/*');\n $request = new ServerRequest([\n 'url' => '/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index',\n ],\n 'environment' => ['HTTP_HOST' => 'localhost'],\n ]);\n Router::setRequest($request);\n\n $result = Router::url([\n '_https' => true,\n ]);\n $this->assertSame('https://app.test/Images/index', $result);\n\n $result = Router::url([\n '_https' => false,\n ]);\n $this->assertSame('http://app.test/Images/index', $result);\n }",
"public function testIsSSLC() {\n // To revert\n $original_port = ( isset( $_SERVER['SERVER_PORT'] ) ) ? $_SERVER['SERVER_PORT'] : NULL;\n\n // If it's HTTPS is not set, but the port is, SSL\n $_SERVER['SERVER_PORT'] = 443;\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['SERVER_PORT'] = $original_port;\n }",
"public function testHttpsTestServerAvailable() {\n\t\t$this->assertTrue(\\REQUESTS_TEST_SERVER_HTTPS_AVAILABLE);\n\t}",
"public function testIfRequestIsntHTTPSReturnsFalse()\n {\n $config = array_merge($this->config, ['mode' => 'production']);\n $request = new Request($config, []);\n $request->setScheme('http://');\n $this->assertFalse($request->identifyUser('This is a bad header'));\n }",
"protected function isSSLEnabled()\n {\n return GeneralUtility::getIndpEnv('TYPO3_SSL');\n }",
"public static function is_url_https( string $url ) {\n\t\t\t$scheme = wp_parse_url( $url, PHP_URL_SCHEME );\n\t\t\treturn ( 'https' === $scheme ) ? true : false;\n\t\t}",
"function trigger_https()\n\t{\n\t\t$exclude_url_list = array();\n\t\t//$exclude_url_list[] = '/(.*)js$/';\n\t\tforeach ($exclude_url_list as $exclude_url) {\n\t\t\tif(preg_match($exclude_url, uri_string()))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t \n\t\t// switch to HTTPS for these urls\n\t\t$ssl_url_list = array();\n\t\t$ssl_url_list[] = '/(.*)contact(.*)$/';\n\t \n\t\tforeach ($ssl_url_list as $ssl_url) {\n\t\t\tif(preg_match($ssl_url, uri_string()))\n\t\t\t{\n\t\t\t\tforce_ssl();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t \n\t\t// still here? switch to HTTP (if necessary)\n\t\tremove_ssl();\n\t}",
"function secure_connection() {\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"public function isVerifySsl()\n {\n return $this->verify_ssl;\n }",
"public function getSSL() \n {\n return (bool)$this->_ssl;\n }",
"function wp_is_home_url_using_https()\n {\n }",
"public function isSecure(): bool\n {\n return $this->secure;\n }",
"public function __https()\n{\n\tif(strpos($_SERVER['HTTP_HOST'],'www') === false or !isset($_SERVER['HTTPS']))\n\t{\n\t\theader('Location: '._https);\n\t\texit(0);\n\t}\n}",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"protected function is_https_domain($domain)\n {\n }",
"public function testIsSSLB() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's on, it should be ssl\n $_SERVER['HTTPS'] = 'on';\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }",
"private function is_ssl_capable(){\r\n\t\treturn defined('OPENSSL_VERSION_NUMBER') && is_numeric(OPENSSL_VERSION_NUMBER);\r\n\t}",
"public function requireHttps(): Route\n {\n $this->setSchemes('https');\n\n return $this;\n }",
"protected function sslRedirection()\n {\n return;\n }",
"protected function sslCheck()\n {\n $ssl_port = '443'; // default\n if(\n isset($_SERVER['OPENSSL_CONF'])\n || isset($_SERVER['SSL_PROTOCOL'])\n || preg_match('~SSL~',$_SERVER['SERVER_SOFTWARE']))\n {\n try {\n $context = stream_context_create();\n stream_context_set_option($context, \"ssl\", \"verify_peer\", false);\n $SSL_Check = @stream_socket_client( 'ssl://'.$_SERVER['SERVER_NAME'].':'.$ssl_port, $errno, $errstr, ini_get(\"default_socket_timeout\"), STREAM_CLIENT_CONNECT , $context);\n if (!$SSL_Check) {\n return false;\n } else {\n fclose($SSL_Check);\n return true;\n }\n } catch( Exception $e ) {\n return false;\n }\n }\n }",
"public function getUseSsl()\n {\n return $this->use_ssl;\n }",
"private static function httpOrHttps()\n {\n if(isset($_SERVER['HTTPS'])) {\n return 'https://';\n }\n return 'http://';\n }",
"function force_ssl() {\n\t global $psts;\n return (bool)$psts->get_setting('stripe_ssl', false);\n\t}",
"private function usesNonStandardHttpPort(): bool\n {\n return 'http' === $this->getScheme() && '80' != $this->router->getContext()->getHttpPort();\n }",
"public function getSsl() {\n return @$this->attributes['ssl'];\n }",
"public function test_https_status()\n {\n }",
"public function matches(lib_routing_route $route, lib_http_request $request)\n\t{\n\t\tif ($route->httpOnly())\n\t\t{\n\t\t\treturn ! $request->secure();\n\t\t}\n\t\telseif ($route->secure())\n\t\t{\n\t\t\treturn $request->secure();\n\t\t}\n\n\t\treturn true;\n\t}",
"function wp_schedule_https_detection()\n {\n }",
"public function isSecure()\n {\n return $this->secure;\n }",
"public function getSecureTunnelUrl()\n {\n return false;\n }",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function secureSsl()\n {\n return $this->secureSsl;\n }",
"public function isSecure()\r\n\t{\r\n\t\treturn $this->secure;\r\n\t}",
"function redirect_to_https() {\n\tif ($_SERVER['HTTPS'] !== \"on\") {\n\t\t$url = \"https://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t\tredirect($url);\n\t}\n}",
"public function testProtocolDetect() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Test']);\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTP right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('http');\n\n\t\t$_SERVER['HTTPS'] = true;\n\t\t(new Verify(\n\t\t\t'check that GetProtocol() thinks its on HTTPS right now.',\n\t\t\t$router->GetProtocol()\n\t\t))->equals('https');\n\n\t\treturn;\n\t}",
"function http() {\n\treturn !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https':'http';\n}",
"public function isSecure()\n {\n return $this->_secure;\n }"
]
| [
"0.8124776",
"0.8062833",
"0.80528396",
"0.8016135",
"0.8009119",
"0.7939497",
"0.7918721",
"0.7918229",
"0.7917067",
"0.784984",
"0.7848425",
"0.777524",
"0.777339",
"0.776641",
"0.7756559",
"0.7753274",
"0.77507305",
"0.7748564",
"0.774786",
"0.7747424",
"0.77442354",
"0.77403456",
"0.7705662",
"0.76692605",
"0.7630199",
"0.76299363",
"0.7595504",
"0.756842",
"0.75658363",
"0.75561595",
"0.74962014",
"0.7469197",
"0.7439913",
"0.741294",
"0.739652",
"0.73782766",
"0.73496646",
"0.7328611",
"0.73099536",
"0.7298457",
"0.72798514",
"0.7271303",
"0.7270276",
"0.72660595",
"0.7248931",
"0.72438896",
"0.724258",
"0.72085464",
"0.7176432",
"0.71310455",
"0.71180385",
"0.7067555",
"0.7061816",
"0.705764",
"0.7052367",
"0.7037721",
"0.7018402",
"0.6931541",
"0.690968",
"0.6884458",
"0.6842906",
"0.6824641",
"0.6784009",
"0.67189515",
"0.66880023",
"0.6685786",
"0.66593546",
"0.6648586",
"0.65470976",
"0.6514519",
"0.6468444",
"0.64666176",
"0.64216644",
"0.64160734",
"0.63770735",
"0.6368965",
"0.63476896",
"0.63405204",
"0.63253605",
"0.63187444",
"0.63068056",
"0.62485194",
"0.62458944",
"0.6241464",
"0.623596",
"0.62223685",
"0.62171066",
"0.62127703",
"0.6210806",
"0.620941",
"0.62071574",
"0.61663425",
"0.6150464",
"0.6150464",
"0.6141169",
"0.6141011",
"0.61288965",
"0.61173755",
"0.6110134",
"0.61056006"
]
| 0.7447317 | 32 |
Get the domain defined for the route. | public function domain()
{
return isset($this->action['domain'])
? str_replace(['http://', 'https://'], '', $this->action['domain']) : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDomain()\n {\n $hostParts = explode('.', $this->getHost());\n array_shift($hostParts);\n\n return implode('.', $hostParts);\n }",
"public function get_domain()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_load_config();\n\n $domain = (empty($this->config['domain'])) ? '' : $this->config['domain'];\n\n if (empty($domain))\n $domain = $this->convert_domain();\n\n return $domain;\n }",
"public function getDomain()\n {\n if(!($domainId = $this->getData('domainId'))) {\n return null;\n }\n \n return Core_Model_DiFactory::getDomainManager()->getDomain($domainId);\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain(): string\n {\n return $this->domain;\n }",
"public function getDomain(): string\n {\n return $this->domain;\n }",
"public function getDomain()\r\n {\r\n return $this->domain;\r\n }",
"public function getDomain()\n {\n return Session::get(self::DOMAIN) ?? self::$domain;\n }",
"public function getDomain(): string\r\n {\r\n return $this->domain;\r\n }",
"public function getDomain(): string {\n return $this->context->domain;\n }",
"public function get_domain(): string\n {\n return $this->domain;\n }",
"public function getDomain()\n\t{\n\t\treturn $this->domain;\n\t}",
"public function getDomain()\n {\n return $this->_domain;\n }",
"public function getDomain() {\n return $this->domain;\n }",
"public function get_domain()\r\n\t\t{\r\n\t\t\treturn $_SERVER[ 'SERVER_NAME' ];\r\n\t\t}",
"function getDomain() {\n\t\treturn $this->domain;\n\t}",
"public function getDomain(): string;",
"function getDomain()\n {\n }",
"public function getDomain(): ?string\n {\n return $this->sDomain;\n }",
"public static function domain()\n\t{\n\t\tif (isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']))\n\t\t{\n\t\t\treturn $_SERVER['SERVER_NAME'] . ((integer) $_SERVER['SERVER_PORT'] === 80 ? '' : ':' . $_SERVER['SERVER_PORT']);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getDomain()\n {\n if (!$this->_domain) {\n try {\n $this->_domain = \\Ca\\Db\\DomainMap::create()->find($this->getDomainId());\n } catch (\\Exception $e) {}\n }\n return $this->_domain;\n }",
"public function getDomain()\n {\n\n }",
"public function getDomain(){\n\t\treturn $_SERVER['SERVER_NAME'];\n\t}",
"public function domain()\n {\n return $this->protocol() . \"://\" . $this->host();\n }",
"protected function getRouteDomain($route)\n {\n return $route->getDomain() ? $this->formatDomain($route) : null;\n }",
"public function getDomain()\n {\n if ($this->domain === null) {\n $this->domain = new Domain();\n }\n\n return $this->domain;\n }",
"public function getDomain()\n\t{\n\t\treturn substr(strrchr($this->email, \"@\"), 1);\n\t}",
"public function getDomain()\n\t{\n\t\treturn $this->activeDomain;\n\t}",
"public function getDomain()\n {\n return substr($this->email, strpos($this->email, '@'));\n }",
"public static function getDomain()\r\n\t{\r\n\t\t$port = $_SERVER['SERVER_PORT'];\r\n\t\t$port = ( $port == 80 ) ? '' : \":$port\";\r\n\t\treturn 'http://' . $_SERVER['SERVER_NAME']. \"$port/\";\r\n\t}",
"public function domain(): string|null\n\t{\n\t\tif (empty($this->host) === true || $this->host === '/') {\n\t\t\treturn null;\n\t\t}\n\n\t\t$auth = $this->auth();\n\t\t$domain = '';\n\n\t\tif ($auth !== null) {\n\t\t\t$domain .= $auth . '@';\n\t\t}\n\n\t\t$domain .= $this->host;\n\n\t\tif ($this->port !== null && in_array($this->port, [80, 443]) === false) {\n\t\t\t$domain .= ':' . $this->port;\n\t\t}\n\n\t\treturn $domain;\n\t}",
"function domain()\n{\n return $_SERVER['HTTP_HOST'];\n}",
"public function getEndpointDomain()\n {\n return $this->endpoint_domain;\n }",
"public function domainName()\n\t{\n\t\treturn isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\n\t}",
"function getDomain() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_DOMAIN);\n\t}",
"function getDomain() {\n\t\treturn $this->getAttribute(DOMIT_RSS_ATTR_DOMAIN);\n\t}",
"private function getRootDomain()\n\t{\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$parts = explode('.', $host);\n\t\tif(count($parts)>1){\n\t\t\t$tld = array_pop($parts);\n\t\t\t$domain = array_pop($parts).'.'.$tld;\n\t\t} else {\n\t\t\t$domain = array_pop($parts);\n\t\t}\n\t\treturn '.'.$domain;\n\t}",
"protected function getDomain($url){\n // return static::DOMAIN;\n return parse_url($url, PHP_URL_HOST);\n }",
"public static function getDomain()\n {\n $serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null;\n // CORS\n /*if (isset($_SERVER['HTTP_ORIGIN'])) {\n return $_SERVER['HTTP_ORIGIN'];\n }*/\n if (!$serverName) {\n // when in cli mode\n return null;\n }\n\n if (substr($serverName, 0, strLen(self::PUNYCODE_PREFIX)) == self::PUNYCODE_PREFIX) {\n $convertor = new \\Bazalt\\Site\\IDNConvertor(array('idn_version' => 2008));\n $serverName = $convertor->decode($serverName);\n }\n // If server name has port number attached then strip it\n $colon = strpos($serverName, ':');\n if ($colon) {\n $serverName = substr($serverName, 0, $colon);\n }\n $serverName .= !self::needPortInDomain() ? '' : ':' . $_SERVER['SERVER_PORT'];\n\n return self::getProtocol() . $serverName;\n }",
"public function domainOfURL()\n {\n $urlDetails = parse_url($this->url);\n return $urlDetails['host'] ?? $this->shortUrl(20);\n }",
"public static function getDomain()\n {\n if (!isset($_SERVER['SERVER_NAME'])) {\n // when in cli mode\n return null;\n }\n $serverName = $_SERVER['SERVER_NAME'];\n\n if (substr($serverName, 0, 4) == self::PUNYCODE_PREFIX) {\n $convertor = new Core_IDNConvertor(array('idn_version' => 2008));\n $serverName = $convertor->decode($serverName);\n }\n // If server name has port number attached then strip it\n $colon = strpos($serverName, ':');\n if ($colon) {\n $serverName = substr($serverName, 0, $colon);\n }\n $serverName .= !self::needPortInDomain() ? '' : ':' . $_SERVER['SERVER_PORT'];\n\n return $serverName;\n }",
"public function domain()\n {\n return $this->context->getDomainManager();\n }",
"public function getDomainName()\n {\n return $this->_fields['DomainName']['FieldValue'];\n }",
"public function getDomain()\n {\n return $this->apiDomain;\n }",
"public function getDomain()\n {\n return 'example.test';\n }",
"private function get_cookie_domain() {\n\t\t$requested_domain_parts = explode( '.', $_SERVER['HTTP_HOST'] );\n\t\t$cookie_domain = array_pop( $requested_domain_parts );\n\t\t$cookie_domain = '.' . array_pop( $requested_domain_parts ) . '.' . $cookie_domain;\n\n\t\treturn $cookie_domain;\n\t}",
"public static function hostNameDomain() {\n\t\tif (!isset($_SERVER['HTTP_HOST'])) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($_SERVER['HTTP_HOST'] == $_SERVER['REMOTE_ADDR']) {\n\t\t\treturn $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t$domain = explode('.', $_SERVER['HTTP_HOST']);\n\t\t$size = count($domain);\n\n\t\tif ($size <= 2) {\n\t\t\treturn $_SERVER['HTTP_HOST'];\n\t\t} else {\n\t\t\treturn \"{$domain[$size -2]}.{$domain[$size -1]}\";\n\t\t}\n\t}",
"public function getDomain()\n {\n return textdomain();\n }",
"public function\n\tGetFullDomain():\n\t?String {\n\n\t\treturn $this->Domain;\n\t}",
"public function getDomainName() {\n return self::DOMAIN_NAME;\n }",
"public function getDomain(): ?Domain\n {\n $result = null;\n if (!empty($this->api->main_domain_id)) {\n $result = Domain::getById($this->api->main_domain_id);\n }\n return $result;\n }",
"function get_cur_domain()\n{\n}",
"public function getDomain() {\n\t\t\t# Default StyleSheet\n\t\t\tif (! $_REQUEST[\"stylesheet\"]) $_REQUEST[\"stylesheet\"] = 'network.domain.xsl';\n\t\t\t$response = new \\HTTP\\Response();\n\t\n\t\t\t# Initiate Domain Object\n\t\t\t$domain = new \\Network\\Domain();\n\t\t\tif (! isset($_REQUEST['name'])) $this->error(\"name required\");\n\t\n\t\t\t$domain->get($_REQUEST['name']);\n\t\n\t\t\t# Error Handling\n\t\t\tif ($domain->error()) $this->error($domain->error());\n\t\t\telseif ($domain->id) {\n\t\t\t\t$response->domain = $domain;\n\t\t\t\t$response->success = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$response->success = 0;\n\t\t\t\t$response->error = \"Domain not found\";\n\t\t\t}\n\t\n\t\t\tapi_log('network',$_REQUEST,$response);\n\t\n\t\t\t# Send Response\n\t\t\tprint $this->formatOutput($response);\n\t\t}",
"public function get_external_domain(): string;",
"public function getDomain(): string\n {\n /** @var WebstoreHelper $webstoreHelper */\n $webstoreHelper = pluginApp(WebstoreHelper::class);\n\n return $webstoreHelper->getCurrentWebstoreConfiguration()->domainSsl;\n }",
"public function getDomain(): string\n {\n $domain = php_uname('n');\n if ($this->from) {\n $email = $this->from[0];\n list(, $domain) = explode('@', $email);\n }\n\n return $domain;\n }",
"public function getSiteDomain() {\n \n return $this->siteDomain;\n \n }",
"public function domain($domain = null)\n {\n if(null === $domain)\n {\n return $this->property('domain');\n }\n return $this->property('domain', trim($domain));\n }",
"static public function getDomain()\n {\n $user = self::getUser(true);\n $pos = strpos($user, '@');\n\n return ($pos !== false)\n ? substr($user, $pos + 1)\n : false;\n }",
"public function getCustomDomainName()\n {\n if (array_key_exists(\"customDomainName\", $this->_propDict)) {\n return $this->_propDict[\"customDomainName\"];\n } else {\n return null;\n }\n }",
"public function getFloatedDomain() {\n\t\t\tif(!is_null($domain_floated = getRequest('domain'))) {\n\t\t\t\t$domain_floated = urldecode($domain_floated);\n\t\t\t\t$domain_floated_id = domainsCollection::getInstance()->getDomainId($domain_floated);\n\t\t\t\tif($domain_floated_id) {\n\t\t\t\t\treturn $domain_floated_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"function ajan_core_get_root_domain() {\n\n\t$domain = get_home_url( ajan_get_root_blog_id() );\n\n\treturn apply_filters( 'ajan_core_get_root_domain', $domain );\n}",
"function getRoute()\n{\n\t// Get the requested uri from the server exluding the domain name.\n\t$uri = strtok($_SERVER['REQUEST_URI'], '?');\n\n\t// Remove the site path from the uri so we only get the segments\n\t// that we actually want.\n\t$uri = str_replace(SITE_PATH, '', $uri);\n\n\treturn $uri;\n}",
"public function getDomain($includeProtocol = TRUE)\n\t{\n\t\t$domain\t\t= $_SERVER['SERVER_NAME'];\n\t\t$domain \t= rtrim(\\Config::get('mediamanager.domain', $domain), '/');\n\n\t\treturn ($includeProtocol ? $this->getProtocol() : '') . $domain;\n\t}",
"protected function _domainName() {\n\t\t$this->CI->load->helper('url');\n\t $url = site_url();\n\t //$parse the url\n\t\t$host = parse_url( $url, PHP_URL_HOST );\n\t\t//reverse array\n\t\t$host = array_reverse( explode( '.', $host ) );\n\t\t//check in_array for .bd domain name\n\t\tif( in_array( 'bd', $host ) == True ) :\n\t\t\t$host = $host[2] . '.' . $host[1] . '.' . $host[0];\n\t\telseif( in_array( 'localhost', $host ) == true ) :\n\t\t\t$host = $host[0];\n\t\telse :\n\t\t\t$host = $host[1] . '.' . $host[0];\n\t\tendif;\n\t\treturn $host;\n\t}",
"function getDomainName($domain = 0)\n{\n\tif($domain == 0)\n\t\t$domain = ARC_DOMAIN;\n\n\t$name = getDBData('domain_name', $domain, 'domain_id', 'domain');\n\n\tif($name == '')\n\t\treturn '-None-';\n\telse\n\t\treturn $name;\n}",
"protected function formatDomain($route)\n {\n return $this->getRouteScheme($route).$route->getDomain();\n }",
"function kopa_get_domain() {\n\tif ( defined( 'KOPA_DOMAIN' ) ) {\n\t\treturn KOPA_DOMAIN;\n\t}\n\n\treturn 'kopa-framework';\n}",
"public function getMainDomain($step = null) {\n $parts = explode('.', $this->hostName);\n $count = sizeof($parts);\n if ($step === null) {\n $step = \\TS_Functions::getCookiesDomainLevel();\n }\n if ($count >= $step) {\n $return = array();\n while ($step > 0) {\n $return[] = $parts[$count - $step];\n $step--;\n }\n\n return implode('.', $return);\n }\n return null;\n }",
"public function getDomain()\n {\n if (!isset($this->_domain)) {\n throw new \\LogicException('Missing property _domain');\n }\n return $this->_domain;\n }",
"static public function get_cdn_domain( $path = '' ) {\n\t\t$cdncommon = Dispatcher::component( 'Cdn_Core' );\n\t\t$cdn = $cdncommon->get_cdn();\n\t\treturn $cdn->get_domain( $path );\n\t}",
"function get_domain()\n\t{\n\t\t$http_host = $_SERVER['HTTP_HOST'];\n\t\t$DOC_ROOT = $_SERVER['DOCUMENT_ROOT'];\n\t\t$site_root = str_replace($DOC_ROOT, \"\", SITE_ROOT);\n\t\t// $win = str_replace(\"/\",\"\\\\\",$DOC_ROOT);\n\t\t$site_root = str_replace($DOC_ROOT,\"\",SITE_ROOT);\n\t\t$http_chunk = \"$http_host/$site_root/\";\n\t\treturn \"http://\".str_replace(\"//\", \"/\", $http_chunk);\n\t}",
"function curr_url_domain()\n{\n return Request::root(true);\n}",
"protected function getCookieDomain() {}",
"protected function negotiateActiveDomain() {\n $httpHost = $this->negotiateActiveHostname();\n $this->setRequestDomain($httpHost);\n return $this->domain;\n }",
"function get_domain_url()\n{\n static $url = NULL;\n if (NULL === $url) {\n $is_ssl = isset($_REQUEST['is_ssl']) ? $_REQUEST['is_ssl'] : is_ssl();\n $protocol = $is_ssl ? 'https://' : 'http://';\n $url = $protocol . $_SERVER['HTTP_HOST'];\n }\n return $url;\n}",
"public function subDomain(): DomainName;",
"public function getHost()\n {\n return isset($this->urlParts['host']) ? $this->urlParts['host'] : NULL;\n }",
"public function convert_domain()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (!clearos_load_library('openldap/LDAP_Driver'))\n return;\n\n $ldap = new \\clearos\\apps\\openldap\\LDAP_Driver();\n $ldaph = $ldap->get_ldap_handle();\n $dn = $ldap->get_master_dn();\n \n $attributes = $ldaph->read($dn);\n\n $domain = empty($attributes['clearMasterMailDomain'][0]) ? '' : $attributes['clearMasterMailDomain'][0];\n\n if (!empty($domain))\n $this->set_domain($domain);\n\n return $domain;\n }",
"public function getHost()\n {\n return $this->wrapped->getHost();\n }",
"protected function _getDomain($ending_slash = false)\n {\n $protocol = 'http';\n if (isset($_SERVER['SERVER_PROTOCOL'])) {\n if (strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS')) {\n $protocol = 'https';\n }\n }\n\n $host = \"localhost\";\n if (isset($_SERVER['HTTP_HOST'])) {\n $host = $_SERVER['HTTP_HOST'];\n }\n\n $out = $protocol . \"://\" . $host;\n if ($ending_slash) {\n $out .= \"/\";\n }\n\n return $out;\n }",
"public function getSubdomain()\n {\n return $this->subdomain;\n }",
"public function getGitlabDomain (): string {\n\t\t$config = $this->getOauthProviderConfig();\n\n\t\treturn $config['options']['domain'];\n\t}",
"function get_email_domain($e)\n{\n\t$email = explode('@', $e);\n\t$num = count($email);\n\treturn $email[$num-1];\n}",
"function get_domain()\n{\n global $SITE_INFO;\n $ret = (!empty($SITE_INFO['domain'])) ? $SITE_INFO['domain'] : '';\n\n // Ah, no explicit setting, so derive...\n if ($ret == '') {\n // Derive from base URL\n if (!empty($SITE_INFO['base_url'])) {\n $matches = array();\n if (preg_match('#://([^/\\#:]+)#', $SITE_INFO['base_url'], $matches) != 0) {\n return preg_replace('#^www\\.#', '', $matches[1]);\n }\n }\n\n // Derive from other possibilities. Note that we can't use cms_srv due to bootstrap order (it's in global3.php)\n if (!empty($_SERVER['HTTP_HOST'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['HTTP_HOST']);\n }\n if (!empty($_ENV['HTTP_HOST'])) {\n return preg_replace('#^www\\.#', '', $_ENV['HTTP_HOST']);\n }\n if (function_exists('gethostname')) {\n return preg_replace('#^www\\.#', '', gethostname());\n }\n if (!empty($_SERVER['SERVER_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['SERVER_ADDR']);\n }\n if (!empty($_ENV['SERVER_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_ENV['SERVER_ADDR']);\n }\n if (!empty($_SERVER['LOCAL_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_SERVER['LOCAL_ADDR']);\n }\n if (!empty($_ENV['LOCAL_ADDR'])) {\n return preg_replace('#^www\\.#', '', $_ENV['LOCAL_ADDR']);\n }\n return 'localhost';\n }\n return $ret;\n}",
"public function getBaseDomain();",
"function get_domain(string $prepend = null): string\n {\n [$scheme, $domain] = explode('://', config('app.url'), 2);\n\n return str_replace('www.', '', $prepend ? $prepend.'.'.$domain : $domain);\n }",
"public function getRublonDomain() {\n\t\treturn self::RUBLON_DOMAIN;\n\t}",
"public function getHomeDomain()\n {\n $result = parse_url($this->url);\n return $result['scheme'] . \"://\" . $result['host'];\n }",
"public function getDomainDescriptor($domain = null) {\n\t\tif ($domain == null) $domain = $this->current_domain;\n\t\t$domains = include(\"conf/domains\");\n\t\treturn $domains[$domain];\n\t}",
"public function getHost()\n {\n return $this->server['HTTP_HOST'];\n }",
"public function secondLevelDomain(): DomainName;",
"public function get($name, $optParams = array())\n {\n $params = array('name' => $name);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), \"Google_Service_FirebaseHosting_Domain\");\n }"
]
| [
"0.7569333",
"0.75035954",
"0.7492639",
"0.7430586",
"0.7430586",
"0.7430586",
"0.7430586",
"0.7430586",
"0.7430586",
"0.7430586",
"0.7430586",
"0.74143606",
"0.74143606",
"0.7410105",
"0.7383315",
"0.7373811",
"0.7360791",
"0.7349513",
"0.7346464",
"0.73149735",
"0.7301041",
"0.7256056",
"0.7250834",
"0.72018665",
"0.7166076",
"0.7164951",
"0.71603245",
"0.71517324",
"0.7130917",
"0.7105372",
"0.7056214",
"0.70499593",
"0.69970274",
"0.6973908",
"0.6933316",
"0.68980163",
"0.6888993",
"0.6826185",
"0.6791521",
"0.6789694",
"0.67798215",
"0.67671394",
"0.67671394",
"0.67410606",
"0.6724832",
"0.6701683",
"0.66934973",
"0.6664739",
"0.6651617",
"0.6645301",
"0.66280425",
"0.6611248",
"0.6599907",
"0.65939295",
"0.656878",
"0.6536339",
"0.6536156",
"0.64948606",
"0.6483994",
"0.6468206",
"0.64642584",
"0.64621216",
"0.64435446",
"0.64409107",
"0.6430349",
"0.64061785",
"0.6391686",
"0.6380917",
"0.63805836",
"0.6370527",
"0.6346984",
"0.6338452",
"0.63293386",
"0.62928426",
"0.628961",
"0.6288921",
"0.6269169",
"0.62644684",
"0.62580746",
"0.62381846",
"0.6220039",
"0.6169434",
"0.6142698",
"0.6116845",
"0.6106678",
"0.60981417",
"0.6077148",
"0.6071924",
"0.6065692",
"0.60632724",
"0.6056928",
"0.60430056",
"0.6041233",
"0.60395557",
"0.60240424",
"0.60200125",
"0.60147244",
"0.5991114",
"0.5984958",
"0.59779394"
]
| 0.6965841 | 34 |
Get the prefix of the route instance. | public function getPrefix()
{
return isset($this->action['prefix']) ? $this->action['prefix'] : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getRoutePrefix();",
"public static function getRoutePrefix()\n {\n /** @var \\Illuminate\\Routing\\Route */\n $route = request()->route();\n return trim($route->getPrefix() ?? '', '/');\n }",
"public function getRoutePrefix(){\n return $this->routePrefix;\n }",
"protected function getRoutePrefix()\n {\n if ($this->routePrefix !== null) {\n return $this->routePrefix;\n }\n\n return str_plural(snake_case($this->getControllerName(), '-'));\n }",
"public function routePrefix(): string\n {\n $locale = $this->routedLocale() ? $this->routedLocale() : $this->defaultLocale();\n\n return $locale->{$this->defaultKey};\n }",
"public function getPrefix()\n {\n return $this->action['prefix'] ?? null;\n }",
"public function getPrefix();",
"public function getPrefix();",
"public function getPrefix()\n {\n return $this->prefix ?? '';\n }",
"public function getRoutePrefix()\n {\n if (!isset($this->matchedRoute[3]['mount_path'])) {\n echo '<pre>';\n debug_print_backtrace();\n echo '</pre>';\n throw new \\Exception('mount_path is not set in matchedRoute');\n }\n return $this->matchedRoute[3]['mount_path'];\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix()\n {\n return $this->prefix;\n }",
"public function getPrefix() {\n return $this->sPrefix;\n }",
"Public Function getPrefix() { Return $this->prefix; }",
"public function getPrefix() {}",
"public function getPrefix()\n {\n return $this->_prefix;\n }",
"protected function getPrefix()\n {\n $prefix = '';\n return $prefix;\n }",
"public function getPrefix() {\n return $this->_prefix;\n }",
"public function getPathPrefix()\n {\n return $this->pathPrefix;\n }",
"public function getPrefix()\n {\n // TODO: Implement getPrefix() method.\n }",
"public function GetPrefix() {\n\n return $this->\n config['prefix'];\n }",
"public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}",
"public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}",
"public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}",
"public function getPrefix()\n\t{\n\t\treturn $this->prefix;\n\t}",
"public static function getPrefix()\n\t\t{\n\t\t\treturn substr(self::get(), 0, 2);\n\t\t}",
"public function getPrefix(): string\n {\n return $this->prefix;\n }",
"public function getPrefix() {\n return $this->_prefix;\n }",
"public function getPrefix(): string\n {\n return (string) $this->prefix;\n }",
"protected function getPrefix(): string\n\t{\n\t\treturn $this->arParams['PREFIX'] !== '' ? $this->arParams['PREFIX'] : $this->getDefaultPrefix();\n\t}",
"public function getPrefix()\n {\n return $this->__get(self::FIELD_PREFIX);\n }",
"public function getPrefix()\n\t{\n\t\treturn (strlen($this->prefix) > 0) ? $this->prefix.'_' : '';\n\t}",
"protected function _getPrefix()\n\t{\n\t\t$ret = '/';\n\n\t\tif(isset($this->_options['namespace'])) {\n\t\t\t$ret .= isset($this->_options['prefix']) ? $this->_options['prefix'] : $this->_options['namespace'];\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public function getPrefix()\n\t{\n\t\t\n\t\t$parsed = $this->getAsArray();\n\t\t\n\t\tif( ! empty($parsed) )\n\t\t{\n\t\t\tif( in_array($parsed[0], (array)$this->prefixes) )\n\t\t\t{\n\t\t\t\treturn $parsed[0];\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"protected function routePrefix($delimiter = '')\n\t{\n\t\treturn $this->config('routes.prefix') ? $this->config('routes.prefix') . $delimiter : '';\n\t}",
"public function getPrefix(): ? string\n {\n return $this->prefix;\n }",
"public function getPrefix(): ?string\n {\n return $this->prefix ?? null;\n }",
"function route_prefix(): ?string\n{\n return RouteController::getCurrentRoute()['prefix'] ?? null;\n}",
"public function getPrefix()\n {\n $connector_parameters = $this->getConnectorParameters();\n \n foreach( $connector_parameters as $param )\n {\n if( $param->getName() == self::PREFIX )\n {\n return $param->getValue();\n }\n }\n }",
"public function getPrefixKey()\n {\n return $this->getNamespace();\n }",
"public function getPrefix()\n {\n return $this->wpdb->prefix . $this->config['namespace'];\n }",
"public function getPrefix()\n {\n return '';\n }",
"public function getPrefix(): string\n {\n }",
"protected function getPrefix() {\n\t\t$prefix = (string) $this->viewHelperVariableContainer->get('TYPO3\\\\CMS\\\\Fluid\\\\ViewHelpers\\\\FormViewHelper', 'fieldNamePrefix');\n\n\t\tif (!empty($this->prefix)) {\n\t\t\t$prefix = sprintf('%s[%s]', $prefix, $this->prefix);\n\t\t}\n\t\treturn $prefix;\n\t}",
"public function getXpathPrefix()\n {\n return $this->xpathPrefix;\n }",
"public function getResourcePrefix()\n {\n return $this->resourcePrefix;\n }",
"public function getUniqueControllerPrefix()\n {\n return self::PREFIX;\n }",
"public function getPrefix()\n\t{\n\t\treturn $this->royalcms['config']['cache.prefix'];\n\t}",
"abstract public function getPrefix(): string;",
"public function getClassPrefix()\n {\n return $this->classPrefix;\n }",
"function rest_get_url_prefix()\n {\n }",
"public function getLabelPrefix(): string\n {\n return $this->labelPrefix;\n }",
"public function getPrefix(): string\n {\n if (is_null($this->prefixCache)) {\n $prefix = Config::get('database-encryption.prefix', null);\n $prefix = ! empty($prefix) && is_string($prefix) ? $prefix : self::getPrefixDefault();\n\n $this->prefixCache = $this->isVersioning() ?\n str_replace('%VERSION%', $this->getVersionForPrefix(), $prefix) :\n $prefix;\n }\n\n return $this->prefixCache;\n }",
"public function getIdPrefix()\n {\n return $this->idPrefix;\n }",
"protected function getViewPrefix()\n {\n if ($this->viewPrefix !== null) {\n return $this->viewPrefix;\n }\n\n return str_plural(snake_case($this->getControllerName()));\n }",
"public function getCustomerPrefix();",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n return $this->_prefix = $prefix;\n }",
"public function getRoutePrefix()\n {\n return 'admin_category';\n }",
"public function getPrefix(): string\n {\n return config('linky.db.prefix');\n }",
"public function route($route)\n {\n return $this->options['default-prefix'] . $route;\n }",
"public function getHeaderPrefix(): string\n {\n if (is_null($this->headerPrefixCache)) {\n $characters = $this->getControlCharacters();\n\n $this->headerPrefixCache = $characters['header']['start']['string'].\n $characters['prefix']['start']['string'].\n $this->getPrefix().\n $characters['prefix']['stop']['string'];\n }\n\n return $this->headerPrefixCache;\n }",
"public function routePrefix()\n {\n return 'orders';\n }",
"public function getKeyPrefix()\n\t{\n\t\treturn $this->_redisKeyPrefix;\n\t}",
"public function getBaseRouteName(): string;",
"protected function route_base() {\n\t\treturn substr( strrchr( get_class( $this ), '\\\\' ), 1 );\n\t}",
"public function getRoute() : string\n {\n return $this->route;\n }",
"public function getRouteName();",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n\n if (is_string($prefix)) {\n $prefix = $prefix;\n }\n\n return $this->_prefix = $prefix;\n }",
"protected function getRouteName()\n {\n if (is_null($this->routeName)) {\n $this->routeName = $this->getCurrentCallingControllerName();\n }\n\n return $this->routeName;\n }",
"public function prefix() {\n return $this->db['prefix'];\n }",
"public function getRoutePrefix($name = '')\n {\n return $this->getRoutesDomain() . '/' . $this->getLanguage($this->getRoutesLocale()) . $name;\n }",
"public function getFullNamespace(): string\n {\n return $this->requestStack->getMainRequest()->get('_route') . $this->separator;\n }",
"public function getRouteName()\n {\n $routeName = $this->getConfiguredRouteName();\n\n return trim($routeName, '/') . '/';\n }",
"public function getTablePrefix()\n {\n return $this->tablePrefix;\n }",
"public function getBaseNamespace(): string\n {\n $routeName = $this->requestStack->getMainRequest()->get('_route');\n\n return mb_substr($routeName, 0, mb_strrpos($routeName, $this->separator) + 1);\n }",
"public function getNamespacePrefix() {\n\t\treturn $this->nsPrefix;\n\t}",
"public static function route()\n {\n return self::$route;\n }",
"public function getTemplateClassPrefix()\n {\n return $this->templateClassPrefix;\n }",
"public function getRouteName()\n {\n return $this->routeName;\n }",
"public function getRouteName()\n {\n return $this->routeName;\n }",
"public function getRouteNamespace()\n {\n return $this->routeNameSpace;\n }",
"public function getRoute(): string\n {\n return (string) $this->route;\n }",
"public function getTablePrefix(): string\n {\n return $this->tablePrefix;\n }",
"public static function keyPrefix()\n {\n return Inflector::camel2id(StringHelper::basename(get_called_class()), '_');\n }",
"public function prefix() : string\n {\n return config('admin.slug', 'admin');\n }",
"public function getClassPrefix()\n {\n \tif (isset($this->_options['options']['builder']['classPrefix'])) {\n \t\treturn $this->_options['options']['builder']['classPrefix'];\n \t}\n\n \treturn NULL;\n\n }",
"function getRouteName() {\n \treturn $this->route_name;\n }",
"function getRouteName();",
"protected function getMainTablePrefix(): string\n {\n $prefixes = $this->getTablePrefixes();\n return array_shift($prefixes);\n }",
"public function getFormPrefix() {}",
"protected function getPrefix($entity)\n {\n $entity_class = get_class($entity);\n $metadata = $entity_class::metadata();\n $entity_class = $metadata->name;\n\n $entity_namespace = $entity_class::getModule();\n $module = \\Module::exists($entity_namespace);\n $prefix = $entity->urlPrefix();\n \n if ($module !== false && $entity_namespace != '')\n {\n $module_prefix = \\Arr::get($this->moduleUrls, $entity_namespace, $entity_namespace);\n if (strpos($prefix, '/'.$module_prefix) === 0) return $prefix;\n return \"/$module_prefix\".$prefix;\n }\n \n return $prefix;\n }",
"public function getTablePrefix($table)\r\n {\r\n return isset($this->tablePrefixes[$table]) ? $this->tablePrefixes[$table] : $this->tablePrefix;\r\n }",
"public function getGivenIpWithPrefixlen()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->prefix;\n\t}",
"public function getTelephonePrefix()\n {\n return $this->getValue('nb_icontact_prospect_telephone_prefix');\n }"
]
| [
"0.84102166",
"0.8399282",
"0.8348332",
"0.81305206",
"0.8084067",
"0.75930864",
"0.75585026",
"0.75585026",
"0.7548401",
"0.7529557",
"0.7521178",
"0.7521178",
"0.7521178",
"0.7521178",
"0.7521178",
"0.7521178",
"0.7521178",
"0.7521178",
"0.7480851",
"0.74803",
"0.7471486",
"0.74603724",
"0.74408686",
"0.7431627",
"0.74294287",
"0.74057996",
"0.7376014",
"0.73622644",
"0.73622644",
"0.73622644",
"0.73622644",
"0.73458314",
"0.73414737",
"0.73206955",
"0.72693014",
"0.72088695",
"0.7117762",
"0.70790946",
"0.70672655",
"0.7043681",
"0.703729",
"0.70106536",
"0.7005072",
"0.6965123",
"0.6956321",
"0.6918861",
"0.6914774",
"0.6848542",
"0.6773401",
"0.67161435",
"0.67084515",
"0.6606757",
"0.6600315",
"0.65800494",
"0.65454537",
"0.65147096",
"0.6488719",
"0.64665866",
"0.64402604",
"0.64311963",
"0.6419421",
"0.6413085",
"0.6405225",
"0.64009154",
"0.63982326",
"0.63950723",
"0.6393956",
"0.6367906",
"0.63534176",
"0.63533795",
"0.6342005",
"0.6335834",
"0.6335486",
"0.63274837",
"0.6322674",
"0.63143754",
"0.6287984",
"0.62757117",
"0.62601817",
"0.6249578",
"0.6248338",
"0.6239012",
"0.6203403",
"0.62027377",
"0.61981446",
"0.61981446",
"0.6172936",
"0.617171",
"0.6134191",
"0.61264825",
"0.61120135",
"0.6056016",
"0.6047997",
"0.6007002",
"0.6002643",
"0.5972981",
"0.59494543",
"0.59453005",
"0.593561",
"0.5935406"
]
| 0.7574746 | 6 |
Add a prefix to the route URI. | public function prefix($prefix)
{
$uri = rtrim($prefix, '/').'/'.ltrim($this->uri, '/');
$this->uri = trim($uri, '/');
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRoutePrefix($prefix)\n {\n if (Str::startsWith($prefix, Lit::url(''))) {\n $prefix = Str::replaceFirst(Lit::url(''), '', $prefix);\n }\n\n $this->routePrefix = $prefix;\n }",
"abstract public function getRoutePrefix();",
"public function setPrefix($prefix)\n {\n $uri = rtrim($prefix, '/') . '/' . ltrim($this->uri, '/');\n $this->uri = trim($uri, '/');\n return $this;\n }",
"public function setPrefix($prefix);",
"public function setPrefix( $prefix );",
"public function testPrefix(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n\n $routes->prefix('admin', ['_namePrefix' => 'admin:'], function (RouteBuilder $routes): void {\n $this->assertSame('admin:', $routes->namePrefix());\n $this->assertEquals(['prefix' => 'Admin'], $routes->params());\n });\n }",
"public function setPathPrefix($prefix)\n {\n $prefix = ltrim($prefix, '/');\n\n return parent::setPathPrefix($prefix);\n }",
"public function addPrefix($prefix, $path) {\r\n if (substr($path, 0, 4) == 'EXT:') {\r\n\t\t $this->prefixes[$prefix] = t3lib_div::getFileAbsFileName($path, 1);\r\n }\r\n else {\r\n\t\t $this->prefixes[$prefix] = $path;\r\n }\r\n\t}",
"public function testAddRouteAndCheckPrefix()\n {\n $this->collection->setPrefix('name-prefix.', '/path-prefix');\n $this->collection->get('name', '/path', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertEquals('name-prefix.name', $routes[0]->getName());\n $this->assertEquals('/path-prefix/path', $routes[0]->getSourceRoute());\n }",
"public static function registerPrefix($prefix, $uri, $overwrite = false)\n\t{\n\t\tself::registerPrefixes();\n\t\t$uri = strval($uri);\n\t\tif($overwrite || !isset(self::$namespaces[$uri]))\n\t\t{\n\t\t\tself::$namespaces[$uri] = $prefix;\n\t\t}\n\t}",
"public function testUrlWritingWithPrefixes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/company/{controller}/{action}/*', ['prefix' => 'Company']);\n $routes->connect('/{action}', ['controller' => 'Users']);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login', 'prefix' => 'Company']);\n $expected = '/company/Users/login';\n $this->assertSame($expected, $result);\n\n $request = new ServerRequest([\n 'url' => '/',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Users',\n 'action' => 'login',\n 'prefix' => 'Company',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login', 'prefix' => false]);\n $expected = '/login';\n $this->assertSame($expected, $result);\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = !empty($prefix) ? $prefix . ':' : '';\n }",
"protected function routePrefix($delimiter = '')\n\t{\n\t\treturn $this->config('routes.prefix') ? $this->config('routes.prefix') . $delimiter : '';\n\t}",
"public function prefix($value);",
"public function testPrefixOptions(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->prefix('admin', ['param' => 'value'], function (RouteBuilder $routes): void {\n $this->assertSame('/admin', $routes->path());\n $this->assertEquals(['prefix' => 'Admin', 'param' => 'value'], $routes->params());\n });\n\n $routes->prefix('CustomPath', ['path' => '/custom-path'], function (RouteBuilder $routes): void {\n $this->assertSame('/custom-path', $routes->path());\n $this->assertEquals(['prefix' => 'CustomPath'], $routes->params());\n });\n }",
"public function prefix($prefix)\n {\n return $this->addAction(ClassUtils::verifyInstance($prefix, Prefix::class));\n }",
"public function route($route)\n {\n return $this->options['default-prefix'] . $route;\n }",
"public function install($prefix = null)\n {\n /** @var RoutesService $routeService */\n $routeService = \\Craft\\craft()->routes;\n\n $data = $this->getData();\n $demoFolder = $prefix . \"/\";\n\n foreach ($data as $route) {\n if (isset($route->urlParts) && is_array($route->urlParts) && isset($route->template)) {\n $urlParts = $route->urlParts;\n\n array_walk_recursive($urlParts, function(&$value) {\n $value = stripslashes($value);\n });\n\n $urlParts[0] = $demoFolder . $urlParts[0];\n\n $pattern = \"/(\\/?)(.*)/\";\n $template = preg_replace($pattern, \"$1$demoFolder$2\", $route->template, 1);\n\n $routeService->saveRoute($urlParts, $template);\n }\n }\n }",
"public function prefix($prefix): static\n {\n $this->prefix = $prefix;\n\n return $this;\n }",
"public function addLeadingSlash(): static\n {\n $path = $this->uri->getPath();\n\n return match (true) {\n str_starts_with($path, '/') => $this,\n default => new static($this->uri->withPath('/'.$path)),\n };\n }",
"public function setPrefix() {\n\t}",
"public function setPrefix($prefix = \"\") {\n $this->_prefix = !empty($prefix) ? $prefix : '';\n }",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n\n if (is_string($prefix)) {\n $prefix = $prefix;\n }\n\n return $this->_prefix = $prefix;\n }",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n return $this->_prefix = $prefix;\n }",
"public static function prefix($prefix, Closure $callback)\n {\n $apricot = self::getInstance();\n\n $oldPrefix = $apricot->prefix;\n\n if (null !== $apricot->prefix) {\n $prefix = $apricot->prefix . $prefix;\n }\n\n $apricot->prefix = $prefix;\n\n call_user_func($callback);\n\n $apricot->prefix = $oldPrefix;\n }",
"public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }",
"public static function addPrefixPath($prefix, $path)\n {\n $prefix = rtrim($prefix, '_');\n $path = rtrim($path, DIRECTORY_SEPARATOR);\n self::getPluginLoader()->addPrefixPath($prefix, $path);\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function prependRouteControllersWithPrefix($prefix)\n {\n foreach (parent::all() as $route) {\n $route->setDefault('_controller', $prefix.$route->getDefault('_controller'));\n }\n }",
"public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}",
"public function addNamespace($prefix, $dir, $prepend = false)\n {\n $prefix = trim($prefix, '\\\\').'\\\\';\n $dir = rtrim($dir, DIRECTORY_SEPARATOR).'/';\n\n if (!array_key_exists($prefix, $this->prefixes)) {\n $this->prefixes[$prefix] = [];\n }\n\n if ($prepend) {\n array_unshift($this->prefixes[$prefix], $dir);\n } else {\n $this->prefixes[$prefix][] = $dir;\n }\n\n return $this;\n }",
"public function addNamespace($prefix, $baseDir, $prepend = false)\n\t{\n\t\t// normalise $prefix\n\t\t$prefix = trim($prefix, '\\\\').'\\\\';\n\n\t\t// normalise $prefix\n\t\t$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\n\t\t// initialise the $prefix array within $this->prefixes\n\t\tif (isset($this->prefixes[$prefix]) === false) {\n\t\t\t$this->prefixes[$prefix] = array();\n\t\t}\n\n\t\t// add direction to $prefix array\n\t\tif ($prepend) {\n\t\t\tarray_unshift($this->prefixes[$prefix], $baseDir);\n\t\t} else {\n\t\t\tarray_push($this->prefixes[$prefix], $baseDir);\n\t\t}\n\t}",
"function rest_get_url_prefix()\n {\n }",
"public function getRoutePrefix(){\n return $this->routePrefix;\n }",
"public function withPrefix(string $prefix)\n {\n $this->prefix = $prefix;\n\n return $this;\n }",
"public function setPathPrefix($prefix)\n {\n $prefix = (string) $prefix;\n\n if ($prefix === '') {\n $this->pathPrefix = null;\n return;\n }\n\n $this->pathPrefix = rtrim($prefix, '\\\\/') . $this->pathSeparator;\n }",
"public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_prefix = $prefix;\n\t\t} else {\n\t\t\t$args = func_get_args();\n\t\t\t$args = Arrays::castToType($args, 'string');\n\t\t\t$this->id_prefix = implode('.', $args);\n\t\t}\n\n\t\tif (substr($this->id_prefix, -1, 1) != '.') {\n\t\t\t$this->id_prefix .= '.';\n\t\t}\n\t}",
"public function setPrefix(string $prefix): void\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix(string $prefix): void\n {\n $this->prefix = $prefix;\n }",
"public function testUrlWritingWithPrefixesAndCustomRoutes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/admin/login',\n ['controller' => 'Users', 'action' => 'login', 'prefix' => 'Admin']\n );\n $request = new ServerRequest([\n 'url' => '/',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Posts',\n 'action' => 'index',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/',\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n }",
"public function setPrefix( $prefix ) {\n $this->_prefix = $prefix;\n return $this;\n }",
"public function addPrefixArgument($argument)\n {\n $this->_prefixArgument = $argument;\n\n return true;\n }",
"public function setPrefix($prefix)\n {\n $this->idPrefix = $prefix;\n }",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t}",
"function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }",
"public function setPrefix($value)\n {\n $this->prefix = $value;\n }",
"public function setPrefix(string $prefix): self\n {\n $this->prefix = $prefix;\n return $this;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n return $this;\n }",
"public function testPrefixOverride(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/admin/{controller}/{action}', ['prefix' => 'Admin']);\n $routes->connect('/protected/{controller}/{action}', ['prefix' => 'Protected']);\n\n $request = new ServerRequest([\n 'url' => '/protected/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Protected',\n ],\n ]);\n Router::setRequest($request);\n\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Admin']);\n $expected = '/admin/Images/add';\n $this->assertSame($expected, $result);\n\n $request = new ServerRequest([\n 'url' => '/admin/images/index',\n 'params' => [\n 'plugin' => null, 'controller' => 'Images', 'action' => 'index', 'prefix' => 'Admin',\n ],\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Images', 'action' => 'add', 'prefix' => 'Protected']);\n $expected = '/protected/Images/add';\n $this->assertSame($expected, $result);\n }",
"function setPrefix($str)\r\n\t{\r\n\t\t$this->url_prefix = $str;\r\n\t}",
"public function prefix(string $prefix) : Type {\n $this->_prefix = $prefix;\n return $this;\n }",
"public function prefixKey($prefix)\n {\n if (empty($this->key)) {\n $this->key = $prefix;\n } else {\n $this->key = $prefix . '.' . $this->key;\n }\n\n return $this;\n }",
"public function getUrlWithPrefix()\n {\n if (substr($this->url, 0, 1) === '/') {\n return '/' . $this->resourcePrefix . ltrim($this->url, '/');\n }\n return $this->resourcePrefix . $this->url;\n }",
"public function prefixKey($prefix);",
"public function setPrefix($prefix)\n {\n $this->__set(self::FIELD_PREFIX,$prefix);\n return $this;\n }",
"public function setPrefix(string $prefix): self\n {\n $this->prefix = $prefix;\n\n return $this;\n }",
"public function routePrefix()\n {\n return 'orders';\n }",
"public static function addPrefix($string, $prefix)\n {\n if (empty($prefix)) {\n return $string;\n }\n\n return strtolower($prefix) . $string;\n }",
"function _polylang_fix_sitemap_prefix( $prefix = '' ) {\n\t$path = parse_url( \\home_url(), PHP_URL_PATH );\n\treturn \\trailingslashit( \"$prefix$path\" );\n}",
"public function routePrefix(): string\n {\n $locale = $this->routedLocale() ? $this->routedLocale() : $this->defaultLocale();\n\n return $locale->{$this->defaultKey};\n }",
"public function setNamespacePrefix($prefix) {\n $this->nsprefix= $prefix;\n }",
"public function setPrefix(string $prefix = null)\n {\n $this->prefix = $prefix;\n return $this;\n }",
"public function setPrefix($prefix): self\n {\n $this->prefix = is_array($prefix) ? $prefix : [$prefix];\n\n return $this;\n }",
"public function startsWith($prefix);",
"protected function _getPrefix()\n\t{\n\t\t$ret = '/';\n\n\t\tif(isset($this->_options['namespace'])) {\n\t\t\t$ret .= isset($this->_options['prefix']) ? $this->_options['prefix'] : $this->_options['namespace'];\n\t\t}\n\n\t\treturn $ret;\n\t}",
"function apply_url_prefix($data, $prefix) {\n foreach (array_keys($data['tar']) as $key) {\n $data['tar'][$key] = $prefix . $data['tar'][$key];\n }\n return $data;\n}",
"public function testUrlGenerationMultiplePrefixes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->prefix('admin', function (RouteBuilder $routes): void {\n $routes->prefix('backoffice', function (RouteBuilder $routes): void {\n $routes->fallbacks('InflectedRoute');\n });\n });\n $result = Router::url([\n 'prefix' => 'Admin/Backoffice',\n 'controller' => 'Dashboards',\n 'action' => 'home',\n ]);\n $expected = '/admin/backoffice/dashboards/home';\n $this->assertSame($expected, $result);\n }",
"public function setPrefix($address_prefix)\n\t{\n\t\t$this->address_prefix = trim($address_prefix);\n\t}",
"public function setPrefix($prefix): self\n {\n $this->prefix = $prefix;\n\n return $this;\n }",
"public function addPrefix($prefix, &$item)\n {\n $isObject = $item instanceof \\Magento\\Framework\\DataObject;\n $array = $isObject ? $item->getData() : $item;\n\n $newArray = [];\n foreach ($array as $key => &$value) {\n $newArray[$prefix . $key] = $value;\n }\n\n $array = $newArray;\n\n if ($isObject) {\n $item->setData($array);\n } else {\n $item = $array;\n }\n }",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t\t\n\t\treturn $this;\n\t}",
"public function registerNamespace ($prefix, $namespaceURI) {}",
"public function addPrefixPath($prefix, $path, $prepend = true)\n {\n if ($this->cascade) {\n $newPrefix = $prefix . '_' . $this->cascade;\n $newPath = $path . '/' . strtr($this->cascade, '_', '/');\n } else {\n $newPrefix = $prefix;\n $newPath = $path;\n }\n\n if ($prepend) {\n $this->_dirs = array($newPrefix => $newPath) + $this->_dirs;\n } else {\n $this->_dirs[$newPrefix] = $newPath;\n }\n \n if ($this->_loader instanceof Zalt\\Loader\\ProjectOverloader) {\n $this->_loader->addOverloaders([$newPrefix]);\n } else {\n $this->_loader->addPrefixPath($newPrefix, $newPath, $prepend);\n }\n\n if (\\MUtil_Registry_Source::$verbose) {\n \\MUtil_Echo::r($this->_dirs, '$this->_dirs in ' . get_class($this) . '->' . __FUNCTION__ . '():');\n }\n\n return $this;\n }",
"public static function addNamespace(string $prefix, string $base_dir, bool $prepend = false): void\r\n {\r\n // normalize namespace prefix\r\n $prefix = trim($prefix, '\\\\') . '\\\\';\r\n // normalize the base directory with a trailing separator\r\n $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/';\r\n // initialize the namespace prefix array\r\n if ( isset(self::$prefixes[$prefix]) === false ) {\r\n self::$prefixes[$prefix] = [];\r\n }\r\n // retain the base directory for the namespace prefix\r\n if ( $prepend ) {\r\n array_unshift(self::$prefixes[$prefix], $base_dir);\r\n } else {\r\n self::$prefixes[$prefix][] = $base_dir;\r\n }\r\n }",
"public abstract function add($prefix, $output);",
"function dvs_add_rewrite_rules( $wp_rewrite )\n{\n $new_rules = array(\n 'my-prefix/(.+?)/?$' => 'index.php?post_type=post&name='. $wp_rewrite->preg_index(1),\n );\n\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n}",
"public function prefixClassName($prefix) {\n\t\t$this->processedClassCode = preg_replace_callback(self::PATTERN_CLASS_SIGNATURE, function($matches) use ($prefix) {\n\t\t\treturn $matches['modifiers'] . $prefix . $matches['className'] . $matches['parents'];\n\t\t}, $this->processedClassCode);\n\t}",
"private static function prepareRoutePath($prefix, $givenPath) {\r\n if ($givenPath[0] == '/') {\r\n $path = $givenPath;\r\n } else {\r\n $lastChar = substr($prefix, -1);\r\n \r\n if ($lastChar == '/') {\r\n $path = \"{$prefix}{$givenPath}\"; \r\n } else {\r\n $path = \"{$prefix}/{$givenPath}\";\r\n }\r\n }\r\n return $path;\r\n }",
"abstract protected function prefixName($name);",
"abstract protected function prefixName($name);",
"function startNameSpace($parser,$prefix,$uri=NULL)\n\t{\n\t\tunset($parser);\n\t\tunset($prefix);\n\n\t\tarray_push($this->namespace_stack,strtolower($uri));\n\t}",
"public static function start(string $value, string $prefix): string\n {\n $quoted = preg_quote($prefix, '/');\n\n return $prefix . preg_replace('/^(?:' . $quoted . ')+/u', '', $value);\n }",
"public static function getRewriteAPIPrefix()\n {\n return apply_filters('rewrite_api_request_prefix_url', 'api');\n }",
"public function setPrefix(?string $value = null): self\n {\n throw_if(is_string($value) && strlen(trim($value)) == 0, RuntimeException::class,\n 'Cannot use empty string as prefix.');\n\n $this->prefixCache = is_string($value) && $this->isVersioning() ?\n str_replace('%VERSION%', $this->getVersionForPrefix(), $value) :\n $value;\n\n return $this;\n }",
"public function appendSegment(string $segment): UrlManipulatorInterface;",
"public function prefixDecl(){\n try {\n // Sparql11query.g:36:3: ( PREFIX PNAME_NS iriRef ) \n // Sparql11query.g:37:3: PREFIX PNAME_NS iriRef \n {\n $this->match($this->input,$this->getToken('PREFIX'),self::$FOLLOW_PREFIX_in_prefixDecl120); \n $this->match($this->input,$this->getToken('PNAME_NS'),self::$FOLLOW_PNAME_NS_in_prefixDecl122); \n $this->pushFollow(self::$FOLLOW_iriRef_in_prefixDecl124);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"function mPREFIX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$PREFIX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:101:3: ( 'prefix' ) \n // Tokenizer11.g:102:3: 'prefix' \n {\n $this->matchString(\"prefix\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function setNamePrefix(string $prefix): self\n {\n $this->namePrefix = $prefix;\n\n return $this;\n }",
"public function getPrefix();",
"public function getPrefix();",
"public function getPrefix() {}",
"public static function addNamespace(string $prefix, string $baseDir, bool $prepend = false): void\n {\n if (!self::$registered) {\n spl_autoload_register([__CLASS__, 'load']);\n self::$registered = true;\n }\n\n // normalize namespace prefix\n $prefix = trim($prefix, '\\\\') . '\\\\';\n\n // normalize the base directory with a trailing separator\n $baseDir = rtrim($baseDir, '/') . DIRECTORY_SEPARATOR;\n $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . '/';\n\n // initialize the namespace prefix array\n if (!isset(self::$map[$prefix])) {\n self::$map[$prefix] = [];\n }\n\n // retain the base directory for the namespace prefix\n if ($prepend) {\n array_unshift(self::$map[$prefix], $baseDir);\n } else {\n self::$map[$prefix][] = $baseDir;\n }\n }",
"public function routeModule(AbstractModule $module, $prefix)\n {\n\t\t//store current globals so they aren't used in\n\t\t//the module and can be restored later\n\t\t$old_globals = $this->globals;\n\t\t//reset globals so the module can define them\n\t\t$this->globals = null;\n //set the current module name so the name() method can use it\n $this->current_module = $module->getName();\n\n $prefixes = (array) $prefix;\n //create the routes for every prefix, passing in this Router\n //and the module name\n foreach ($prefixes as $prefix) {\n $module->routes($this, $prefix);\n }\n\n //reset the module name to null and the globals to what they were before\n $this->current_module = null;\n $this->globals = $old_globals;\n\n return true;\n }",
"public static function add_root( $prefix, $dir ){\n\t\tself::$roots[ $prefix ] = $dir;\n\t}",
"public static function uriForPrefix($prefix, $asString = false)\n\t{\t\n\t\tself::registerPrefixes();\n\t\t$r = array_search($prefix, self::$namespaces);\n\t\tif($r !== false)\n\t\t{\n\t\t\treturn ($asString ? $r : new URI($r));\n\t\t}\t\t\n\t\treturn null;\n\t}",
"function rest_get_url_prefix() {\n\t/**\n\t * Filter the REST URL prefix.\n\t *\n\t * @since 4.4.0\n\t *\n\t * @param string $prefix URL prefix. Default 'wp-json'.\n\t */\n\treturn apply_filters( 'rest_url_prefix', 'wp-json' );\n}",
"private function applyPrefix($key)\n {\n $prefix = (string) $this->client->getOption(Redis::OPT_PREFIX);\n\n return $prefix.$key;\n }",
"public function getRoutePrefix()\n {\n return 'admin_category';\n }"
]
| [
"0.6983873",
"0.65291196",
"0.6460623",
"0.63571733",
"0.63267744",
"0.62622356",
"0.62263477",
"0.6086105",
"0.60764027",
"0.6039959",
"0.60200024",
"0.6010153",
"0.59769446",
"0.59632766",
"0.5898266",
"0.586056",
"0.5837089",
"0.5825626",
"0.5814023",
"0.581072",
"0.5809628",
"0.58066434",
"0.5797291",
"0.57912064",
"0.5782358",
"0.5779952",
"0.5779952",
"0.57795465",
"0.57786125",
"0.57786125",
"0.5772927",
"0.57681805",
"0.57582647",
"0.57500774",
"0.5748992",
"0.57475543",
"0.57297766",
"0.5723093",
"0.57042086",
"0.570132",
"0.570132",
"0.5700681",
"0.565709",
"0.5655073",
"0.5651967",
"0.5649853",
"0.56292856",
"0.5625817",
"0.56257546",
"0.5616702",
"0.5614529",
"0.56104034",
"0.5595989",
"0.55943507",
"0.5583531",
"0.5581452",
"0.5578479",
"0.55614316",
"0.55593884",
"0.5558047",
"0.5557649",
"0.5544705",
"0.55262494",
"0.5525053",
"0.54724264",
"0.54673135",
"0.54617363",
"0.54494816",
"0.5426416",
"0.5424833",
"0.5412812",
"0.54010063",
"0.53712523",
"0.5364488",
"0.53584677",
"0.53531754",
"0.53314257",
"0.53288364",
"0.5317658",
"0.53168917",
"0.5309299",
"0.5309299",
"0.5303916",
"0.53016204",
"0.52719045",
"0.5268866",
"0.52644885",
"0.52643675",
"0.5256809",
"0.5248102",
"0.5247103",
"0.5247103",
"0.5236055",
"0.52331775",
"0.52328384",
"0.5232635",
"0.5220938",
"0.5214614",
"0.52126753",
"0.5212039"
]
| 0.67205405 | 1 |
Get the compiled version of the route. | public function getCompiled()
{
return $this->compiled;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function compile(Route $route)\n {\n if ($route instanceof LegacyRoute)\n {\n $legacy = $route->getRoute();\n $legacy->compile();\n\n $tokens = $legacy->getTokens();\n $prefix = $this->getStaticPrefix($tokens);\n\n $tokens = $this->convertTokens($tokens, $legacy->getRequirements(), $legacy->getOptions());\n $variables = array_keys($this->getVariables($tokens));\n\n $compiled = new CompiledRoute(\n $prefix,\n $legacy->getRegex(),\n array_reverse($tokens),\n $variables\n );\n\n return $compiled;\n }\n else\n {\n return parent::compile($route);\n }\n }",
"public function getLastRoute() : CompiledRoute\n {\n return $this->dispatcher->getLastRoute();\n }",
"public static function compiledRoutes()\n {\n return self::$compiled_routes;\n }",
"public function getCompiled()\n {\n if ($this->compiled === null) {\n $regexp = \"/^\";\n\n // Method(s)\n $methodIdx = 0;\n foreach($this->methods as $method) {\n $regexp .= \"(?:\" . strtoupper($method) . \")\";\n if (($methodIdx + 1) < count($this->methods)) {\n $regexp .= \"|\";\n }\n $methodIdx++;\n }\n\n // Separator\n $regexp .= \"~\";\n\n // Url\n $regexp .= str_replace('/', '\\/', $this->match);\n\n $regexp .= \"$/\";\n\n $this->compiled = $regexp;\n }\n return $this->compiled;\n }",
"public function compile()\n {\n $compiled = $this->dumper()->getCompiledRoutes();\n /* This line is added in order to compile `conditions` into cache file. */\n $compiled[4] = $this->dumper()->getCompiledRoutes(true)[4];\n\n $attributes = [];\n\n foreach ($this->getRoutes() as $route) {\n $attributes[$route->getName()] = [\n 'methods' => $route->methods(),\n 'uri' => $route->uri(),\n 'action' => $route->getAction(),\n 'fallback' => $route->isFallback,\n 'defaults' => $route->defaults,\n 'wheres' => $route->wheres,\n 'bindingFields' => $route->bindingFields(),\n 'lockSeconds' => $route->locksFor(),\n 'waitSeconds' => $route->waitsFor(),\n 'withTrashed' => $route->allowsTrashedBindings(),\n ];\n }\n\n return compact('compiled', 'attributes');\n }",
"public function get()\n\t{\n\t\t\n\t\t$route = $this->__path;\n\t\t\n\t\tif( $this->__mapper )\n\t\t{\n\t\t\t\n\t\t\t$map = $this->__mapper->match($this->__path);\n\t\t\n\t\t\tif( $map )\n\t\t\t{\n\t\t\t\t$route = $map;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn self::sanetize($route);\n\t\t\n\t}",
"public function get_version();",
"private static function createVersionRoute()\n {\n self::$Router->map('GET|POST', '/[a:version]', function(string $version){\n if(isset(Handler::$MainConfiguration->VersionConfigurations[$version]) == false)\n {\n UnsupportedVersion::executeResponse();\n exit();\n }\n else\n {\n /** @var VersionConfiguration $VersionConfiguration */\n $VersionConfiguration = Handler::$MainConfiguration->VersionConfigurations[$version];\n\n $Modules = array();\n\n /** @var ModuleConfiguration $module */\n foreach($VersionConfiguration->Modules as $module)\n {\n $ModuleObject = self::getModuleObject($version, $module);\n\n $Modules['/' . $module->Path] = array(\n 'name' => $ModuleObject->name,\n 'version' => $ModuleObject->version,\n 'description' => $ModuleObject->description\n );\n }\n\n ModuleListingResponse::executeResponse($Modules);\n exit();\n }\n });\n }",
"public static function getPatVersion()\n {\n return static::VERSION_MAJOR . '.' . static::VERSION_MINOR . '.' . static::VERSION_PATCH;\n }",
"public function get_version(){\n\n\t\t\tswitch( $this->method ){\n\n\t\t\t\tcase 'commit-message':\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->get_version_from_commit_message();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'file':\n\t\t\t\t\treturn $this->get_version_from_file();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'tag':\n\t\t\t\t\treturn $this->get_version_from_tag();\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}",
"protected function generateGetRouteMethod()\n {\n return <<<EOF\n public function getRoute(\\$route)\n {\n if (!isset(self::\\$declaredRoutes[\\$route])) {\n return null;\n }\n \\$info = self::\\$declaredRoutes[\\$route];\n return new Route(\n \\$info['route'],\n \\$info['options'],\n \\$info['parent'],\n \\$info['routeRequirements']\n );\n }\nEOF;\n }",
"function route($route_name)\n {\n global $router; \n return $router->generate($route_name);\n }",
"public static function route()\n {\n return self::$route;\n }",
"public function getRoute(): string\n {\n return (string) $this->route;\n }",
"public static function version(): string\n {\n return static::VERSION;\n }",
"abstract public function get_version();",
"public function getWebRoute(): string;",
"public static function compile(Route $route): CompiledRoute\n {\n $hostVariables = [];\n $variables = [];\n $hostRegex = null;\n $hostTokens = [];\n\n if ('' != $host = $route->getHost()) {\n $result = static::compileIteractionPattern($route, $host, true);\n\n $hostVariables = $result['variables'];\n $variables = $hostVariables;\n\n $hostTokens = $result['tokens'];\n $hostRegex = $result['regex'];\n }\n\n $path = $route->getPath();\n\n $result = static::compileIteractionPattern($route, $path, false);\n\n $prefix = $result['prefix'];\n\n $pathVariables = $result['variables'];\n\n foreach ($pathVariables as $pathParam) {\n if ('_fragment' === $pathParam) {\n throw new InvalidArgumentException(\n sprintf('Route pattern \"%s\" cannot contain \"_fragment\" as a path parameter.', $route->getPath())\n );\n }\n }\n\n $variables = array_merge($variables, $pathVariables);\n\n $tokens = $result['tokens'];\n $regex = $result['regex'];\n\n return new CompiledRoute(\n $regex,\n $tokens,\n $prefix,\n $pathVariables,\n $hostRegex,\n $hostTokens,\n $hostVariables,\n array_unique($variables)\n );\n }",
"public static function getCachedCompilePath(){\n return \\Illuminate\\Foundation\\Application::getCachedCompilePath();\n }",
"public static function Version(): string {\n\t\treturn self::VERSION;\n\t}",
"public static function Version(): string {\n\t\treturn self::VERSION;\n\t}",
"public function getFullRoute();",
"public function retrieveVersion()\n {\n return $this->start()->uri(\"/api/system/version\")\n ->get()\n ->go();\n }",
"public function getRoute(): Route;",
"protected function route()\n {\n return route($this->uri, $this->params);\n }",
"static public function get_Version()\n {\n $version = self::get_version_number();\n \n $build_num = self::get_build_number();\n \n return \"v{$version[2]}.{$version[1]}.{$build_num}\";\n }",
"function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}",
"public function getRoute();",
"protected function compileRoute($route)\r\n {\r\n // First escape all of the non-named param (non [block]s) for regex-chars\r\n $route = preg_replace_callback(\r\n static::ROUTE_ESCAPE_REGEX,\r\n function ($match) {\r\n return preg_quote($match[0]);\r\n },\r\n $route\r\n );\r\n\r\n // Get a local reference of the match types to pass into our closure\r\n $match_types = $this->match_types;\r\n\r\n // Now let's actually compile the path\r\n $route = preg_replace_callback(\r\n static::ROUTE_COMPILE_REGEX,\r\n function ($match) use ($match_types) {\r\n list(, $pre, $type, $param, $optional) = $match;\r\n\r\n if (isset($match_types[$type])) {\r\n $type = $match_types[$type];\r\n }\r\n\r\n // Older versions of PCRE require the 'P' in (?P<named>)\r\n $pattern = '(?:'\r\n . ($pre !== '' ? $pre : null)\r\n . '('\r\n . ($param !== '' ? \"?P<$param>\" : null)\r\n . $type\r\n . '))'\r\n . ($optional !== '' ? '?' : null);\r\n\r\n return $pattern;\r\n },\r\n $route\r\n );\r\n\r\n $regex = \"`^$route$`\";\r\n\r\n // Check if our regular expression is valid\r\n $this->validateRegularExpression($regex);\r\n\r\n return $regex;\r\n }",
"private function getRoute(){\n\t}",
"function klein_compile_route( $route ) {\n\tif ( preg_match_all( '`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`', $route, $matches, PREG_SET_ORDER ) ) {\n\t\t$match_types = array(\n\t\t\t'i' => '[0-9]++',\n\t\t\t'a' => '[0-9A-Za-z]++',\n\t\t\t'h' => '[0-9A-Fa-f]++',\n\t\t\t'*' => '.+?',\n\t\t\t'**' => '.++',\n\t\t\t'' => '[^/]+?',\n\t\t);\n\t\tforeach ( $matches as $match ) {\n\t\t\tlist( $block, $pre, $type, $param, $optional ) = $match;\n\n\t\t\tif ( isset( $match_types[ $type ] ) ) {\n\t\t\t\t$type = $match_types[ $type ];\n\t\t\t}\n\t\t\tif ( $pre === '.' ) {\n\t\t\t\t$pre = '\\.';\n\t\t\t}\n\t\t\t// Older versions of PCRE require the 'P' in (?P<named>)\n\t\t\t$pattern = '(?:' . ( $pre !== '' ? $pre : null ) . '(' . ( $param !== '' ? \"?P<$param>\" : null ) . $type . '))' . ( $optional !== '' ? '?' : null );\n\n\t\t\t$route = str_replace( $block, $pattern, $route );\n\t\t}\n\t}\n\n\treturn \"`^$route$`\";\n}",
"public function getRouteMatch();",
"public function route(): RouteContract;",
"public static function getCompiledPath($path){\n //Method inherited from \\Illuminate\\View\\Compilers\\Compiler \n return \\Illuminate\\View\\Compilers\\BladeCompiler::getCompiledPath($path);\n }",
"public function route()\n {\n return call_user_func($this->getRouteResolver());\n }",
"protected function getRouteStub()\n {\n return file_get_contents(__DIR__.'/stubs/route/route.stub');\n }",
"public static function getRoute() {\n\n\t\tif (self::_hasAdapter(get_class(), __FUNCTION__))\n\t\t\treturn self::_callAdapter(get_class(), __FUNCTION__);\n\n\t\t$route = (isset(self::$route_options['route'])) ? self::$route_options['route'] : null;\n\n\t\tself::_notify(get_class() . '::' . __FUNCTION__, $route);\n\t\t$route = self::_applyFilter(get_class(), __FUNCTION__, $route, array('event' => 'return'));\n\n\t\treturn $route;\n\t}",
"#[Pure]\n public function getHttpVersion() {}",
"public function GetCompiled ();",
"public function getApiRoute(): string;",
"public function getLocalVersion(){\n\t\t\n\t\treturn getJSON( 'version.php' );\n\t}",
"public function compileRegex()\n {\n $route = $this->route->getUri();\n\n if (strpos($route, '?')) {\n $route = preg_replace('@\\/{([\\w]+)\\?}@', '(?:/{$1})?', $route);\n }\n\n $route = preg_replace('/{([a-z0-9_-]+)}/i', '(?P<$1>[^/]+)', $route);\n\n if(substr($route, -1) === '/') {\n $route .= '?';\n }\n\n return \"%^{$route}$%s\";\n }",
"public function getRoute() : string\n {\n return $this->route;\n }",
"abstract public function getRoute();",
"static function getCurrent()\n {\n $route = App::router()->getCurrent();\n return self::generate($route, $route->getParameters());\n }",
"public function getConsoleRoute(): string;",
"protected function getVersion()\n {\n return $this->getRequest()->args('version') ?: strftime('%y%m%d.%H%M.%S');\n }",
"public function getVersion()\n {\n return $this->sendrequest('version', null);\n }",
"public function getVersion(): string\n {\n $manifest = [];\n\n if(class_exists(ZipArchive::class) && file_exists($this->path))\n {\n $zip = new ZipArchive();\n\n if($zip->open($this->path))\n {\n $content = $zip->getFromName('META-INF/MANIFEST.MF') ?: 'ERROR';\n if(preg_match_all('/(.+):\\s+(.+)\\r?\\n/U', $content, $match))\n {\n foreach($match[1] as $index => $key)\n {\n $manifest[$key] = $match[2][$index];\n }\n }\n }\n }\n\n return $manifest['Implementation-Version'] ?? $this->request('version');\n }",
"public function getVersion()\n {\n return new Types\\Version($this->request('GET', 'version'));\n }",
"public function get_version(): string\n {\n return $this->version;\n }",
"abstract public function getRouteMatch();",
"function get_version() {\n return self::VERSION;\n }",
"function get_version() {\n return self::VERSION;\n }",
"public function version(): string\n {\n return static::VERSION;\n }",
"public function getVersion(): string;",
"public function getVersion(): string;",
"public static function Version() :string {\n\t\treturn self::VERSION;\n\t}",
"public function getDynamic(string $regex, string $method = null): Route|null;",
"public function Check($CompiledRoute) { if (!isset($CompiledRoute['Event'])) {\n return self::RESULT_CONTINUE;\n }\n\n // trigger event\n $Event= new EventRuleEvent([\n 'Route'=> $CompiledRoute,\n 'Context'=> $this->Context,\n ]);\n $this->EventDispatch($CompiledRoute['Event'], $Event);\n\n // skip this route if no listener has claim this route\n if (!$Event->IsHandled()) {\n return self::RESULT_SKIP_ROUTE;\n }\n\n // inject returned value in compiled route record\n $CompiledRoute['Handler']= $Event->GetRouteHandler();\n\n // re-create Route object from compiled version and populate with matching information\n $Route= $this->RebuildMatchedRoute($CompiledRoute + array(\n 'MatchedPath'=> array(),\n 'MatchedVars'=> array(),\n ));\n\n // return object\n return $Route;\n }",
"public function currentRoute(): Route\n {\n return app(Route::class);\n }",
"public function getVersion(): string {}",
"public function version(): ?string;",
"public function version(): ?string;",
"public function compileRoute($route) {\r\n\t\tpreg_match_all(static::ROUTE, $route, $matches, PREG_SET_ORDER);\r\n\t\tforeach ($matches as $match) {\r\n\t\t\tlist($pre, $block, $param, $optional) = $match;\r\n\t\t\tif ($block === '.') {\r\n\t\t\t\t$block = '\\\\.';\r\n\t\t\t}\r\n\t\t\t$block .= \"(?<$param>[^/]++)\";\r\n\t\t\tif ($optional) {\r\n\t\t\t\t$block = \"(?:$block)?\";\r\n\t\t\t}\r\n\t\t\t$route = str_replace($pre, $block, $route);\r\n\t\t}\r\n\t\treturn $route;\r\n\t}",
"public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}",
"function route_method(): string\n{\n return RouteController::getCurrentRoute()['method'] ?? '';\n}",
"protected function compileRoute($route)\n {\n if ( ($matches = Stringify::matchAll('`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`',$route,-1,PREG_SET_ORDER)) ) {\n $matchTypes = $this->matchTypes;\n foreach ($matches as $match) {\n list($block, $pre, $type, $param, $optional) = $match;\n if ( isset($matchTypes[$type]) ) {\n $type = $matchTypes[$type];\n }\n if ( $pre === '.' ) {\n $pre = '\\.';\n }\n $optional = $optional !== '' ? '?' : null;\n // Older versions of PCRE require the 'P' in (?P<named>)\n $pattern = '(?:'\n . ($pre !== '' ? $pre : null)\n . '('\n . ($param !== '' ? \"?P<$param>\" : null)\n . $type\n . ')'\n . $optional\n . ')'\n . $optional;\n\n $route = Stringify::replace($block,$pattern,$route);\n }\n }\n return \"`^$route$`u\";\n }",
"private static function createModuleRoute()\n {\n self::$Router->map('GET|POST', '/[a:version]/[**:path]', function(string $version, string $path){\n $version = strtolower($version);\n $path = strtolower($path);\n\n if(isset(self::$PathRoutes[$version][$path]))\n {\n /** @var VersionConfiguration $VersionConfiguration */\n $VersionConfiguration = self::$MainConfiguration->VersionConfigurations[$version];\n\n /** @var ModuleConfiguration $ModuleConfiguration */\n $ModuleConfiguration = $VersionConfiguration->Modules[self::$PathRoutes[$version][$path]];\n\n if($VersionConfiguration->Available == false)\n {\n ResourceNotAvailable::executeResponse($VersionConfiguration->UnavailableMessage);\n exit();\n }\n\n if($ModuleConfiguration->Available == false)\n {\n ResourceNotAvailable::executeResponse($ModuleConfiguration->UnavailableMessage);\n exit();\n }\n\n self::verifyRequest();\n\n $AccessRecord = new AccessRecord();\n $AccessRecord->ID = 0;\n $AccessRecord->ApplicationID = 0;\n\n if($ModuleConfiguration->AuthenticationRequired)\n {\n $AccessRecord = self::authenticateUser();\n }\n\n /** @var Module $ModuleObject */\n $ModuleObject = self::getModuleObject($version, $ModuleConfiguration);\n $ModuleObject->access_record = $AccessRecord;\n\n // Process the request\n self::startTimer();\n\n $ModuleException = null;\n\n try\n {\n $ModuleObject->processRequest();\n\n header('Content-Type: ' . $ModuleObject->getContentType());\n header('Content-Size: ' . $ModuleObject->getContentLength());\n http_response_code($ModuleObject->getResponseCode());\n\n // Create the response\n if($ModuleObject->isFile())\n {\n header(\"Content-disposition: attachment; filename=\\\"\" . basename($ModuleObject->getFileName()) . \"\\\"\");\n }\n }\n catch(Exception $exception)\n {\n $ModuleException = $exception;\n //InternalServerError::executeResponse($exception);\n //exit();\n }\n\n $ExecutionTime = self::stopTimer();\n self::logRequest($AccessRecord, $version, $ModuleObject, $ExecutionTime);\n self::setHeaders();;\n\n // Update the last used state\n $AccessRecord->LastActivity = (int)time();\n $IntellivoidAPI = self::getIntellivoidAPI();\n $IntellivoidAPI->getAccessKeyManager()->updateAccessRecord($AccessRecord);\n\n if($ModuleException == null)\n {\n print($ModuleObject->getBodyContent());\n }\n else\n {\n $RequestRecordObject = $IntellivoidAPI->getRequestRecordManager()->getRequestRecord(\n RequestRecordSearchMethod::byReferenceId, self::$ReferenceCode\n );\n\n $IntellivoidAPI->getExceptionRecordManager()->recordException(\n $RequestRecordObject->ID, $AccessRecord, $ModuleException\n );\n\n InternalServerError::executeResponse($ModuleException);\n }\n\n exit();\n }\n else\n {\n ResourceNotFound::executeResponse();\n exit();\n }\n\n });\n }",
"public function getRoute()\n {\n }",
"public function GetRouteClass ();",
"protected function compileRoute($route)\n {\n if (preg_match_all(\n '`(/|\\.|)\\[([^:\\]]*+)(?::([^:\\]]*+))?\\](\\?|)`', \n $route, \n $matches, \n PREG_SET_ORDER\n )) {\n $match_types = array(\n 'i' => '[0-9]++',\n 'a' => '[0-9A-Za-z]++',\n 'h' => '[0-9A-Fa-f]++',\n '*' => '.+?',\n '**' => '.++',\n '' => '[^/]++'\n );\n foreach ($matches as $match) {\n list($block, $pre, $type, $param, $optional) = $match;\n\n if (isset($match_types[$type])) {\n $type = $match_types[$type];\n }\n if ($pre === '.') {\n $pre = '\\.';\n }\n // Older versions of PCRE require the 'P' in (?P<named>)\n $pattern = '(?:'\n . ($pre !== '' ? $pre : null)\n . '('\n . ($param !== '' ? \"?P<\".$param.\">\" : null)\n . $type\n . '))'\n . ($optional !== '' ? '?' : null);\n\n $route = str_replace($block, $pattern, $route);\n }\n }\n return '`^'.$route.'$`';\n }",
"public static function getCurrent() {\n global $CFG;\n\n if ($data = file_get_contents(\"$CFG->dirroot/mod/amvonetroom/revision\"))\n return new amvonetroom_Version($data);\n else\n return new amvonetroom_Version(0);\n }",
"public static function get_version() {\n return self::$version;\n }",
"public static function Version() {\n\t\treturn self::VERSION;\n\t}",
"public static function Version() {\n\t\treturn self::VERSION;\n\t}",
"public static function Version() {\n\t\treturn self::VERSION;\n\t}",
"public static function version()\n {\n return self::VERSION;\n }",
"public function getVersion()\n\t{\n\t\t$insert = $this->inject();\n\t\t$injectURL = $this->url . $insert . 'null%2c version%28%29%23&Submit=Submit#';\n\t\treturn $injectURL;\n\t}",
"public function getVersion()\n {\n return Controllers\\VersionController::getInstance();\n }",
"protected function getc9f84ddda9d00c1b7a3d422c26b92c3f7acb8604c9d7c3c5ca1e13e1367f8e4a(): \\Viserio\\Component\\Routing\\Generator\\UrlGenerator\n {\n return $this->services[\\Viserio\\Contract\\Routing\\UrlGenerator::class] = new \\Viserio\\Component\\Routing\\Generator\\UrlGenerator(($this->services[\\Viserio\\Contract\\Routing\\Router::class] ?? $this->get410eb27931e780eeccc23e52a6c17e0e6e2e1827d28f90c4254c8f4111788d4e())->getRoutes(), ($this->services[\\Psr\\Http\\Message\\ServerRequestInterface::class] ?? $this->get(\\Psr\\Http\\Message\\ServerRequestInterface::class)), ($this->services[\\Psr\\Http\\Message\\UriFactoryInterface::class] ?? $this->get(\\Psr\\Http\\Message\\UriFactoryInterface::class)));\n }",
"function get_version() {\n\n\t\treturn $this->version;\n\n\t}",
"public static function Version() : string {\n\n if (self::$_Version !== NULL) {\n return self::$_Version;\n }\n\n return self::$_Version = trim(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'VERSION'));\n }",
"public function getServerVersion() {}",
"public function getServerVersion() {}",
"protected function loadFromVersion()\n {\n return $this->loadVersion($this->context['source_dir']);\n }",
"public function getAppVersion(): string\n {\n $this->findAppPort();\n\n return $this->appVer;\n }",
"protected function getVersionFromRouteMatch($routeMatches)\n {\n $version = $routeMatches->getParam('laminas_ver_version', false);\n if ($version) {\n return $version;\n }\n return $routeMatches->getParam('version', false);\n }",
"public function getResourceVersion();",
"public function getRequestedVersion()\n {\n return $this->_options['requested_version'];\n }",
"public function getCurrentVersion();",
"function armin_version()\n { \n $composer = json_decode(File::get(base_path('composer.json')));\n\n return optional($composer)->version;\n }",
"public function version(): string\n {\n return Version::RELEASE;\n }",
"static function gen($route) {\n return URL_APPLICATION . substr($route, 1);\n }",
"function getCurrentRoute() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n \n return $this->getMatchingRoute($santitizedUrl);\n }",
"public function get_route()\n {\n }",
"public function get_matched_route()\n {\n }",
"public function getVersion() \n\t{\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=version\";\n\t\treturn $this->curlObj->fetch_url($url);\n\t}",
"public static function getCachedRoutesPath(){\n return \\Illuminate\\Foundation\\Application::getCachedRoutesPath();\n }",
"function getServerVersion();",
"public static function getCurrent() {\n return new amvonetroom_Version(AMVONETROOM_PROTOCOL_VERSION);\n }"
]
| [
"0.60828483",
"0.6067915",
"0.6052833",
"0.5915224",
"0.5665707",
"0.5646819",
"0.56357145",
"0.56226766",
"0.5588866",
"0.5569223",
"0.5528274",
"0.547295",
"0.54687756",
"0.5462089",
"0.54283917",
"0.54182106",
"0.53999245",
"0.53928727",
"0.53742474",
"0.5368766",
"0.5368766",
"0.53350383",
"0.53336126",
"0.5332559",
"0.53223246",
"0.5318918",
"0.53169316",
"0.5292567",
"0.5290634",
"0.5290291",
"0.5287382",
"0.52830464",
"0.5271465",
"0.52692646",
"0.5254843",
"0.52524066",
"0.5242172",
"0.5233497",
"0.5233385",
"0.5233171",
"0.5231953",
"0.52289903",
"0.5222662",
"0.5207504",
"0.5200287",
"0.5198366",
"0.51962554",
"0.51925576",
"0.5183024",
"0.51825947",
"0.51702785",
"0.51692843",
"0.5167744",
"0.5167744",
"0.51671785",
"0.51661104",
"0.51661104",
"0.5159012",
"0.5148258",
"0.5145732",
"0.51404566",
"0.5133279",
"0.51305884",
"0.51305884",
"0.5127829",
"0.5125257",
"0.5124454",
"0.5117502",
"0.5114021",
"0.51072216",
"0.51052284",
"0.5100816",
"0.50835294",
"0.50833124",
"0.50810987",
"0.50810987",
"0.50810987",
"0.5077669",
"0.5074251",
"0.5072376",
"0.5070916",
"0.50685996",
"0.50623494",
"0.50518084",
"0.50512487",
"0.5041183",
"0.50402415",
"0.5030715",
"0.50235945",
"0.50216866",
"0.502147",
"0.5017684",
"0.5014553",
"0.50016224",
"0.4995697",
"0.49924123",
"0.49915162",
"0.49899027",
"0.49858275",
"0.49780482",
"0.4973231"
]
| 0.0 | -1 |
Set the container instance on the route. | public function setContainer(Container $container)
{
$this->container = $container;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function setInstance($container){\n //Method inherited from \\Illuminate\\Container\\Container \n \\Illuminate\\Foundation\\Application::setInstance($container);\n }",
"private function bindContainer()\n {\n parent::setInstance($this);\n \n $this->instance('container', $this);\n $this->instance(BaseContainer::class, $this);\n }",
"protected function bootstrapContainer()\n {\n static::$instance = $this;\n $this->instance('zim', $this);\n $this->instance('config', new Config());\n $this->instance('event', new Dispatcher());\n $this->instance('router', new Router());\n $this->instance('env', $this->env());\n\n $this->aliases = [\n Zim::class => 'zim',\n Container::class => 'zim',\n Config::class => 'config',\n ConfigContract::class => 'config',\n Event::class => 'event',\n Dispatcher::class => 'event',\n RequestContract::class => 'request',\n Request::class => 'request',\n Router::class => 'router',\n ];\n }",
"public function setContainer(\\Slim\\Container $container)\n {\n $this->container = $container;\n }",
"public function setContainer(Container $container);",
"public static function setInstance( IContainer $container );",
"protected function bootstrapContainer()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n $this->instance(self::class, $this);\n\n $this->instance('path', $this->path());\n\n $this->instance('env', $this->environment());\n $this->registerContainerAliases();\n }",
"public function setContainer($container);",
"public function __construct(){\n $this->container = new Container();\n }",
"public static function configure($closure) {\n self::$instance = $route = new Router();\n $closure($route);\n }",
"protected function prepareContainer()\n {\n $this -> container\n -> set('app', new InstanceService($this))\n -> set('config', new InstanceService($this -> config));\n }",
"public function setContainer(?ContainerInterface $container) : void\n {\n $this->referenceResolver->setContainer($container);\n }",
"public function setContainer(Container $container)\n {\n $this->container = $container;\n }",
"public function setContainer(Container $container)\n {\n $this->container = $container;\n }",
"public function setContainer(Container $container)\n {\n $this->container = $container;\n }",
"public function setContainer(Container $container)\n {\n $this->container = $container;\n }",
"protected function bootstrapContainer()\n {\n static::setInstance($this);\n\n $this->instance('app', $this);\n $this->instance(self::class, $this);\n\n $this->instance('path', $this->path());\n $this->instance('path.base', $this->basePath());\n $this->instance('path.config', $this->basePath('config'));\n $this->instance('path.database', $this->databasePath());\n $this->instance('path.storage', $this->storagePath());\n $this->instance('path.resources', $this->resourcePath());\n $this->instance('path.bootstrap', $this->bootstrapPath());\n\n $this->instance('env', $this->environment());\n\n $this->registerContainerAliases();\n\n $this->configure('app');\n $this->configure('view');\n }",
"protected function setContainer() {\n $router = $this->getMockBuilder(TestRouterInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $router->expects($this->any())\n ->method('matchRequest')\n ->willReturn([\n '_raw_variables' => new ParameterBag([]),\n '_route' => 'test',\n ]);\n\n $validator = $this->createMock(PathValidatorInterface::class);\n\n $fsi = $this->getMockBuilder(FacetSourcePluginInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $fsi->method('getPath')\n ->willReturn('/test');\n\n $manager = $this->getMockBuilder(FacetSourcePluginManager::class)\n ->disableOriginalConstructor()\n ->getMock();\n $manager->method('createInstance')\n ->willReturn($fsi);\n $manager->method('hasDefinition')\n ->with('facet_source__dummy')\n ->willReturn(TRUE);\n\n $facetentity = $this->getMockBuilder(Facet::class)\n ->disableOriginalConstructor()\n ->getMock();\n $facetentity->method('id')\n ->willReturn('king');\n\n $storage = $this->createMock(EntityStorageInterface::class);\n $storage->expects($this->any())\n ->method('loadByProperties')\n ->willReturn([$facetentity]);\n $em = $this->getMockBuilder(EntityTypeManagerInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n $em->expects($this->any())\n ->method('getStorage')\n ->willReturn($storage);\n $this->entityManager = $em;\n\n $container = new ContainerBuilder();\n $container->set('router.no_access_checks', $router);\n $container->set('plugin.manager.facets.facet_source', $manager);\n $container->set('entity_type.manager', $em);\n $container->set('path.validator', $validator);\n \\Drupal::setContainer($container);\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n parent::setContainer($container);\n $this->carService=$container->get('app.cars');\n $this->clientService=$container->get('app.clients');\n $this->rentalService=$container->get('app.rentals');\n }",
"private function setContainer()\n {\n \t$builder = new ContainerBuilder();\n \t$locator = new FileLocator(RES_DIR);\n \t$loader = new YamlFileLoader($builder, $locator);\n \t$loader->load(\"services.yml\");\n $this->container = $builder;\n\n return $this;\n }",
"protected function registerContainer()\n {\n app()->singleton(\n 'Container',\n Container::class\n );\n }",
"public function __construct($container){\n $this->container = $container;\n }",
"public function register(Container $container)\n {\n $container[\"view\"] = $this;\n }",
"public static function setFacadeContainer($container)\n {\n static::$container = $container;\n }",
"public function setContainer(\\Symfony\\Component\\DependencyInjection\\ContainerInterface $container = null)\n\t\t{\n\t\t $this->container = $container;\n\n\t\t}",
"private function bindRoute(): void\n {\n if (isset($this->route)) {\n return;\n }\n $this->route = new SymfonyRoute('');\n }",
"private function configureDispatcher()\n {\n $dispatcher = new Dispatcher($this->container);\n $this->setDispatcher($dispatcher);\n $this->container->set('dispatcher', $dispatcher);\n }",
"public function setContainer(ContainerInterface $container){\n $this->container = $container;\n }",
"public static function setContainer($container)\n\t{\n\t\tparent::setContainer($container instanceof Builder ? $container->container() : $container);\n\t}",
"public function __construct(\\Slim\\Container $container)\n {\n $this->container = $container;\n }",
"protected function setUp()\n {\n $this->container = new \\Acd\\Container;\n $this->object = $this->container->resolve('\\Acd\\Uri');\n }",
"public function register(RouterContainer $container);",
"public function setContainer(ContainerInterface $container = null)\n\t{\n\t\t$this->container = $container;\n\t\t\n\t\tforeach ($this->descriptors as $descriptor) {\n\t\t\t$descriptor->setContainer($container);\n\t\t}\n\t}",
"public static function setInstance($container = null)\n {\n return static::$instance = $container;\n }",
"protected function initContainer(): void\n {\n // reserve some ids\n $this->reserveObject('config', $this->getConfig());\n $this->reserveObject('container', $this->delegator);\n\n // resolve all objects defined in di.services\n $this->autoResolve();\n\n // resolve all object referenced in the $config\n $tree = $this->getConfig()->getTree();\n $settings = &$tree->get('');\n $this->deReference($settings);\n }",
"private function __di_init_service_route () {\n $this->route = $this->constant(new GoDiService_Route_Property($this));\n }",
"public static function setInstance(ContainerInterface $container)\r\n {\r\n static::$instance = $container;\r\n }",
"public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }",
"public function containerSet($name, $value)\n {\n return $this->container->set($name, $value);\n }",
"public function setContainer(\\Interop\\Container\\ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function __construct($container) {\n $this->container = $container;\n $this->view = $container->view;\n $this->session = new \\Tazzy\\Utils\\Session();\n }",
"protected function initializeContainer()\n {\n $class = $this->getContainerClass();\n $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);\n $container = $this->buildContainer();\n $container->compile();\n $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());\n\n require_once $cache->getPath();\n\n $this->container = new $class();\n $this->container->set('kernel', $this);\n\n if ($this->container->has('cache_warmer')) {\n $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));\n }\n }",
"public function setContainer(ContainerInterface $container)\r\n {\r\n $this->container = $container;\r\n $this->kernel = $container->get('kernel');\r\n }",
"public function __construct()\n {\n $this->rota = new url;\n $this->last_module = '';\n $container = new \\vendor\\container;\n $container = (object)$container->container;\n $this->container= $container;\n }",
"public static function set($route) {\n self::registerRoute($route);\n }",
"private function initSlim() {\n $this->routeContainer = new Container();\n\n $routeContainer = $this->routeContainer;\n\n $routeContainer['notFoundHandler'] = function ($routeContainer) {\n return function() use ($routeContainer) {\n $this->template->variables['website_page'] = $this->twig->render('error.twig', ['message' => Dictionary::init()['error404']]);\n\n return $routeContainer['response']\n ->withStatus(404)\n ->withHeader('Content-Type', 'text/html');\n };\n };\n\n $this->route = new App($this->routeContainer);\n }",
"public function setContainer(?string $container) : self\n {\n $this->container = $container;\n return $this;\n }",
"public function __construct($container) {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container)\n {\n $this->container = $container;\n }",
"public static function setContainer(ContainerInterface $container)\n {\n static::$container = $container;\n }",
"public static function setContainer(Psr\\Container\\ContainerInterface $container)\n {\n self::$container = $container;\n }",
"protected function setupContainer(Container $container)\n {\n $this->container = $container;\n\n if (! $this->container->bound('config')) {\n $this->container->instance('config', new Fluent);\n }\n }",
"public function setContainer($container)\n {\n if ($container instanceof Space) {\n $this->space_id = $container->id;\n } elseif ($container instanceof User) {\n $this->user_id = $container->id;\n } else {\n throw new Exception(\"Invalid container type!\");\n }\n\n $this->_container = $container;\n }",
"public function setContainer(Whois_Lookup_Container $container)\n {\n $this->_container = $container;\n }",
"public function __construct($container)\n {\n $this->container = $container;\n }",
"public function __construct($container)\n {\n $this->container = $container;\n }",
"public function __construct(ContainerInterface $container)\n {\n parent::__construct($container);\n $this->router->get($container->get(\"login.admin\"), LoginAdminControl::class, [\"name\"=>\"loginAdmin.get.index\", \"description\"=>\"Connexion administrateur\"]);\n $this->router->post($container->get(\"login.admin\").\"/action:connect\", LoginAdminControl::class, [\"name\"=>\"loginAdmin.post.connect\", \"description\"=>\"Connexion administrateur\"]);\n }",
"private function setRoutes() : void\n {\n $this->routes = $this->routeProvider->getRoutes();\n $this->syRouteCollection = new RouteCollection();\n foreach ($this->routes as $route) {\n $syRoute = new SymfonyRoute(\n $route->getPath(),\n $route->getParamsDefaults(),\n $route->getParamsRequirements(),\n [],\n '',\n [],\n $route->getMethods()\n );\n $this->syRouteCollection->add($route->getName(), $syRoute);\n }\n }",
"public function instance(): Container\n {\n return ($this->resolver)();\n }",
"public function bootstrapRouter()\n {\n $this->router = new Router($this);\n }",
"public function setUp()\n {\n $delegate = new \\Rougin\\Slytherin\\Container\\Container;\n\n $this->container = new \\Rougin\\Slytherin\\Container\\ReflectionContainer($delegate);\n }",
"public function set_router( sn\\base\\routing\\I_Router $router );",
"public function setContainer(ContainerInterface $container = null)\n {\n }",
"public static function setInstance(Container $container = null)\n {\n return static::$instance = $container;\n }",
"public function __construct()\n {\n if (Registry::isKeySet('route')) {\n\n $this->route = Registry::get('route');\n\n }\n\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function setContainer(ContainerInterface $container = null)\n {\n $this->container = $container;\n }",
"public function routeStartup()\n {\n //...\n }",
"public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }",
"protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}",
"private function configureContainer()\n {\n // Build the DI container.\n $builder = new ContainerBuilder;\n $builder->addDefinitions(__DIR__ . '/config/di.php');\n\n $this->container = $builder->build();\n }",
"public function __construct(Container $container);",
"public function __construct(Container $container);",
"public function setUp()\n {\n $this->app->instance($this->name(), new Dispatcher($this->app));\n }",
"public function __construct()\n {\n parent::__construct();\n\n // Get container\n $container = $this->slim->getContainer();\n\n $container['view'] = function ($c) {\n $view = new \\Slim\\Views\\Twig('client', [\n 'cache' => false,\n ]);\n\n // Instantiate and add Slim specific extension\n $basePath = rtrim(str_ireplace('index.php', '', $c['request']->getUri()->getBasePath()), '/');\n $view->addExtension(new \\Slim\\Views\\TwigExtension($c['router'], $basePath));\n\n return $view;\n };\n $container['notFoundHandler'] = function ($c) {\n return function (Request $request, Response $response) use ($c) {\n if (substr($request->getUri()->getPath(), 0, 5) == \"/api/\") {\n $err = [\n 'error' => true,\n 'error_message' => \"Endpoint not found. GET /api for help.\",\n ];\n return $c['response']->withJson($err, 404);\n } else {\n return $c['view']->render($response, '404.twig', [\n 'path' => $request->getUri()->getPath()\n ]);\n }\n };\n };\n $this->setupEndpoints();\n $this->slim->run();\n }",
"protected function bindPathsInContainer()\n {\n $this->instance('path', $this->path());\n $this->instance('path.base', $this->basePath());\n $this->instance('path.config', $this->configPath());\n $this->instance('path.public', $this->publicPath());\n $this->instance('path.storage', $this->storagePath());\n $this->instance('path.database', $this->databasePath());\n $this->instance('path.resources', $this->resourcePath());\n }",
"public function __construct()\n {\n $this->uri = Fly::app()->getUri();\n Fly::log('debug', \"Router Class Initialized\");\n $this->setRouting();\n }",
"public function runRouter(Container $container) : void\n {\n $dispatcher = \\FastRoute\\simpleDispatcher(function(RouteCollector $router) {\n $this->includeRoutes($router);\n });\n // call route\n $this->setParams($dispatcher)->callHandler($container);\n }",
"public function configure()\n {\n $this->container = require __DIR__ . '/../../config/configure-services.php';\n $this->scratchSpace = vfsStream::setup('scratch')->url();\n }",
"public function __set($key, $value)\n\t{\n\t\t$this->container[$key] = $value;\n\t}",
"public function __construct()\n {\n $this->container = getContainer();\n $this->queue = $this->container->get(Queue::class);\n }",
"public function __construct(\\Slim\\Container $container) {\n $this->container = $container;\n $this->entityManager = $container['em'];\n $this->logger = $container['logger'];\n }",
"public function setContainer(ContainerInterface $container)\n {\n $this->resolver->setContainer($container);\n $this->container = $container;\n\n return $this;\n }",
"public function __construct(){\n\n $this->routes = new \\SplObjectStorage();\n\n }",
"public function injectContainer($container);",
"public function __construct() {\n $this->setRouteData();\n }",
"public function __construct(ContainerInterface $container)\n {\n //Set stuff\n $this->container = $container;\n }",
"public function __construct($container = null)\n {\n $this->container = $container ?? config('recaptcha.default');\n }",
"public static function create(ContainerInterface $container) {\n return new static(\n $container->get('cache_context.route')\n );\n }",
"public static function container(){\n\n $container = 'container';\n\n return $container;\n\n }",
"public function __construct(Container $app);",
"public function __construct(Container $app);",
"public function setAwareContainer(ContainerInterface $container) {\n\t\t$container->setManager($this);\n\t\t$this->awareContainer = $container;\n\t}"
]
| [
"0.68896115",
"0.6587121",
"0.64862204",
"0.637465",
"0.63727826",
"0.6333071",
"0.62990797",
"0.6120226",
"0.60602266",
"0.6035198",
"0.602692",
"0.6020465",
"0.5991134",
"0.5991134",
"0.5991134",
"0.5991134",
"0.5916006",
"0.58764327",
"0.58270144",
"0.57645285",
"0.5760674",
"0.57373506",
"0.5733755",
"0.5726103",
"0.56403744",
"0.5631041",
"0.5621538",
"0.5608012",
"0.56022143",
"0.5585448",
"0.5545972",
"0.55054146",
"0.55015767",
"0.549403",
"0.5471118",
"0.54621357",
"0.5460206",
"0.54500854",
"0.5448166",
"0.5446919",
"0.542546",
"0.54129845",
"0.54124665",
"0.5411167",
"0.54054105",
"0.540255",
"0.5399712",
"0.5381299",
"0.537416",
"0.5357703",
"0.534021",
"0.53392553",
"0.53338605",
"0.5324234",
"0.5281217",
"0.5281217",
"0.52803713",
"0.5266292",
"0.52624834",
"0.5259561",
"0.52572006",
"0.52484137",
"0.52126676",
"0.5210975",
"0.5193754",
"0.5180604",
"0.5180604",
"0.5180604",
"0.5180604",
"0.5180604",
"0.5180604",
"0.5180604",
"0.5180604",
"0.51791996",
"0.51697457",
"0.51675665",
"0.5143479",
"0.514256",
"0.514256",
"0.5137515",
"0.5132157",
"0.51210207",
"0.5119381",
"0.5115205",
"0.5113995",
"0.5110966",
"0.5110564",
"0.5110521",
"0.5102139",
"0.51006055",
"0.5100146",
"0.50956863",
"0.50847554",
"0.50834996",
"0.50821626",
"0.5079141",
"0.50784725",
"0.50784725",
"0.50766397"
]
| 0.50906706 | 93 |
Get the HTTP verbs the route responds to. | public function methods()
{
return $this->methods;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function verbs()\n {\n return [];\n }",
"public function getHttpVerb()\n {\n return $this->_http_verb;\n }",
"public function getHttpMethods()\r\n {\r\n return $this->methods;\r\n }",
"public function verbProvider(): array\n {\n return [\n ['POST'],\n ['PUT'],\n ['PATCH'],\n ['DELETE'],\n ['CONNECT'],\n ['TRACE'],\n ];\n }",
"public function getHttpMethod();",
"public function getHttpMethods()\n {\n return $this->methods;\n }",
"public function getHttpMethods()\n {\n return $this->httpMethods;\n }",
"public function testHttpMethods()\n {\n //Case A\n $r = new \\Slim\\Route('/foo', function () {});\n $this->assertEmpty($r->getHttpMethods());\n //Case B\n $r->setHttpMethods('GET');\n $this->assertEquals(array('GET'), $r->getHttpMethods());\n //Case C\n $r->appendHttpMethods('POST', 'PUT');\n $this->assertEquals(array('GET', 'POST', 'PUT'), $r->getHttpMethods());\n //Case D\n $this->assertTrue($r->supportsHttpMethod('GET'));\n $this->assertFalse($r->supportsHttpMethod('DELETE'));\n //Case E\n $viaResult = $r->via('DELETE');\n $this->assertTrue($viaResult instanceof \\Slim\\Route);\n $this->assertTrue($r->supportsHttpMethod('DELETE'));\n }",
"function getAllowedHttpMethods();",
"public function getRequestMethods ()\n {\n return Request::GET | Request::POST;\n }",
"public function get_allowedMethods() {\n\t\treturn Response::make('', '200',\n\t\t\t\tarray('Allow' => 'GET,PUT,POST,DELETE'));\n\t}",
"public function getHttpMethod()\n {\n return $this->http_method;\n }",
"public function httpAccept(){\n return $this->getServerVar('HTTP_ACCEPT');\n }",
"public function get_normalized_http_method() {\n\t\treturn strtoupper( $_SERVER['REQUEST_METHOD'] );\n\t}",
"public function getHttpMethod()\n {\n return $this->getAttribute('method');\n }",
"protected function getHttpMethod()\n {\n return 'GET';\n }",
"public function getVerb()\n {\n return $this->verb;\n }",
"public function getRequestMethods ()\n\t{\n\t\treturn Request::GET;\n\t}",
"public function getMethod()\n {\n return Http::GET;\n }",
"function searchHTTPMethod()\t{\n\t\treturn $this->getRandomHTTPMethod();\n\t}",
"public function methodProvider()\n {\n return [\n ['GET'],\n ['POST'],\n ['PUT'],\n ['DELETE'],\n ['TRACE'],\n ['HEAD'],\n ['OPTIONS'],\n ];\n }",
"protected function methods() {\n\t\treturn array(\n\t\t\t'status' => 'GET',\n\t\t\t'sessions' => 'POST',\n\t\t);\n\t}",
"public function get_normalized_http_method()\n {\n return strtoupper($this->http_method);\n }",
"public function httpGet()\n {\n return $this->method(\"GET\");\n }",
"public function get_normalized_http_method() {\n return strtoupper($this->http_method);\n }",
"public function getHttpMethodOptions()\n {\n return $this->getOptionArray(Mage::helper('mp_debug/filter')->getHttpMethodValues());\n }",
"public function getMethod()\n\t{\n\t\treturn strtoupper($this->_internal_request->get_normalized_http_method());\n\t}",
"public function getMethod()\n {\n return $this->method ?: 'GET';\n }",
"public function getMethod()\n {\n return $this->server->get('REQUEST_METHOD');\n }",
"public function httpMethod()\n\t{\n\t\tif (!$this->_httpMethodString)\n\t\t{\n\t\t\t$this->_httpMethodString = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\t$this->_httpMethod = $this->getHttpMethodFromString($this->_httpMethodString);\n\t\t}\n\n\t\treturn $this->_httpMethod;\n\t}",
"public function test_match_withSupportedMethod()\n {\n $route = new Route('GET|POST', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if method provided is supported by the route instanciated with more than one method.'\n );\n }",
"public function headerAllowedHttpMethods();",
"public function getMatchableAcceptHeaders();",
"public function getSpecialVerbs() {\n\t\treturn $this->specialVerbs;\n\t}",
"public function getRouteAccessStatuses()\n\t{\n\t\treturn $this->routeAccessStatuses;\n\t}",
"public function getMethod()\r\n {\r\n if (isset($this->server['REQUEST_METHOD'])) {\r\n return strtoupper($this->server['REQUEST_METHOD']);\r\n }\r\n\r\n return 'GET';\r\n }",
"public function getMethod()\n {\n return $this->getServer('REQUEST_METHOD');\n }",
"public function requestMethod(){\n return strtolower($_SERVER['REQUEST_METHOD']);\n }",
"public function method(){\n return $this->getServerVar('REQUEST_METHOD');\n }",
"public function getMethod()\n {\n return strtoupper($this->server['REQUEST_METHOD']);\n }",
"public function getAccept() {\n if (isset($this->accept)) {\n return $this->accept;\n }\n\n $header = $this->getHeader(Header::HEADER_ACCEPT);\n if (!$header) {\n return $this->accept = array();\n }\n\n return $this->accept = Header::parseAccept($header);\n }",
"public function getImplementedMethods() {\n\n $supported_methods = $this->getConfiguration()->get('supported-http-methods');\n\n if ( is_null($supported_methods) ) $supported_methods = self::$supported_methods;\n\n if ( method_exists($this, 'any') ) {\n\n return $supported_methods;\n\n }\n\n $implemented_methods = [];\n\n foreach ( $supported_methods as $method ) {\n\n if ( method_exists($this, strtolower($method)) ) array_push($implemented_methods, $method);\n\n }\n\n return $implemented_methods;\n\n }",
"public function getMethod()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"public function getMethod()\n {\n return $this->getParam('server/REQUEST_METHOD');\n }",
"public function getNormalizedHttpMethod()\n {\n return strtoupper($this->httpMethod);\n }",
"public static function getMethod()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"public function getMethod()\n {\n return filter_input(INPUT_SERVER, 'REQUEST_METHOD');\n }",
"public function getRequestMethod() {\n $request_method = variable_get($this->module . '_supported_method');\n\n $request_method = preg_split('/,/', $request_method);\n return $request_method;\n }",
"function get_method() {\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 3) {\n return $parts[3];\n }\n return 'index';\n }",
"public function getAllowedMethods()\n {\n return $this->methods;\n }",
"public function getMethods()\r\n {\r\n return $this->validMethods;\r\n }",
"public static function getRequestMethod(){\n return $_SERVER['REQUEST_METHOD'];\n }",
"public function getHttpMethod() : string\n {\n\n return $this->httpMethod;\n }",
"function _getRequestMethod(){\n return $_SERVER['REQUEST_METHOD'];\n }",
"public function getMethod(): string {\n\n return strtoupper($_SERVER['REQUEST_METHOD']);\n }",
"public function httpMethodString()\n\t{\n\t\t$this->httpMethod();\n\t\treturn $this->_httpMethodString;\n\t}",
"protected function getHttpMethodsOptions()\n {\n $model = config('admin.database.permissions_model');\n\n return array_combine($model::$httpMethods, $model::$httpMethods);\n }",
"public function route($http_verb, $uri) {\n // OPTIONS HTTP Verb support\n if (Request::$http_verb === \"OPTIONS\") {\n $route = $this->match_route($http_verb, $uri);\n if ($route === false) {\n return $route;\n }\n $supports = array(\"OPTIONS\", \"HEAD\");\n foreach ($route->actions as $verb => $action) {\n $supports[] = $verb;\n }\n header(\"Allow: \".implode(\", \", $supports));\n exit;\n }\n\n // Find the route\n $route = $this->match_route($http_verb, $uri);\n\n // Check if the route was found and is valid\n if ($route === false) {\n Marmalade::error(Error::create(Error::PAGE_NOT_FOUND));\n } else if (!isset($route->actions[Request::$http_verb])) {\n Marmalade::error(Error::create(Error::METHOD_NOT_ALLOWED));\n }\n return $route;\n }",
"public function getRequestMethod()\n\t{\n\t\t$method = $this->server->get('REQUEST_METHOD');\n\t\tif(in_array(strtoupper($method),$this->methods))\n\t\t{\n\t\t\treturn $method;\n\t\t}\n\t\treturn ;\n\t}",
"public function getRequestMethod()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"function getAcceptTypes() {\n\t\treturn $this->getParam(self::PARAM_ACCEPT_TYPES);\n\t}",
"public function get_http_accept(){\r\n\t\t\treturn $this->http_accept;\r\n\t\t}",
"public function getMethod()\n {\n return 'GET';\n }",
"public static function method()\n\t{\n\t\treturn $_SERVER['REQUEST_METHOD'];\n\t}",
"public function getMethod(): ?string { return $this->server->get('REQUEST_METHOD'); }",
"function getManagementVerbs() {\n\t\t$verbs = array();\n\t\tif ($this->getEnabled()) {\n\t\t\t$verbs[] = array('settings', Locale::translate('plugins.generic.issuecarousel.settings'));\n\t\t}\n\t\treturn parent::getManagementVerbs($verbs);\n\t}",
"public static function method()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"public static function method()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"function getManagementVerbs() {\n\t\treturn null;\n\t}",
"public function getRequestMethod()\n {\n if (is_null($this->method)) {\n $server = provider::access('server');\n\n if ($server->isExist('REQUEST_METHOD') && $server->isValid('REQUEST_METHOD', validate::T_PRINTABLE)) {\n $this->method = strtoupper($server->getValue('REQUEST_METHOD'));\n }\n }\n\n return $this->method;\n }",
"public function test_route_method_array() {\n\t\tregister_rest_route(\n\t\t\t'test-ns',\n\t\t\t'/test',\n\t\t\tarray(\n\t\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t\t'callback' => '__return_null',\n\t\t\t\t'permission_callback' => '__return_true',\n\t\t\t)\n\t\t);\n\n\t\t$routes = $GLOBALS['wp_rest_server']->get_routes();\n\n\t\t$this->assertSame(\n\t\t\t$routes['/test-ns/test'][0]['methods'],\n\t\t\tarray(\n\t\t\t\t'GET' => true,\n\t\t\t\t'POST' => true,\n\t\t\t)\n\t\t);\n\t}",
"function getManagementVerbs() {\n\t\t$verbs = array();\n\t\tif ($this->getEnabled()) {\n\t\t\t$verbs[] = array('settings', __('plugins.generic.thesisfeed.settings'));\n\t\t}\n\t\treturn parent::getManagementVerbs($verbs);\n\t}",
"public static function method(){\n \n return self::$request->getMethod(); \n }",
"public function getMethod(): string\n {\n return (string)$this->env['REQUEST_METHOD'];\n }",
"public function get_request_method() {\n return (!empty($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : '');\n }",
"public function getMethodAllowableValues()\n {\n return [\n self::METHOD_GET,\n self::METHOD_HEAD,\n self::METHOD_POST,\n self::METHOD_PUT,\n self::METHOD_PATCH,\n self::METHOD_DELETE,\n self::METHOD_OPTIONS,\n self::METHOD_TRACE,\n ];\n }",
"protected function getVerb($method)\n {\n switch ($method) {\n case 'index':\n case 'create':\n case 'show':\n case 'edit':\n return 'get';\n\n case 'store':\n return 'post';\n\n case 'update':\n return 'put';\n\n case 'destroy':\n return 'delete';\n }\n }",
"public static function method(): string\n\t{\n\t\treturn strtoupper(Server::get('REQUEST_METHOD'));\n\t}",
"protected function routeDescriptions()\n {\n return [\n //\n ];\n }",
"public function getMethod()\n {\n $httpMethod = $this->serverAttributes()['REQUEST_METHOD'];\n\n if (!$httpMethod) {\n return false;\n }\n\n return $httpMethod;\n }",
"private function getActionRoutes() : array {\n return [\n 'session_entity.close',\n 'session_entity.download_answers',\n 'la_pills_timer.la_pills_timer_controller_sessionTimer',\n 'la_pills_timer.la_pills_timer_controller_stopAll',\n 'la_pills_timer.la_pills_timer_controller_exportTimers', // This produces two events one of those AJAX preflight and the other one POST download event if that is possible\n 'la_pills_timer.la_pills_timer_controller_ajaxTimerActiveInactive',\n 'la_pills_quick_feedback.la_pills_quick_feedback_controller_ajaxQuestionActiveInactive',\n ];\n }",
"public function method(): string\n {\n return \\strtoupper($this->request()->getMethod());\n }",
"private function requestMethod() \n {\n // Take the method as found in $_SERVER\n $method = $_SERVER['REQUEST_METHOD'];\n\n if ($_SERVER['REQUEST_METHOD'] == 'HEAD') {\n ob_start();\n $method = 'GET';\n } // If it's a POST request, check for a method override header\n elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n $headers = $this->requestHeaders();\n if (isset($headers['X-HTTP-Method-Override']) && in_array($headers['X-HTTP-Method-Override'], array('PUT', 'DELETE', 'PATCH'))) {\n $method = $headers['X-HTTP-Method-Override'];\n }\n }\n return $method;\n }",
"public function getAllowedMethods()\n {\n return ['loomisrate' => __('Loomis')];\n }",
"public function getMethod()\n\t{\n\t\t//current method\n\t\t$httpMethod = mb_strtoupper($this->getRequestMethod());\n\t\t// If it's a HEAD request override it to being GET and prevent any output, as per HTTP Specification\n\t\t// @url http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4\n\t\tif ($httpMethod === Request::HEAD) {\n\t\t\t$httpMethod = Request::GET;\n\t\t}\n\n\t\t//When request is POST then check whether method override was sent and check whether in the method override have an annother method\n\t\t//like PUT, PATCH or DELETE \n\t\tif ($httpMethod === Request::POST) {\n\t\t\t$httpHeaders = $this->getServerParams();\n\n\t\t\tif (isset($httpHeaders['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n\t\t\t\t$overrideMethod = $httpHeaders['HTTP_X_HTTP_METHOD_OVERRIDE'];\n\n\t\t\t\tif (in_array($overrideMethod, array('PUT', 'DELETE', 'PATCH'))) {\n\t\t\t\t\t$httpMethod = $overrideMethod;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$httpMethod = $httpHeaders['REQUEST_METHOD'];\n\t\t\t}\n\t\t}\n\n\t\t//return current method\n\t\treturn $httpMethod;\n\t}",
"static function method(): string\n\t{\n\t\treturn $_SERVER['REQUEST_METHOD'];\n\t}",
"public function getMethod()\n {\n return $this->values[\"method\"];\n }",
"public function getMethod()\n {\n return $this->getBody()->getMethod();\n }",
"public function getRoutes(): array\r\n {\r\n return [\r\n [\r\n 'name' => 'exclusive/json/messagetutor',\r\n 'path' => '/exclusive/json/mT',\r\n 'middleware' => Action\\Json\\MessageTutor::class,\r\n 'allowed_methods' => ['POST']\r\n ],\r\n [\r\n 'name' => 'exclusive/json/certificateprintfree',\r\n 'path' => '/exclusive/json/cPf',\r\n 'middleware' => Action\\Json\\CertificatePrintFree::class,\r\n 'allowed_methods' => ['POST']\r\n ]\r\n ];\r\n }",
"public function validRequests()\n {\n return [\n [\n HttpRequestMethod::GET,\n 'https://postman-echo.com/get?foo1=bar1&foo2=bar2',\n '',\n []\n ],\n [\n HttpRequestMethod::POST,\n 'https://postman-echo.com/post',\n 'This is expected to be sent back as part of response body.',\n [\n 'Content-type' => 'text/html; charset=UTF-8'\n ]\n ],\n [\n HttpRequestMethod::DELETE,\n 'https://postman-echo.com/delete',\n '',\n []\n ],\n ];\n }",
"public static function httpVia() {\n\t\treturn (isset($_SERVER['HTTP_VIA']))\n\t\t\t? $_SERVER['HTTP_VIA']\n\t\t\t: null;\n\t}",
"public function getRequestMethod(): string;",
"public function getMethod()\n {\n if (isset($_POST[$this->methodParam])) {\n return strtoupper($_POST[$this->methodParam]);\n } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } else {\n return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';\n }\n }",
"public function getRequestMethod()\n {\n return sanitize_key($this->getServerVar('REQUEST_METHOD'));\n }",
"public function getMethods()\n\t{\n\t\treturn ['POST'];\n\t}",
"public function getMethods()\n\t{\n\t\treturn ['POST'];\n\t}",
"public static function getMethod()\n {\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n\n return $method;\n }",
"private static function getMethodRequest(){\n return $_SERVER[\"REQUEST_METHOD\"];\n }",
"public function request_method() {\n\t\tif ( isset( $_SERVER['REQUEST_METHOD'] ) ) {\n\t\t\treturn $_SERVER['REQUEST_METHOD'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function acceptableContentTypes() {\n\t\t$accept = $this->getHeader('Accept');\n\t\treturn $accept === null ? array() : self::parseNegotiation($accept);\n\t}",
"public function getRoutes(){\n return CoreArrayUtils::asArray(CoreControllerObject::buildAction('/^\\/email\\/activate\\/([^\\/]+)\\/?$/i', __CLASS__, CoreControllerObject::MATCH_TYPE_REGEX, CoreControllerObject::REQUEST_GET));\n }"
]
| [
"0.7465922",
"0.69613796",
"0.6846852",
"0.681579",
"0.678143",
"0.6780335",
"0.6569153",
"0.6545659",
"0.6279203",
"0.62694705",
"0.61290497",
"0.60901994",
"0.60876805",
"0.6059517",
"0.60132974",
"0.59631383",
"0.5947417",
"0.5908767",
"0.5908546",
"0.58901864",
"0.5885864",
"0.5851993",
"0.5813252",
"0.58049184",
"0.5794307",
"0.5793394",
"0.57917976",
"0.5791012",
"0.5759002",
"0.5718158",
"0.5716698",
"0.5700671",
"0.5699574",
"0.5696874",
"0.56915265",
"0.5686866",
"0.5680047",
"0.5677977",
"0.5665796",
"0.56655306",
"0.5656694",
"0.5644275",
"0.56442434",
"0.5631682",
"0.56109434",
"0.5606129",
"0.55770934",
"0.55564344",
"0.5554075",
"0.55393684",
"0.5530635",
"0.55263484",
"0.5515031",
"0.5514621",
"0.5513432",
"0.55109876",
"0.55104476",
"0.5491619",
"0.5487364",
"0.5481461",
"0.5481069",
"0.54779387",
"0.54743844",
"0.545069",
"0.5448576",
"0.54439557",
"0.5443798",
"0.5443798",
"0.5440181",
"0.5434564",
"0.54235333",
"0.5417637",
"0.5413582",
"0.53995776",
"0.53820294",
"0.537747",
"0.53473496",
"0.5335141",
"0.53217316",
"0.5321324",
"0.5318278",
"0.52984023",
"0.5290682",
"0.529037",
"0.5290012",
"0.5285784",
"0.5281331",
"0.52577096",
"0.5256583",
"0.5255382",
"0.525442",
"0.52492636",
"0.52460694",
"0.523586",
"0.5228981",
"0.5228981",
"0.52142054",
"0.521261",
"0.51963323",
"0.5193511",
"0.5193021"
]
| 0.0 | -1 |
Checks whether the route's action is a controller. | protected function isControllerAction()
{
return is_string($this->action['uses']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }",
"public function isController($action)\n {\n return (bool) preg_match(\"/^[A-Za-z0-9\\\\\\]+@[A-Za-z0-9_]+$/\", $action);\n }",
"public function checkRoute(){\n $pathController = \"../app/controllers/\".$this->controllerName.\".class.php\";\n\n if( !file_exists($pathController) ){\n //echo \"Le fichier du controller n'existe pas\";\n return false;\n }\n include $pathController;\n\n if ( !class_exists($this->controllerName) ){\n //echo \"Le fichier du controller existe mais il n'y a pas de classe\";\n return false;\n }\n if( !method_exists($this->controllerName, $this->actionName) ){\n //echo \"L'action n'existe pas\";\n return false;\n }\n return true;\n }",
"private static function check_route($a_route){\n\t\t$args=explode(\"/\",$a_route);\n\t\t\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t\tdie();\n\t\t}\n\t}",
"private static function isAction( $controller, $action )\n {\n $controllerClass = self::toClass( $controller );\n $actionMethod = self::toMethod( $action );\n \n return class_exists( $controllerClass ) && is_callable( \"$controllerClass::$actionMethod\" );\n }",
"private static function isController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t\n\t\tif (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function hasControllerNamespace()\r\n\t{\r\n\t\treturn !empty($this->controllerNamespace);\r\n\t}",
"private function _actionExists($request) { \n $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher(); \n \n // Check controller \n if (!$dispatcher->isDispatchable($request)) { \n return false; \n } \n \n // Check action \n $controllerClassName = $dispatcher->formatControllerName( $request->getControllerName() ); \n $controllerClassFile = str_replace('_', '/', $controllerClassName) . '.php'; \n if ($request->getModuleName() != $dispatcher->getDefaultModule()) { \n $controllerClassName = ucfirst($request->getModuleName()) . '_' . $controllerClassName; \n } \n try { \n require_once 'Zend/Loader.php'; \n Zend_Loader::loadFile($controllerClassFile, $dispatcher->getControllerDirectory($request->getModuleName()), true); \n $actionMethodName = $dispatcher->formatActionName($request->getActionName()); \n if (@in_array($actionMethodName, get_class_methods($controllerClassName))) { \n return true; \n } \n return false; \n } catch(Exception $e) { \n return false; \n } \n }",
"public function hasCustomController()\n {\n $controllerName = ucfirst(str_replace('post_', '', $this->slug));\n if(File::exists(Theme::getPath().'/controllers/'.$controllerName.'Controller.php')) {\n return true;\n }\n return false;\n }",
"function VerifyController()\n\t\t{\n\t\t\tif ($this->CONTROLLER == \"\" && $this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->CONTROLLER\t= \"PageController\";\n\t\t\t\t$this->ACTION\t\t= \"Home\";\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the parameters are well-formed\t\t\t\n\t\t\tif ($this->CONTROLLER == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->ACTION == \"\")\n\t\t\t{\n\t\t\t\t$this->error_message = \"Error: Class method name value was blank.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t\treturn $this->loaded;\n\t\t\t}\n\t\t\t\n\t\t\t// Check that the data class file actually exists\n\t\t\t$this->CheckFile($this->config->base['app'] . '/Base' . $this->CONTROLLER . \".php\", \"Base\" . $this->CONTROLLER);\n\t\t\t$this->CheckFile($this->config->classes['app'] . '/' . $this->CONTROLLER . \".php\", $this->CONTROLLER);\n\n\t\t\t// Check the function we want to run is in the class\n\t\t\tif (is_callable(array($this->CONTROLLER, $this->ACTION)))\n\t\t\t{\n\t\t\t\t$this->error_message = \"\";\n\t\t\t\t$this->loaded = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo $this->CONTROLLER . \"->\" . $this->ACTION;\n\t\t\t\theader(\"HTTP/1.0 404 Not Found\"); exit;\n\t\t\t\t// $this->error_message = \"Error: Class \" . $this->CONTROLLER . \" does not contain a method called '\" . $this->ACTION . \"'.\";\n\t\t\t\t$this->loaded = false;\n\t\t\t}\n\n\t\t\treturn $this->loaded;\n\t\t}",
"private function hasController($page) {\r\n return file_exists($this->getController($page));\r\n }",
"public static function hasController($modname, $type)\n {\n return (bool)self::getClass($modname, $type);\n }",
"private static function action_allowed( $action ) {\n\t\tif ( in_array( $action, self::allowed_actions() ) ) {\n\t\t\t$class = route::action_class( $action );\n\t\t\tif ( self::check_interface( $class ) && self::check_parent_class( $class ) ) {\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"private static function checkControllerIsExist () {\n\t\tif ( !isset(self::$url[0]))\n\t\t\treturn false ;\n\t\t$controller = trim(self::$url[0]);\n\t\tif ( !empty($controller)) {\n\t\t\t$controllerPatch = self::$appPatch.self::$app.DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $controller . '.php' ;\n\t\t\tif (file_exists($controllerPatch)) {\n\t\t\t\tif (class_exists('App\\\\'.self::$app.'\\controller\\\\'.$controller)) {\n\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\tif ( ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\treturn false ;\n\t\t\t\t\t}\n\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\treturn true ;\n\t\t\t\t} else {\n\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\treturn false ;\n\t\t\t\t}\n\t\t\t} elseif ( is_dir(self::$appPatch.self::$app )) {\n\t\t\t\t$files = file::get_files_by_pattern(self::$appPatch,'*'.DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php');\n\t\t\t\tif ( is_array($files) and count($files) > 0 ){\n\t\t\t\t\t$appProvider = strings::deleteWordFirstString(strings::deleteWordLastString($files[0] ,DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php'),self::$appPatch);\n\t\t\t\t\tif (class_exists('App\\\\'.$appProvider.'\\app_provider\\\\'.self::$app.'\\\\'.$controller)) {\n\t\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\t\tif ( ! self::checkAppIsInstalled($appProvider,true) or ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\t\tself::$appProvider = $appProvider;\n\t\t\t\t\t\treturn true ;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}",
"protected function _getAction($route)\n {\n $parts = explode('/', $route);\n $result = isset($parts[4]) ? $parts[4] : 'index';\n $result .= 'Action';\n \n return method_exists($this->_controller, $result) ? $result : false; \n }",
"private function checkRoute()\n\t{\n\t $route = GlobalSystem::routeType();\n\t\tif(key_exists($route, RequestRoute::$routes)){\n\t\t\t$this->trigger = RequestRoute::$routes[$route][GlobalSystem::ExpRouteKeyTrigger];\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function isAllowed() {\n\t\treturn $this->allowedActions == array('*') ||\n\t\t\t\tin_array($this->_request->params['action'], array_map('strtolower', $this->allowedActions));\n\t}",
"protected function checkForMissingController($action)\n {\n $exists = is_object($action)\n || $this->dispatcher->hasObject($action);\n if ($exists) {\n return;\n }\n\n $this->logger->debug(__METHOD__ . \" missing action '$action'\");\n $this->request->params['action'] = 'aura.web_kernel.missing_action';\n $this->request->params['missing_action'] = $action;\n }",
"function check_path($controller, $action)\n {\n if(!method_exists($controller, $action)){\n $controller = $config['error_controller'];\n require_once(APP_DIR . 'controllers/' . $controller . '.php');\n $action = 'index';\n }\n }",
"static function requireController($controllerName, $action ) {\n\n\t\t$paths = array_merge(array(\n\t\t\tROOT . 'app' . DS . 'controllers' . DS,\n\t\t\tROOT . 'controllers' . DS,\n\t\t\tAE_CONTROLLERS\n\t\t\t), self::$_paths\n\t\t);\n\n\t\tif (strpos($action, '.') !== false) {\n\t\t\t$action = substr($action, 0, strpos($action, '.'));\n\t\t}\n\t\t\n\t\t$controllerName = camelize($controllerName) . 'Controller';\n\t\t$action = camelize($action);\n\n\t\tforeach ($paths as $p) {\n\t\t\tif (is_file($p . $controllerName . '.php')) {\n\t\t\t\trequire_once($p . $controllerName . '.php');\n\n\t\t\t\tif (!class_exists($controllerName)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($controllerName . ' is not defined as class.');\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!method_exists($controllerName, $action)) {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not defined in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (!is_public_controller_method($controllerName, $action) || substr($controllerName, 0, 1) == '_') {\n\t\t\t\t\tif (debuggin()) {\n\t\t\t\t\t\tthrow new Exception ($action . ' is not public in class ' . $controllerName);\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\treturn true;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private function tryDispatch()\n\t{\n\t\t// Get the name of the controller to be instantiated.\n\t\t$controller_name = $this->route->getController();\n\t\t$defualt_method = $this->config->getDefaultAction();\n\n\t\t// Use the default controller if no other controller was specified.\n\t\tif (empty($controller_name) && $this->config->getDefaultController()) {\n\t\t\t$controller_name = ucfirst($this->config->getDefaultController());\n\t\t}\n\n\t\t// Add 'Controller' suffix.\n\t\t$controller_name .= \"Controller\";\n\n\t\t// FIXME: Hardcoded application path.\n\t\t// Make sure the controller-class file exists\n\n\t\t$controller_file = $this->config->getApplicationPath() . \"/controllers/\" .\n\t\t\t$controller_name . \".php\";\n\t\tif (file_exists($controller_file)) {\n\t\t\t// Include the controller-class file.\n\t\t\trequire_once($controller_file);\n\t\t}\n\n\t\t$success = false;\n\n\t\tif (class_exists($controller_name)) {\n\t\t\t$controller = new $controller_name($this->request);\n\t\t\t$method = $this->route->getAction();\n\n\t\t\tif (empty($method)) {\n\t\t\t\tif (method_exists($controller,$defualt_method)) {\n\t\t\t\t\tcall_user_func(array($controller,$defualt_method));\n\t\t\t\t\t$success = true;\n\t\t\t\t}\n\t\t\t} else if (method_exists($controller,$method)) {\n\t\t\t\t$rmethod = new ReflectionMethod($controller_name, $method);\n\t\t\t\t$rparams = $rmethod->getNumberOfRequiredParameters();\n\t\t\t\t$params = $rmethod->getNumberOfParameters();\n\t\t\t\t$user_params = $this->route->getNumberOfParameters();\n\n\t\t\t\tif ($user_params <= $params && $user_params >= $rparams) {\n\t\t\t\t\tcall_user_func_array(array($controller,$method),\n\t\t\t\t\t\t$this->route->getParameters());\n\t\t\t\t\t$success = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}",
"public function has_valid_action(): bool {\n\t\treturn is_string( $this->get_action() )\n\t\t&& \\mb_strlen( $this->get_action() ) > 0;\n\t}",
"public function checkControllerMethodExists(object $controller, string $method)\n {\n if(!method_exists($controller,$method))\n {\n die(\"Unknown method for instantiated controller object\");\n }\n }",
"public function controller()\n {\n return isset($this->controller) ? $this->controller : false;\n }",
"protected function checkIsAuthorized(string $action): bool\n {\n return method_exists($this, $action)\n ? $this->$action()\n : false;\n }",
"public function checkControllerExists(string $controller)\n {\n if(!class_exists($this->ctlrStrSrc.$controller))\n {\n die(\"Defined Controller doesn't exists\");\n }\n }",
"public function validate_route($route)\n\t{\n\t\t// If we don't have any segments, the default will have to do\n\t\tif (empty($route))\n\t\t{\n\t\t\t$route = $this->_default_segments();\n\t\t\tif (empty($route))\n\t\t\t{\n\t\t\t\t// No default - fail\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Explode route if not already segmented\n\t\tif ( ! is_array($route))\n\t\t{\n\t\t\t$route = explode('/', $route);\n\t\t}\n\n\t\t// Parse any custom routing that may exist\n\t\t$route = $this->_parse_routes($route);\n\n\t\t// Search paths for controller\n\t\tforeach ($this->CI->load->get_package_paths() as $path)\n\t\t{\n\t\t\t// Does the requested controller exist in the base folder?\n\t\t\tif (file_exists($path.'controllers/'.$route[0].'.php'))\n\t\t\t{\n\t\t\t\t// Found it - append method if missing\n\t\t\t\tif ( ! isset($route[1]))\n\t\t\t\t{\n\t\t\t\t\t$route[] = 'index';\n\t\t\t\t}\n\n\t\t\t\t// Prepend path and empty directory and return\n\t\t\t\treturn array_merge(array($path, ''), $route);\n\t\t\t}\n\n\t\t\t// Is the controller in a sub-folder?\n\t\t\tif (is_dir($path.'controllers/'.$route[0]))\n\t\t\t{\n\t\t\t\t// Found a sub-folder - is there a controller name?\n\t\t\t\tif (isset($route[1]))\n\t\t\t\t{\n\t\t\t\t\t// Yes - get class and method\n\t\t\t\t\t$class = $route[1];\n\t\t\t\t\t$method = isset($route[2]) ? $route[2] : 'index';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Get default controller segments\n\t\t\t\t\t$default = $this->_default_segments();\n\t\t\t\t\tif (empty($default))\n\t\t\t\t\t{\n\t\t\t\t\t\t// No default controller to apply - carry on\n\t\t\t\t\t\tunset($default);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Get class and method\n\t\t\t\t\t$class = array_shift($default);\n\t\t\t\t\t$method = array_shift($default);\n\t\t\t\t}\n\n\t\t\t\t// Does the requested controller exist in the sub-folder?\n\t\t\t\tif (file_exists($path.'controllers/'.$route[0].'/'.$class.'.php'))\n\t\t\t\t{\n\t\t\t\t\t// Found it - assemble segments\n\t\t\t\t\tisset($route[1]) OR $route[] = $class;\n\t\t\t\t\tisset($route[2]) OR $route[] = $method;\n\t\t\t\t\tif (isset($default) && count($default) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$route = array_merge($route, $default);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepend path and return\n\t\t\t\t\tarray_unshift($route, $path);\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Search for controller in modules hierarchy\n\t\t// If the module path is APPPATH/modules/, \"/foo/bar/baz\" may map to:\n\t\t//\tAPPPATH/modules/controllers/foo.php\n\t\t//\tAPPPATH/modules/foo/controllers/bar.php\n\t\t//\tAPPPATH/modules/foo/bar/controllers/baz.php\n\t\t//\tAPPPATH/modules/foo/bar/baz/controllers/[default].php\n\t\t$seg_ct = count($route);\n\t\tforeach ($this->CI->load->get_module_paths() as $path)\n\t\t{\n\t\t\t// Does the requested controller exist in the base folder?\n\t\t\tif (file_exists($path.'controllers/'.$route[0].'.php'))\n\t\t\t{\n\t\t\t\t// Found it - append method if missing\n\t\t\t\tif ($seg_ct < 2)\n\t\t\t\t{\n\t\t\t\t\t$route[] = 'index';\n\t\t\t\t}\n\n\t\t\t\t// Prepend path and empty directory and return\n\t\t\t\treturn array_merge(array($path, ''), $route);\n\t\t\t}\n\n\t\t\t// Is there a module sub-folder?\n\t\t\tfor ($sub = '', $seg = 0; $seg < $seg_ct; ++$seg)\n\t\t\t{\n\t\t\t\t// Add segment to subdirectory path and check for controllers\n\t\t\t\t$sub .= $route[$seg].'/';\n\t\t\t\tif (is_dir($path.$sub.'controllers/'))\n\t\t\t\t{\n\t\t\t\t\t// Found a module - is there a controller name?\n\t\t\t\t\tif ($seg_ct > $seg + 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Yes - get class and method\n\t\t\t\t\t\t$class = $route[$seg + 1];\n\t\t\t\t\t\t$method = $seg_ct > $seg + 2 ? $route[$seg + 2] : 'index';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Get default controller segments\n\t\t\t\t\t\t$default = $this->_default_segments();\n\t\t\t\t\t\tif (empty($default))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// No default controller to apply - carry on\n\t\t\t\t\t\t\tunset($default);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Get class and method\n\t\t\t\t\t\t$class = array_shift($default);\n\t\t\t\t\t\t$method = array_shift($default);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Does the requested controller exist in the module?\n\t\t\t\t\tif (file_exists($path.$sub.'controllers/'.$class.'.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\t// Found it - assemble segments\n\t\t\t\t\t\tif ($seg_ct <= $seg + 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route[] = $class;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($seg_ct <= $seg + 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route[] = $method;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isset($default) && count($default) > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$route = array_merge($route, $default);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Return path, empty (post-)subdirectory, and remainder of route\n\t\t\t\t\t\t$route = array_merge(array($path.$sub, ''), array_slice($route, $seg + 1));\n\t\t\t\t\t\treturn $route;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we got here, no valid route was found\n\t\treturn FALSE;\n\t}",
"public function say_controller()\n\t{\n return $this->controller ? $this->controller : false;\n }",
"function hasMockClass($type) {\n\t\t$type = strtolower($type);\n\t\treturn $type == 'controller';\n\t}",
"public function isAction($action)\n\t{\n\t\treturn strpos($this->getAction(TRUE), $action) !== FALSE;\n\t}",
"private function _verifyAction($controllerName, $action, $config){\n \tif (array_key_exists('rest', $config) && \n \t\t\tarray_key_exists($controllerName, $config['rest']) &&\n \t\t\tarray_key_exists($this->method, $config['rest'][$controllerName]) &&\n \t\t\t$config['rest'][$controllerName][$this->method]==strtolower($action)\n \t\t\t) {\n\t\t\treturn $config['rest'][$controllerName][$this->method];\n \t}\n \treturn false;\n }",
"function isAllowedAction($action) {\n\t\t\treturn true;\n\t\t}",
"private function _getRoute()\n {\n $route = str_replace($this->_registry->rootPath, '', $_SERVER['REQUEST_URI']);\n $routeParts = explode('/', $route);\n if ($routeParts[0]=='public') {\n $this->_registry->route = false;\n return true;\n }\n if (!empty($routeParts)) {\n $this->controller = $routeParts[0];\n if (!empty($routeParts[1])) {\n $this->action = strtolower($routeParts[1]);\n }\n }\n if (empty($this->controller)) {\n $this->controller = 'index';\n }\n if (empty($this->action)) {\n $this->action = 'index';\n }\n $this->_registry->route = $routeParts;\n // split to arguments;\n unset($routeParts[0], $routeParts[1]);\n if (empty($routeParts)) {\n $routeParts = array();\n }\n $arguments = array();\n foreach ($routeParts as $part) {\n $arguments[] = $part;\n }\n $this->_registry->args = $arguments;\n \n return true;\n }",
"protected function isNoLoginController(Controller $controller)\n {\n\n // reserved routes that doesn't need redirect or need permission check\n $no_login_routes = array(\n '\\Project\\Controllers\\Admin\\Auth', // login page\n '\\Project\\Controllers\\Admin\\Logout', // logout page\n '\\Project\\Controllers\\Admin\\Account\\Forgot', // password page\n '\\Project\\Controllers\\Admin\\Account\\ResetPassword', // password reset page\n );\n\n return in_array('\\\\' . get_class($controller), $no_login_routes);\n }",
"public static function isAllowedRouteRequest() {\n\t\treturn self::$correct_request_method;\n\t}",
"public function GetControllerHasAbsoluteNamespace ();",
"public function isAction()\n {\n $args = func_get_args();\n foreach ($args as $arg)\n {\n // Check if action is set and exists\n if ($_POST['action'] == $arg || $_GET['action'] == $arg)\n {\n // quit here\n return true;\n }\n }\n\n return false;\n }",
"protected function validController($path) {\r\n return file_exists($path) && is_readable($path);\r\n }",
"public function loadBaseController()\n\t{\n\t\t$baseControllerClass = $this->getOption('defaultClassBaseController', null, 'eccBaseController');\n\t\tif (!$this->isBaseController OR !class_exists($baseControllerClass)) {\n\t\t\t$this->isBaseController = $this->modx->loadClass($baseControllerClass, $this->config['controllersPath'], true, true);\n\t\t}\n\n\t\treturn !empty($this->isBaseController) AND class_exists($baseControllerClass);\n\t}",
"function hasAction()\n {\n return !is_null($this->_action);\n }",
"private function ControllerExist($controller) {\n $ControllerExist = false;\n\n foreach ($this->folders as $folder) {\n\n if (class_exists($folder.'\\\\'.$controller)) {\n\n $ControllerExist = true;\n $this->namespace = $folder;\n $this->controller = $controller;\n\n }\n\n }\n\n return $ControllerExist;\n\n }",
"protected function isAllowedAction($action)\n {\n return true;\n }",
"public function routeController()\n\t{\n\t\t$action = \"actionIndex\";\n\n\t\tif (isset($_GET[\"p\"]))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$params = array_filter(explode(\"/\", $_GET[\"p\"]));\n\n\t\t\tif (count($params) != 1)\n\t\t\t{\n\t\t\t\t$action = \"action\";\n\n\t\t\t\tfor ($i = 1; $i < count($params); $i++)\n\t\t\t\t{\n\t\t\t\t\t$action .= ucwords($params[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$controller = \"Controller_\" . ucwords($params[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcall_user_func(array(new Controller_Index(), $action));\n\t\t\texit();\n\t\t}\n\n\t\tif (isset($controller) && class_exists($controller))\n\t\t{\n\t\t\tif (method_exists(new $controller(), $action))\n\t\t\t{\n\t\t\t\tcall_user_func(array(new $controller(), $action));\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\texit();\n\t\t}\n\t}",
"public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }",
"public static function getRouteControllerClass()\r\n {\r\n $route = self::getRouteResolve();\r\n\r\n if(isset($route['class'])){\r\n return $route['class'];\r\n }\r\n\r\n return null;\r\n }",
"private static function viewRequiresController(): bool\n {\n return true;\n }",
"function my_is_current_controller($names)\n {\n $names = array_map('trim', explode(',', $names));\n $current = explode('.', Route::currentRouteName())[0];\n return in_array($current, $names, true);\n }",
"public function hasRoute(): bool;",
"public function isActionRequest()\n\t{\n\t\t$this->_checkRequestType();\n\t\treturn $this->_isActionRequest;\n\t}",
"protected function requiredPermission() {\n $route = \\Route::currentRouteAction();\n if(isset($route)) {\n $route = class_basename($route);\n $route = explode(\"Controller@\", $route, 2);\n\n if($route[1] == \"store\")\n $route[1] = \"create\";\n if($route[1] == \"update\")\n $route[1] = \"edit\";\n\n $action = strtolower($route[0]).'/'.$route[1];\n }\n\n return isset($action) ? $action : null;\n }",
"function is_route(string $route): bool\n {\n return Route::currentRouteName() == $route;\n }",
"public function getController(RouteObjectInterface $document)\n {\n $content = $document->getReference();\n if (null == $content) {\n return false;\n }\n $class = get_class($content);\n\n if (! isset($this->controllers_by_class[$class])) {\n return false;\n }\n\n return $this->controllers_by_class[$class];\n }",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n return strstr($requestedName, __NAMESPACE__.'\\Controller') !== false;\n }",
"public function isApi()\n {\n return $this->controller() instanceof ApiController;\n }",
"public function hasUrlFor($instance, $controller, $action, $args, $kwargs) {\n // Custom name for controller is substitued with actual controller for this rule.\n if (!is_null($this->customName) && $controller == $this->customName) {\n $controller = NULL;\n\n if (!is_null($this->controller)) {\n $controller = $this->controller;\n } elseif (!is_null($this->instance)) {\n $instance = $this->instance;\n }\n }\n\n // Try to match controller part.\n if (!is_null($instance)) {\n if (is_null($this->instance) || $this->instance !== $instance) {\n // Given instance is different.\n return false;\n }\n\n // For further examination, we need to handle uniformly both instance and controller,\n // so it is safe to overwrite controller here.\n $controller = $instance;\n } elseif (!is_null($controller)) {\n if (is_null($this->controller) && strpos($this->originalPattern, \"<controller>\") === false) {\n // Controller is not bound and not in URL either.\n return false;\n } elseif (!is_null($this->controller) && $this->controller != $controller) {\n // Controller is bound, but not the one that was requested.\n return false;\n }\n }\n\n if (!is_null($this->action) && $action != $this->action) {\n // Requested other action than specified in the rule.\n return false;\n }\n\n // Try to match method part.\n if (!FastRouterCompiler::methodIsAccessible($controller, $action)) {\n // Requested method is not callable.\n return false;\n }\n\n // Test number of arguments.\n $refl = new \\ReflectionMethod($controller, $action);\n\n $hasVariadicArgs = false;\n $kwArgsForParams = $kwargs;\n\n reset($args);\n foreach ($refl->getParameters() as $param) {\n if ($param->isVariadic()) {\n $hasVariadicArgs = true;\n }\n\n if (!isset($kwArgsForParams[$param->getName()]) && !each($args)) {\n if (!$param->isOptional()) {\n // Requested method has too much parameters.\n return false;\n }\n } elseif (isset($kwArgsForParams[$param->getName()])) {\n unset($kwArgsForParams[$param->getName()]);\n }\n }\n\n if (!empty($kwArgsForParams)) {\n // Unknown keyword argument that was not specified for given method.\n return false;\n }\n\n if (each($args) !== false && !$hasVariadicArgs) {\n // Method does not have enough parameters.\n return false;\n }\n\n // Here we know, the URL can be generated. So we only need to generate the URL from original pattern.\n return true;\n }",
"public function beforeExecuteRoute(Event $event, DispatcherInterface $dispatcher) : bool\n {\n if(rtrim($dispatcher->getNamespaceName(), \"\\\\\") == \"LightCloud\\CentCMS\\Api\\Controllers\\Apis\") {\n return true;\n }\n \n $controller = $dispatcher->getActiveController();\n $ctrClassName = $dispatcher->getControllerClass();\n $method = $dispatcher->getActiveMethod();\n\n Log::debug($ctrClassName . '#####' . $method);\n\n if(Request::isPost()) {\n if(\\method_exists($controller, \"post\".ucfirst($method))) {\n $dispatcher->forward([\n 'controller' => $dispatcher->getControllerName(),\n 'action' => \"post\".ucfirst($dispatcher->getActionName()),\n ]);\n return false;\n }\n }\n \n // Action注解分析\n $anno = Annotations::getMethod($ctrClassName, $method);\n\n $user = Di::get('user');\n if(!Acl::isAllowed($user->getRole(), $ctrClassName, $method)) {\n // Log::error($user->getRole() . \"###\" . $ctrClassName . \"###\" . $method);\n if($user->isGuest()) {\n\t\t\t\t$from = urlencode(Request::getURI());\n Response::redirect('/user/login?from='.$from);\n } else {\n if($anno->has('api')) {\n ExceptionBase::throw('您没有权限');\n } else {\n $dispatcher->forward(array(\n 'controller' => 'error',\n 'action' => 'show403'\n ));\n }\n }\n return false;\n }\n\n if(method_exists($controller, 'setUser')) {\n // Log::debug(var_export($user, true));\n $controller->setUser($user);\n }\n if($anno->has('title')) {\n $controller->setTitle($anno->get('title')->getArgument(0));\n }\n if($anno->has('disableView') || $anno->has('api')) {\n View::disable();\n }\n\n return true;\n }",
"private static function performStandardRouting(){\n if(!isset($_GET['controller'])) {\n return self::executeController(self::$notSpecifiedFallbackController, $_GET);\n } else if(empty($_GET['controller'])) {\n return false;\n }\n\n return self::executeController($_GET['controller'], $_GET);\n }",
"protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }",
"public function isDispatchable(Zend_Controller_Dispatcher_Token $action)\n\t{\n return $this->_dispatch($action, false);\n\t}",
"protected function _getController($route)\n {\n $ctrlClass = $this->_getControllerClassName($route);\n $this->_controller = new $ctrlClass;\n \n if (!is_subclass_of($this->_controller, 'Konekt_Framework_Core_Controller_Abstract')) {\n return false;\n }\n \n return $this->_controller;\n }",
"private function getRouteAction($route)\n {\n return ($this->isClosureRoute($route)) ? 'Closure' : 'Controller';\n }",
"public function isCallableFromRouter($actionName)\n {\n return FALSE;\n }",
"public function isAction($action): bool\n {\n return is_subclass_of($action, Action::class) &&\n ! (new ReflectionClass($action))->isAbstract();\n }",
"public static function isRouteValid()\n {\n global $Routes;\n $uri = $_SERVER['REQUEST_URI'];\n if (!in_array(explode('?', $uri)[0], $Routes, true)) {\n return 0;\n } else {\n return 1;\n }\n }",
"function get_controller() {\n\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n return $parts[2];\n }\n return null;\n }",
"public function testGetControllerClassNoControllerName()\n {\n $request = new ServerRequest([\n 'url' => 'test_plugin_three/ovens/index',\n 'params' => [\n 'plugin' => 'Company/TestPluginThree',\n 'controller' => 'Ovens',\n 'action' => 'index',\n ],\n ]);\n $result = $this->factory->getControllerClass($request);\n $this->assertSame('Company\\TestPluginThree\\Controller\\OvensController', $result);\n }",
"public static function getRouteControllerMethod()\r\n {\r\n $route = self::getRouteResolve();\r\n\r\n if(isset($route['method'])){\r\n return $route['method'];\r\n }\r\n\r\n return null;\r\n }",
"public function hasMethod() : bool\n {\n return array_key_exists($this->request->getMethod(), $this->routes);\n }",
"public function eh_rota_prefixada() {\n $routes = Configure::read('Routing.prefixes');\n if (count($routes)) {\n $a = $this->controller->action;\n foreach ($routes as $route) {\n $strpos = strpos($a, $route . '_');\n if ($strpos === 0) {\n return true;\n }\n }\n }\n return false;\n }",
"public function post($route, $controllerAction = '');",
"public function _checkControllerAccess() \n {\n static $_unprotectedControllersHookDone = false;\n static $_hookCalled = false;\n \n if ($_hookCalled || !$controller = Yii::app()->getController()) {\n return;\n }\n \n $_hookCalled = true;\n $unprotectedControllers = (array)Yii::app()->params->itemAt('unprotectedControllers');\n\n if (!$_unprotectedControllersHookDone) {\n Yii::app()->params->add('unprotectedControllers', $unprotectedControllers);\n $_unprotectedControllersHookDone = true;\n }\n\n if (!in_array($controller->id, $unprotectedControllers) && !Yii::app()->user->getId()) {\n // make sure we set a return url to the previous page that required the user to be logged in.\n Yii::app()->user->setReturnUrl(Yii::app()->request->requestUri);\n // and redirect to the login url.\n $controller->redirect(Yii::app()->user->loginUrl);\n }\n \n // since 1.3.5, user permission to controller action, aka route\n if (!in_array($controller->id, $unprotectedControllers) && Yii::app()->user->getId()) {\n $controller->onBeforeAction = array($this, '_checkRouteAccess');\n }\n \n // check version update right before executing the action!\n $controller->onBeforeAction = array($this, '_checkUpdateVersion');\n \n // check app wide messages\n $controller->onBeforeAction = array($this, '_checkAppWideMessages');\n }",
"public function isAction($action)\n {\n if (!$this->MultiStepForm->isWhitelist($action)) {\n return false;\n }\n\n return parent::isAction($action);\n }",
"public function hasAction($action)\n {\n if (method_exists($this, $action . 'Action')) {\n return $action . 'Action';\n }\n return false;\n }",
"public function GetDefaultControllerIfHasAction ($actionName);",
"public static function method($type) {\n return $_SERVER['REQUEST_METHOD'] == strtoupper($type);\n }",
"public static function isActiveRoute()\n {\n return \\Route::currentRouteName() === static::routeName();\n }",
"public function get_action_class() {\n if (!empty($this->action)) {\n $parts = explode('/', $this->action);\n \n if (count($parts) > 1) {\n $className = $parts[count($parts) - 1];\n } else {\n $className = $this->action;\n }\n \n $className = str_replace('-', ' ', $className);\n $className = ucwords($className);\n $className = str_replace(' ', '', $className);\n \n if (class_exists($className)) {\n return $className;\n }\n }\n return false;\n }",
"abstract public function getControllerAction();",
"public function hasAccess($route)\n {\n $userId = Yii::app()->user->id;\n $am = Yii::app()->accessManager;\n\n //No controller ID specified. Use current controller ID.\n if(!strpos($route, '/'))\n {\n return $am->hasAccess($userId, $this->id, $route);\n }\n else\n {\n $r = explode('/', $route);\n return $am->hasAccess($userId, $r[0], $r[1]);\n }\n }",
"public function testCanSendRoute()\n {\n $this->assertEmpty([]);\n\n $routes = $this->app->getRoutes();\n\n foreach ($routes as $route) {\n if ($route->getName() == 'api.oauth') {\n $this->assertContains('POST', $route->getAllowedMethods());\n $this->assertEquals('/api/oauth', $route->getPath());\n }\n }\n }",
"private function veriFyControllerOnUrl()\n {\n if (!empty($this->urlParameters[3])) {\n $this->existControllerOnRoute = true;\n }\n if ($this->urlParameters && array_key_exists(0, $this->urlParameters)) {\n $this->controller = ucfirst($this->urlParameters[0]) . 'Controller';\n $this->controllerNameAliases = $this->urlParameters[0];\n }\n }",
"function callControllerAction() {\n $santitizedUrl = ''; \n if (!empty($_GET['route'])) {\n $santitizedUrl = trim($_GET['route']);\n }\n\n $route = $this->getMatchingRoute($santitizedUrl);\n if ($route != null) {\n $actionValues = explode('/', ltrim(str_replace($route->getUrl(), '', $santitizedUrl), '/'));\n $controllerName = $route->getControllerName();\n $controllerName = $controllerName . 'Controller'; \n $controller = new $controllerName;\n $action = $route->getActionName();\n $controller->$action($actionValues);\n } else {\n // If we've entered this else section, we've effectively been unable to match\n // the specified url to a registered route. Normally we would throw a 404\n // error and return a user friendly message stating so, however, I'm leaving\n // that as an exersize for the reader\n }\n \n }",
"public function hasAction(string $name): bool;",
"public function getControllerAction()\n {\n $router = $this->serviceManager->get('router');\n $request = $this->serviceManager->get('request');\n $routeMatch = $this->serviceManager->get('Application')->getMvcEvent()->getRouteMatch();\n $routeMatch = $router->match($request);\n if (!is_null($routeMatch)) {\n //echo $routeMatch->getMatchedRouteName();\n $controller = strtolower($routeMatch->getParam('controller'));\n $action = strtolower($routeMatch->getParam('action'));\n $this->controller_action = sprintf(\"%s_%s\", strtolower($controller), strtolower($action));\n } else {\n $this->controller_action = 'application_index';\n }\n }",
"public function isInContext(ControllerResultInterface $controllerResult, Request $request): bool;",
"private function isClosureRoute($route)\n {\n return !isset($route['action']['uses']);\n }",
"public function get($route, $controllerAction = '');",
"public function route()\n\t{\n\t\t$this->request = $this->getRequest();\n\n\t\t$controller_name = 'app\\controllers\\Controller' . ucfirst($this->request->getController());\n\t\t$action_name = 'Action'.ucfirst($this->request->getAction());\n\n\t\tif(!class_exists($controller_name)){\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\n\t\t$controller = new $controller_name;\n\n\t\tif(method_exists($controller, $action_name)){\n\t\t\t$response = $controller->$action_name();\n\t\t\treturn $response ? $response : static::app()->response;\n\t\t} else {\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\t}",
"public static function isRouteValid() {\r\n global $Routes;\r\n $uri = $_SERVER['REQUEST_URI'];\r\n\r\n if (!in_array(explode('?',$uri)[0], $Routes)) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }",
"public function runController($controllerClass, $action, Request $request, Route $route=null);",
"public function matchRequest(\\TYPO3\\Flow\\Mvc\\RequestInterface $request) {\n\t\tif ($this->authenticationManager->isAuthenticated() === FALSE) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$controllerClassName = $this->objectManager->getClassNameByObjectName($request->getControllerObjectName());\n\t\t$actionName = $request->getControllerActionName(). 'Action';\n\n\t\tif ($this->policyService->hasPolicyEntryForMethod($controllerClassName, $actionName) && !$this->reflectionService->isMethodTaggedWith($controllerClassName, $actionName, 'skipcsrfprotection')) {\n\t\t\t$internalArguments = $request->getMainRequest()->getInternalArguments();\n\t\t\tif (!isset($internalArguments['__csrfToken'])) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\t$csrfToken = $internalArguments['__csrfToken'];\n\t\t\tif (!$this->securityContext->hasCsrfProtectionTokens()) {\n\t\t\t\tthrow new \\TYPO3\\Flow\\Security\\Exception\\AuthenticationRequiredException('No tokens in security context, possible session timeout', 1317309673);\n\t\t\t}\n\t\t\tif ($this->securityContext->isCsrfProtectionTokenValid($csrfToken) === FALSE) {\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}",
"protected function _checkIsForcedFormKeyAction()\n {\n return in_array($this->getRequest()->getActionName(), $this->_forcedFormKeyActions);\n }",
"public function getControllerActionName() {}",
"public function isActionAllowed($action){\r\n if(in_array($action,$this->_allowedActions)){\r\n return true;\r\n }\r\n return false;\r\n }",
"function isAuthorized($aro, $controller, $action = null)\n\t{\n\t\t//if the user is an admin -> allow\n\t\tif( !empty($this->admins) &&\n\t\t\t ((in_array($aro[$this->userModel][$this->role], $this->admins)\n\t\t\t \t|| in_array($aro[$this->userModel][$this->username], $this->admins)\n\t\t\t\t|| in_array($aro[$this->userModel]['id'], $this->admins))))\n\t\t{\n\t\t\t$this->admin = true;\n\t\t\treturn true;\n\t\t}\n\n\t\t// if the key doesnt exist - allow access\n\t\tif (is_array($this->access) && array_key_exists($action, $this->access))\n\t\t{\n\t\t\tif(!empty($aro[$this->userModel][$this->role]))\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel][$this->role], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//be sure to check if the user doesnt have the same username as the admin group\n\t\t\telseif($aro[$this->userModel][$this->username])\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel][$this->username], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif($aro[$this->userModel]['id'])\n\t\t\t{\n\t\t\t\tif (in_array($aro[$this->userModel]['id'], $this->access[$action]))\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// if the action is an admin action and the user isnt an admin and the permissions for the action werent\n\t\t// defined\n\t\tif(strpos($action, Configure::read('Routing.admin')) === 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn\ttrue;\n\t}",
"private function controllerExist($controller)\r\n {\r\n $controller = ucfirst($controller . self::$postfix);\r\n if (file_exists(\"controllers/{$controller}.php\")) {\r\n $this->controller = new $controller;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"function taxonomies_is_active_route(string $route = '', array $params = []): bool\n {\n if (is_array($params) && count($params) > 0) {\n $route = route($route, $params, false);\n $path = '/'. request()->decodedPath();\n\n return $route === $path;\n }\n\n if (request()->routeIs($route))\n return true;\n\n if (! $currentRoute = app()->router->currentRouteName())\n return false;\n\n if (! is_array($route))\n $route = [$route];\n\n if (in_array($currentRoute, $route))\n return true;\n\n return false;\n }",
"protected function isActionMethodValid($methodName)\n {\n // try {\n if (!$this->selfRefl->hasMethod($methodName)) {\n return false;\n }\n $method = $this->selfRefl->getMethod($methodName);\n \n return\n // $method->getDeclaringClass()->getName() == $this->selfRefl->getName() &&\n $method->isPublic();\n // } catch (\\ReflectionException $e) {\n // return false;\n // }\n }",
"public static function isCurrentActionPublic() {\r\n $patterns = implode('|', self::$_publicActions);\r\n if (preg_match('#'.$patterns.'#', Dispatcher::getInstance()->getActionName())) {\r\n return true;\r\n }\r\n return false;\r\n }"
]
| [
"0.80553967",
"0.7323095",
"0.7158247",
"0.673717",
"0.6546891",
"0.64538616",
"0.6431315",
"0.64115965",
"0.6364602",
"0.62683094",
"0.6228873",
"0.62278587",
"0.6195076",
"0.6081347",
"0.6042074",
"0.6037484",
"0.6034907",
"0.60069525",
"0.5987156",
"0.598389",
"0.59684753",
"0.59676886",
"0.59086865",
"0.5851841",
"0.5845732",
"0.58122605",
"0.58121395",
"0.5798189",
"0.57980645",
"0.57975566",
"0.57813513",
"0.5780506",
"0.5779337",
"0.5773147",
"0.57701904",
"0.57554096",
"0.57463235",
"0.5740432",
"0.5739811",
"0.57395804",
"0.5736075",
"0.5734122",
"0.5728885",
"0.57281375",
"0.5726039",
"0.5707277",
"0.5704975",
"0.570461",
"0.56804335",
"0.5678035",
"0.5671663",
"0.5671619",
"0.5656693",
"0.56555676",
"0.56265116",
"0.5617056",
"0.56095994",
"0.56088537",
"0.5606233",
"0.5605158",
"0.5596986",
"0.5596369",
"0.55861366",
"0.5583618",
"0.5569935",
"0.55621606",
"0.5548173",
"0.5546928",
"0.5542242",
"0.55255675",
"0.5521126",
"0.5515783",
"0.5510806",
"0.55102736",
"0.5507277",
"0.55056643",
"0.55025756",
"0.55016565",
"0.55001295",
"0.54840684",
"0.54747224",
"0.5467428",
"0.54465437",
"0.54377407",
"0.5437252",
"0.54351485",
"0.5423255",
"0.5419937",
"0.54082537",
"0.54012316",
"0.53999746",
"0.53949994",
"0.53821135",
"0.53818923",
"0.537942",
"0.5360466",
"0.53567404",
"0.5355661",
"0.5339279"
]
| 0.80675614 | 1 |
Get the controller instance for the route. | public function getController()
{
$class = $this->parseControllerCallback()[0];
if (! $this->controller) {
$this->controller = $this->container->make("App\\Controllers\\".$class);
}
return $this->controller;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getController(): Controller {\n\t\t$action = Check::key( $this->request->get( 'action' ), '' );\n\n\t\tif ( !$action ) {\n\t\t\treturn $this->getDefaultController();\n\t\t}\n\n\t\t$controller_class = $this->controller_namespace . $action;\n\n\t\tif ( !\\class_exists( $controller_class ) ) {\n\t\t\treturn $this->getDefaultController();\n\t\t}\n\n\t\treturn $this->instanceController( $controller_class );\n\t}",
"public static function controller()\n\t{\n\t\treturn self::$router->getController();\n\t}",
"public function getController()\n {\n if (!empty($this->_registry)) {\n return $this->_registry->getController();\n }\n\n return $this->_Controller;\n }",
"private function getControllerToRun()\n {\n $routing = $this->getRouting();\n $module = strtolower($this->urlParams[self::PARAM_CONTROLLER]);\n \n $module = strtr($module, '-', '_');\n \n // Check if we have routing to this module\n if (isset($routing[$this->apiType][$module])) {\n $controllerName = $routing[$this->apiType][$module];\n } else {\n // Call default controller\n $controllerName = $routing[$this->apiType][self::DEFAULT_CONTROLLER_ROUTE_NAME];\n }\n \n if (class_exists($controllerName)) {\n return new $controllerName();\n }\n \n self::debug(\"Fatal error: Controller ({$controllerName}) not found\");\n }",
"public function getController()\n {\n return $this->Controller();\n }",
"public function getController()\n {\n return $this->__get($this->getControllerKey());\n }",
"public function getController()\n {\n $match = $this->_getMatch();\n return $match[0];\n }",
"public function controller()\n {\n if ($this->controller === null) {\n return $this->defaultController();\n }\n\n return $this->controller;\n }",
"public function getController()\n {\n return $this->getContext()->getController();\n }",
"public function getController()\n {\n if (is_null($this->_controller)) {\n $controller = $this->getConfiguration()\n ->get('router.controller', 'pages');\n if (isset($this->_params['controller'])) {\n $controller = $this->_params['controller'];\n }\n $this->_controllerName = $controller;\n $this->_controller = trim(\n \"{$this->namespace}\\\\\". ucfirst($controller),\n '\\\\'\n );\n }\n return $this->_controller;\n }",
"protected function getController()\n\t{\n\t\treturn $this->controller;\n\t}",
"private function getController() {\n\n $controller = 'index';\n $action = 'index';\n\n if ($this->route) {\n\n /**\n * Get the controller and/or action from the route.\n *\n * 0: Controller\n * 1: Action\n * 2+: Additional params\n */\n $controller = request::getRoute(0);\n if(request::getRoute(1)) {\n $action = request::getRoute(1);\n }\n\n /**\n * Loop through and gather any params that\n * might be accompanying the route.\n */\n $done = false;\n $index = 2;\n while (!$done) {\n if (request::getRoute($index)) {\n array_push($this->params, request::getRoute($index));\n $index++;\n } else {\n $done = true;\n }\n }\n\n }\n\n // Set the controller and action.\n $this->controller = $controller;\n $this->action = $action;\n\n // set the file path\n $this->file = $this->path .'/'. $this->controller . '.php';\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function getController()\n {\n return $this->controller;\n }",
"public function GetController () {\n\t\treturn $this->controller;\n\t}",
"public function getController($route)\n {\n // Get the controller name based on the route patterns and requested route.\n $name = $this->parseRoute($route);\n\n // controller.task\n $task = $this->app->input->getCmd('task');\n if (strpos($task,'.') && $name == '\\Controller\\DefaultController') {\n $parts = explode('.',$task);\n $controller = $parts[0];\n $controllerTask = sprintf('\\\\Controller\\\\%sController', $controller);\n $class_name = $this->controllerPrefix.$controllerTask;\n if (class_exists($this->controllerPrefix.$controllerTask)) {\n $name = $controllerTask;\n // set task value\n $this->app->input->set('task', $parts[1]);\n }\n }\n\n // Get the controller object by name.\n return $this->fetchController($name);\n }",
"public function getController()\n {\n return $this->_controller;\n }",
"public function getController()\n {\n return $this->_controller;\n }",
"public function getController() {\n return $this->controller;\n }",
"public function getController() {\n \n return $this->controller;\n \n }",
"public function getController() {\r\n\t\treturn $this->controllerObject;\r\n\t}",
"public function getController()\n\t{\n\t\treturn $this->controller;\n\t}",
"public function getController()\n\t{\n\t\treturn $this->controller;\n\t}",
"public function get_route_to_controller(){\n\t\treturn $this->route_to_controller;\n\t}",
"function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}",
"protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }",
"public function getController( );",
"public function getController();",
"public function getController();",
"public function getController();",
"protected function _getController()\n\t{\n\t\treturn $this->_registry->getController();\n\t}",
"public static function getController()\n {\n return self::getInstance()->urlParams[self::PARAM_CONTROLLER];\n }",
"public static function getRouteControllerClass()\r\n {\r\n $route = self::getRouteResolve();\r\n\r\n if(isset($route['class'])){\r\n return $route['class'];\r\n }\r\n\r\n return null;\r\n }",
"public function get_controller()\n {\n return $this->_controller;\n }",
"function getController() {\n\t\treturn $this->Controller;\n\t}",
"public function get_controller() {\n\t\treturn $this->controller;\n\t}",
"public function get_controller() {\r\n\t\treturn $this->controller;\r\n\t}",
"public function getController() {\n \t\n \t// Return our controller\n \treturn $this->sController;\n }",
"public function getController()\n {\n return $this->sController;\n }",
"protected function _getController($route)\n {\n $ctrlClass = $this->_getControllerClassName($route);\n $this->_controller = new $ctrlClass;\n \n if (!is_subclass_of($this->_controller, 'Konekt_Framework_Core_Controller_Abstract')) {\n return false;\n }\n \n return $this->_controller;\n }",
"public function route()\n\t{\n\t\t$this->request = $this->getRequest();\n\n\t\t$controller_name = 'app\\controllers\\Controller' . ucfirst($this->request->getController());\n\t\t$action_name = 'Action'.ucfirst($this->request->getAction());\n\n\t\tif(!class_exists($controller_name)){\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\n\t\t$controller = new $controller_name;\n\n\t\tif(method_exists($controller, $action_name)){\n\t\t\t$response = $controller->$action_name();\n\t\t\treturn $response ? $response : static::app()->response;\n\t\t} else {\n\t\t\tthrow new NotFoundException('Not found route: ' . $this->request->getPath());\n\t\t}\n\t}",
"protected function _controller() {\n\t\treturn $this->_container->controller;\n\t}",
"public function & GetController ();",
"public function getController($constraint = null) {\n\t\t$r = new \\ReflectionClass($this->controllerClass);\n\t\treturn $r->newInstanceArgs($constraint);\n\t}",
"function get_controller() {\n\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n return $parts[2];\n }\n return null;\n }",
"public function controller()\n {\n return $this->controller;\n }",
"public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }",
"static public function controller() {\n\t\treturn self::$controller;\n\t}",
"public function getController() {\n if (!$this->controller instanceof baxe_App_Web_Controller_Abstract) {\n $this->controller = new baxe_App_Web_Controller_Front($this);\n }\n return $this->controller;\n }",
"public function getController()\n {\n return $this->str_controller;\n }",
"public function getControllerAction()\n {\n $router = $this->serviceManager->get('router');\n $request = $this->serviceManager->get('request');\n $routeMatch = $this->serviceManager->get('Application')->getMvcEvent()->getRouteMatch();\n $routeMatch = $router->match($request);\n if (!is_null($routeMatch)) {\n //echo $routeMatch->getMatchedRouteName();\n $controller = strtolower($routeMatch->getParam('controller'));\n $action = strtolower($routeMatch->getParam('action'));\n $this->controller_action = sprintf(\"%s_%s\", strtolower($controller), strtolower($action));\n } else {\n $this->controller_action = 'application_index';\n }\n }",
"public function getController() {\n\n\t\t\t$masterView = new \\permag\\view\\MasterView();\n\n\t\t\tif (isset($_GET[self::PAGE_CONTROLLER]) && $_GET[self::PAGE_CONTROLLER] != '') {\n\t\t\t\treturn $_GET[self::PAGE_CONTROLLER];\n\t\t\t\n\t\t\t} else {\n\t\t\t\t$this->redirectTo($this->getHomeLink());\n\n\t\t\t}\n\t\t}",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }",
"public function getController()\n\t{\n\t\t$className = strtolower(get_class($this));\n\t\t$className = preg_replace('/_controller$/', '', $className);\n\n\t\treturn $className;\n\t}",
"public function getController()\n\t{\t\n\n\t\t$parsed = $this->getAsArray();\n\t\t\n\t\tif( ! empty($parsed) )\n\t\t{\n\t\t\tif( $this->getPrefix() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t\tif( ! empty($parsed) )\n\t\t\t{\n\t\t\t\treturn $parsed[0];\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function getControllerFromPath($path = NULL, ResourceInterface $resource = NULL);",
"public function activeController()\n {\n return $this->controller;\n }",
"public function routeController()\n\t{\n\t\t$action = \"actionIndex\";\n\n\t\tif (isset($_GET[\"p\"]))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$params = array_filter(explode(\"/\", $_GET[\"p\"]));\n\n\t\t\tif (count($params) != 1)\n\t\t\t{\n\t\t\t\t$action = \"action\";\n\n\t\t\t\tfor ($i = 1; $i < count($params); $i++)\n\t\t\t\t{\n\t\t\t\t\t$action .= ucwords($params[$i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$controller = \"Controller_\" . ucwords($params[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcall_user_func(array(new Controller_Index(), $action));\n\t\t\texit();\n\t\t}\n\n\t\tif (isset($controller) && class_exists($controller))\n\t\t{\n\t\t\tif (method_exists(new $controller(), $action))\n\t\t\t{\n\t\t\t\tcall_user_func(array(new $controller(), $action));\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//call_user_func(array(new Controller_Error(), \"actionIndex\"));\n\t\t\tcall_user_func(array(new Controller_Index(), \"actionIndex\"));\n\t\t\texit();\n\t\t}\n\t}",
"public function getControllerName()\n {\n $current = static::class;\n $ancestry = ClassInfo::ancestry($current);\n $controller = null;\n while ($class = array_pop($ancestry)) {\n if ($class === self::class) {\n break;\n }\n if (class_exists($candidate = sprintf('%sController', $class))) {\n $controller = $candidate;\n break;\n }\n $candidate = sprintf('%sController', str_replace('\\\\Model\\\\', '\\\\Control\\\\', $class));\n if (class_exists($candidate)) {\n $controller = $candidate;\n break;\n }\n }\n if ($controller) {\n return $controller;\n }\n return PageController::class;\n }",
"public function getController()\n {\n return $this->joUrl['CONTROLLER'];\n }",
"public function getController(): string\n {\n return $this->controller;\n }",
"public function getController(): string\n {\n return $this->controller;\n }",
"private function getUserFormController()\n {\n if ($this->userFormController) {\n return $this->userFormController;\n } else {\n if ($this->UserForm()->exists()) {\n return $this->userFormController = new UserDefinedForm_Controller($this->UserForm());\n }\n }\n\n return $this->userFormController = null;\n }",
"public static function getController($method, $url)\n {\n // Si obtuvimos una url parametrizada,\n // la retornamos.\n if(!is_null(self::$controllerAction)) {\n return self::$controllerAction;\n }\n\n return self::$routes[$method][$url];\n }",
"public function controller_for($url, &$parameters, $method = 'get') {\n $url = $this->normalize($url);\n $params = $parameters;\n \n // walk the routes\n foreach ($this->routes as $route) {\n if ($route->match($url, $method, $params)) {\n \n // a controller must be specified\n if (!isset($params['controller'])) {\n $this->logger()->error(\"No controller specified for route #\".$route->position());\n continue;\n }\n \n // and the class must exist\n $class = $this->controller_class($params['controller']);\n if (!class_exists($class)) {\n $this->logger()->error(\"No such controller class \\\"$class\\\"\");\n continue;\n }\n \n // ok, we're good to go\n $parameters = $params;\n return new $class();\n }\n }\n \n // no match\n return $this->error_route('404', 'Not Found', $method, $parameters);\n }",
"public function getRouteController(PageInterface $page, $routePath)\n {\n $skin = $page->getSkin();\n if (method_exists($skin, 'getThemeNamespaces')) {\n $controllerName = str_replace('/', ' ', $routePath);\n $controllerName = str_replace(' ', '\\\\', ucwords($controllerName));\n $controllerName = str_replace(' ', '', ucwords(str_replace('-', ' ', str_replace('_', '-', $controllerName))));\n $controllerClasses = ['%s\\Controller\\%sController', '%s\\Controller\\%s\\IndexController'];\n foreach ($skin->getThemeNamespaces() as $ns) {\n foreach ($controllerClasses as $controllerClass) {\n $controllerClass = sprintf($controllerClass, $ns, $controllerName);\n if (class_exists($controllerClass)) {\n return $controllerClass;\n }\n }\n }\n }\n return null;\n }",
"public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }",
"public function getController() {\n\t\tif (isset($_GET[$this->config->get('controllerParam')]))\n\t\t\t$controller = clearPath(urldecode($_GET[$this->config->get('controllerParam')]));\n\t\telse\n\t\t\t$controller = clearPath($this->config->get('defaultController'));\n\t\t\n\t\treturn strtolower($controller);\n\t}",
"public function getController() //string(4) \"home\"\n {\n \n return $this->controller;\n\n }",
"final protected function getController()\n {\n if (!$this->controller) {\n $this->controller = entity_get_controller($this->entityType);\n\n if (!$this->controller) {\n throw new \\InvalidArgumentException(sprintf(\"%s: entity type does not exist\", $this->entityType));\n }\n }\n\n return $this->controller;\n }",
"public function GetController ();",
"public function getAccessController() {\n\t\tif (!$this->accessController) {\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Authentication Provider\n\t\t\t$accessControllerClass = 'Tx_' . $extension . '_Rest_AccessController';\n\t\t\tif (!class_exists($accessControllerClass)) {\n\t\t\t\t$accessControllerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\AccessController';\n\t\t\t}\n\n\t\t\t// Use the configuration based Authentication Provider\n\t\t\tif (!class_exists($accessControllerClass)) {\n\t\t\t\t$accessControllerClass = 'Cundd\\\\Rest\\\\Access\\\\ConfigurationBasedAccessController';\n\t\t\t}\n\t\t\t$this->accessController = $this->get($accessControllerClass);\n\t\t\t$this->accessController->setRequest($this->dispatcher->getRequest());\n\t\t}\n\t\treturn $this->accessController;\n\t}",
"public function withController($controller): Route;",
"public function getController()\n {\n return ucfirst($this->controller).'Controller';\n }",
"function getController($context) {\n\t\t$uri=$context->getURI();\n\t\t$path=$uri->getPart();\n\t\tswitch ($path) {\n\t\t\tcase 'admin':\n\t\t\t\treturn getAdminController($context);\n\t\t\tcase '':\n\t\t\t\t$uri->prependPart('home');\n\t\t\t\treturn 'Static';\n\t\t\tcase 'static':\n\t\t\t\treturn 'Static';\n\t\t\tcase 'login':\n\t\t\t\treturn 'Login';\n\t\t\tcase 'logout':\n\t\t\t\treturn 'Logout';\n\t\t\tcase \"checkout\":\n\t\t\t\treturn \"Checkout\";\n\t\t\tcase \"myShoppingCart\":\n\t\t\t return \"ShoppingCart\";\n\t\t\tdefault:\n\t\t\t\tthrow new InvalidRequestException (\"No such page \");\n\t\t}\n\t}",
"private function getDefaultController(): Controller {\n\t\t$default_controller_class = $this->controller_namespace . self::DEFAULT_CONTROLLER;\n\n\t\treturn $this->instanceController( $default_controller_class );\n\t}",
"public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }",
"public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}",
"protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }",
"public function GetControllerClass ();",
"public function getDefaultController() {\r\n\t\treturn $this->defaultController;\r\n\t}",
"private function getRealController(): RealController\n {\n /*\n * I have to pass container to the controller to avoid exception:\n * Call to a member function get() on null\n *\n * in method:\n * \\Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerTrait::generateUrl()\n *\n * caused by call of \"get()\" method:\n * $this->container->get()\n */\n $controller = new RealController($this->requestService);\n $controller->setContainer(static::getContainer());\n\n return $controller;\n }",
"function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }",
"public function rt() {\n\t\treturn $this->controller;\n\t}",
"private function getController($controller) {\n if (isset($this->routes[$controller])) {\n return $this->routes[$controller];\n }\n\n return null;\n }",
"public function getControllerClass()\n {\n if (file_exists($this->getFolder() . '/controller.php')) {\n return $this->getNamespace() . '\\\\Controller';\n }\n return BaseController::class;\n }",
"public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}",
"public function getViewController()\n {\n return new ezpRestApiViewController();\n }",
"public function controller()\n {\n return isset($this->controller) ? $this->controller : false;\n }",
"public function getControllerAction() {}",
"public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }"
]
| [
"0.77019906",
"0.745486",
"0.7453814",
"0.745137",
"0.7444927",
"0.7393769",
"0.73855036",
"0.73601127",
"0.72157294",
"0.7184482",
"0.7173024",
"0.71430147",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7141726",
"0.7104458",
"0.70929277",
"0.70842683",
"0.70842683",
"0.70785016",
"0.7053007",
"0.69903135",
"0.699012",
"0.699012",
"0.69884557",
"0.69732296",
"0.69674075",
"0.6964154",
"0.694838",
"0.694838",
"0.694838",
"0.6931875",
"0.69114923",
"0.69101983",
"0.69037884",
"0.68869203",
"0.68844676",
"0.68829525",
"0.6882074",
"0.6861274",
"0.68420964",
"0.683876",
"0.67616695",
"0.67510664",
"0.6701854",
"0.6657258",
"0.66570604",
"0.6645201",
"0.6584667",
"0.6580804",
"0.6567368",
"0.65077657",
"0.65001297",
"0.6433459",
"0.6425956",
"0.6377435",
"0.6368542",
"0.636813",
"0.63232464",
"0.6294456",
"0.62861",
"0.62854755",
"0.62854755",
"0.6280765",
"0.62720734",
"0.6272017",
"0.625552",
"0.6253257",
"0.6243107",
"0.62089103",
"0.62037396",
"0.6178823",
"0.6171437",
"0.61557907",
"0.6154077",
"0.6149703",
"0.6125971",
"0.61239576",
"0.60974926",
"0.608286",
"0.60616916",
"0.60409355",
"0.6030723",
"0.6025456",
"0.6022814",
"0.6020248",
"0.60076344",
"0.59865487",
"0.59537524",
"0.5950316",
"0.59489566",
"0.59304786"
]
| 0.7734427 | 0 |
Get the controller method used for the route. | public function getControllerMethod()
{
return $this->parseControllerCallback()[1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getRouteControllerMethod()\r\n {\r\n $route = self::getRouteResolve();\r\n\r\n if(isset($route['method'])){\r\n return $route['method'];\r\n }\r\n\r\n return null;\r\n }",
"public function controllerMethod()\n {\n return $this->controllerMethod;\n }",
"public static function getMethod()\n {\n return ! empty(self::getInstance()->urlParams[self::PARAM_METHOD]) ? self::getInstance()->urlParams[self::PARAM_METHOD] : self::DEFAULT_CONTROLLER_ACTION;\n }",
"function get_method() {\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 3) {\n return $parts[3];\n }\n return 'index';\n }",
"function current_route_method()\n {\n return RouteController::getCurrentRoute()['method'] ?? '';\n }",
"public static function method()\n\t{\n\t\treturn self::$router->getAction();\n\t}",
"public function fetch_method()\n\t{\n\t\t$method = $this->route_stack[self::SEG_METHOD];\n\t\treturn ($method === $this->fetch_class()) ? 'index' : $method;\n\t}",
"function route_method(): string\n{\n return RouteController::getCurrentRoute()['method'] ?? '';\n}",
"public function getMethod()\t{\n\t\tif ($this->class != \"NoRoute\")\t{\n\t\t\treturn $this->method;\n\t\t}\n\t\treturn \"invoke\";\n\t}",
"public function GetControllerAction () {\n\t\treturn $this->controller . ':' . $this->action;\n\t}",
"public static function method()\n\t{\n\t\treturn $_SERVER['REQUEST_METHOD'];\n\t}",
"public function getActionMethod()\n {\n return array_last(explode('@', $this->getActionName()));\n }",
"public static function method()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"public static function method()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"public function method(): string\n {\n return \\strtoupper($this->request()->getMethod());\n }",
"public static function getMethod()\n {\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n\n return $method;\n }",
"public function getControllerActionName() {}",
"public function getMethod()\n {\n return strtoupper($this->server['REQUEST_METHOD']);\n }",
"public function method(): string\n {\n return $this->request->getMethod();\n }",
"public function method(): string\n {\n return $this->request->getMethod();\n }",
"public function method(): string\n {\n return $this->request->getMethod();\n }",
"public function getMethodInvokerName()\n {\n return $this->action['controller'] ?? 'Closure';\n }",
"public function getMethod(): string {\n\n return strtoupper($_SERVER['REQUEST_METHOD']);\n }",
"public function get_route_to_controller(){\n\t\treturn $this->route_to_controller;\n\t}",
"public function method() {\n\t\treturn strtoupper($this->getMethod());\n\t}",
"public static function method(): string\n\t{\n\t\treturn strtoupper(Server::get('REQUEST_METHOD'));\n\t}",
"public function getMethod() {\n\t\tif (isset($_GET[$this->config->get('methodParam')]))\n\t\t\t$method = urldecode($_GET[$this->config->get('methodParam')]);\n\t\telse\n\t\t\t$method = $this->config->get('defaultMethod');\n\t\t\n\t\treturn strtolower($method);\n\t}",
"public static function getMethod()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"static function method(): string\n\t{\n\t\treturn $_SERVER['REQUEST_METHOD'];\n\t}",
"public function getController()\n {\n return ucfirst($this->controller).'Controller';\n }",
"private static function get_method(){\n\t\t\tif(!self::$method)\n\t\t\t\tself::$method = $_SERVER['REQUEST_METHOD'];\n\t\t\t\t\n\t\t\treturn strtolower(self::$method);\n\t\t}",
"public function getMethod()\n {\n return $this->server->get('REQUEST_METHOD');\n }",
"public function getMethod()\n {\n return $_SERVER['REQUEST_METHOD'];\n }",
"public function getMethod(): ?string { return $this->server->get('REQUEST_METHOD'); }",
"public function get_method() {\n\t\treturn $this->method;\n\t}",
"public static function getMethod() {\n\t if(!isset(self::$method)) {\n\t self::$method = isset($_SERVER['REQUEST_METHOD'])\n\t ? $_SERVER['REQUEST_METHOD']\n\t : null;\n\t }\n\t return self::$method;\n\t}",
"public function getMethod()\n {\n if($this->_method == NULL || !isset($this->_method))\n {\n $this->_method = substr(get_class($this),3);\n }\n \n return $this->_method;\n }",
"public function getMethod()\n {\n return $this->getServer('REQUEST_METHOD');\n }",
"public function getMethod(): string\n {\n return (string)$this->env['REQUEST_METHOD'];\n }",
"public function method()\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public static function method(){\n \n return self::$request->getMethod(); \n }",
"public function getActionName()\n {\n return isset($this->action['controller']) ? $this->action['controller'] : 'Closure';\n }",
"public function getControllerAction() {}",
"public function method() {\n return $this->method;\n }",
"public function getRequestMethod()\n {\n if (is_null($this->method)) {\n $server = provider::access('server');\n\n if ($server->isExist('REQUEST_METHOD') && $server->isValid('REQUEST_METHOD', validate::T_PRINTABLE)) {\n $this->method = strtoupper($server->getValue('REQUEST_METHOD'));\n }\n }\n\n return $this->method;\n }",
"public static function getMethod(): ?string {\r\n return isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : null;\r\n }",
"public function getMethod()\n {\n return $this->getParam('server/REQUEST_METHOD');\n }",
"public function get_method() {\n return $this->_method;\n }",
"public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->{$method}() )\n\t\t\t{\n\t\t\t\tarray_shift($parsed);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( empty($parsed) )\n\t\t{\n\t\t\t$action = $this->default_action;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$action = $parsed[0];\n\t\t}\n\t\t\n\t\t$prefix = $this->getPrefix();\n\t\t\n\t\tif( $prefix )\n\t\t{\n\t\t\t$action = $prefix . '_' . $action;\n\t\t}\n\t\t\n\t\treturn $action;\n\t\t\n\t}",
"public static function getController()\n {\n return self::getInstance()->urlParams[self::PARAM_CONTROLLER];\n }",
"protected function getMethod(): string\n {\n return $this->getTwoStep() ? 'rest/registerPreAuth.do' : 'rest/register.do';\n }",
"public function getMethod()\n {\n return filter_input(INPUT_SERVER, 'REQUEST_METHOD');\n }",
"public function getMethod()\n {\n if (isset($_POST[$this->methodParam])) {\n return strtoupper($_POST[$this->methodParam]);\n } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } else {\n return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';\n }\n }",
"public static function getCurrentRoute() {\t\t\n\t\t$route = self::$controller.'/'.self::$method;\n\t\tif( !empty(self::$parameters) ) {\n\t\t\t$route .= '/'.implode('/', self::$parameters);\n\t\t}\n\t\t\n\t\treturn $route;\n\t}",
"abstract public function getControllerAction();",
"public function getMethod()\r\n {\r\n if (isset($this->server['REQUEST_METHOD'])) {\r\n return strtoupper($this->server['REQUEST_METHOD']);\r\n }\r\n\r\n return 'GET';\r\n }",
"protected function resolveActionMethodName()\n {\n // sets correct $this->request actionMethodName:\n $actionMethodName = parent::resolveActionMethodName();\n // replace controllerContext sets which was set ini initializeController callec before actionMethod was replaced\n $this->controllerContext = new ControllerContext($this->request, $this->response, $this->arguments, $this->uriBuilder);\n return $actionMethodName;\n }",
"public function method(){\n return $this->getServerVar('REQUEST_METHOD');\n }",
"public function getController()\n {\n return $this->joUrl['CONTROLLER'];\n }",
"protected function resolveActionMethodName()\n\t{\n\t\tif ($this->request->getHttpRequest()->getMethod() === 'OPTIONS') {\n\t\t\t$this->request->setControllerActionName('options');\n\t\t}\n\t\tif ($this->request->getControllerActionName() === 'index') {\n\t\t\t$actionName = 'index';\n\t\t\tswitch ($this->request->getHttpRequest()->getMethod()) {\n\t\t\t\tcase 'HEAD':\n\t\t\t\tcase 'GET':\n\t\t\t\t\t$actionName = ($this->request->hasArgument(static::$RESOURCE_ARGUMENT_NAME)) ? 'show' : 'list';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'POST':\n\t\t\t\t\t$actionName = 'create';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'PUT':\n\t\t\t\tcase 'PATCH':\n\t\t\t\t\t$actionName = 'update';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'DELETE':\n\t\t\t\t\t$actionName = 'remove';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->request->setControllerActionName($actionName);\n\t\t}\n\n\t\treturn parent::resolveActionMethodName();\n\t}",
"public function method(): string\n {\n return $this->method;\n }",
"public function getRequestMethod()\n\t{\n\t\t$method = $this->server->get('REQUEST_METHOD');\n\t\tif(in_array(strtoupper($method),$this->methods))\n\t\t{\n\t\t\treturn $method;\n\t\t}\n\t\treturn ;\n\t}",
"public function method() {\n return $this->method;\n }",
"public function method()\n {\n return $this->_method;\n }",
"public function method()\n {\n return $this->_method;\n }",
"public function route() {\n\t\t$method = $_SERVER['REQUEST_METHOD'];\n\t\t$request = (isset($_SERVER['PATH_INFO'])) ? explode(\"/\", trim($_SERVER['PATH_INFO'], \"/\")) : \"\";\n\t\t\n\t\treturn $this->routeRequest($method, $request);\n\t}",
"public function getController(): string\n {\n return $this->controller;\n }",
"public function getController(): string\n {\n return $this->controller;\n }",
"public function GetMethod () {\n\t\treturn $this->method;\n\t}",
"public function GetMethod() {\n\n $Server= $this->GetRequestContext()->SERVER;\n $Method= $Server['REQUEST_METHOD']; // it is always present\n\n // for XMLHttpRequest request return 'AJAX'\n if (isset($this->Headers['X-REQUESTED-WITH']) && $this->Headers['X-REQUESTED-WITH'] === 'XMLHttpRequest'\n && $this->GetOption('AcceptAjaxAsMethod')) {\n return 'AJAX';\n }\n\n // honor 'X-HTTP-METHOD-OVERRIDE' header\n if ($Method === 'POST' && isset($this->Headers['X-HTTP-METHOD-OVERRIDE'])) {\n return strtoupper($this->Headers['X-HTTP-METHOD-OVERRIDE']);\n }\n\n // override with custom method\n $Key= $this->GetOption('OverrideMethodField');\n $Post= $this->GetRequestContext()->POST;\n if ($Method === 'POST' && isset($Post[$Key])) {\n return strtoupper($Post[$Key]);\n }\n\n // return original value\n return $Method;\n }",
"public function showMethod (Request $request) \n {\n // return method used on route\n return $request->method();\n }",
"public function requestMethod(){\n return strtolower($_SERVER['REQUEST_METHOD']);\n }",
"function get_controller() {\n\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n return $parts[2];\n }\n return null;\n }",
"public function method(): string\n {\n return $this->getMethod();\n }",
"public function getController() : string\n {\n return substr($this->uri, 0, -strlen($this->match)) .\n $this->replacement;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->method ?: 'GET';\n }",
"protected function __get_method()\n\t{\n\t\t$method = $this->env['REQUEST_METHOD'];\n\n\t\tif ($method == 'POST' && !empty($this->request_parameters['_method']))\n\t\t{\n\t\t\t$method = $this->request_parameters['_method'];\n\t\t}\n\n\t\t$method = strtolower($method);\n\n\t\tif (!in_array($method, self::$methods))\n\t\t{\n\t\t\tthrow new Exception('Unsupported request method: %method', array('%method' => $method), 400);\n\t\t}\n\n\t\treturn $method;\n\t}",
"public function getController() {\n\t\tif (isset($_GET[$this->config->get('controllerParam')]))\n\t\t\t$controller = clearPath(urldecode($_GET[$this->config->get('controllerParam')]));\n\t\telse\n\t\t\t$controller = clearPath($this->config->get('defaultController'));\n\t\t\n\t\treturn strtolower($controller);\n\t}",
"private function getRouteAction($route)\n {\n return ($this->isClosureRoute($route)) ? 'Closure' : 'Controller';\n }",
"protected function getRequestMethod() {\n\t\tif($this->_requestMethod === null) {\n\t\t\t$this->_requestMethod = $_SERVER['REQUEST_METHOD'];\n\t\t}\n\t\treturn $this->_requestMethod;\n\t}",
"public function getAction()\n\t{\n\t\t$action = strtolower($this->getParam(self::ACTION_PARAM));\n\t\tif ($action === '' or ! preg_match('/^[a-z0-9_-]+$/', $action)) {\n\t\t\treturn Controller::DEFAULT_ACTION;\n\t\t}\n\n\t\treturn $action;\n\t}",
"public function getController()\n {\n $match = $this->_getMatch();\n return $match[0];\n }",
"public function getController()\n {\n return $this->str_controller;\n }",
"private function method(): ?string\r\n {\r\n return $_SERVER['REQUEST_METHOD'] ?? NULL;\r\n }",
"protected function getMethod(): string\n {\n if (strlen($this->method) == 0) {\n $this->method = 'get';\n }\n return $this->method;\n }",
"protected function getRouteName()\n {\n if (is_null($this->routeName)) {\n $this->routeName = $this->getCurrentCallingControllerName();\n }\n\n return $this->routeName;\n }",
"protected function getMethod() {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->values[\"method\"];\n }",
"public function getControllerName() {}",
"public function getCustomController()\n {\n $controllerName = ucfirst(str_replace('post_', '', $this->slug));\n return $controllerName.'Controller';\n }",
"public function getMethod()\n {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->method;\n }",
"public function getMethod()\n {\n return $this->method;\n }"
]
| [
"0.86962616",
"0.83992755",
"0.7784474",
"0.7744026",
"0.7578295",
"0.75071746",
"0.74318904",
"0.7426495",
"0.73498213",
"0.7324387",
"0.72632235",
"0.7256106",
"0.72472894",
"0.72472894",
"0.72044474",
"0.71953005",
"0.71917975",
"0.7152061",
"0.7139798",
"0.7139798",
"0.7139798",
"0.7116103",
"0.7105873",
"0.71039164",
"0.7090992",
"0.7075315",
"0.7053367",
"0.70352376",
"0.70255536",
"0.7013366",
"0.70119417",
"0.7008421",
"0.69917965",
"0.69608086",
"0.6935143",
"0.6922787",
"0.6902066",
"0.689842",
"0.6896559",
"0.68942624",
"0.68942624",
"0.68942624",
"0.68928987",
"0.6891968",
"0.68820816",
"0.68780464",
"0.68736917",
"0.6868866",
"0.6853768",
"0.68516487",
"0.68342406",
"0.6833507",
"0.68322873",
"0.6811543",
"0.68064326",
"0.67959607",
"0.679467",
"0.6774345",
"0.67741376",
"0.67715937",
"0.67616856",
"0.6759829",
"0.6756347",
"0.67543584",
"0.67451084",
"0.67401606",
"0.67401606",
"0.6730895",
"0.6730283",
"0.6730283",
"0.6725887",
"0.6723054",
"0.67220443",
"0.67192125",
"0.6695288",
"0.6694793",
"0.6690434",
"0.6687294",
"0.6687294",
"0.66834974",
"0.6680251",
"0.6670049",
"0.66669947",
"0.6659091",
"0.66524965",
"0.66462684",
"0.66438746",
"0.6643526",
"0.6639577",
"0.66324073",
"0.66314536",
"0.66230005",
"0.66168016",
"0.66075844",
"0.6601767",
"0.6601767",
"0.6601767",
"0.6601767",
"0.6601767",
"0.6601767"
]
| 0.8484391 | 1 |
Seed the application's database. | public function run()
{
Order::factory()->count(7)->create();
Category::factory()
->has(
Product::factory()
->has(
Ingredient::factory()->count(5)
)
->count(5)
)->count(5)
->create();
$this->call([
ProductSeeder::class,
CategorySeeder::class,
OrderSeeder::class
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}",
"protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }",
"protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }",
"public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }",
"public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }",
"public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }",
"protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }",
"public function seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }",
"protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }",
"public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }",
"public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('jpearson@ec4p.com');\n $this->seedUserAccount('jgpearson1@gmail.com');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }",
"public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }",
"public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}",
"public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }",
"public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }",
"public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }",
"protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }",
"public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => 'chrud66@example.com',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', 'chrud66@example.com')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('chrud66@example.com')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }",
"public function run()\n {\n $this->call(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }",
"public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}",
"public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => 'admin@example.org',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }",
"public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }",
"public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => 'admin@crm.com',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => 'staff@crm.com',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => 'customer@crm.com',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }",
"public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }",
"public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"public function run()\n {\n # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\n }",
"public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }",
"public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }",
"public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }",
"public function run()\n {\n DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }",
"public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }",
"public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => 'admin@admin.com',\n 'password' => Hash::make('12345678'),\n ]);\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }",
"public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }",
"public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }",
"public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\n }",
"public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }",
"public function run()\n {\n $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }",
"public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }",
"public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }",
"public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }",
"public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\n });*/\n }",
"public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => 'admin@mail.com',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => 'user@mail.com',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }",
"public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }",
"public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }",
"public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }",
"public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => 'foo@foo.com',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }",
"public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }",
"public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }",
"public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }",
"public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => 'correo@correo.com',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => 'correo2@correo.com',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => 'correo@correo.com',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s')\n ]); */\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\n }\n }\n }",
"public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }",
"public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }",
"public function run()\n {\n $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\n }",
"public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }",
"protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => 'peterwong.brisbane@gmail.com',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }",
"public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => 'admin@lig.com',\n 'password' => $password,\n ]);\n }",
"public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }",
"public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\n });\n }",
"public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }",
"public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\n }",
"public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }",
"public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }",
"public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }",
"public function run()\n {\n Model::unguard();\n\n if( !User::where('email', 'nbpalomino@gmail.com')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'nbpalomino@gmail.com'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\n }",
"public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }",
"public function run()\n {\n Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\n }",
"public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }",
"public function run()\n {\n $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }",
"public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }",
"public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }",
"public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }",
"public function run()\n {\n $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }",
"public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}",
"public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }",
"public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }",
"public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\n }",
"public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }",
"public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }"
]
| [
"0.80656344",
"0.7848881",
"0.7675292",
"0.7244225",
"0.7217565",
"0.7133432",
"0.7097866",
"0.70765376",
"0.7050091",
"0.6992686",
"0.6987265",
"0.6985281",
"0.69677085",
"0.6899853",
"0.68693805",
"0.6848007",
"0.68316054",
"0.68211395",
"0.6804046",
"0.6804046",
"0.68030554",
"0.67907983",
"0.67901367",
"0.6789082",
"0.67873317",
"0.67775625",
"0.6775607",
"0.6772966",
"0.6766751",
"0.6762704",
"0.6759577",
"0.6734889",
"0.6733905",
"0.67303914",
"0.67302465",
"0.672603",
"0.67237747",
"0.672354",
"0.6722578",
"0.6716178",
"0.6708093",
"0.670718",
"0.67044336",
"0.67035913",
"0.6703501",
"0.67031544",
"0.66976255",
"0.66945046",
"0.66876715",
"0.6685169",
"0.667935",
"0.66764027",
"0.66735506",
"0.66666955",
"0.6650536",
"0.6641681",
"0.6640682",
"0.6640362",
"0.663783",
"0.66345066",
"0.66310996",
"0.66287786",
"0.6626591",
"0.66185176",
"0.6611343",
"0.66033185",
"0.6601061",
"0.66002315",
"0.65974337",
"0.6597131",
"0.6593928",
"0.6593631",
"0.6593624",
"0.6589948",
"0.6582383",
"0.6581999",
"0.6581381",
"0.6580668",
"0.6576815",
"0.6575986",
"0.6575291",
"0.65719545",
"0.65704876",
"0.6569897",
"0.6563589",
"0.6561914",
"0.6560707",
"0.6559285",
"0.65567636",
"0.6555531",
"0.6551919",
"0.65494365",
"0.6548453",
"0.654637",
"0.65461946",
"0.6544901",
"0.6544256",
"0.6544193",
"0.65438366",
"0.65429187",
"0.6540024"
]
| 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request){
$validator = $request->validate([
'name' => 'required|string',
'email' => 'required|email',
'subject' => 'nullable|string',
'message' => 'required|string',
]);
$contact = new Contact();
$contact->name = $request->name;
$contact->email = $request->email;
$contact->subject = $request->subject;
$contact->message = $request->message;
if ($contact) {
$contact->save();
$this->admin = Admin::where('role','Super-Admin')->first();
$this->admin->notify(new MessageNotification($contact));
$notification = array(
'message' => 'Message Sent',
'alert-type' => 'success'
);
}else{
$notification = array(
'message' => $validator,
'alert-type' => 'error'
);
}
return back()->with($notification);
} | {
"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());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"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.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
]
| 0.0 | -1 |
/ Searches the 'Advising Appointments' table by the Advising Appointment's primary key and loads the properties from the Advising Appointment that matches the ID provided Returns null if no matching advising schedule model can be found in the database. | public function loadPropertiesFromPrimaryKey($advisingAppointmentID)
{
if($advisingAppointmentID != null && filter_var($advisingAppointmentID, FILTER_VALIDATE_INT))
{
$results = $this->db->get_where('AdvisingAppointments', array('AdvisingAppointmentID' => $advisingAppointmentID), 1);
if($results->num_rows() > 0)
{
$row = $results->row_array();
$this->advisingAppointmentID = $row['AdvisingAppointmentID'];
$this->advisingScheduleID = $row['AdvisingScheduleID'];
$this->startTime = $row['StartTime'];
$this->endTime = $row['EndTime'];
$results = $this->db->get_where('ScheduledAdvisingAppointments', array('AdvisingAppointmentID' => $advisingAppointmentID), 1);
if($results->num_rows() > 0)
{
$row = $results->row_array();
$this->advisingAppointmentStateID = $row['AppointmentStateID'];
$this->studentUserID = $row['StudentUserID'];
}
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show($id)\n {\n $appointment = Appointment::with('user', 'items')->findOrFail($id);\n\n }",
"public function findById(int $id): AppointmentEntity\n {\n return AppointmentEntity::fromResponse(\n $this->client->get(\"Appointments/$id\")\n );\n }",
"public function getAppointmentDetails($appointmentid){\r\n $userappointment = new UserAppoinment();\r\n if(!empty($appointmentid)){\r\n $getAppointment = $userappointment->getAppointment($appointmentid);\r\n if($getAppointment){\r\n return $getAppointment;\r\n }else{\r\n return FALSE;\r\n }\r\n }else{\r\n return FALSE;\r\n } \r\n }",
"public function show(Appointment $appointment)\n {\n //\n }",
"public function show(Appointment $appointment)\n {\n //\n }",
"public function getAppointments($id)\n {\n $search = request()->all();\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n\n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination($id, $search);\n \n return $appointments;\n \n }",
"public function get_appointment_detail($appointment_id) {\n\n $prescription_query = \"\n SELECT\n drug_name,\n prescription_drug_id, \n prescription_generic_name,\n prescription_unit_id,\n prescription_unit_value,\n prescription_frequency_id,\n prescription_frequency_value,\n prescription_frequency_instruction,\n prescription_intake,\n prescription_intake_instruction,\n prescription_duration,\n prescription_duration_value,\n prescription_diet_instruction,\n prescription_next_follow_up\n FROM \" . TBL_APPOINTMENTS . \" \n \n JOIN \" . TBL_PRESCRIPTION_REPORTS . \"\n ON prescription_appointment_id=appointment_id AND prescription_status=1\n JOIN \" . TBL_DRUGS . \"\n ON drug_id=prescription_drug_id AND drug_status=1\n WHERE\n prescription_appointment_id=\" . $appointment_id . \" AND\n prescription_status=1 AND\n prescription_share_status=1 AND \n drug_status=1\n \";\n\n $prescription_data = $this->get_all_rows_by_query($prescription_query);\n\n $vital_query = \"\n SELECT\n vital_signature_reports_weight,\n vital_signature_reports_bloodpressure,\n vital_signature_reports_pulse,\n vital_signature_reports_temperature,\n vital_signature_reports_resp_rate\n FROM \" . TBL_VITAL_REPORTS . \" \n WHERE\n vital_signature_reports_status=1 AND \n vital_signature_reports_share_status=1 AND \n vital_signature_reports_appointment_id=\" . $appointment_id . \" \n \";\n\n $vital_data = $this->get_all_rows_by_query($vital_query);\n\n $clinical_notes_query = \"\n SELECT\n clinical_notes_reports_kco,\n clinical_notes_reports_complaints,\n clinical_notes_reports_observation,\n clinical_notes_reports_diagnoses,\n clinical_notes_reports_add_notes\n FROM \" . TBL_CLINICAL_REPORTS . \" \n WHERE\n clinical_notes_reports_status=1 AND \n clinical_notes_reports_share_status=1 AND \n clinical_notes_reports_appointment_id=\" . $appointment_id . \" \n \";\n\n $clinical_data = $this->get_all_rows_by_query($clinical_notes_query);\n\n $procedure_query = \"\n SELECT\n procedure_report_procedure_text,\n procedure_report_note\n FROM \" . TBL_PROCEDURE_REPORTS . \" \n WHERE\n procedure_report_status=1 AND \n procedure_report_share_status=1 AND\n procedure_report_appointment_id=\" . $appointment_id . \" \n \";\n\n $procedure_data = $this->get_all_rows_by_query($procedure_query);\n\n return array(\n \"prescription_data\" => $prescription_data,\n \"clinical_data\" => $clinical_data,\n \"procedure_data\" => $procedure_data,\n \"vital_data\" => $vital_data\n );\n }",
"protected function findAppealModel($task_id) {\n $appeal = DemandAppeal::find()->where(['demand_task_id' => $task_id])\n ->orderBy('id desc')->one();\n \n if ($appeal !== null) {\n return $appeal;\n } else {\n return null;\n }\n }",
"public function handleExistAppointments($id){\n\n $appointments = DB::table('medical_appointments')\n ->join('users', 'medical_appointments.user', '=', 'users.id')\n ->where('workplace',$id)->wheredate('when', '>', Carbon::today())\n ->select('medical_appointments.*', 'users.name', 'users.profile_photo')\n ->get();\n\n if(count($appointments) > 0){\n foreach($appointments as $app){\n $app->when;\n }\n return $appointments;\n } \n else{ \n return 'null';\n }\n }",
"public static function LoadById($announcement_id)\n {\n \t$result = &get_instance()->db->get_where(\"Announcements\", array(\"announcement_id\" => $announcement_id));\n \t$result = $result->result();\n \treturn count($result) != 0 ? Announcement_model::LoadWithData($result[0]) : null;\n }",
"protected function doGet()\n {\n $apptId = intval($_GET['id']);\n try {\n $apptDetailBO = new AppointmentDetailBO();\n $this->appointmentDetail = $apptDetailBO->getAppointmentDetails($apptId);\n } catch (NoDataFoundException $e) {\n parent::setAlertErrorMessage($e->getMessage());\n }\n\n parent::doGet();\n\n }",
"public function getAppointments()\n {\n return $this->hasMany(Appointment::className(), ['id' => 'id']);\n }",
"public function loadAppointment() {\n $this->load->model(array('Doctor'));\n $doctor = new Doctor();\n\n $data['doctorList'] = $doctor->get();\n $this->load->view('patient/patient-appointment', $data);\n }",
"public function getAppointmentId()\n {\n return $this->appointmentId;\n }",
"function findAccessiblePatients($id, $allPatients, $sameSite) {\n $query = $this->getAccessiblePatientsQuery($id, $allPatients, \n\t $sameSite);\n $patients = $this->query($query[0] . $query[1]);\n\n $patients = $this->afterFind($patients);\n\n $thisProject = ClassRegistry::init('Project');\n $allProjects = \n $thisProject->find('all', \n array('recursive' => -1));\n // re-key to Project.id\n $allProjects = Hash::combine($allProjects, '{n}.Project.id', '{n}');\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), allProjects: ' . print_r($allProjects, true), LOG_DEBUG);\n\n $currentGmt = $this->currentGmt();\n\n // retrieve appts and add to data model\n foreach ($patients as &$patient){\n\n $appt = $this->Appointment->find('first', array(\n 'conditions' => array(\n 'Appointment.patient_id' => $patient['Patient']['id'],\n 'Appointment.datetime > \"' . $currentGmt . '\"'\n ),\n 'order' => 'Appointment.datetime DESC',\n 'recursive' => -1));\n if ($appt) {\n $patient['Patient']['next_appt_dt'] \n = $appt['Appointment']['datetime'];\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), found upcoming appt for patient id ' . $patient['Patient']['id'] . ': ' . print_r($appt, true), LOG_DEBUG);\n }\n else $patient['Patient']['next_appt_dt'] = '';\n \n $latestAppt = $this->Appointment->find('first', array(\n 'conditions' => array(\n 'Appointment.patient_id' => $patient['Patient']['id']\n ),\n 'order' => 'Appointment.datetime DESC',\n 'recursive' => -1));\n if ($latestAppt) {\n $patient['Patient']['latest_appt_dt'] \n = $latestAppt['Appointment']['datetime'];\n }\n else $patient['Patient']['latest_appt_dt'] = ''; \n\n $patient['SurveySession'] = array();\n $patient['SurveySession']['last_session_proj'] = '--';\n $patient['SurveySession']['last_session_date'] = '--';\n $patient['SurveySession']['last_session_status'] = '--';\n\n $lastSession = $this->SurveySession->find('first', array(\n 'conditions' => array(\n 'SurveySession.patient_id' => $patient['Patient']['id']\n ),\n 'order' => 'SurveySession.id DESC',\n 'recursive' => -1\n ));\n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), lastSession for patient id ' . $patient['Patient']['id'] . ': ' . print_r($lastSession, true), LOG_DEBUG);\n\n if (!$lastSession)\n continue;\n\n $lastSession = $lastSession['SurveySession'];\n\n $lastSessionsProjectId = $lastSession['project_id'];\n if (!isset($allProjects[$lastSessionsProjectId]))\n continue; // on the rare occasion that this project id no longer exists \n// $this->log(__CLASS__ . '.' . __FUNCTION__ . '(), lastSessionsProjectId for patient id ' . $patient['Patient']['id'] . ': ' . print_r($lastSessionsProjectId, true), LOG_DEBUG);\n\n $patient['SurveySession']['last_session_proj'] \n = $allProjects[$lastSessionsProjectId]['Project']['Title'];\n $patient['SurveySession']['last_session_date'] \n = $lastSession['reportable_datetime'];\n \n if ($lastSession['finished'] == 1)\n $patient['SurveySession']['last_session_status'] = 'finished';\n elseif ($lastSession['partial_finalization'] == 1)\n $patient['SurveySession']['last_session_status'] \n = 'partially finished';\n else\n $patient['SurveySession']['last_session_status'] = 'in process';\n\n }// foreach ($patients as &$patient){\n\n return $patients;\n //return $this->afterFind($patients); // not needed for the fields the calling fxn cares about\n }",
"function get($id) {\r\n\t\t$newsletterscheduleObj = NewsletterSchedulePeer::retrieveByPK($id);\r\n return $newsletterscheduleObj;\r\n }",
"public function scheduled_appointmentDetails($studentID)\n\t{\n\t\t$this->db->select(\"appointments.id, appointments.user_id, appointments.start_datetime, appointments.module_id,\n\t\t\t\t\t\t\tusers_details.fullname, users_details.phone, users_details.skype_id,\n\t\t\t\t\t\t\tmodule_details.course_title\");\n\t\t$this->db->from(\"appointments\")->join('users_details', 'appointments.user_id=users_details.id', 'LEFT')->join('module_details', 'appointments.module_id=module_details.id', 'LEFT');\n\t\t$this->db->where('user_id', $studentID);\n\t\t$res = $this->db->get();\n\t\tif($res->num_rows()){\n\t\t\t$result = $res->row_array();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function show($id)\n {\n //\n $appointment = Appointment::find($id);\n return response()->json($appointment, 200);\n }",
"public function show(Appointments $appointments)\n {\n //\n }",
"public static function forApartment($apartment_id) {\n\t\t\t\n\t\t\treturn ReservedDay::where('apartment_id', $apartment_id)->get();\n\t\t}",
"public function fetchData()\n {\n $invoice = InvoiceAppointment::leftjoin('appointments as appt','appt.id','invoice_appointment.detail_id')\n ->leftjoin('appointment_status as appt_stat','appt_stat.appt_id','invoice_appointment.detail_id')\n ->where(fn($query) => $query\n ->where( 'appt.name', 'like', '%' . $this->search . '%')\n ->orWhere('invoice_appointment.total', 'like', '%' . $this->search . '%')\n )\n ->orderBy($this->sortBy, $this->sortDirection)\n ->paginate($this->perPage);\n $this->invappt = $invoice;\n\n /*For notifications*/\n $appoint = Appointment::leftjoin('appointment_status as apts','apts.appt_id','appointments.id')\n ->where('apts.status','Pending')\n ->latest()->get();\n $this->appt = $appoint;\n }",
"public function show($id)\n {\n $appointment = Appointment::findOrFail($id);\n return view('admin.appointments.show')->with([\n 'appointment' => $appointment\n ]);\n }",
"public function getApptForSpecialist($id){\n\t\t$user=User::findOrFail($id);\n\t\t$profile=$user->profiles; \n\t\t$appointments=$user->appointments->where('available','1');\n\t\treturn view('appointments.availAppointments',compact('appointments','profile')); \n\t}",
"function get_assesment(){\n \n $assesm_db=$this->assesm_db;\n // query to read single record\n //It loads the data file and converts it to an array\n $assesm_data = file_get_contents($assesm_db);\n $assesm_json = json_decode($assesm_data, true);\n if (count($assesm_json)>0){\n $assesm_found=$assesm_json[$this->session_id];\n }else{\n $assesm_found=null;\n }\n \n // set values to object properties\n $this->session_id = $assesm_found['session_id'];\n $this->test = $assesm_found['test'];\n $this->taker = $assesm_found['taker'];\n }",
"public function show($ID){\n $data = Appointment::findOrFail($ID);\n $this->viewData['pageTitle'] = __('Appointment Data');\n $this->viewData['result'] = $data;\n\n $this->viewData['breadcrumb'] = [\n [\n 'text'=> __('Home'),\n 'url'=> url('system'),\n ],\n [\n 'text'=> __('Appointment'),\n 'url'=> route('system.appointment.index'),\n ],\n [\n 'text'=> __('Show Appointment')\n ]\n ];\n\n\n return $this->view('appointment.show',$this->viewData);\n }",
"public function show($id)\n {\n return $this->attendanceRepository->find($id);\n }",
"function getAppointments($disAccess){\n\t//echo \"<br>Get executed\";\n $db = dbConnect();\n\t\n\t// If disability access required\n\tif ($disAccess == 1){\n \t\t// Find appointments in future based on time and disability access\n \t \t$sql = \"SELECT Appointment.id, Appointment.start_date, Dentist.id AS 'dentist_id', Dentist.rating, Practice.lat, Practice.lng, Practice.city AS 'practice_city'\n\t\t\t \tFROM Appointment \n\t\t\t\t\tINNER JOIN PracticeDentist\n\t\t\t\t\t\tON Appointment.practiceDentist_id = PracticeDentist.id\n\t\t\t\t\tINNER JOIN Practice\n\t\t\t\t\t\tON PracticeDentist.practice_id = Practice.id \n\t\t\t\t\tINNER JOIN Dentist\n\t\t\t\t\t\tON PracticeDentist.dentist_id = Dentist.id\t\n\t\t\t\tWHERE Appointment.dis_access = 1 AND Appointment.start_date > DATE_ADD(NOW(), INTERVAL 45 MINUTE) AND Appointment.timestamp <= NOW() AND Appointment.type = 0 AND (Appointment.status = 0 OR Appointment.status = 1)\";\n\t// if disability access not required\n\t} else { \n\t\t// Find appointments in future based on time and no disability access\n \t \t$sql = \"SELECT Appointment.id, Appointment.start_date, Dentist.id AS 'dentist_id', Dentist.rating, Practice.lat, Practice.lng, Practice.city AS 'practice_city'\n\t\t\t \tFROM Appointment \n\t\t\t\t\tINNER JOIN PracticeDentist\n\t\t\t\t\t\tON Appointment.practiceDentist_id = PracticeDentist.id\n\t\t\t\t\tINNER JOIN Practice\n\t\t\t\t\t\tON PracticeDentist.practice_id = Practice.id \n\t\t\t\t\tINNER JOIN Dentist\n\t\t\t\t\t\tON PracticeDentist.dentist_id = Dentist.id\n\t\t\t\tWHERE (Appointment.status = 0 OR Appointment.status = 1) AND Appointment.start_date > DATE_ADD(NOW(), INTERVAL 45 MINUTE) AND Appointment.timestamp <= NOW() AND Appointment.type = 0\";\n\t}\n // Execute Query\n $result = $db->query($sql);\n // Return Result Array \n return $result;\n}",
"public function getAppointments ($id){\n $appointmentRequest = AppointmentRequest::where('id',$id)->first();\n $appointmentRequestId=$id;\n $parentId = $appointmentRequest->parent_id;\n //Retrieve parent and student details corresponding to the appointment request\n $parentDetails = UserDetails::where('user_id',$parentId)->first();\n $parentName = $parentDetails->name;\n $parentContact = $appointmentRequest->parentContact;\n $studentDetails = Student::where('parent_id',$parentId)->first();\n $studentId = $studentDetails->id;\n $studentName = $studentDetails->name;\n $gradeId = $studentDetails->grade_id;\n $gradeDetails = Grade::where('id',$gradeId)->first();\n $gradeName = $gradeDetails->grade_name;\n $reasonOfAppointment = $appointmentRequest->reasonOfAppointment;\n $cancellationReason = $appointmentRequest->cancellationReason;\n $requestType = $appointmentRequest->requestType;\n if($requestType == \"Parent Request\")\n $requestedBy = \"Parent\";\n else\n $requestedBy = \"You\";\n //Retrieve appointment slot corresponding to the appointment request\n $slotId=$appointmentRequest->teacherAppointmentsSlot_id;\n $slot = TeacherAppointmentSlots::where('id',$slotId)->first();\n $booked= $slot->isBooked;\n $awaited = $appointmentRequest->isAwaited;\n $confirmed = $appointmentRequest->isApproved;\n $cancelled = $appointmentRequest->isCancel;\n if ($awaited==1 && $confirmed==0 && $cancelled==0){\n $status = \"Awaited\";\n }\n elseif ($awaited==0 && $confirmed==1 && $cancelled==0){\n $status = \"Confirmed\";\n }\n elseif($awaited==0 && $confirmed==0 && $cancelled==1) {\n $status=\"Cancelled\";\n }\n else{\n $status = \"Invalid Status\";\n }\n //Retrieve appointment event corresponding to the appointment slot\n $eventId = $slot->calendarEventsId;\n $event = CalendarEvent::where('id',$eventId)->first();\n $title=$event->title;\n $start=$event->start;\n $end=$event->end;\n $teacherId = $appointmentRequest->teacher_id;\n $contactNo = $appointmentRequest->contactNo;\n $appointmentDetails= array(\n 'requestId' => $appointmentRequestId,\n 'parentName'=>$parentName,\n 'parentContact'=>$parentContact,\n 'studentId'=>$studentId,\n 'studentName'=>$studentName,\n 'grade'=>$gradeName,\n 'eventId'=>$eventId,\n 'title'=>$title,\n 'reasonOfAppointment'=>$reasonOfAppointment,\n 'cancellationReason'=>$cancellationReason,\n 'start'=>$start,\n 'end'=>$end,\n 'requestedBy'=>$requestedBy,\n 'status'=>$status,\n 'contact'=>$contactNo,\n 'teacherId'=>$teacherId\n );\n return $appointmentDetails;\n }",
"public function show($apt_id)\n {\n\n if($apt_id!=null){\n $doctor_with_his_her_patient= Auth::user()->doctor_with_his_patients();\n $dr_with_ptn= $doctor_with_his_her_patient->where('id',$apt_id)->first();\n\n $problems = Clinic_Problems::where('apt_problmes_id', $dr_with_ptn->id)->pluck('problems', 'id')->toArray();\n $observations = Clinic_Observations::where('apt_observations_id', $dr_with_ptn->id)->pluck('observations', 'id')->toArray();\n $diagnosis = Clinic_Diagnosis::where('apt_diagnoses_id', $dr_with_ptn->id)->pluck('diagnoses', 'id')->toArray();\n $investigations = Clinic_Investigations::where('apt_investigations_id', $dr_with_ptn->id)->pluck('investigations', 'id')->toArray();\n $notes_advices = clinicNotes_advices::where('apt_notes_adv_id', $dr_with_ptn->id)->pluck('notes_advices', 'id')->toArray();\n $prescriptions=Prescriptions::where(\"apt_id\",$apt_id)->get();\n $teeth_processes=Teeth_Process::where(\"apt_id\",$apt_id)->get();\n\n if($dr_with_ptn!=null){\n $date= Carbon::parse($dr_with_ptn->apt_date)->format(\"d/m/Y H:m\");\n return view('pages.Appointment_View',compact('dr_with_ptn',\"date\",\"problems\",\"observations\",\"diagnosis\",\"investigations\",\"investigations\",\"notes_advices\",\"prescriptions\",\"teeth_processes\"));\n }else{\n echo \"Kayıt incelemesi için doktor veya hasta kaydı bulunamadı. Yönlendiriliyorsunuz...\";\n return header('refresh:3;url=/Appointments');\n }\n\n }else{\n echo \"Hatalı URL Girişi yapıldı. Yönlendiriliyorsunuz...\";\n return header('refresh:2;url=/Appointments');\n }\n\n\n }",
"function load($pid)\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\t\t\r\n\t\tif ($dbh == null) {\r\n\t\t\t$dbh = openDB();\r\n\t\t\tif ($dbh == null)\r\n\t\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ($pid == \"\")\r\n\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t$sql = \"\r\n\t\t\tselect\r\n\t\tId,\r\n\t\tCompetitionId,\r\n\t\tDayNo,\r\n\t\tFirstStart,\r\n\t\tLastStart,\r\n\t\tMaxStation,\r\n\t\tPatrolSpace\r\n\t\tfrom tbl_Pistol_CompetitionDay\r\n\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t$result = mysqli_query($dbh,$sql);\r\n\t\tif ($obj = mysqli_fetch_object($result))\r\n\t\t{\r\n\t\t\t$this->id = $obj->Id;\r\n\t\t\t$this->competitionId = $obj->CompetitionId;\r\n\t\t\t$this->dayNo = $obj->DayNo;\r\n\t\t\t$this->firstStart = $obj->FirstStart;\r\n\t\t\t$this->lastStart = $obj->LastStart;\r\n\t\t\t$this->maxStation = $obj->MaxStation;\r\n\t\t\t$this->patrolSpace = $obj->PatrolSpace;\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\tmysqli_free_result($result);\r\n\t}",
"public function appointment()\n {\n return $this->hasMany('App\\Models\\Appointment');\n }",
"public function show(int $id) : EducationalActivityAttendance\n {\n return EducationalActivityAttendance::findOrFail($id);\n }",
"public function editappointment($id = null){\n $appointments_table = TableRegistry::get('Appointments');\n $users_table = TableRegistry::get('Users');\n $appointment = $appointments_table->get($id, [\n 'contain' => []\n ]);\n if ($this->request->is(['patch', 'post', 'put'])) {\n $appointment_time = $this->request->getData('appointment_time');\n $appointment_date = $this->request->getData('appointment_date');\n $time = $appointment_date.' '.$appointment_time;\n $appointment = $appointments_table->patchEntity($appointment, $this->request->getData());\n $appointment->appointment_date = date('Y-m-d H:i A', strtotime($time));\n if ($appointments_table->save($appointment)) {\n $userscontroller = new UsersController();\n $ip = $userscontroller->get_client_ip();\n $userscontroller->makeLog('Updated Appointment', $this->Auth->user('id'), 'Doctor Edited an appointment', $ip, 'Edit');\n $this->Flash->success(__('The appointment has been updated.'));\n\n return $this->redirect(['action' => 'viewappointments']);\n }\n $this->Flash->error(__('The appointment could not be updated. Please, try again.'));\n }\n $doctors = $users_table->find('list', ['limit' => 200])->where(['role_id'=>2]);\n $patients = $appointments_table->Patients->find('list', ['limit' => 200]);\n $this->set(compact('appointment', 'doctors', 'patients'));\n \n $this->viewBuilder()->setLayout('backend');\n }",
"public function findGuardByIdWithSchedules(int $id)\n {\n return $this->model->whereId($id)\n ->with(['schedules' => function ($query) {\n $query->orderBy('date', 'ASC');\n }])\n ->firstOrFail();\n }",
"public function Appointment() {\n return $this->hasMany('App\\TIME');\n }",
"public function getAppointmentsByHospitalAndDoctor($hospitalId, $doctorId)\n {\n $appointments = null;\n\n try\n {\n $query = DB::table('doctor_appointment as da')->select('da.id', 'da.patient_id',\n 'p.name as patient_name', 'p.pid',\n 'da.hospital_id', 'h.hospital_name',\n 'da.doctor_id', 'd.name as doctor_name',\n 'da.appointment_date', 'da.appointment_time');\n $query->join('hospital as h', 'h.hospital_id', '=', 'da.hospital_id');\n $query->join('patient as p', 'p.patient_id', '=', 'da.patient_id');\n $query->join('doctor as d', 'd.doctor_id', '=', 'da.doctor_id');\n $query->where('da.hospital_id', '=', $hospitalId);\n $query->where('da.doctor_id', '=', $doctorId);\n\n $appointments = $query->get();\n }\n catch(QueryException $queryEx)\n {\n throw new HospitalException(null, ErrorEnum::APPOINTMENT_LIST_ERROR, $queryEx);\n }\n catch(Exception $exc)\n {\n throw new HospitalException(null, ErrorEnum::APPOINTMENT_LIST_ERROR, $exc);\n }\n\n return $appointments;\n }",
"public function show($id)\n {\n $assessment = Assessment::find($id);\n\n return $assessment;\n }",
"public function findOneById(int $id): ?MySchedule\n {\n return $this->app->repositories->myScheduleRepository->findOneById($id);\n }",
"public function setAppointmentId($appointmentId)\n {\n $this->appointmentId = $appointmentId;\n }",
"public function show($id)\n {\n $scheduling = Scheduling::findOrFail($id);\n $scheduling->room->local;\n return new SchedulingResource($scheduling);\n }",
"public function loadBookingInformation()\n {\n $this->booking = Booking::with([\n 'usedCoupon',\n 'bookingPeriods',\n 'bookingAddOns.addOn',\n 'AdhocItems',\n ])->find(json_decode($this->request->booking, true)['id']);\n }",
"public function edit($id)\n {\n $dp = DB::table('appointments')->where('id', $id)->first();\n $startdatetime = explode(\" \", $dp->start_date_time);\n $startdate = $startdatetime[0];\n $starttime = $startdatetime[1];\n $enddatetime = explode(\" \", $dp->end_date_time);\n $enddate = $enddatetime[0];\n $endtime = $enddatetime[1];\n $patient = Patient::find($dp->patient_id)->user->name;\n $nurse = Nurse::find($dp->nurse_id)->user->name;\n $physician = Physician::find($dp->physician_id)->user->name;\n $dp_obj = [\n 'patient' => $patient,\n 'patient_id' => $dp->patient_id, \n 'physician' => $physician,\n 'physician_id' => $dp->physician_id,\n 'nurse' => $nurse,\n 'nurse_id' => $dp->nurse_id,\n 'url' => url('admin/appointments'),\n 'id' => $dp->id,\n 'exaroom' => $dp->examinationroom,\n 'startdate' => $startdate,\n 'starttime' => $starttime,\n 'enddate' => $enddate,\n 'endtime' => $endtime\n ];\n return response()->json($dp_obj);\n }",
"public static function getById($id)\n {\n $schedule = self::query()->find($id);\n return $schedule;\n }",
"public function getAssessment()\n {\n if (!$this->_assessment) {\n try {\n $this->_assessment = \\Ca\\Db\\AssessmentMap::create()->find($this->getAssessmentId());\n } catch (\\Exception $e) {}\n }\n return $this->_assessment;\n }",
"public function update(Request $request, $id)\n {\n $starttime = new \\DateTime($request->starttime);\n $endtime = new \\DateTime($request->endtime);\n DB::table('appointments')\n ->where('id', $id)\n ->update([\n 'physician_id' => $request->physician,\n 'nurse_id' => $request->nurse,\n 'patient_id' => $request->patient,\n 'examinationroom' => $request->exaroom,\n 'start_date_time' => $request->startdate . \" \" . $starttime->format('H:i:s'),\n 'end_date_time' => $request->enddate . \" \" . $endtime->format('H:i:s'),\n ]);\n $dp = DB::table('appointments')->get();\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n return response()->json($dp_obj);\n }",
"public function AnnouncementById($id) {\n $result = $this->conn->query(Announcement::toSelectByIdQuery($id));\n if ($result) {\n if(!$result->num_rows) {\n $this->err = 'Entity not found';\n return FALSE;\n }\n return $result->fetch_object('Announcement');\n }\n $this->err = $this->conn->error;\n return false; \n }",
"public function show($id)\n {\n $appointment = Appointment::with('doctor','patient')->findOrFail($id);\n\n return view('appointments.show', compact('appointment'));\n }",
"public static function deleteAppointments($a_obj_id)\n\t{\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarEntry.php');\n\t\t\n\t\tforeach(ilCalendarCategoryAssignments::_getAutoGeneratedAppointmentsByObjId($a_obj_id) as $app_id)\n\t\t{\n\t\t\tilCalendarCategoryAssignments::_deleteByAppointmentId($app_id);\n\t\t\tilCalendarEntry::_delete($app_id);\n\t\t}\n\t}",
"public function get( int $id ) : IEmployerIncentive\n {\n if ( !isset( self::DB[$id] ))\n throw new RecordNotFoundException();\n \n return self::DB[$id]; \n }",
"public function agendaRapat(){\n return $this->hasOne(AgendaRapatModel::class, 'rapat_id_pimpinan_rapat');\n }",
"public function getAvisById($id)\n\t{\n\t\tif($id === null)\n\t\t\treturn null;\n\t\t$this->ensureAvisLoaded(array($id));\n\t\tif(!isset($this->_avis[$id]))\n\t\t\treturn null;\n\t\treturn new GmthBridgeAvis($this, $this->_avis[$id]);\n\t}",
"public function testFindScheduleByAdId()\n {\n $scheduleDocument = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Document\\Schedule');\n\n $model = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Model\\ScheduleModel', ['findScheduleByAdId']);\n $this->setMockMethodsReturnValue($model, ['findScheduleByAdId'], $scheduleDocument);\n\n $cronManager = new CronManager();\n $cronManager->setScheduleModel($model);\n\n $result = $cronManager->findScheduleByAdId('test');\n\n $this->assertEquals($scheduleDocument, $result);\n }",
"public function patientAppointment() {\n $loggedUser = Sentinel::getUser();\n\n # Get the profile of the logged in User\n $profile = new UserProfile;\n $profile = $profile->find($loggedUser->id);\n\n # Some info of the logged in user\n $user = array(\"fullname\" => $profile->fullname, \"profile_type\" => $profile->profile_type);\n\n # Return all Doctors with their complete profile\n $users = new User();\n $users = $users::with('userProfile')\n ->whereHas('userProfile', function ($query) {\n $query->where('profile_type', '=', 'doctor');\n })->get();\n\n # All Appointment\n $userAppointment = Appointment::where('patient_id', '=', $loggedUser->id)->get();\n\n return view('Dashboard.patient.appointments', compact('user', 'users', 'userAppointment'));\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function appointments()\n {\n return $this->hasMany(Appointment::class);\n }",
"public function getAppointments()\n {\n $search['office'] = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->id : '';\n\n $search['date1'] = isset($search['date1']) ? Carbon::parse($search['date1']) : '';\n $search['date2'] = isset($search['date2']) ? Carbon::parse($search['date2']) : '';\n \n $appointments = $this->appointmentRepo->findAllByDoctorWithoutPagination(request('medic'),$search);\n\n return $appointments;\n \n }",
"public function show($id)\n\t{\n\t\t$prenomina = Payroll::find($id);\n\t\t$adicionales = $prenomina->adicionales;\n\t\t$empleados = $prenomina->payrolls;\n\t\t$deducciones = Deduction::first();\n $cestaticket = Cestaticket::first();\n\t\t$sso = array();\n\t\t$rpe = array();\n\t\t$rpvh = array();\n\t\t$horasExtras = array();\n\t\t$totalAsignacion = array();\n\t\t$diasLaborados = array();\n\t\t$totalCancelar = array();\n\t\t$totalDeducciones = array();\n\n\t\t$fecha = $prenomina->year.'-'.$prenomina->mes;\n\n\t\tif ($prenomina->quincena == 1)\n\t\t{\n\n\t\t\t$i = $fecha.'-01';\n\t\t\t$f = $fecha.'-15';\n\t\t\t\t\t\t\n\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n\n\t\t} else {\n\n\t\t\tif ($prenomina->quincena == 2 AND $prenomina->mes == 1 OR $prenomina->mes == 3 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $prenomina->mes == 5 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $prenomina->mes == 7 OR\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $prenomina->mes == 8 OR $prenomina->mes == 10 OR $prenomina->mes == 12)\n\t\t\t{\n\t\t\t\t$i = $fecha.'-16';\n\t\t\t\t$f = $fecha.'-31';\n\n\t\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n\n\t\t\t} else {\n\n\t\t\t\tif ($prenomina->quincena == 2 AND $prenomina->mes == 2)\n\t\t\t\t{\n\t\t\t\t\t$i = $fecha.'-16';\n\t\t\t\t\t$f = $fecha.'-29';\n\n\t\t\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$i = $fecha.'-16';\n\t\t\t\t\t$f = $fecha.'-30';\n\n\t\t\t\t\t$dates = Days_planning::whereBetween('dia', [$i,$f])->get();\n\t\t\t\t\t$assistances = Day_attendance::whereBetween('fecha', [$i,$f])->get();\n }\n }\n }\n\n if (count($assistances) < 10)\n {\n Flash::warning('<strong> Disculpe </strong> las asistencias de los empleados no estan completas, debe registrar primero asistencias.');\n\n return redirect()->back();\n\n } else {\n return view('admin.payroll.show', compact('i', 'f', 'dates', 'assistances', 'adicionales', 'empleados', 'sso', 'rpe', 'rpvh', 'horasExtras', 'deducciones', 'cestaticket', 'totalAsignacion', 'diasLaborados', 'totalCancelar', 'totalDeducciones', 'prenomina'));\n }\n }",
"public function edit(Appointment $appointment)\n {\n //\n }",
"public function edit(Appointment $appointment)\n {\n //\n }",
"public function addAppointment($id){\n try{\n \n \n $sql = 'INSERT INTO `appointments` (dateHour, idPatients) VALUE (:dateHour , :idPatients);';\n $sth = $this->_pdo->prepare($sql);\n $sth->bindValue(':idPatients',$id, PDO::PARAM_INT);\n $sth->bindValue(':dateHour', $this->_dateHour, PDO::PARAM_STR);\n \n $appoint = $sth->execute();\n \n return $appoint;\n\n }catch(PDOException $e) {\n echo 'Connexion échouée : ' . $e->getMessage();\n return false;\n } \n }",
"public static function forApartment($apartment_id) {\n\t\t\t\n\t\t\treturn Booking::where('apartment_id', $apartment_id)->get();\n\t\t}",
"protected function getMasterAppointments($args) {\n\n if ($args['ent_appnt_dt'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $dates = explode('-', $args['ent_appnt_dt']);\n\n if (count($dates) == 3) {\n $endDate = date('Y-m-d', strtotime('+7 day', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" DATE(a.appointment_dt) between '\" . $args['ent_appnt_dt'] . \"' and '\" . $endDate . \"'\";\n } else {\n $args['ent_appnt_dt'] = $args['ent_appnt_dt'] . '-01';\n $endDate = date('Y-m-d', strtotime('+1 month', strtotime($args['ent_appnt_dt'])));\n $selectStr = \" YEAR(a.appointment_dt) = '\" . (int) $dates[0] . \"' and MONTH(a.appointment_dt) = '\" . (int) $dates[1] . \"'\";\n }\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appointment_id,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.drop_addr1,a.drop_addr2,a.drop_lat,a.drop_long,a.complete_dt,a.start_dt,a.arrive_dt,a.status,a.payment_status,a.amount,a.distance_in_mts,(select count(appointment_id) from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"') as pen_count from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.mas_id = '\" . $this->User['entityId'] . \"' and \" . $selectStr . \" and a.status NOT IN (1,3,4,5,10) order by a.appointment_id DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"' a.status NOT in (1,3,4,7) and\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0) {\n\n $selectPenCountQry = \"select count(*) as count from appointment where status = 1 and mas_id = '\" . $this->User['entityId'] . \"'\";\n $countArr = mysql_fetch_assoc(mysql_query($selectPenCountQry, $this->db->conn));\n $errMsgArr = $this->_getStatusMessage(30, 2);\n\n $date = $args['ent_appnt_dt'];\n\n while ($date <= $endDate) {\n\n $sortedApnts[] = array('date' => $date, 'appt' => array());\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $countArr['count'], 'refIndex' => array(), 'appointments' => $sortedApnts, 't' => $selectAppntsQry);\n }\n\n $appointments = $daysArr = array();\n\n $pendingCount = 0;\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pendingCount = $appnt['pen_count'];\n\n $aptdate = date('Y-m-d', strtotime($appnt['appointment_dt']));\n\n $durationSec = (abs(strtotime($appnt['complete_dt']) - strtotime($appnt['start_dt'])) / 60);\n\n $durationMin = round($durationSec, 2);\n\n// if ($appnt['status'] == '1')\n// $status = 'Booking requested';\n// else if ($appnt['status'] == '2')\n// $status = 'Driver accepted.';\n// else if ($appnt['status'] == '3')\n// $status = 'Driver rejected.';\n// else if ($appnt['status'] == '4')\n// $status = 'You have cancelled.';\n// else if ($appnt['status'] == '5')\n// $status = 'Driver have cancelled.';\n// else\n if ($appnt['status'] == '6')\n $status = 'Driver is on the way.';\n else if ($appnt['status'] == '7')\n $status = 'Driver arrived.';\n else if ($appnt['status'] == '8')\n $status = 'Booking started.';\n else if ($appnt['status'] == '9')\n $status = 'Booking completed.';\n// else if ($appnt['status'] == '10')\n// $status = 'Booking expired.';\n else\n $status = 'Status unavailable.';\n\n $appointments[$aptdate][] = array('pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'statCode' => $appnt['status'], 'status' => $status,\n 'fname' => $appnt['first_name'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])), 'bid' => $appnt['appointment_id'], 'apptDt' => $appnt['appointment_dt'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'payStatus' => ($appnt['payment_status'] == '') ? 0 : $appnt['payment_status'],\n 'dropLine1' => urldecode($appnt['drop_addr1']), 'duration' => round($durationMin, 2), 'distance' => round($appnt['distance_in_mts'] / $this->distanceMetersByUnits, 2), 'amount' => $appnt['amount']);\n\n\n// $appointments[$aptdate][] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'], 'status' => $appnt['status'], 'pickupDt' => $appnt['arrive_dt'], 'dropDt' => $appnt['complete_dt'],\n// 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('h:i a', strtotime($appnt['appointment_dt'])),\n// 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n// 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'],\n// 'dropLine1' => urldecode($appnt['drop_addr1']), 'dropLine2' => urldecode($appnt['drop_addr2']), 'dropLat' => (double) $appnt['drop_lat'], 'dropLong' => (double) $appnt['drop_long'], 'duration' => $durationMin, 'distanceMts' => $appnt['distance_in_mts'], 'amount' => $appnt['amount']);\n }\n $refIndexes = $sortedApnts = array();\n $date = date('Y-m-d', strtotime($args['ent_appnt_dt']));\n\n while ($date < $endDate) {\n\n $empty_arr = array();\n\n if (is_array($appointments[$date])) {\n $sortedApnts[] = array('date' => $date, 'appt' => $appointments[$date]);\n $num = date('j', strtotime($date));\n $refIndexes[] = $num;\n } else {\n $sortedApnts[] = array('date' => $date, 'appt' => $empty_arr);\n }\n\n $date = date('Y-m-d', strtotime('+1 day', strtotime($date)));\n }\n//print_r($sortedApnts);\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'penCount' => $pendingCount, 'refIndex' => $refIndexes, 'appointments' => $sortedApnts); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }",
"public function appointments(){\n return $this->hasMany(Appointment::class);\n }",
"public function fetchSchedulesForSpecificInstructor($aId)\n {\n // Prepare a select query.\n $statement = $this->oConnection->prepare(\"\n SELECT\n tc.courseCode, ts.id AS scheduleId,\n ts.fromDate, ts.toDate, tv.venue\n FROM tbl_schedules ts\n INNER JOIN tbl_courses tc\n ON ts.courseId = tc.id\n INNER JOIN tbl_venue tv\n ON ts.venueId = tv.id\n WHERE 1 = 1\n AND ts.instructorId = :userId\n AND ts.fromDate > CURDATE()\n AND ts.toDate > CURDATE()\n \");\n\n // Execute the above statement.\n $statement->execute($aId);\n\n // Return the number of rows returned by the executed query.\n return $statement->fetchAll();\n }",
"public function show($id,Request $request)\n {\n $user_id = $request->session()->get('id');\n $user = \\DB::table('users')->whereId($user_id)->first();\n $data['user'] = $user;\n $userDetails = UserDetails::where('user_id', $user_id)->first();\n $data['profilePath'] = $userDetails->profilePhotoPath;\n $data['name'] = $userDetails->name;\n\n $appointmentDetails = $this->getAppointments($id);\n $eventId = $appointmentDetails['eventId'];\n $appointmentLogs = AuditAppointments::orderBy('id','asc')\n ->where('eventId',$eventId)\n ->get();\n $appointmentLogCount = count($appointmentLogs);\n $appointmentLog = array(\n 'initiatedBy'=>\"\",\n 'confirmedBy'=>\"\",\n 'cancelledBy'=>\"\",\n 'initiatedAt'=>\"\",\n 'confirmedAt'=>\"\",\n 'cancelledAt'=>\"\",\n 'expired'=>0,\n 'expiredOn'=>\"\"\n );\n for ($i=0;$i<$appointmentLogCount;$i++){\n $state = $appointmentLogs[$i]->appointmentState;\n if ($state == 1){\n $appointmentLog['initiatedBy'] = $appointmentLogs[$i]->triggeredBy;\n $initiatedAt = $appointmentLogs[$i]->created_at;\n $initiatedAt =Carbon::parse($initiatedAt)->addHours(5)->addMinutes(30);\n $appointmentLog['initiatedAt'] = $initiatedAt;\n $calendarEvent = CalendarEvent::where('id',$eventId)->first();\n $start = Carbon::parse($calendarEvent->start);\n $today = Carbon::today();\n $teacherSlots = TeacherAppointmentSlots::where('calendarEventsId',$eventId)->first();\n $slotId = $teacherSlots->id;\n $appointmentRequest = AppointmentRequest::where('teacherAppointmentsSlot_id',$slotId)->first();\n $confirmed = $appointmentRequest->isCancel;\n $cancelled = $appointmentRequest->isApproved;\n if($start<$today && ($confirmed==0 || $cancelled==0)){\n $appointmentLog['expired']=1;\n $appointmentLog['expiredOn']=$today;\n }\n \n }\n elseif ($state == 2){\n $appointmentLog['confirmedBy'] = $appointmentLogs[$i]->triggeredBy;\n $confirmedAt = $appointmentLogs[$i]->created_at;\n $confirmedAt =Carbon::parse($confirmedAt)->addHours(5)->addMinutes(30);\n $appointmentLog['confirmedAt'] = $confirmedAt;\n }\n else{\n $appointmentLog['cancelledBy'] = $appointmentLogs[$i]->triggeredBy;\n $cancelledAt = $appointmentLogs[$i]->created_at;\n $cancelledAt =Carbon::parse($cancelledAt)->addHours(5)->addMinutes(30);\n $appointmentLog['cancelledAt'] = $cancelledAt;\n }\n }\n return view('appointments.show', compact('appointmentDetails','appointmentLog'),$data);\n }",
"public function editSchedule($id)\n\t{\n\t\t$schedule = RecruiterSchedule::find($id);\n\t\treturn $schedule;\n\n\t}",
"public function show($id)\n { \n $airplaneseat = Airplaneseat::findOrFail($id);\n return $airplaneseat;\n }",
"public function load()\n {\n parent::load();\n\n // appointments are not to the second, so remove the :00 at the end of the datetime field\n $this->datetime = substr( $this->datetime, 0, -3 );\n }",
"function getAppointmentByDate($start, $end, $status = ['scheduled'], $type = [], $getFull = FALSE, $page = 0, $pageSize = 10, $patient_id = null, $pdo = null)\n\t{\n\n\t\t$type = (isset($type) && sizeof($type) > 0) ? \"AND g.type IN ('\" . implode($type, \"', '\") . \"')\" : \"\";\n\t\t$Patient = ($patient_id != null && $patient_id != '') ? ' AND g.patient_id = ' . $patient_id : '';\n\t\t$sql = \"SELECT p.*, g.patient_id FROM appointment p LEFT JOIN appointment_group g ON p.group_id=g.id LEFT JOIN appointment_clinic c ON c.id=g.clinic_id WHERE DATE(start_time) BETWEEN '\" . $start . \"' AND '\" . $end . \"' AND `status` IN ('\" . implode($status, \"', '\") . \"'){$type}{$Patient} /*AND g.department_id IS NULL*/ ORDER BY FIELD(status, 'Scheduled', 'Active', 'Completed', 'Missed' , 'Cancelled'), Date(start_time), end_time DESC\";\n\t\t//error_log($sql);\n\t\t$total = 0;\n\t\ttry {\n\t\t\t$pdo = $pdo == null ? $this->conn->getPDO() : $pdo;\n\t\t\t$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t$stmt->execute();\n\t\t\t$total = $stmt->rowCount();\n\t\t} catch (PDOException $e) {\n\t\t\terror_log(\"ERROR: Failed to return total number of records\");\n\t\t}\n\n\t\t$page = ($page > 0) ? $page : 0;\n\t\t$offset = ($page > 0) ? $pageSize * $page : 0;\n\n\t\ttry {\n\t\t\t$pdo = $pdo == null ? $this->conn->getPDO() : $pdo;\n\t\t\t$sql .= \" LIMIT $offset, $pageSize\";\n\t\t\t//error_log($sql);\n\t\t\t$appoints = array();\n\t\t\t$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t\t$stmt->execute();\n\t\t\twhile ($row = $stmt->fetch(PDO::FETCH_NAMED, PDO::FETCH_ORI_NEXT)) {\n\t\t\t\t$appoint = new Appointment();\n\t\t\t\t$appoint->setId($row['id']);\n\t\t\t\tif ($getFull) {\n\t\t\t\t\t$group = (new AppointmentGroupDAO())->getAppointmentGroup($row['group_id'], TRUE, $pdo);\n\t\t\t\t\t$editor = (new StaffDirectoryDAO())->getStaff($row['editor_id'], FALSE, $pdo);\n\t\t\t\t} else {\n\t\t\t\t\t$group = new AppointmentGroup();\n\t\t\t\t\t$group->setId($row['group_id']);\n\t\t\t\t\t$editor = new StaffDirectory();\n\t\t\t\t\t$editor->setId($row['editor_id']);\n\t\t\t\t}\n\t\t\t\t$appoint->setGroup($group);\n\t\t\t\t$appoint->setStartTime((explode(\" \", $row['start_time'])[1] === \"00:00:00\") ? explode(\" \", $row['start_time'])[0] : $row['start_time']);\n\t\t\t\t$appoint->setEndTime($row['end_time'] === null ? null : (explode(\" \", $row['end_time'])[1] === \"00:00:00\") ? explode(\" \", $row['end_time'])[0] : $row['end_time']);\n\t\t\t\t$appoint->setAttendedTime($row['attended_time']);\n\t\t\t\t$appoint->setStatus(($row['status'] === \"Scheduled\" && strtotime(explode(\" \", $row['start_time'])[0]) < strtotime(date(\"Y-m-d\"))) ? \"Missed\" : $row['status']);\n\t\t\t\t$appoint->setEditor($editor);\n\t\t\t\t\n\t\t\t\t$appoints[] = $appoint;\n\t\t\t}\n\t\t\t$stmt = null;\n\t\t} catch (PDOException $e) {\n\t\t\t$stmt = null;\n\t\t\t$appoints = array();\n\t\t}\n\t\t$results = (object)null;\n\t\t$results->data = $appoints;\n\t\t$results->total = $total;\n\t\t$results->page = $page;\n\n\t\treturn $results;\n\t}",
"public function appointments()\n {\n //the relationship means that the class midwife can associate with many appointments\n return $this->hasMany(Appointment::class);\n }",
"public function findWithData($id) {\n $qb = $this->getQueryBuilder();\n $qb\n ->addSelect('ap_r')\n ->addSelect('ap_t')\n ->addSelect('ap_ms')\n ->addSelect('ap_t_g')\n ->addSelect('ap_t_g_r')\n ->addSelect('ap_r_g')\n ->addSelect('ap_t_g_r_g')\n ->addSelect('ap_t_g_gd')\n ->addSelect('ap_to')\n ->addSelect('ap_oo')\n ->innerJoin('ap.tacticalObjective', 'ap_to')\n ->leftJoin('ap.operationalObjective', 'ap_oo')\n ->leftJoin('ap.responsibles', 'ap_r')\n ->leftJoin('ap_r.groups', 'ap_r_g')\n ->leftJoin('ap.timeline', 'ap_t')\n ->leftJoin('ap.managementSystem', 'ap_ms')\n ->leftJoin('ap_t.goals', 'ap_t_g')\n ->leftJoin('ap_t_g.responsibles', 'ap_t_g_r')\n ->leftJoin('ap_t_g.goalDetails', 'ap_t_g_gd')\n ->leftJoin('ap_t_g_r.groups', 'ap_t_g_r_g')\n ->andWhere('ap.id = :id')\n ->setParameter('id', $id)\n ;\n return $qb->getQuery()->getOneOrNullResult();\n }",
"public function __construct(Appointment $appointment)\n {\n $this->appointment = $appointment;\n }",
"public function update($id)\n {\n if (Sentry::check()) {\n // Find active user\n $user = Sentry::getUser();\n $event = Appointment::find($id);\n\n // Check if User belongs to group/school which the appointment is from\n if ($user->hasAccess('school') || ($user->hasAccess(\n 'event'\n ) && $user->school_id == $event->group->school_id)\n ) {\n $endDate = new DateTime();\n // Check if endDate isn't blank\n if (Input::get('end-date') == '') {\n $endDate = null;\n }\n\n $validator = Validator::make(\n [\n 'group' => Input::get('group'),\n 'description' => Input::get('description'),\n 'start-date' => Input::get('start-date'),\n 'end-date' => $endDate,\n 'start-time' => Input::get('start-time'),\n 'end-time' => Input::get('end-time'),\n 'title' => Input::get('title'),\n 'day' => Input::get('day')\n ],\n [\n 'group' => 'required',\n 'description' => 'required',\n 'start-date' => 'date',\n 'end-date' => 'date',\n 'start-time' => 'required|date_format:H:i',\n 'end-time' => 'required|date_format:H:i',\n 'title' => 'required'\n ]\n );\n\n if ($validator->fails()) {\n return Redirect::route('event.edit', $id)->withInput()->withErrors($validator);\n } else {\n $title = e(Input::get('title'));\n $description = e(Input::get('description'));\n $location = e(Input::get('location'));\n $group_id = Input::get('group');\n $start_date = e(Input::get('start-date'));\n $end_date = e(Input::get('end-date'));\n $start_time = e(Input::get('start-time'));\n $end_time = e(Input::get('end-time'));\n $parents = Input::get('par');\n\n // TODO: Handle All day events, or decide to remove it alltogether\n // TODO: Update date/time if needed\n // If the event isn't the whole day, determine the end date/time\n //$event->allday = false;\n\n // Handle datetime\n if(!$start_date) {\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.required', ['attribute ' => 'start-date '])\n );\n\n return Redirect::back()->withErrors($validator)->withInput();\n } else {\n $sd = new DateTime($start_date . ' ' . $start_time);\n\n if ($end_date == '') {\n $end_date = $start_date;\n }\n $ed = new DateTime($end_date . ' ' . $end_time);\n\n // Check if end date is before start date, if so, return with error\n if ($sd >= $ed) {\n\n $validator->getMessageBag()->add(\n 'end',\n Lang::get('validation.after', ['attribute ' => 'end-date ', 'date' => Input::get('start-date')])\n );\n\n // Redirect back with inputs and validator instance\n return Redirect::back()->withErrors($validator)->withInput();\n }\n }\n\n // Recurring events handling\n if ($event->parent_id) {\n if($parents) {\n $parent = AppParent::find($event->parent_id);\n // Update parent event\n $parent->title = $title;\n $parent->description = $description;\n $parent->location = $location;\n $parent->group_id = $group_id;\n $parent->save();\n\n Appointment::where('parent_id', $parent->id)->update([\n 'title' => $title,\n 'description' => $description,\n 'location' => $location,\n 'group_id' => $group_id\n ]);\n } else {\n // If event had a parent_id, but the checkbox was unchecked, unlink event from parent\n $event->parent_id = null;\n }\n }\n\n $event->title = $title;\n $event->description = $description;\n $event->location = $location;\n $event->group_id = $group_id;\n $event->start_date = $sd;\n $event->end_date = $ed;\n $event->save();\n\n return Redirect::route('calendar.index');\n }\n } else {\n // If no permissions, redirect the user to the calendar index page\n return Redirect::route('calendar.index');\n }\n } else {\n return Redirect::route('landing');\n }\n }",
"public function detail($vacation_id) {}",
"public function testGetSchedulesByAdId()\n {\n $scheduleDocument = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Document\\Schedule');\n\n $model = $this->getMockObject('Litvinab\\Bundle\\CronEventBundle\\Model\\ScheduleModel', ['getSchedulesByAdId']);\n $this->setMockMethodsReturnValue($model, ['getSchedulesByAdId'], [$scheduleDocument]);\n\n $cronManager = new CronManager();\n $cronManager->setScheduleModel($model);\n\n $result = $cronManager->getSchedulesByAdId('test');\n\n $this->assertCount(1, $result);\n $this->assertContains($scheduleDocument, $result);\n }",
"public function editAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('appointment', array(\n 'action' => 'add'\n ));\n }\n\n // Get the Appointment with the specified id. An exception is thrown\n // if it cannot be found, in which case go to the index page.\n try {\n $appointment = $this->getAppointmentTable()->getappointment($id);\n }\n catch (\\Exception $ex) {\n return $this->redirect()->toRoute('appointment', array(\n 'action' => 'index'\n ));\n }\n \n $form = new AppointmentForm();\n //attach model to the form\n $form->bind($appointment);\n \n // Display appointment start and end time on form as Y-m-d\\TH:i because seconds should be 00 for a valid input of //datetimelocal\n $form->setData([\n 'start_time' => date_create_from_format('Y-m-d H:i:s', $appointment->start_time)->format('Y-m-d\\TH:i'), \n 'end_time' => date_create_from_format('Y-m-d H:i:s', $appointment->end_time)->format('Y-m-d\\TH:i'),\n ]);\n \n \n $form->get('submit')->setAttribute('value', 'Edit');\n\n // perform similar steps as Add action\n $request = $this->getRequest();\n if ($request->isPost()) {\n $form->setInputFilter($appointment->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $this->getAppointmentTable()->saveAppointment($appointment);\n\n // Redirect to list of appointments\n return $this->redirect()->toRoute('appointment');\n } else {\n // $validator = new Zend_Validate_Date();\n // $validator->setMessage( 'Please input 00 in seonds !',Zend_Validate_Date::INVALID_DATE);\n $messages = $form->getMessages();\n }\n }\n\n \n return array(\n 'id' => $id,\n 'form' => $form,\n );\n }",
"public function index()\n {\n \n if(Auth::user()->getRoleNames()->first() == 'patient')\n {\n $dp = DB::table('appointments')->where('patient_id', Auth::user()->patient->id)->get();\n }\n else if(Auth::user()->getRoleNames()->first() == 'physician')\n {\n $dp = DB::table('appointments')->where('physician_id', Auth::user()->physician->id)->get();\n }\n else if(Auth::user()->getRoleNames()->first() == 'nurse')\n {\n $dp = DB::table('appointments')->where('nurse_id', Auth::user()->nurse->id)->get();\n }\n else{\n $dp = DB::table('appointments')->get();\n }\n $dp_obj = $dp->map(function ($element){\n $startdatetime = new Carbon($element->start_date_time);\n $enddatetime = new Carbon($element->end_date_time);\n $patient = Patient::find($element->patient_id)->user->name;\n $physician = Physician::find($element->physician_id)->user->name;\n $nurse = Nurse::find($element->nurse_id)->user->name;\n return [\n 'patient' => $patient, \n 'physician' => $physician,\n 'nurse' => $nurse,\n 'url' => url('admin/appointments'),\n 'id' => $element->id,\n 'exaroom' => $element->examinationroom,\n 'startdatetime' => $startdatetime->toDayDateTimeString(),\n 'enddatetime' => $enddatetime->toDayDateTimeString()\n ];\n });\n $physicians = Physician::all();\n $patients = Patient::all();\n $nurses = Nurse::all();\n return view('backend.appointments.index', compact('dp_obj', 'patients', 'physicians', 'nurses'));\n }",
"public function appointments()\n {\n return $this->belongsToMany('App\\Appointment', 'appointment_details', 'patient_id', 'appointment_id');\n }",
"public function applyAppointmentWasScheduled(AppointmentWasScheduled $event)\n {\n $this->appointmentId = $event->getAppointmentId();\n }",
"public function load($campaignId);",
"public function __construct(Appointment $appointment)\n\t{\n\t\t$this->appointment = $appointment;\n\t}",
"function is_schedule( $schedule_identifier = null ) {\r\n global $bp;\r\n $courseware_uri = bp_get_group_permalink( $bp->groups->current_group ) . 'courseware/' ;\r\n \r\n if( is_object( $schedule_identifier ) && $schedule_identifier->post_type == \"assignment\" )\r\n if( $schedule_identifier->group[0]->name == $bp->groups->current_group->id )\r\n return $schedule_identifier;\r\n else\r\n return null;\r\n \r\n if( !$schedule_identifier && get_class( (object)$this->current_schedule ) == __CLASS__ )\r\n return $this->current_schedule;\r\n \r\n $schedule_query = array(\r\n 'post_type' => 'schedule',\r\n 'group_id' => $bp->groups->current_group->id,\r\n );\r\n \r\n if ( $schedule_identifier != null ) {\r\n if( is_numeric( $schedule_identifier ) )\r\n $schedule_query['p'] = $schedule_identifier;\r\n else\r\n $schedule_query['name'] = $schedule_identifier;\r\n }\r\n $schedule = get_posts( $schedule_query );\r\n \r\n if( !empty( $schedule[0] ) )\r\n $schedule = $schedule[0];\r\n else\r\n return null;\r\n \r\n $schedule->start_date = get_post_meta( $schedule->ID, 'start_date', true );\r\n $schedule->end_date = get_post_meta( $schedule->ID, 'end_date', true );\r\n $schedule->location = get_post_meta( $schedule->ID, 'location', true );\r\n $schedule_lecture = get_post_meta( $schedule->ID, 'lecture_id', true );\r\n $schedule->lecture = $schedule_lecture ? BPSP_Lectures::is_lecture( $schedule_lecture ) : null;\r\n $schedule->permalink = $courseware_uri . 'schedule/' . $schedule->post_name;\r\n $course_id = wp_get_object_terms( $schedule->ID, 'course_id' );\r\n if( !empty( $course_id ) )\r\n $schedule->course = BPSP_Courses::is_course( $course_id[0]->name );\r\n \r\n return $schedule;\r\n }",
"public function appointments(): HasMany\n {\n return $this->hasMany(Appointment::class);\n }",
"public function validate_date()\n {\n if( is_null( $this->participant_id ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot validate appointment date, participant id is not set.', __METHOD__ );\n\n $db_participant = lib::create( 'database\\participant', $this->participant_id );\n $db_site = $db_participant->get_primary_site();\n if( is_null( $db_site ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot validate an appointment date, participant has no primary address.', __METHOD__ );\n \n $shift_template_class_name = lib::get_class_name( 'database\\shift_template' );\n $shift_class_name = lib::get_class_name( 'database\\shift' );\n\n // determine the full and half appointment intervals\n $setting_manager = lib::create( 'business\\setting_manager' );\n $half_duration = $setting_manager->get_setting( 'appointment', 'half duration' );\n $full_duration = $setting_manager->get_setting( 'appointment', 'full duration' );\n\n $start_datetime_obj = util::get_datetime_object( $this->datetime );\n $next_day_datetime_obj = clone $start_datetime_obj;\n $next_day_datetime_obj->add( new\\DateInterval( 'P1D' ) );\n $end_datetime_obj = clone $start_datetime_obj;\n $duration = 'full' == $this->type ? $full_duration : $half_duration;\n $end_datetime_obj->add( new \\DateInterval( sprintf( 'PT%dM', $duration ) ) );\n\n // determine whether to test for shifts or shift templates on the appointment day\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_datetime', '>=', $start_datetime_obj->format( 'Y-m-d' ) );\n $modifier->where( 'start_datetime', '<', $next_day_datetime_obj->format( 'Y-m-d' ) );\n\n $diffs = array();\n\n if( 0 == $shift_class_name::count( $modifier ) )\n { // determine slots using shift template\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_date', '<=', $start_datetime_obj->format( 'Y-m-d' ) );\n foreach( $shift_template_class_name::select( $modifier ) as $db_shift_template )\n {\n if( $db_shift_template->match_date( $start_datetime_obj->format( 'Y-m-d' ) ) )\n {\n $start_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift_template->start_time, 0, -3 ) ) );\n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[$start_time_as_int] = 0;\n $diffs[$start_time_as_int] += $db_shift_template->operators;\n\n $end_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift_template->end_time, 0, -3 ) ) );\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[$end_time_as_int] = 0;\n $diffs[$end_time_as_int] -= $db_shift_template->operators;\n }\n }\n }\n else // determine slots using shifts\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_datetime', '<', $end_datetime_obj->format( 'Y-m-d H:i:s' ) );\n $modifier->where( 'end_datetime', '>', $start_datetime_obj->format( 'Y-m-d H:i:s' ) );\n foreach( $shift_class_name::select( $modifier ) as $db_shift )\n {\n $start_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift->start_datetime, -8, -3 ) ) );\n $end_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift->end_datetime, -8, -3 ) ) );\n\n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[$start_time_as_int] = 0;\n $diffs[$start_time_as_int]++;\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[$end_time_as_int] = 0;\n $diffs[$end_time_as_int]--;\n }\n }\n \n // and how many appointments are during this time?\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'datetime', '>=', $start_datetime_obj->format( 'Y-m-d' ) );\n $modifier->where( 'datetime', '<', $next_day_datetime_obj->format( 'Y-m-d' ) );\n if( !is_null( $this->id ) ) $modifier->where( 'appointment.id', '!=', $this->id );\n $appointment_class_name = lib::get_class_name( 'database\\appointment' );\n foreach( $appointment_class_name::select_for_site( $db_site, $modifier ) as $db_appointment )\n {\n $state = $db_appointment->get_state();\n if( 'reached' != $state && 'not reached' != $state )\n { // incomplete appointments only\n $appointment_datetime_obj = util::get_datetime_object( $db_appointment->datetime );\n \n $start_time_as_int = intval( $appointment_datetime_obj->format( 'Gi' ) );\n \n $duration = 'full' == $db_appointment->type ? $full_duration : $half_duration;\n $appointment_datetime_obj->add( new \\DateInterval( sprintf( 'PT%dM', $duration ) ) );\n $end_time_as_int = intval( $appointment_datetime_obj->format( 'Gi' ) );\n \n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[ $start_time_as_int ] = 0;\n $diffs[ $start_time_as_int ]--;\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[ $end_time_as_int ] = 0;\n $diffs[ $end_time_as_int ]++;\n }\n }\n \n // if we have no diffs on this day, then we have no slots\n if( 0 == count( $diffs ) ) return false;\n\n // use the 'diff' arrays to define the 'times' array\n $times = array();\n ksort( $diffs );\n $num_operators = 0;\n foreach( $diffs as $time => $diff )\n {\n $num_operators += $diff;\n $times[$time] = $num_operators;\n }\n\n // end day with no operators (4800 is used because it is long after the end of the day)\n $times[4800] = 0;\n \n // Now search the times array for any 0's inside the appointment time\n // NOTE: we need to include the time immediately prior to the appointment start time\n $start_time_as_int = intval( $start_datetime_obj->format( 'Gi' ) );\n $end_time_as_int = intval( $end_datetime_obj->format( 'Gi' ) );\n $match = false;\n $last_slots = 0;\n $last_time = 0;\n\n foreach( $times as $time => $slots )\n {\n // check the start time\n if( $last_time <= $start_time_as_int &&\n $time > $start_time_as_int &&\n 1 > $last_slots ) return false;\n\n // check the end time\n if( $last_time < $end_time_as_int &&\n $time >= $end_time_as_int &&\n 1 > $last_slots ) return false;\n\n $last_slots = $slots;\n $last_time = $time;\n }\n \n return true;\n }",
"public function _validateAppPackageWithAdplacementId()\n {\n return DB::table('applications')\n ->join('ad_placement', 'ad_placement.app_id', '=', 'applications.id')\n ->where('ad_placement.id', '=', $this->_placementId)\n ->where('applications.package_id', '=', $this->_appPackage)\n ->first();\n }",
"public function show($id)\n {\n $batch = Batch::all();\n $classes = Classes::all();\n $classroom = Classroom::all();\n $course = Course::all();\n $day = Day::all();\n $level = Level::all();\n $shift = Shift::all();\n $time = Time::all();\n $semester = Semester::all();\n\n $schedule = $this->scheduleRepository->find($id);\n\n if (empty($schedule)) {\n Flash::error('Schedule not found');\n\n return redirect(route('schedules.index'));\n }\n\n return view('schedules.show',compact('batch','classes','classroom','course',\n 'day','level','shift','time','semester'))->with('schedule', $schedule);\n }",
"public function viewappointments(){\n $appointments_table = TableRegistry::get('Appointments');\n $appointments = $appointments_table->find()->contain(['Users','Patients'])->order(['appointment_date'=>'DESC']);\n $this->set('appointments', $appointments);\n $this->viewBuilder()->setLayout('backend');\n }",
"public function show(Appointment $appointment)\n {\n return response(['appointment' => new AppointmentResource($appointment), 'message' => 'Retrieved Successfully'], 200);\n }",
"public function show(PatientAppointmentReminders $patientAppointmentReminders)\n {\n //\n }",
"public function show($id)\n {\n return Schedule::where('conference_id', $id)->latest()->get();\n }",
"public function __construct(appointment $appointment)\n {\n //\n $this->appointment = $appointment;\n }",
"public function getStationWithSchedules($id);",
"function get_assesment_by_taker(){\n \n $assesm_db=$this->assesm_db;\n // query to read single record\n //It loads the data file and converts it to an array\n $assesm_data = file_get_contents($assesm_db);\n $assesm_json = json_decode($assesm_data, true);\n $assesm_found=null;\n if (count($assesm_json)>0){\n $taker=$this->taker;\n foreach ($assesm_json as $as_key => $as_value) {\n $assesment_id=$as_key;\n foreach ($as_value as $as_var => $as_dat) {\n if ($as_var==\"taker\" && $as_dat==$taker) {\n $assesm_found=$assesm_json[$assesment_id];\n } \n }\n }\n }\n \n // set values to object properties\n $this->session_id = $assesm_found['session_id'];\n $this->test = $assesm_found['test'];\n $this->taker = $assesm_found['taker'];\n }",
"function getBookingDetailsByBookingId($bookingid) {\n $query = \"SELECT * FROM `bookingdetails` WHERE BookingId='\".$bookingid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }",
"public function findById($id) {\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM activities WHERE id=?\");\r\n\t\t$stmt->execute(array($id));\r\n\t\t$activity = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif($activity != null) {\r\n\t\t\treturn new Activity($activity[\"id\"],\r\n\t\t\t\t\t\t\t\t$activity[\"nombre\"],\r\n\t\t\t\t\t\t\t\t$activity[\"descripcion\"],\r\n\t\t\t\t\t\t\t\t$activity[\"dia\"],\r\n\t\t\t\t\t\t\t\t$activity[\"hora_inicio\"],\r\n\t\t\t\t\t\t\t\t$activity[\"hora_fin\"],\r\n\t\t\t\t\t\t\t\t$activity[\"plazas\"],\r\n\t\t\t\t\t\t\t\t$activity[\"entrenador\"]);\r\n\t\t} else {\r\n\t\t\treturn NULL;\r\n\t\t}\r\n\t}",
"protected function getPendingAppointments($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '1');\n\n if (is_array($returned))\n return $returned;\n\n// $curr_date = date('Y-m-d H:i:s', time());\n// $curr_date_bfr_30min = date('Y-m-d H:i:s', time() - 1800);\n// $curr_date_bfr_1hr = date('Y-m-d H:i:s', time() - 3600);\n\n\n $selectAppntsQry = \"select p.profile_pic,p.first_name,p.phone,p.email,a.appt_lat,a.appt_long,a.appointment_dt,a.extra_notes,a.address_line1,a.address_line2,a.status,a.booking_type from appointment a, slave p \";\n $selectAppntsQry .= \" where p.slave_id = a.slave_id and a.status = 1 and a.mas_id = '\" . $this->User['entityId'] . \"' order by a.appointment_dt DESC\"; // and a.appointment_dt >= '\" . $curr_date_bfr_1hr . \"'\n\n $selectAppntsRes = mysql_query($selectAppntsQry, $this->db->conn);\n\n if (mysql_num_rows($selectAppntsRes) <= 0)\n return $this->_getStatusMessage(30, $selectAppntsQry);\n\n $pending_appt = array();\n\n while ($appnt = mysql_fetch_assoc($selectAppntsRes)) {\n\n if ($appnt['profile_pic'] == '')\n $appnt['profile_pic'] = $this->default_profile_pic;\n\n $pending_appt[] = array('apntDt' => $appnt['appointment_dt'], 'pPic' => $appnt['profile_pic'], 'email' => $appnt['email'],\n 'fname' => $appnt['first_name'], 'phone' => $appnt['phone'], 'apntTime' => date('H:i', strtotime($appnt['appointment_dt'])),\n 'apntDate' => date('Y-m-d', strtotime($appnt['appointment_dt'])), 'apptLat' => (double) $appnt['appt_lat'], 'apptLong' => (double) $appnt['appt_long'],\n 'addrLine1' => urldecode($appnt['address_line1']), 'addrLine2' => urldecode($appnt['address_line2']), 'notes' => $appnt['extra_notes'], 'bookType' => $appnt['booking_type']);\n }\n\n\n $errMsgArr = $this->_getStatusMessage(31, 2);\n\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'appointments' => $pending_appt); //,'test'=>$selectAppntsQry,'test1'=>$appointments);\n }",
"public function show($id)\n {\n return $this->bookingRepository->find($id);\n }",
"public function show(Vacancy $id): DataResource\n {\n $vacancy = Vacancy::whereId($id->id)\n ->with(['category', 'district', 'cities', 'jobs', 'files'])\n ->firstOrFail();\n return new DataResource($vacancy);\n }",
"public function show(int $id)\n {\n return Applicant::findOrFail($id);\n }"
]
| [
"0.5577757",
"0.5511492",
"0.5421218",
"0.5330417",
"0.5330417",
"0.52154714",
"0.5206155",
"0.5195",
"0.5173478",
"0.5148814",
"0.5125115",
"0.51072997",
"0.51066935",
"0.50515807",
"0.50389725",
"0.49968475",
"0.4973263",
"0.4940497",
"0.49311906",
"0.492464",
"0.4905074",
"0.48862067",
"0.48857066",
"0.4863774",
"0.48625526",
"0.48454154",
"0.4814719",
"0.48076436",
"0.47936",
"0.47688925",
"0.47671816",
"0.4763031",
"0.47590926",
"0.47563535",
"0.47464237",
"0.47425508",
"0.47241592",
"0.47236145",
"0.47225198",
"0.47126052",
"0.47007835",
"0.46967494",
"0.46962816",
"0.46899417",
"0.4685589",
"0.4684974",
"0.46710506",
"0.4671015",
"0.46641546",
"0.46598932",
"0.46592692",
"0.46561223",
"0.46543062",
"0.46513212",
"0.46513212",
"0.46513212",
"0.46504033",
"0.4620418",
"0.46029213",
"0.46029213",
"0.4595472",
"0.45890957",
"0.4578264",
"0.4577927",
"0.45567057",
"0.4543723",
"0.45435822",
"0.45369804",
"0.4532086",
"0.45113674",
"0.45049754",
"0.44945598",
"0.44939506",
"0.44937778",
"0.4488516",
"0.4480871",
"0.4480795",
"0.447684",
"0.44693232",
"0.4460611",
"0.44472364",
"0.44386432",
"0.44319046",
"0.44211152",
"0.44209874",
"0.4416431",
"0.4408437",
"0.44063228",
"0.4401523",
"0.4398983",
"0.43986732",
"0.43945462",
"0.43933234",
"0.43801695",
"0.43751895",
"0.43669078",
"0.43519437",
"0.43481752",
"0.43446267",
"0.4343345"
]
| 0.7690778 | 0 |
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 return __CLASS__;;\n }",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}",
"public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}",
"public function getClassName() { return __CLASS__; }",
"public static function getClassName() {\n\t\treturn get_called_class();\n\t}",
"public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }",
"public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}",
"public static function getClassName()\n {\n return get_called_class();\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public static function className() : string {\n return get_called_class();\n }",
"public function getName()\n {\n return __CLASS__;\n }",
"public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}",
"public function getClassName()\n {\n return $this->class_name;\n }",
"public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}",
"public function getName(): string\n {\n return __CLASS__;\n }",
"public static function getClassName() {\n return get_called_class();\n }",
"public function getClassname(){\n\t\treturn $this->classname;\n\t}",
"public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}",
"public function getClassName()\n {\n return $this->_sClass;\n }",
"public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}",
"protected function getClassName(): string\n {\n return $this->className;\n }",
"public static function getClassName() {\n return self::$className;\n }",
"public function getClassName(): string;",
"public function getClassName() : string;",
"public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }",
"public function getClassName() : string\n {\n return $this->className;\n }",
"public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }",
"public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}",
"public function getClassName() : string\n {\n\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public static function staticGetClassName()\n {\n return __CLASS__;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n\t\treturn $this->className;\n\t}",
"public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }",
"public function getClassName() {\n\t\treturn $this->_className;\n\t}",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }",
"function getClassName()\n {\n // TODO: Implement getClassName() method.\n }",
"public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }",
"function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }",
"public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }",
"public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }",
"public function getClass()\n {\n return $this->_className;\n }",
"private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }",
"public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}",
"public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }",
"public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }",
"private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }",
"public function getClass(): string\n {\n return $this->class;\n }",
"public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }",
"public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}",
"public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }",
"public function getName(){\n\t\treturn get_class($this);\n\t}",
"public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }",
"public static function className()\n\t{\n\t\treturn static::class;\n\t}",
"public function toClassName(): string\n {\n return ClassName::full($this->name);\n }",
"public function getName()\n {\n return static::CLASS;\n }",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"function getName()\n {\n return get_class($this);\n }",
"public function className(): string\n {\n return $this->taskClass->name();\n }",
"public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }",
"function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}",
"public function getName() {\n return get_class($this);\n }",
"public function getName() {\n return get_class($this);\n }",
"public function toString()\n {\n return __CLASS__;\n }",
"public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}",
"public function getNamespacedName()\n {\n return get_class();\n }",
"protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}",
"protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }",
"function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}",
"public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}",
"public function __toString() {\n\t\treturn $this->className();\n\t}",
"public static function name()\n {\n return lcfirst(self::getClassShortName());\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.8529981",
"0.85237026",
"0.8502733",
"0.8493115",
"0.8491238",
"0.8488943",
"0.8484194",
"0.847459",
"0.8441478",
"0.8418852",
"0.8399611",
"0.83950585",
"0.83949184",
"0.83853173",
"0.8378261",
"0.837777",
"0.8372544",
"0.8355432",
"0.8355432",
"0.83479965",
"0.8325877",
"0.8325877",
"0.8312873",
"0.83027107",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.82474744",
"0.8242934",
"0.8202995",
"0.8185409",
"0.8184752",
"0.81829107",
"0.81829107",
"0.8176191",
"0.81761754",
"0.8162896",
"0.8142928",
"0.81323636",
"0.8062757",
"0.80528253",
"0.8045769",
"0.8033823",
"0.8026215",
"0.8001116",
"0.79949147",
"0.79779136",
"0.79672754",
"0.7957633",
"0.790449",
"0.78617185",
"0.7860126",
"0.7847096",
"0.78195953",
"0.7817044",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.77821547",
"0.7761565",
"0.77588034",
"0.7747239",
"0.77409905",
"0.77409905",
"0.7710985",
"0.76808393",
"0.7670475",
"0.76640886",
"0.76514393",
"0.76499707",
"0.76323646",
"0.76005036",
"0.75937456"
]
| 0.0 | -1 |
Funcao que seta a url de onde chegouse a esta UI. Para ser utilizado com acoes do tipo voltar e cancelar. | function setUrlUIAnterior($url) {
$this->urlUIAnterior = $url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function set_url_this_view($val){ $this->input ['table_url'] = $val ; }",
"function setUrl($url);",
"public function setUrl( $url );",
"function setURL($url){\n $this->urltoopen = $url;\n }",
"protected function set_url_this_edit($val){ $this->input ['edit_url'] = $val ; }",
"public function setURL($url);",
"public function setURL($url);",
"public function setUrl($url) {}",
"public function setUrl($url);",
"public function setUrl($url);",
"public function setUrl($url);",
"public function setUrl($url);",
"protected function set_url_this_dele($val){ $this->input ['delete_url'] = $val ; }",
"public function setUrl($url)\n {\n $this->options['url'] = $url;\n $this->storage[] = \"window.location.href = '$url';\";\n\n return $this->_btn;\n }",
"function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }",
"protected function setUrl() {\r\n\t\t$this->url = htmlspecialchars(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), ENT_QUOTES);\r\n\t}",
"public function editUrl() {}",
"public function setUrl()\n {\n $this->set('url', function() {\n $url = new Url();\n $url->setBaseUri('/');\n return $url;\n });\n }",
"public function setUrl($url){\n $this->url = $url;\n }",
"function set_url($select)\n{\n switch ($select) {\n case 'auth':\n return 'https://www.otomoto.pl/api/open/oauth/token';\n break;\n case 'advert':\n return 'https://www.otomoto.pl/api/open/account/adverts';\n break;\n case 'regions':\n return 'https://www.otomoto.pl/api/open/regions';\n break;\n case 'cities':\n return 'https://www.otomoto.pl/api/open/cities';\n break;\n case 'disctricts':\n return 'https://www.otomoto.pl/api/open/districts';\n break;\n case 'categories':\n return 'https://www.otomoto.pl/api/open/categories';\n break;\n case 'gallery':\n return 'https://www.otomoto.pl/api/open/imageCollections';\n break;\n default:\n return 'https://www.otomoto.pl/api/open';\n }\n}",
"protected function set_url_this_add($val){ $this->input ['add_url'] = $val ; }",
"public function setCurrentUrl(Url $url): void;",
"public function setUrl(?string $url): void;",
"public function setUrl(string $url): void;",
"function setUrl($url) {\n\t\t$this->_url = $url;\n\t}",
"function setUrl($url) {\n\t\t$this->_url = $url;\n\t}",
"public function setURL($url)\n {\n $this->url = $url;\n }",
"public function setUrl($value)\n {\n $this->_url = $value;\n }",
"function setUrl( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Url = ( $value );\n }",
"public function setIntended($url);",
"public function setUrl($url) {\n $this->url = $url;\n }",
"function VM_setVisualURL($VMguest,$url)\n{\n\t//Get information about the VM guest and its host\n\t$info = VM_getSWandHost($VMguest);\n\n\t//e.g. $url = \"m23vmclient:1\" => $hostScreen[0] = \"m23vmclient\", $hostScreen[1] = \"1\"\n\t$hostScreen = explode(\":\",$url);\n\t$data['vmVisualURL'] = \"$info[vmHostIP]:$hostScreen[1]\";\n\treturn(CLIENT_setAllParams($VMguest,$data));\n}",
"public function setUrl($url) {\n\t\t$this->url = $url;\n\t}",
"public function setUrl($work)\n\t{\n\t\t$this->url = $work;\n\t}",
"public function setEditUrl($url)\n {\n $this->_editUrl = $url;\n }",
"private function setUrl()\n {\n curl_setopt($this->curl, CURLOPT_URL, $this->server);\n }",
"public function setRequestUrl($url) {}",
"public function setUrl($url)\n\t{\n\t\t$this->url = $url;\n\t}",
"public function setUrl($url)\n\t{\n\t\t$this->url = $url;\n\t}",
"public function setUrlOnClick($url) {\r\n\t\t$this->urlOnClick = $url;\r\n\t}",
"public function setUrl($url)\r\n {\r\n $this->url = $url;\r\n }",
"public function addUrl() {\r\n\t\t$current = $this->params['url']['url'];\r\n\t\t$accept = array('show', 'admin_show', 'admin_index');\r\n\t\tif(in_array($this->action, $accept)) {\r\n\t\t\tif ($this->Session->read('history.current') != $current){\r\n\t\t\t\t//$this->Session->write('history.previous', $this->Session->read('history.current'))->write('history.current', $current);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function setSiteUrl()\n {\n }",
"public function setCancelUrl($url) {\n\t\t$this->_url_cancel = $url;\n\t}",
"public function getURL()\n {\n return $this->site->getURL() . 'unl_progress/edit/';\n\n }",
"private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }",
"public function setUrl( $url )\n\t{\n\t\tif ( $url ) {\n $this->url = $url;\n\t\t}\n\t}",
"public function setup_plugin_url()\n {\n }",
"public function ov_url($name, $value = ''){\n $args = func_get_args(); array_shift($args); array_shift($args);\n return $this->generate_input('url', $name, $value, true, $args);\n }",
"function setSyncUrl()\n {\n }",
"public function setUrl($url)\n {\n $this->_url = $url;\n }",
"public function setUrl($url)\r\n {\r\n $this->path['url'] = $url;\r\n }",
"public function setExternalJumpUrl() {}",
"public function setUrl($url)\n {\n $this->url = $url;\n }",
"public function setUrl($url)\n {\n $this->url = $url;\n }",
"public function setUrl($url)\n {\n $this->url = $url;\n }",
"protected function initiateUrl()\n\t{\n\t\t// base url\n\t\tif($this->app->config->has('app.url'))\n\t\t\t$this->setBase($this->app->config->get('app.url'));\n\n\t\t// asset url\n\t\tif($this->app->config->has('asset.url'))\n\t\t\t$this->setAsset($this->app->config->get('asset.url'));\n\t}",
"public static function setUrl(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$url = substr(static::$fullUrl, 0, strpos(static::$fullUrl, '?'));\n\t\t} else {\n\t\t\tstatic::$url = static::$fullUrl;\n\t\t}\n\n\t}",
"public function getEditUrl() { }",
"public function setUrl($url)\n {\n self::$url = $url;\n }",
"public function set_url( $url ) {\n\t\t$this->items[ $this->id ]['url'] = $url;\n\t\treturn $this;\n\t}",
"public function display_option_client_remote_url() {\n $client_remote_url = $this->options['client_remote_url'];\n $this->display_input_text_field('client_remote_url', $client_remote_url);\n?>\nThe URL of the remote instance on which to clear the cache.\n<?php\n }",
"function setActionURL($url) {\n\t\t$this->actionURL = $url;\n\t}",
"abstract public function get_url_update();",
"protected abstract function getButtonCallbackURL();",
"function force_menu_url($url)\r\n {\r\n //$this->get_category_menu()->forceCurrentUrl($url);\r\n }",
"function force_menu_url($url)\r\n {\r\n //$this->get_category_menu()->forceCurrentUrl($url);\r\n }",
"protected function get_url_this_edit(){ return $this->input ['edit_url'] ;}",
"public function setUrl($str){\n\t\t$this->url = $str;\n\t\t$tmp=parse_url($this->url); // heroku refuses to make direct dereference\n\t\t$host = $tmp['host'];\n\t\tforeach ($this->supportedHosts as $supportedHost) {\n\t\t\tif($host === $supportedHost){\n\t\t\t\t$this->host = $supportedHost;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public function setButtonImage($url)\n {\n $this->_image = $url;\n }",
"public function setLocation($url);",
"public function setURL($url)\n\t\t{\n\t\t\t$this->url = preg_replace(\"#/$#\", \"\", $url);\n\t\t}",
"public function setUrl($value) {\n return $this->set(self::URL, $value);\n }",
"function model_set_url($hook, $type, $url, $params) {\n\t$entity = $params['entity'];\n\tif (elgg_instanceof($entity, 'object', 'model')) {\n\t\t$friendly_title = elgg_get_friendly_title($entity->title);\n\t\treturn \"model/view/{$entity->guid}/$friendly_title\";\n\t}\n}",
"private function setURL($url)\r\n\t{\r\n\t\tcurl_setopt($this->getConnection(), CURLOPT_URL, $url);\r\n\t}",
"public function widgetUriAction()\n {\n }",
"public function setUrl($url)\n {\n if (is_string($url)) {\n $this->url = $url;\n }\n }",
"public function getCancelUrl() {\n return new Url('tfa.settings');\n }",
"public function setUrl($url) {\n return curl_setopt($this->ch,CURLOPT_URL,$url);\n }",
"abstract public function url($manipulation_name = '');",
"public function url()\n {\n return backpack_url(\"/page/{$this->id}/edit\");\n }",
"public function url();",
"public function url();",
"public function url();",
"public function setLocalizedUrl($url, $default);",
"function setURL( $url ) \n {\n $this->setValueByFieldName( 'navbarlink_url', $url );\n }",
"public function offerte_view($url) {\n\t\t\n\t\tif (!$this->session->user) {\n\t\t\taudit_log(\"Error: tentativo accesso con utente non loggato. (admin/offerte_view)\");\n\t\t\tredirect('admin/login');\n\t\t}\n\t\t\n\t\tif (!isset($url)) show_404();\n\t\t\n\t\t// carico usato\n\t\tif (!$offerta=$this->offerte_model->getOffertaByUrl($url)) show_404();\n\t\t$offerta->pics=$this->offerte_model->getOffertaPics($offerta->id);\n\t\t// se immagini home e banner sono null.jpg passo json array vuoto \n\t\t$offerta->home_file=$offerta->img_home==\"null.jpg\" ? \"[]\" : json_encode(array($offerta->img_home));\n\t\t$offerta->banner_file=$offerta->img_banner==\"null.jpg\" ? \"[]\" :json_encode(array($offerta->img_banner));\n\t\t$offerta->descr=json_decode($offerta->descr);\n\t\t$offerta->btn_txt=json_decode($offerta->btn_txt);\n\t\t$offerta->link=json_decode($offerta->link);\n\t\t$offerta->link_ita=$offerta->link->it==\"\" ? \"[]\" : json_encode(array($offerta->link->it));\n\t\t$offerta->link_eng=$offerta->link->en==\"\" ? \"[]\" : json_encode(array($offerta->link->en));\n\t\t$offerta->seo=json_decode($offerta->seo);\n\t\t$data['offerta']=$offerta;\n\t\t\n\t\t$this->load->view('admin/start');\n\t\t$this->load->view('admin/navigation');\n\t\t$this->load->view('admin/offerte/view',$data);\n\t\t$this->load->view('admin/scripts');\t\n\t\t$this->load->view('admin/offerte/view_scripts');\t\n\t\t$this->load->view('admin/close');\n\t}",
"public function set_status_peca_url($status_peca) : void\n {\n try {\n if (self::Verificar_Login()) {\n $this->status_peca = DAO_Status_Peca::Buscar_Id_Por_Url(Validador::Status_Peca()::validar_url($status_peca));\n }\n } catch (Exception $e) {\n $this->status_peca = null;\n }\n }",
"protected function get_url_this_view(){ return $this->input ['table_url'] ;}",
"public function program_url() {\n $tipos = Feeds::all()->lists('nameFeed', 'id_feed');\n $combobox = array(0 => \"Seleccione ... \") + $tipos;\n $selected = array();\n $exito = 'hola';\n\n return View::make(\"escaleta.programsUrls\", compact('combobox', 'selected', 'hrs', 'tiphr', 'minust', 'exito'));\n }",
"public function setUrl($val)\n {\n $this->_propDict[\"url\"] = $val;\n return $this;\n }",
"public function setURL($url)\n {\n $this->menu_url = $url;\n return $this;\n }",
"public function setUrl(string $url)\n {\n $this->url = $url;\n }",
"public function setUrl(string $url)\n {\n $this->url = $url;\n }",
"function set_current_url() {\r\n\t\t\t$this->current_url = $this->get_current_url();\r\n\t\t}",
"public function set_tgmpa_url() {\n\n\t\t\t$this->tgmpa_menu_slug = ( property_exists( $this->tgmpa_instance, 'menu' ) ) ? $this->tgmpa_instance->menu : $this->tgmpa_menu_slug;\n\t\t\t$this->tgmpa_menu_slug = apply_filters( $this->theme_name . '_theme_setup_wizard_tgmpa_menu_slug', $this->tgmpa_menu_slug );\n\n\t\t\t$tgmpa_parent_slug = ( property_exists( $this->tgmpa_instance, 'parent_slug' ) && $this->tgmpa_instance->parent_slug !== 'themes.php' ) ? 'admin.php' : 'themes.php';\n\n\t\t\t$this->tgmpa_url = apply_filters( $this->theme_name . '_theme_setup_wizard_tgmpa_url', $tgmpa_parent_slug . '?page=' . $this->tgmpa_menu_slug );\n\n\t\t}",
"function client_url() {\n\tglobal $post;\n\t$url = get_post_meta($post->ID, 'client_url', true);\n\tif ($url) {\n\t\t?>\n\t\t<a href=\"<?php echo $url; ?>\" target=\"_blank\">Live Preview →</a>\n <?php\n\t}\n}",
"function widgetopts_addhttp($url) {\n if (!preg_match(\"~^(?:f|ht)tps?://~i\", $url)) {\n $url = \"http://\" . $url;\n }\n return $url;\n}",
"public function getUrl(){\n\t\treturn \\GO::view()->getUrl().'themes/'.$this->getName().'/';\n\t}",
"public function index()\n\t{\n\t\t//on récupère l'URL\n\t\t//echo \"on cherche : \".$this->guid;\n\t\t\n\t\t\n\t}"
]
| [
"0.6519466",
"0.6498581",
"0.64815336",
"0.6444786",
"0.64433604",
"0.6359765",
"0.6359765",
"0.63367283",
"0.6285967",
"0.6285967",
"0.6285967",
"0.6285967",
"0.6214616",
"0.61961114",
"0.61682475",
"0.61540985",
"0.6083587",
"0.6066366",
"0.60239154",
"0.5993777",
"0.59786326",
"0.59600925",
"0.5958029",
"0.5951396",
"0.59456027",
"0.59456027",
"0.59338784",
"0.5904648",
"0.5848129",
"0.5757773",
"0.57447934",
"0.5732875",
"0.568748",
"0.56681126",
"0.56642383",
"0.5661402",
"0.56581116",
"0.56427795",
"0.56427795",
"0.56404513",
"0.56274116",
"0.56224424",
"0.5620226",
"0.5575108",
"0.55703086",
"0.5568249",
"0.55591214",
"0.5538112",
"0.55335784",
"0.5533257",
"0.552873",
"0.55130756",
"0.5505328",
"0.54948485",
"0.54948485",
"0.54948485",
"0.549008",
"0.54828984",
"0.54754895",
"0.5466221",
"0.5425312",
"0.54004824",
"0.53918016",
"0.5391219",
"0.53898996",
"0.5384758",
"0.5384758",
"0.5381849",
"0.5368267",
"0.53646743",
"0.53637743",
"0.53541297",
"0.5348674",
"0.53464013",
"0.5336455",
"0.53353745",
"0.53336906",
"0.5333256",
"0.53329915",
"0.5300079",
"0.529687",
"0.5286034",
"0.5286034",
"0.5286034",
"0.5285797",
"0.528326",
"0.527673",
"0.5263548",
"0.5263507",
"0.5262558",
"0.5257184",
"0.5255637",
"0.525439",
"0.525439",
"0.52493185",
"0.52478004",
"0.5247606",
"0.52453536",
"0.52258736",
"0.52251166"
]
| 0.7376644 | 0 |
Setter for `allRecords` property | public function allRecords(bool $allRecords = true): self
{
$this->allRecords = $allRecords;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRecords();",
"public function setRecords($records)\n {\n $this->records = $records;\n }",
"function setRecords($records) {\n\t\tif (is_null($records)) return;\n\t\t$this->records = $records;\n\t}",
"public function getAll()\n {\n $records = $this->getRecordsModel()->getAll();\n \n return $records;\n }",
"public function setRecords($pArray) {\r\n $this->records = $pArray;\r\n }",
"function getRecords() {\n\t\treturn $this->records;\n\t}",
"public function setAllResults($all_results)\n {\n # Set the variable.\n $this->all_results = $all_results;\n }",
"public function getRecords()\n {\n return $this->records;\n }",
"public function getRecords()\n {\n return $this->records;\n }",
"#[\\ReturnTypeWillChange]\n function records()\n {\n return $this->getArrayCopy();\n }",
"public function records() { return $this->_m_records; }",
"public function testGetAllRecords(): void\n {\n $dnsLookup = $this->buildMockedForType();\n $dnsRecords = $dnsLookup->getAllRecords();\n $this->assertCount($this->numberOfRecordTypes, $dnsRecords);\n }",
"function setTotalRecords($total)\n\t{\n\t\t$this->total_records = 0+$total;\n\t}",
"public function records() : array {\n return $this->records;\n }",
"public function all()\n {\n // TODO: Implement all() method.\n }",
"public function all()\n {\n // TODO: Implement all() method.\n }",
"public static function all()\n\t{\n\t\treturn self::new_instance_records()->all();\n\t}",
"public function setAll(array $values): self {\n $this->record = array_merge($this->record, $values);\n return $this;\n }",
"public function allRecords()\n\t{\n\t\treturn $this->with(['applicant.department.college.branch', \n\t\t\t'patent', 'project', 'projectType'])\n ->get();\n\t}",
"public function setAll($var)\n {\n GPBUtil::checkBool($var);\n $this->all = $var;\n\n return $this;\n }",
"public function all()\n {\n $sql = $this->get();\n $this->query = $sql;\n }",
"public function reset()\n {\n $this->values[self::_RECORDS] = array();\n }",
"public function getRecords()\n\t{\n\t\treturn $this->records['data'];\n\t}",
"public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}",
"public function all($flag = true) {\n\t\t$this->all = (boolean) $flag;\n\t\treturn $this;\n\t}",
"protected final function fetchRecords()\n {\n $this->query->setLimit(\n (($this->parameters->getCurrentPage() - 1) * $this->parameters->getResultsPerPage()),\n $this->parameters->getResultsPerPage()\n );\n\n $this->data = $this->query->execute()->getAssociative();\n }",
"public function setIncludeAllAccountTargets($val)\n {\n $this->_propDict[\"includeAllAccountTargets\"] = boolval($val);\n return $this;\n }",
"public function all() {\n \n }",
"public function records() {\n if( ! property_exists($this->response(), 'records') ) return [];\n\n return $this->response()->records;\n }",
"public function fetchRecords() {\n return self::all();\n }",
"function getRecords($limit = false)\n\t{\n\t\tif ($limit !== false)\n\t\t\t$this->setParam(\"limit\", $limit);\n\n\t\t$this->table->getRecords();\n\t}",
"public function setRecords($recordsCount, $offset = 0)\n {\n $this->recordsPerPage = $recordsCount;\n $this->recordsOffset = $offset;\n }",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function all();",
"public function setRecordsTotal(int $recordsTotal): DataTablesResponseInterface;",
"public function __construct($records)\n {\n $this->_records = $records;\n parent::__construct();\n }",
"function __construct() {\n $this->records = array(new Record(), new Record(), new Record);\n }",
"public function getTotalRecords() {\n return $this->totalRecords;\n }",
"public function getAllRecords()\n\t{\n\t\t$class = get_class( $this );\n\t\t$constraint = '';\n\t\t$return = FALSE;\n\t\t\n\t\t$sql = \"\n\t\tSELECT setting_id\n\t\tFROM common_Settings\n\t\tWHERE setting_id != 0 AND\n\t\tactive = 1\n\t\tORDER BY title ASC\";\n\t\t\n\t\t$records = $this->m_common->m_db->doQuery( $sql );\n\t\t\n\t\tif( is_array( $records ) )\n\t\t{\n\t\t\tforeach( $records as $i => $info )\n\t\t\t{\n\t\t\t\t$return[] = new $class( $info['setting_id'], TRUE );\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\treturn $return;\n\t\t\n\t}",
"public function records()\n {\n return $this->hasMany(Record::class);\n }",
"public function all()\n {\n }",
"public function all()\n {\n }",
"public function all()\n {\n }",
"public function all()\n {\n }",
"protected function getRecords()\n {\n $query = $this->prepareQuery();\n\n if ($this->showTree) {\n $records = $query->getNested();\n }\n elseif ($this->showPagination) {\n $method = $this->showPageNumbers ? 'paginate' : 'simplePaginate';\n $currentPageNumber = $this->getCurrentPageNumber($query);\n $records = $query->{$method}($this->recordsPerPage, $currentPageNumber);\n }\n else {\n $records = $query->get();\n }\n\n /**\n * @event backend.list.extendRecords\n * Provides an opportunity to modify and / or return the `$records` Collection object before the widget uses it.\n *\n * Example usage:\n *\n * Event::listen('backend.list.extendRecords', function($listWidget, $records) {\n * $model = MyModel::where('always_include', true)->first();\n * $records->prepend($model);\n * });\n *\n * Or\n *\n * $listWidget->bindEvent('list.extendRecords', function ($records) {\n * $model = MyModel::where('always_include', true)->first();\n * $records->prepend($model);\n * });\n *\n */\n if ($event = $this->fireSystemEvent('backend.list.extendRecords', [&$records])) {\n $records = $event;\n }\n\n return $this->records = $records;\n }",
"public function find_all() {\n\t\t\t// Return all \n\t\t\treturn $this->all = $this->db->query('SELECT * FROM logs', PDO::FETCH_ASSOC);\n\t\t}",
"public function showAllRecordsPage() { \n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-show-all') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $this->data['message'] = $this->session->flashdata('message');\n $result = $this->UserModel->getAllRecords();\n foreach ($result as $key => $value) {\n $permission_group = $this->UserModel\n ->getUserType($result[$key]['id']);\n $result[$key]['user_role'] = $permission_group->group_name;\n }\n\n $this->data['result'] = $result;\n $this->set_view('user/view_all_records_page', $this->data);\n } else {\n echo \"access denied\";\n }\n }",
"public function useAllFields() {\n $this->__onlyFields = array();\n }",
"abstract public function all();",
"public function allResults(){\n }",
"public function setRecordsFiltered(int $recordsFiltered): DataTablesResponseInterface;",
"function setRecordsPerPage($count) {\n $this->records_per_page = $count;\n}",
"public function addOrReplaceRecords(array $records = []): bool;",
"public function getListOfRecordsPerPage()\n {\n return $this->listOfRecordsPerPage;\n }",
"public function noRecords($value) {\n return $this->setProperty('noRecords', $value);\n }",
"public function recordsPerPage($val) {\r\n $this->settings[\"recordsPerPage\"] = $val;\r\n return $this;\r\n }",
"protected function getCollectedRecords() {}",
"protected function getCollectedRecords() {}",
"protected function getCollectedRecords() {}",
"public function getAll()\n {\n return parent::getAll();\n }",
"public function getAll()\n {\n return parent::getAll();\n }",
"public function getAll()\n {\n return parent::getAll();\n }",
"public function getAll()\n {\n return parent::getAll();\n }",
"public function getQueryRecords()\n {\n return $this->get(self::_QUERY_RECORDS);\n }",
"public static function all();",
"public static function all();",
"public static function all();",
"public function refresh()\n {\n foreach($this->records as $rec) {\n $rec->refresh($this->conn);\n }\n }",
"public function clearRecords()\n\t{\n\t\tdie('Amol. here!!');\n\t}",
"public function all()\n {\n return parent::all();\n }",
"public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }"
]
| [
"0.66266614",
"0.64751077",
"0.6384045",
"0.6284252",
"0.5967521",
"0.5899036",
"0.58822733",
"0.5852143",
"0.5852143",
"0.5741258",
"0.5683714",
"0.5618949",
"0.5556385",
"0.5545155",
"0.54824644",
"0.54824644",
"0.5473287",
"0.54608876",
"0.54227173",
"0.5396415",
"0.5377708",
"0.53662765",
"0.53563917",
"0.5333778",
"0.5305369",
"0.53025717",
"0.52925664",
"0.5282433",
"0.52685565",
"0.5258987",
"0.52388924",
"0.52360153",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.52300084",
"0.5210634",
"0.51649654",
"0.5148194",
"0.50926906",
"0.50837994",
"0.50661474",
"0.50572354",
"0.50572354",
"0.50572354",
"0.50572354",
"0.50494736",
"0.5012919",
"0.5006739",
"0.5004522",
"0.5002319",
"0.49672744",
"0.4965554",
"0.49494138",
"0.49450585",
"0.49419576",
"0.49359077",
"0.4925987",
"0.49097234",
"0.49097234",
"0.49078855",
"0.4893704",
"0.4893704",
"0.4893704",
"0.4893704",
"0.4889487",
"0.48870376",
"0.48870376",
"0.48870376",
"0.48860037",
"0.48857862",
"0.487336",
"0.48732558"
]
| 0.8067954 | 0 |
Set the Program Domain id in temp storage. | public function setProgramDomainId($program_id = NULL); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteProgramDomainId();",
"public function getProgramDomainId();",
"function setDomain($domain)\n {\n }",
"function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }",
"function setSyncIdDev()\n {\n }",
"public function setStoragePid($storagePid) {\n\t\t$setup = $this->configurationManager->getConfiguration(\n\t\t\t\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager::CONFIGURATION_TYPE_FRAMEWORK\n\t\t);\n\t\t$setup = \\TYPO3\\CMS\\Extbase\\Service\\TypoScriptService::convertPlainArrayToTypoScriptArray($setup);\n\t\t$setup['persistence.']['storagePid'] = (int) $storagePid;\n\t\t$this->configurationManager->setConfiguration($setup);\n\t}",
"function setDevId($value)\n {\n $this->_props['DevId'] = $value;\n }",
"public function set_domain_name( $app_id, $new_domain ) {\n\t\treturn update_post_meta( $app_id, 'wpapp_domain', $new_domain );\n\t}",
"private function setDomainSerial($uuid)\n {\n if ($this->request->isPost()) {\n $record = $this->getModel()->getRecord($uuid);\n if ($record !== null) {\n (new Domain())->updateSerial((string)$record->domain)->serializeToConfig();\n Config::getInstance()->save();\n }\n }\n }",
"protected function setDomain($new_domain)\n\t{\n\t\t$this->activeDomain = $new_domain;\n\t}",
"function setDomain( $domain ) {\n $this->domain = $domain;\n }",
"function assign_random_domain($user_id)\n{\n\t$user_domains = TaskBuffer::where('user_id', $user_id)->lists('domain_id');\n\t$all_domains = Domain::all()->lists('id');\n\t$diff = array_diff($all_domains, $user_domains);\n\t$diff = array_values($diff);\n\n\tif (sizeof($diff) > 0)\n\t{\n\t\t$domain_id = select_domain($diff);\n\t\tif (create_task_buffer($domain_id, $user_id))\n\t\t\t$response_array = array(\"status\" => \"success\");\n\t\telse\n\t\t\t// echo \"assigning random domain failed\";\n\t\t\t$response_array = array(\"status\" => \"fail\");\n\t}\n\telse\n\t\t$response_array = array(\"status\" => \"done\");\n\treturn $response_array;\n}",
"public function setDomain($domain)\n {\n $this->_domain = $domain;\n }",
"function setDomain( $domain ) {\n $this->domain = $domain;\n }",
"public function setDomain(string $domain): void\n {\n $this->domain = $domain;\n }",
"public function setUserDomain(?string $value): void {\n $this->getBackingStore()->set('userDomain', $value);\n }",
"public function setDomain(Whois_Lookup_Domain $domain)\n {\n $this->_domain = $domain;\n }",
"public function setDomain( $domain )\n {\n $this->domain = us($domain);\n }",
"public function setDomain($domain)\n {\n $this->domain = $domain;\n }",
"public function setDomain(Domain $domain)\n {\n $this->domain = $domain;\n }",
"public function setDomain( $domain )\n {\n $this->domain = $domain;\n }",
"public function setDomain($domain)\n {\n $this->domain = $this->prepareDomainName($domain);\n }",
"public function store(Request $request, $domainId)\n {\n }",
"public function getProgramID () {\n\t$preValue = $this->preGetValue(\"programID\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"programID\")->preGetData($this);\n\treturn $data;\n}",
"function setSiteId($value)\n {\n $this->_props['SiteId'] = $value;\n }",
"public function setDomain($value = null)\n {\n\n }",
"public function incrementDomains()\n {\n $this->domains[] = '';\n }",
"function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}",
"public function overrideID ($id)\n {\n $this->domain->id = (int) $id;\n $this->replacedID = true;\n }",
"private function loadSiteId() {\r\n\t\tif (function_exists ( 'get_option' ) && get_option ( $this->const_option_fraxion_site_id ) != false) {\r\n\t\t\t$this->fraxion_site_id = get_option ( $this->const_option_fraxion_site_id );\r\n\t\t} else {\r\n\t\t\t$this->fraxion_site_id = NULL;\r\n\t\t}\r\n\t}",
"private function getHostId($domain)\n\t{\n//\t\tget saved host ID\n\t\tif (isset($this->hostIds[$domain]) && !empty($this->hostIds[$domain]))\n\t\t\treturn $this->hostIds[$domain];\n\n//\t\telse get host ID from API (host will be saved in local)\n\t\t$hosts = $this->getFeeds();\n\t\t\n\t\treturn $hosts[$domain]['host_id'];\n\t}",
"public function set(string $id, string $translation, string $domain = 'messages'): void;",
"protected function getStoragePID() {\r\n\t\t$tsConf = tx_pttools_div::typoscriptRegistry('plugin.tx_ptgsaconfmgm.');\r\n\t\t$persDataStorage = $tsConf['persDataStorage'];\r\n\t\treturn $persDataStorage;\r\n\t}",
"public function setProgramID ($programID) {\n\t$this->programID = $this->getClass()->getFieldDefinition(\"programID\")->preSetData($this, $programID);\n\treturn $this;\n}",
"function setID($path);",
"public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }",
"public function setProgram($val)\n {\n $this->_propDict[\"program\"] = $val;\n return $this;\n }",
"public function set($domain, $key, $value)\n {\n if (!$this->enabled)\n {\n return;\n }\n\n static $no_cache = false;\n if (!$no_cache)\n {\n // midgardmvc_core::get_instance()->cache->content->no_cache();\n $no_cache = true;\n }\n\n $this->data[$domain][$key] = serialize($value);\n $this->dispatcher->session_set_var(self::ROOT, $this->data);\n }",
"function newId() {\n $this->log .= \"newId() called<br />\";\n $this->id = sha1(uniqid(rand(), true));\n $this->filename = $this->dir.\"sid_\".$this->id;\n if (!setcookie('sid' ,$this->id, null, \"/\", $this->domain_cookie)) {\n $this->log .= \"sid cookie save failed. This may be due to browser output started prior or the user has disabled cookies.<br />\";\n return false;\n }\n return true;\n }",
"private function setWebsiteValue()\n {\n $value = $this->getData(self::$websiteAttributeCode);\n $list = $this->storeManager->getWebsites();\n $this->setCustomAttribute(self::$websiteAttributeCode, $list[$value]->getName());\n $this->setCustomAttribute(self::$websiteIdAttributeCode, $value);\n }",
"public function set($id, string $translation, string $domain = 'messages');",
"public function getDomainUid(): string\n {\n return $this->domain_uid;\n }",
"function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}",
"public function getProgramId()\n {\n return $this->ProgramId;\n }",
"public function setApplicationId(?string $value): void {\n $this->getBackingStore()->set('applicationId', $value);\n }",
"private function setApplicationDefinitionId($appId) {\n\t\t\\Scrivo\\ArgumentCheck::assertArgs(func_get_args(), array(\n\t\t\tarray(\\Scrivo\\ArgumentCheck::TYPE_INTEGER)\n\t\t));\n\n\t\tif ($this->applicationDefinitionId) {\n\t\t\tthrow new \\Scrivo\\SystemException(\n\t\t\t\t\"Can't reset the the application id\");\n\t\t}\n\t\treturn $this->applicationDefinitionId = $appId;\n\t}",
"public function testUpdateDomain()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"static function change_new_blog_domain_name( int $blog_id, int $user_id, string $domain ) {\n\n // Parse site slug from full domain\n $slug = strtok($domain, '.');\n $new_domain = $slug . '.' . self::get_multisite_tld();\n\n // Replace the domain that was just created\n global $wpdb;\n $wpdb->update( $wpdb->blogs, array( 'domain' => $new_domain ), array( 'blog_id' => $blog_id ) );\n\n // Replace blog home & siteurl\n update_blog_option ( $blog_id, 'siteurl', 'http://' . $new_domain );\n update_blog_option ( $blog_id, 'home', 'http://' . $new_domain );\n }",
"function setid_exp($val)\n { $this->id_exp=$val;}",
"public function set_domain($domain) {\r\n $this->domain = $domain;\r\n textdomain($this->domain);\r\n Application::config()->domain = $this->domain;\r\n return true;\r\n }",
"public function setProcessId(?int $value): void {\n $this->getBackingStore()->set('processId', $value);\n }",
"function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }",
"public function setDeviceId(?string $value): void {\n $this->getBackingStore()->set('deviceId', $value);\n }",
"public function setDomain($url) {\n\t\t$this->_domain = $url;\n\t}",
"function SetId($value) { $this->id=$value; }",
"function setid_exp($val)\n { $this->id_exp=$val;}",
"function setid_exp($val)\n { $this->id_exp=$val;}",
"private function setData( $id, $pk, $uid, $dis, $trials, $active ) {\n\t\t$this->id = $id;\n\t\t$this->passkey = $pk;\n\t\t$this->user_id = $uid;\n\t\t$this->discount = $dis;\n\t\t$this->trials = $trials;\n\t\t$this->active = $active;\n\t\t$this->type_def = PasskeyType::get_type( $this->passkey );\n\t\t$this->type = $this->type['id'];\n\t}",
"function affwp_affiliate_dashboard_update_program( $data ) {\n\n\t$affiliate_id = absint( $data['affiliate_id'] );\n\n\tif ( ! empty( $data['program'] ) ) {\n\n\t\t$program = sanitize_text_field( $data['program'] );\n\n\t\taffwp_update_affiliate_meta( $affiliate_id, 'program', $program );\n\n\t} else {\n\n\t\taffwp_delete_affiliate_meta( $affiliate_id, 'program' );\n\n\t}\n\n}",
"private function set_idapp($idapp = '') {\r\n if (empty($idapp)) {\r\n $this->add_log('set_idapp: IdApp KO, parameter is empty', 'ERROR');\r\n return false;\r\n }\r\n\r\n $this->add_log('set_idapp: IdApp OK, setted to \"'.$idapp.'\"');\r\n\r\n $this->idApp = $idapp;\r\n return true;\r\n }",
"public function getDefaultBackendStoragePid() {}",
"public function getDefaultBackendStoragePid() {}",
"function setProgramPath($programPath)\r\n\t{\r\n\t\t$this->programPath = $programPath;\r\n\t}",
"public function getStoragePid(): array;",
"function setCountryId( $value )\n {\n $this->CountryID = $value;\n }",
"private function generateId() {\n $this->setId(AgaviToolkit::uniqid(\"ldap_conn_\"));\n }",
"function get_branded_domain_id_option() {\n $options = get_option('sbrb_settings');\n $domain = $options['sbrb_domain_id'];\n\n if( isset($domain) || $domain != '') {\n return array('id' => $domain);\n } else {\n return;\n }\n }",
"public function tempId()\n {\n $this->id = uniqid('item');\n }",
"public function setDomain(OntologyClass $domain)\n {\n $this->domain = $domain;\n }",
"public function updateId() {\n $this->Id = session_id();\n }",
"function setPID($pid) {\n\t\t$this->_pid = $pid;\n\t}",
"private function settleId($str)\n\t{\n\t\tif (! $this->setId($str) && ! $this->setId($_COOKIE[$this->name]))\n\t\t\t$this->mkNew();\n\t}",
"function StoreTestId($testID)\n {\n StartSession();\n \n $_SESSION[GetTestIdIdentifier()] = $testID;\n }",
"abstract public function set($id, $namespace = self::DEFAULT_NAMESPACE, $data);",
"private function fillDomainUserId(User $user, Request $request) {\n $user->DomainUserId = $request->domainuserid;\n }",
"public static function loadFromDomainID($db, $domain) {\n\t\t$result = static::find($db, ['domain_id' => $domain]);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function set_program($program)\n {\n $this->program = self::id_or_entity_helper($program, \"ProgramLegacy\");\n return $this;\n }",
"public function record()\n {\n SearchDomainManager::recordDomainConfig($this);\n $dbDomain = new SearchDomainDatabase($this->name);\n $dbDomain->initialize();\n }",
"private function initProcessId()\n {\n if ($this->processId === null) {\n if (1 === preg_match('#(fpm-fcgi|apache)#i', php_sapi_name())) {\n if (function_exists('posix_getppid')) {\n $this->processId = posix_getppid();\n }\n } else {\n $pid = getmypid();\n if ($pid != false) {\n $this->processId = $pid;\n }\n }\n }\n }",
"public function setParentSiteId(?string $value): void {\n $this->getBackingStore()->set('parentSiteId', $value);\n }",
"public function init() {\n parent::init();\n $this->domain = pm_Session::getCurrentDomain();\n }",
"public function setProcessIdAttribute($input)\n {\n $this->attributes['process_id'] = $input ? $input : null;\n }",
"function setCertId($value)\n {\n $this->_props['CertId'] = $value;\n }",
"public function setDomainAttribute($value)\n {\n $this->attributes['domain'] = strtolower($value);\n }",
"public function initDomain($domain)\n {\n\t\t$this->domain = UrlCraw::where('domain' , $domain)->get();\n\t\tforeach ($this->domain as $url) {\n\t\t\t$this->url = $url;\n\t\t\t$this->initCrawler();\n\t\t}\n }",
"public static function setCurrentID($id) {\n Session::put(Privilege::SESSION_NAME_ID, $id);\n }",
"public static function setPersistentVar ($name, $var) {\n if (!isset($_SESSION['system_persistent_var'])) $_SESSION['system_persistent_var'] = array ();\n $_SESSION['system_persistent_var'][$name] = serialize($var);\n \n }",
"protected function setStoragePageId($pid)\n {\n if ($pid) {\n $querySettings = $this->objectManager->get(Typo3QuerySettings::class);\n $querySettings->setStoragePageIds([$pid]);\n $this->setDefaultQuerySettings($querySettings);\n }\n }",
"public function SetDefault($domain) {\n return $this->sendRequest('domain/setdefault', array(\n 'domain' => $domain\n ));\n }",
"public function setLocalIdentifier($val)\n {\n $this->_propDict[\"localIdentifier\"] = $val;\n return $this;\n }",
"function wpsight_option_name() {\n\t$wpsight_options_settings = get_option( WPSIGHT_DOMAIN );\n\t$wpsight_options_settings['id'] = WPSIGHT_DOMAIN;\n\tupdate_option( WPSIGHT_DOMAIN, $wpsight_options_settings );\n}",
"public function set_domain($domain)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_domain($domain));\n\n // Update mail domain\n //-------------------\n\n $this->_set_parameter('domain', $domain);\n\n // Update Postfix domain\n //----------------------\n\n $postfix = new Postfix();\n $postfix->set_domain($domain);\n\n // Set domain for user and group mail attributes\n //----------------------------------------------\n\n if (clearos_load_library('mail_extension/Mail_Domain')) {\n $mail_domain = new \\clearos\\apps\\mail_extension\\Mail_Domain();\n $mail_domain->set_domain($domain);\n }\n }",
"function data_set($path, $value, $type = 0) {\n /**what is the F with php7\n xpAS::set($type ? self::$_global_data : $_SESSION, ($type ? '' : '_application_data,') . $path, $value);\n */\n $fpg = $type ? self::$_global_data : $_SESSION;\n xpAS::set($fpg, ($type ? '' : '_application_data,') . $path, $value);\n if ($type) self::$_global_data = $fpg;\n else $_SESSION = $fpg;\n return $value;\n }",
"public static function setData($data, Host $host){\n\t\t$host->id = $data[\"id\"];\n\t\t$host->domain = $data[\"domain\"];\n\t\t$host->extension = $data[\"extension\"];\n\t\t$host->host = $data[\"host\"];\n\t\tif(isset($data['wildcardOf'])){\n\t\t\t$host->wildcardOf = $data['wildcardOf'];\n\t\t}\n\t}",
"public function getDataDomain();",
"function set_id ($id)\r\n {\r\n $_SESSION[\"id\"] = $id;\r\n }",
"public function set($data) {\r\n return apc_store($this->key, $data, $this->timeout);\r\n }",
"public function setStored($hintId)\n\t{\n\t\t$_SESSION[__CLASS__][$this->questionId] = $hintId;\n\t}",
"public function setProxyDepartmentId($value)\n {\n return $this->set(self::PROXYDEPARTMENTID, $value);\n }",
"function newId() {\r\n\t\t$this->log .= \"newId() called<br />\";\r\n\t\t$this->id = md5(uniqid(rand(), true));\r\n\t\t$this->filename = $this->dir.\"sid_\".$this->id;\r\n\t\tif (!setcookie('sid' ,$this->id, null, \"/\")) {\r\n\t\t\t$this->log .= \"sid cookie save failed. This may be due to browser\"\r\n\t\t\t.\" output started prior or the user has disabled cookies.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\treturn true;\r\n\t}"
]
| [
"0.6269727",
"0.6258912",
"0.53390354",
"0.5254751",
"0.5216292",
"0.51751846",
"0.51483786",
"0.51457924",
"0.5087578",
"0.5074726",
"0.50716096",
"0.5067037",
"0.503262",
"0.5024707",
"0.5023294",
"0.50037855",
"0.49954045",
"0.49743342",
"0.49567708",
"0.4950779",
"0.49367929",
"0.49321166",
"0.49243784",
"0.49052408",
"0.48633868",
"0.48505336",
"0.4816571",
"0.48136303",
"0.47979695",
"0.47850013",
"0.477653",
"0.476873",
"0.47682905",
"0.47258756",
"0.47016093",
"0.46950918",
"0.46868545",
"0.46587577",
"0.46568945",
"0.4653736",
"0.46486497",
"0.4638707",
"0.46338636",
"0.46185234",
"0.46166486",
"0.46069545",
"0.4601471",
"0.45959213",
"0.4594386",
"0.45926425",
"0.45913827",
"0.4587903",
"0.45876393",
"0.4584916",
"0.45763853",
"0.45729655",
"0.45729655",
"0.4566547",
"0.4560211",
"0.45494437",
"0.45357653",
"0.45357653",
"0.45300335",
"0.45286",
"0.452447",
"0.45215562",
"0.45086876",
"0.44905898",
"0.4480813",
"0.4477881",
"0.4469529",
"0.44662356",
"0.44654107",
"0.44643846",
"0.44638795",
"0.44597408",
"0.44583258",
"0.4453553",
"0.44500193",
"0.4447095",
"0.44427162",
"0.4433796",
"0.44325706",
"0.44232583",
"0.44190755",
"0.44133306",
"0.44059673",
"0.44035882",
"0.44035012",
"0.4402773",
"0.44005877",
"0.4388382",
"0.43859807",
"0.4382774",
"0.43799338",
"0.43783525",
"0.43777883",
"0.43759876",
"0.43734837",
"0.43732706"
]
| 0.6836028 | 0 |
Return Program Domain id from temp storage . | public function getProgramDomainId(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProgramID () {\n\t$preValue = $this->preGetValue(\"programID\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"programID\")->preGetData($this);\n\treturn $data;\n}",
"public function getStoragePid(): array;",
"protected function getStoragePID() {\r\n\t\t$tsConf = tx_pttools_div::typoscriptRegistry('plugin.tx_ptgsaconfmgm.');\r\n\t\t$persDataStorage = $tsConf['persDataStorage'];\r\n\t\treturn $persDataStorage;\r\n\t}",
"function collectd_identifier($host, $plugin, $pinst, $type, $tinst) {\n\tglobal $CONFIG;\n\n\t$identifier = sprintf('%s/%s%s%s/%s%s%s', $host,\n\t\t$plugin, strlen($pinst) ? '-' : '', $pinst,\n\t\t$type, strlen($tinst) ? '-' : '', $tinst);\n\n\tif (is_file($CONFIG['datadir'].'/'.$identifier.'.rrd'))\n\t\treturn $identifier;\n\telse\n\t\treturn FALSE;\n}",
"public function deleteProgramDomainId();",
"private function getHostId($domain)\n\t{\n//\t\tget saved host ID\n\t\tif (isset($this->hostIds[$domain]) && !empty($this->hostIds[$domain]))\n\t\t\treturn $this->hostIds[$domain];\n\n//\t\telse get host ID from API (host will be saved in local)\n\t\t$hosts = $this->getFeeds();\n\t\t\n\t\treturn $hosts[$domain]['host_id'];\n\t}",
"public function getProgramId(){\n $progam = null;\n $con = $this->mysqli->prepare(\n \"SELECT ProgramID FROM program where programname=? and callsign=?\");\n $con->bind_param('ss',$this->name,$this->callsign);\n $con->bind_result($progam);\n if($con->execute()){\n return $progam;\n }\n else{return false;}\n }",
"function get_company_id()\n {\n $subdomain_arr = explode('.', $_SERVER['HTTP_HOST'], 2); //creates the various parts\n $subdomain_name = $subdomain_arr[0];\n\n $company = DB::table('admin')->where('username',$subdomain_name)->get();\n \n if(count($company) > 0){\n return $company[0]->company_id;\n }\n else\n {\n return 0;\n }\n }",
"public function getDomainUid(): string\n {\n return $this->domain_uid;\n }",
"function getStorageFolderPid()\n {\n // global $_GET;\n $positionPid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::htmlspecialchars_decode(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GET('id'));\n // $pid = t3lib_div::_GP('id');\n // print_r($pid);\n if(empty($positionPid)) {\n $siteid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GET('returnUrl');\n $siteid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::explodeUrl2Array($siteid);\n $siteid = $siteid['db_list.php?id'];\n $positionPid = $siteid;\n }\n // print_r($positionPid);\n // Negative PID values is pointing to a page on the same level as the current.\n if ($positionPid<0) {\n $pidRow = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', abs($positionPid), 'pid');\n $positionPid = $pidRow['pid'];\n }\n $row = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $positionPid);\n $TSconfig = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getTCEFORM_TSconfig('pages', $row);\n return intval($TSconfig['_STORAGE_PID']);\n }",
"function get_domain_id( $dsn, $domain_name ) {\n\t$db =& MDB2::factory($dsn);\n\t\n\tif (DB::isError($db)) {\n\t\tdie ($db->getMessage());\n\t}\n\n\t$sql = \"SELECT id FROM domains WHERE name = '\" . $domain_name . \"'\";\n\n\treturn $db->queryOne($sql);\n\n}",
"public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}",
"function getid3()\n\t{\n\t\tif ($this->investigated)\n\t\t{\n\t\t\tif ($this->id3 == false)\n\t\t\t\t$this->id3 = gen_file_info_sid($this->origrow);\n\t\t}\n\t\treturn $this->id3;\n\t}",
"function get_branded_domain_id_option() {\n $options = get_option('sbrb_settings');\n $domain = $options['sbrb_domain_id'];\n\n if( isset($domain) || $domain != '') {\n return array('id' => $domain);\n } else {\n return;\n }\n }",
"public function getProgramId()\n {\n return $this->ProgramId;\n }",
"public function getSiteId($domain)\n {\n $parsedDomain = parse_url($domain);\n $domain = 'http://'.$parsedDomain['path'];\n $siteId = Db::fetchOne('SELECT idsite FROM piwik_site WHERE main_url=?',\n array($domain));\n if (!$siteId) {\n $siteId = Db::fetchOne('SELECT idsite FROM piwik_site_url WHERE url=?',\n array($domain));\n }\n\n return $siteId;\n }",
"function getDatabaseId();",
"public function getPId();",
"public function obtenerID();",
"protected static function getExtLocalconfCacheIdentifier() {}",
"public static function getId(){\n\t\t\n\t\t$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : \"unknown\";\n\t\t\n\t\t//added MD5 because IE doesn't like dots I suspect\n\t\treturn md5(\\GO::config()->id.'AT'.$serverName);\n\t}",
"public function getPersonID() {\n\t\t$session_id = $this->getCurrentID();\n\t\t$this->load($session_id);\n\t\treturn $this->contactid;\n }",
"function getPid() ;",
"protected function getTrackedClientId() {\n /*if (isset($_COOKIE['_ga'])) {\n list($version,$domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE[\"_ga\"],4);\n $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1.'.'.$cid2);\n $cid = $contents['cid'];\n }\n else {*/\n $cid = $this->client->serial;\n //}\n return $cid;\n }",
"public function getStoragePrimaryKey();",
"function get_local_install_id() : ?string {\n\tif ( Altis\\get_environment_type() !== 'local' ) {\n\t\treturn null;\n\t}\n\n\t$id = get_network_option( null, 'altis_tracking_id', null );\n\tif ( ! empty( $id ) ) {\n\t\treturn $id;\n\t}\n\n\tif ( is_multisite() ) {\n\t\t// Hash the registration date of the first site to get a unique ID.\n\t\t$site = get_blog_details( get_main_site_id(), false );\n\t\t$generated = 'local-' . substr( hash( 'sha1', $site->registered ), 0, 6 );\n\t} else {\n\t\t// Get the oldest piece of content.\n\t\tglobal $wpdb;\n\t\t$first = $wpdb->get_col( \"SELECT post_date FROM $wpdb->posts ORDER BY post_date ASC LIMIT 1\" );\n\t\t$generated = 'local-' . substr( hash( 'sha1', $first[0] ), 0, 6 );\n\t}\n\tupdate_network_option( null, 'altis_tracking_id', $generated );\n\n\treturn $generated;\n}",
"public function getID(): string {\n\t\treturn $this->appName;\n\t}",
"public function get_program_admin_id() {\n global $remotedb;\n $sql = \"SELECT id FROM {role} WHERE shortname = ?\";\n $params = array('progadmin');\n $prog = $remotedb->get_record_sql($sql, $params);\n return $prog ? $prog->id : 0;\n }",
"function get_cur_domain()\n{\n}",
"public function getStorageId()\n {\n return $this->_getField(self::$STORAGE_ID);\n }",
"protected function getStoragePid(array &$params, \\TYPO3\\CMS\\Backend\\Form\\FormEngine &$pObj) {\n\t\t// Get default first\n\t\t$tsConfig = & $pObj->cachedTSconfig[$params['table'] . ':' . $params['row']['uid']];\n\t\t$storagePid = (int)$tsConfig['_STORAGE_PID'];\n\n\t\t// Check for alternative storage folder\n\t\t$field = $params['table'] == 'pages' ? 'uid' : 'pid';\n\t\t$modTSConfig = BackendUtility::getModTSconfig($params['row'][$field], 'tx_templavoila.storagePid');\n\t\tif (is_array($modTSConfig) && MathUtility::canBeInterpretedAsInteger($modTSConfig['value'])) {\n\t\t\t$storagePid = (int)$modTSConfig['value'];\n\t\t}\n\n\t\treturn $storagePid;\n\t}",
"function get_domain()\n\t{\n\t\t$http_host = $_SERVER['HTTP_HOST'];\n\t\t$DOC_ROOT = $_SERVER['DOCUMENT_ROOT'];\n\t\t$site_root = str_replace($DOC_ROOT, \"\", SITE_ROOT);\n\t\t// $win = str_replace(\"/\",\"\\\\\",$DOC_ROOT);\n\t\t$site_root = str_replace($DOC_ROOT,\"\",SITE_ROOT);\n\t\t$http_chunk = \"$http_host/$site_root/\";\n\t\treturn \"http://\".str_replace(\"//\", \"/\", $http_chunk);\n\t}",
"public function getInstanceIdent() {}",
"private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }",
"function GET_APP_ID(){\n return \"7d0df388-f064-48eb-9092-27fbbf0a438e\";\n}",
"public function getDataDomain();",
"function getDomainName($domain = 0)\n{\n\tif($domain == 0)\n\t\t$domain = ARC_DOMAIN;\n\n\t$name = getDBData('domain_name', $domain, 'domain_id', 'domain');\n\n\tif($name == '')\n\t\treturn '-None-';\n\telse\n\t\treturn $name;\n}",
"public function getIdentifier()\n {\n $configID = $this->get_config() ? $this->get_config()->ID : 1;\n return ucfirst($this->get_mode()) . \"Site\" . $configID;\n }",
"public function getPersonGuid();",
"public function getStorageId(): string\n {\n return sprintf('$%s', $this->getData());\n }",
"private function getOpenIdDomain() : string\n {\n return self::OPENID_DOMAINS[$this->useSteamPoweredDomain];\n }",
"public function getDefaultBackendStoragePid() {}",
"public function getDefaultBackendStoragePid() {}",
"public function getLoggedInHostId();",
"function getDomain()\n {\n }",
"function getDbPlatExID($connect, $pl_id_name)\n {\n $type_id = \"\";\n $sql = \"SELECT ID FROM qpkg_platform_excl WHERE Name LIKE '$pl_id_name'\";\n $result = mysqli_query($connect, $sql);\n while ($row = mysqli_fetch_array($result)) {\n $type_id = $row['ID'];\n }\n\n return $type_id;\n }",
"public function getDomain(): string;",
"function getDbPlatID($connect, $pl_id_name)\n {\n $type_id = -1;\n $sql = \"SELECT ID FROM qpkg_platform WHERE PlatformID LIKE '$pl_id_name'\";\n $result = mysqli_query($connect, $sql);\n while ($row = mysqli_fetch_array($result)) {\n $type_id = $row['ID'];\n }\n\n return $type_id;\n }",
"static function uniqueID()\n {\n return substr(str_pad(str_replace('.', '', microtime(true)), 12, 0), 0, 12);\n }",
"function searchDomain() {\n\t\t$position = mt_rand(1, $this->rnd_domains_number);\n $query = \"select domain from \".self::RNDDOMAINSC_NAME.\" where id=\".$position;\n if ($result = $this->db_conn->query($query)) {\n $row = $result->fetch_assoc();\n return $row[\"domain\"];\n }\n else {\n die (\"Error sending the query '\".$query.\"' to MySQL\");\n }\n\t}",
"public function getWebsiteId()\n {\n $websiteId = $this->_getData('website_id');\n if (is_null($websiteId)) {\n $websiteId = Mage::app()->getStore()->getWebsiteId();\n }\n return $websiteId;\n }",
"public function getSpaceId();",
"public function getPid() {}",
"private function _getPaymentProcessorFullDomain()\r\n {\r\n \t$szPaymentProcessorFullDomain;\r\n \t\r\n \t// get the stored config setting\r\n \t$szPaymentProcessorDomain = $this->getConfigData('paymentprocessordomain');\r\n\t\t$szPaymentProcessorPort = $this->getConfigData('paymentprocessorport');\r\n \t\r\n \tif ($szPaymentProcessorPort == '443')\r\n\t\t{\r\n\t\t\t$szPaymentProcessorFullDomain = $szPaymentProcessorDomain.\"/\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$szPaymentProcessorFullDomain = $szPaymentProcessorDomain.\":\".$szPaymentProcessorPort.\"/\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $szPaymentProcessorFullDomain;\r\n }",
"abstract public function getIdent();",
"public function getStorageUid();",
"private function getCurrentWebsiteId()\n {\n return $this->storeManager->getWebsite()->getId();\n }",
"public function id()\n\t{\n\t\treturn $this->SqueezePlyrID ;\n\t}",
"public function getOGApplicationID();",
"private function get_cookie_domain() {\n\t\t$requested_domain_parts = explode( '.', $_SERVER['HTTP_HOST'] );\n\t\t$cookie_domain = array_pop( $requested_domain_parts );\n\t\t$cookie_domain = '.' . array_pop( $requested_domain_parts ) . '.' . $cookie_domain;\n\n\t\treturn $cookie_domain;\n\t}",
"public static function getGuid()\n {\n return self::$guid;\n }",
"abstract public function getUniqueId();",
"function getID();",
"protected function domainStorage() {\n if (!$this->domainStorage) {\n $this->domainStorage = $this->entityTypeManager->getStorage('domain');\n }\n return $this->domainStorage;\n }",
"private function createSid()\n\t{\n\t\t$id = uniqid($this->VF->input->ipAddress(),TRUE);\n\t\t$id = join('',explode('.',$id));\n\t\treturn md5($id);\n\t}",
"public function getSiteId();",
"protected function getIdentifier()\n {\n if ($this->parameters->scheme === 'unix') {\n return $this->parameters->path;\n }\n\n return \"{$this->parameters->host}:{$this->parameters->port}\";\n }",
"function siteId(): ?string\n {\n return app(\\LeMaX10\\MultiSite\\Classes\\Contracts\\SiteManager::class)\n ->id();\n }",
"function get_blog_id_from_url($domain, $path = '/')\n {\n }",
"function id_domaine($ip){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->query(\"SELECT id_relais FROM relais_mail WHERE ip = '$ip'\");\n\t\t//$req->execute(array(\"ip_domain\"=>'$ip'));\n\n\t\twhile($results = $req->fetch()){\n\t\t\t$result = $results[\"id_relais\"];\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function getExternalId() {\n\t\treturn empty( $this->container['external_ids'] ) ? null : $this->container['external_ids'][0];\n\t}",
"public function getdefaultExecPersonId()\n {\n return $this->defaultexecperson_id;\n }",
"public function setProgramDomainId($program_id = NULL);",
"function getUniqueID(){\n\t\treturn $this->module.'_'.$this->ID;\n\t}",
"public function get_domain()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_load_config();\n\n $domain = (empty($this->config['domain'])) ? '' : $this->config['domain'];\n\n if (empty($domain))\n $domain = $this->convert_domain();\n\n return $domain;\n }",
"public function get_external_domain(): string;",
"public function getStrId();",
"public function getUniqueObjectIdentifier();",
"function id_imm_to_id_cli($id_imm=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\n\t$q=\"SELECT * FROM cli_imm WHERE id_imm=$id_imm\";\n\t$r=$db->query($q);\n if($r){\n $ro=mysql_fetch_array($r);\n\treturn $ro['id_cli'];\n }\n}",
"function get_website_data($session_id, $domain) {\n\t\n\t// get the user_id (and check validity of session) based on session_id\n\t$user_id = get_user_id(make_safe($session_id));\n\t\n\t$domain = make_safe($domain);\n\t\n\tif ($user_id) {\n\t\t\n\t\t$query = \"SELECT * FROM \" . $GLOBALS['db_name'] . \".websites WHERE domain = '$domain' AND user_id = '$user_id' LIMIT 1\";\n\t\t$result = $GLOBALS['db_connection'] -> query($query);\n\t\t\n\t\tif ($result -> num_rows > 0) {\n\t\t\t\t\t\t\n\t\t\twhile($row = $result -> fetch_assoc()) {\n\t\t\t\t$site_data = array('responses' => $row['responses'], 'site_id' => $row['site_id'], 'downtime' => $row['downtime'], 'creation_time' => $row['creation_time'], 'alerts' => $row['alerts'], 'spam_dbs' => explode(\",\", $row['spam_dbs']));\n\t\t\t}\n\t\t\t\n\t\t\treturn $site_data;\n\t\t\t\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t} else {\n\t\treturn \"Invalid Session\";\n\t}\n}",
"public function getID();",
"public function getID();",
"public function getID();",
"function get_id_db($injured_table, $conn, $band_id, $mode) {\n valid_init($injured_table, $conn, $band_id, $mode);\n\n // Get ID from database\n $result = exec_query($conn, \"select id from $injured_table where opaska_id = $band_id and w_akcji = true\", TRUE);\n $id = $result['id'];\n return $id;\n}",
"public static function getID()\n {\n return self::getInstance()->_getID();\n }",
"public function getOrgId()\r\n {\r\n $orgId = Mage::getStoreConfig('payment/threat_metrix/org_id');\r\n return $orgId;\r\n }",
"abstract public function getStoragePids();",
"private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}",
"public function getLiveId() {}",
"protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }",
"public static function getLogid(): string\n {\n $contextData = self::getCoroutineContext(self::DATA_KEY);\n $logid = $contextData['logid'] ?? '';\n return $logid;\n }",
"public function getDomain()\n\t{\n\t\treturn $this->activeDomain;\n\t}",
"function get_master_id(){\r\n\t\t$result=$this->m_master_ambil_paket->get_master_id();\r\n\t\techo $result;\r\n\t}",
"protected function getCurrentSiteIdFromDomain()\n {\n $domainList = $this->domainManager->getDomainList();\n\n $serverParams = $this->request->getServer();\n\n $currentDomain = $serverParams->get('HTTP_HOST');\n\n if (empty($domainList[$currentDomain])\n || empty($domainList[$currentDomain]['siteId'])\n ) {\n throw new SiteNotFoundException(\n 'No site found for request domain: '.$currentDomain\n );\n }\n\n return $domainList[$currentDomain]['siteId'];\n }",
"public function getLockToDomain() {}",
"public function getLockToDomain() {}",
"public function getLockToDomain() {}",
"public function get_domain()\r\n\t\t{\r\n\t\t\treturn $_SERVER[ 'SERVER_NAME' ];\r\n\t\t}",
"static public function GetDeviceID() {\n if (isset(self::$devid))\n return self::$devid;\n else\n return false;\n }",
"function get_account_id($cellphone)\n {\n $query=$this->db->query(\"select id from xl_account where cellphone='{$cellphone}'\");\n \n $arr = array();\n\n foreach($query->result_array() as $row)\n {\n array_push($arr,$row);\n }\n\n return $arr[0]['id'];\n }"
]
| [
"0.6486902",
"0.6181291",
"0.61599976",
"0.6142369",
"0.61188334",
"0.60519254",
"0.60047936",
"0.59305006",
"0.57853466",
"0.5720165",
"0.569421",
"0.56290835",
"0.5587828",
"0.5562061",
"0.5542445",
"0.5526483",
"0.5512712",
"0.54714614",
"0.5470508",
"0.5462221",
"0.5447369",
"0.54411286",
"0.54329616",
"0.5412371",
"0.5383313",
"0.53807193",
"0.53719693",
"0.5369801",
"0.53658086",
"0.5359492",
"0.53532845",
"0.53449404",
"0.5341366",
"0.53339624",
"0.5332127",
"0.5306871",
"0.5296718",
"0.52946216",
"0.5274587",
"0.5271386",
"0.52689296",
"0.5262393",
"0.5262393",
"0.5241251",
"0.52407914",
"0.5228935",
"0.5194001",
"0.51929027",
"0.5184603",
"0.5180204",
"0.5156562",
"0.51471514",
"0.51436275",
"0.51375914",
"0.5135316",
"0.5135038",
"0.51326823",
"0.5125046",
"0.51230216",
"0.51202446",
"0.51196903",
"0.51148355",
"0.511293",
"0.5111292",
"0.5105279",
"0.5099097",
"0.50955224",
"0.5094677",
"0.50930506",
"0.50905037",
"0.5088579",
"0.50840193",
"0.50811076",
"0.50806993",
"0.5073655",
"0.50727946",
"0.5067718",
"0.5062231",
"0.50617105",
"0.5059326",
"0.505895",
"0.505895",
"0.505895",
"0.5056834",
"0.5056814",
"0.5049814",
"0.5047192",
"0.50451505",
"0.5039672",
"0.5038664",
"0.5032268",
"0.50309575",
"0.5020274",
"0.5018314",
"0.5018088",
"0.5018088",
"0.5018088",
"0.50161296",
"0.5014557",
"0.5010244"
]
| 0.7437465 | 0 |
Delete Program Domain id from temp storage . | public function deleteProgramDomainId(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete() {\n\n // Does the program object have an ID?\n if ( is_null( $this->programID ) ) trigger_error ( \"Program::delete(): Attempt to delete an program object that does not have its ID property set.\", E_USER_ERROR );\n\n // Delete the program\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $st = $conn->prepare ( \"DELETE FROM programs WHERE programID = :id LIMIT 1\" );\n $st->bindValue( \":id\", $this->programID, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }",
"function del_relais($domain){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"DELETE FROM `relais_mail` WHERE `nom_domain` = :domain\");\n\t\t$req->execute(array('domain'=>$domain));\n\t\t$req->closeCursor();\n\t}",
"function Delete($id,$HOST_URL=\"/home/hmongbee/public_html/\"){\n\t\t//chmod(\"/home/hmongbee/public_html/tailieu\",0777);\n\t\t\n\t\t$dirname = $this->fileName($id,\"/home/hmongbee/public_html/\"); \n\t\tchmod($dirname, 0777);\n\t\t\n\t\tif(is_dir($dirname)) { \n\t\t\trmdir($dirname);\n\t\t}\n\t\tif(is_file($dirname) && file_exists($dirname)) {\n\t\t\tunlink($dirname);\n\t\t}\n\t\t// Read and write for owner, read for everybody else\n\t\t//chmod(\"/home/hmongbee/public_html/tailieu\",0644);\n\t\t\n\t\t$sql=\"DELETE FROM `tbl_document` WHERE `doc_id` in ('$id')\"; //echo $sql; die;\n\t\t$objdata=new CLS_MYSQL();\n\t\treturn $objdata->Query($sql);\n\t}",
"public function deleteLocal() \n {\n LocalDAC::deleteLocal($this);\n }",
"public function actionRemove($app, $domain)\r\n {\r\n Az::debug($app, 'application');\r\n Az::$app->smart->adder->remove($app, $domain);\r\n }",
"function del_app($id)\n\t {\n\t\t$query = \"delete from wizard_apps where id = $id\";\n\t\techo $this->db->query($query);\n\t }",
"public function destroy($subdomain,$id)\n {\n //\n }",
"public static function delete() {\n\n\n\t\t}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"function delete() ;",
"function delete() ;",
"function delete_apps()\n {\n $deleted = $_POST['delete'];\n $modify_app = new Database();\n $modify_app->alterApplication($deleted, 'App_Status', 'Deleted');\n $modify_app = null; \n }",
"function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_amphur\n\t\t\t\tWHERE amph_id=?\";\n\t\t$this->hr->query($sql, array($this->amph_id));\n\t}",
"function delete() {\t\t$nop = str_repeat(\" \", $this -> size);\n\t\t//10 caratteri per diecimila\n\t\tshmop_write($this -> id, $nop, 0);\n\n\t}",
"function deleteDomain($userName,$password,$role,$langpref,$parentid,$orderId)\n\t\t{\n\t\t\t$para = array($userName,$password,$role,$langpref,$parentid,$orderId);\n\t\t\t$return = $this->s->call(\"deleteDomain\",$para);\n\t\t\t$this->debugfunction();\n\t\t\treturn $return;\n\t\t}",
"function remove_tmpuser($lrdata) {\n tep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key = '\".$lrdata['session'].\"'\");\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}",
"public function testDeleteDomain()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function deleteDatabaseStructure( );",
"function delPlatform($id)\n {\n global $mysqli;\n $sql=\"DELETE FROM platforms WHERE platformID=$id \";\n $mysqli->query($sql)or die(\"query failed due to \".mysqli_error());\n logSuccess(\"platform deleted successfully\");\n }",
"function delete_(){\nglobal $mod_id;\nglobal $db;\n\n$sql =\"DELETE \";\n$sql .=\"FROM t_absensi \";\n$sql .=\"WHERE id= '$_GET[id]' \";\n\n$sqlresult = $db->Execute($sql);\n\n$user_id = base64_decode($_SESSION['UID']);\n $ip_now = $_SERVER['REMOTE_ADDR'];\n $sql2=\"INSERT INTO tbl_log (url, waktu, module, user_id ) VALUES ('$ip_now',now(),'Hapus data >> master WNI Non TKI','$user_id') \";\n $db->Execute($sql2);\n\n}",
"function delete_(){\nglobal $mod_id;\nglobal $db;\n\n$sql =\"DELETE \";\n$sql .=\"FROM t_absensi \";\n$sql .=\"WHERE id= '$_GET[id]' \";\n\n$sqlresult = $db->Execute($sql);\n\n$user_id = base64_decode($_SESSION['UID']);\n $ip_now = $_SERVER['REMOTE_ADDR'];\n $sql2=\"INSERT INTO tbl_log (url, waktu, module, user_id ) VALUES ('$ip_now',now(),'Hapus data >> master WNI Non TKI','$user_id') \";\n $db->Execute($sql2);\n\n}",
"public static function deleteID(){\n $idTimeSlot = $_REQUEST[\"idTimeSlot\"];\n\n $result = DB::dataManipulation(\"DELETE FROM timeslots WHERE idTimeSlot = '$idTimeSlot'\");\n return $result;\n }",
"function dllc_delete_instance($id) {\n global $DB;\n\n if (! $dllc = $DB->get_record('dllc', array('id' => $id))) {\n return false;\n }\n\n // Delete any dependent records here.\n\n $DB->delete_records('dllc', array('id' => $dllc->id));\n\n dllc_grade_item_delete($dllc);\n if($dllc->dateheurefin>time())\n {\n dllc_sendmail_ondelete($dllc);\n }\n\n\n\n return true;\n}",
"function lr_delete($pid) {\n list($ns, $pidn) = explode(':', $pid);\n list($rec, $sort) = explode('.', $pidn);\n $db = lr_connect( );\n $table = lr_make_table($db, $ns);\n $sql = \"DELETE FROM ?n WHERE rec=?i, sort=?i\";\n $db->query($sql, $table, $rec, $sort);\n}",
"public function clearApplicationData();",
"function deleteWorkingData($question_id, $active_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_answer WHERE question_fi = %s AND active_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($question_id, $active_id)\n\t\t);\n\t}",
"public function delete(){\n\t\t$landlord= new Core_Model_Landlord( $this->dto );\n\t\tif( is_numeric( $company->id) && (int)$company->id > 0) {\n\t\t\t$company->delete( array( \"id\" => $this->dto->id) );\n\t\t\t}\n\t}",
"public function destroy($id)\n {\n Programs::find($id)->delete();\n }",
"function ldapauth_delete()\n{\n // Delete module variables\n pnModDelVar('ldapauth', 'ldapauth_serveradr');\n pnModDelVar('ldapauth', 'ldapauth_pnldap');\n pnModDelVar('ldapauth', 'ldapauth_basedn');\n pnModDelVar('ldapauth', 'ldapauth_bindas');\n pnModDelVar('ldapauth', 'ldapauth_bindpass');\n pnModDelVar('ldapauth', 'ldapauth_searchdn');\n pnModDelVar('ldapauth', 'ldapauth_defaultgroup');\n\n\n // Deletion successful\n return true;\n}",
"public static function delete() {\r\n\t\t\r\n\t}",
"function deleteAlias($dstdomain,$srcdomain){\n $res = $this->client->request('DELETE',$this->path.'/'.$dstdomain.'/aliases/'.$srcdomain,[]);\n $this->checkResponse($res,array(204, 400, 404));\n return $res;\n }",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"public function delete(Datastore $db)\n {\n $stmt = $db->prepare('DELETE FROM tbl_survey WHERE col_uuid = :surveyUuid');\n $stmt->bindValue(':surveyUuid', $this->uuid, PDO::PARAM_STR);\n $db->execute($stmt);\n }",
"function lr_clear($pid) {\n list($ns, $x) = explode(':', $pid);\n list($rec, $sort) = explode('.', $x);\n $db = lr_connect( );\n $table = lr_make_table($db, $ns);\n\n if ($sort == '*') {\n $sql = \"DELETE FROM ?n WHERE (rec=?i);\";\n $db->query($sql, $table, $rec);\n } else {\n $sql = \"DELETE FROM ?n WHERE (rec=?i AND sort=?i);\";\n $db->query($sql, $table, $rec, $sort);\n }\n}",
"function delete() {\n\t \t$sql = \"DELETE FROM evs_database.evs_identification\n\t \t\t\tWHERE idf_id=?\";\n\t \t$this->db->query($sql, array($this->idf_id));\n\t\t\n\t }",
"function deletePartition() {\n\n global $connection_production;\n\n if (isset($_POST['delete_league'])) {\n\n echo 'working';\n }\n }",
"public function getProgramDomainId();",
"public function un_used_destroy(Request $request, Domain $domain)\n {\n echo $domain->id . \"<br>\";\n echo $request;\n exit();\n $domain->delete();\n\n return redirect()->route('un_used_domain_index')\n ->with('success', 'Domain kaldırma başarıyla tamamlandı');\n }",
"public function delete_domain($domain) \n\t{\n\t\treturn $this->vpopmail_readline(sprintf(\"B -f %s\", $domain));\n\t}",
"function delete_trip_id() {\n $id = $this->uri->segment(3);\n $this->insert_model->delete_trip_id($id);\n $this->trip_id();\n }",
"abstract public function delete__do_process ();",
"public static function delete(){\r\n }",
"public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}",
"final public function delete() {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\t\n $sql_query = 'DELETE FROM fresco_costing_component_array WHERE component_id ='.$this->_component_id;\n \n $result = $mysqli->query($sql_query);\n if (!$result) {\n trigger_error('Unable to delete from database : SQL query : ' . $sql_query);\n }\n\treturn;\n }",
"public function deleteById($platformcodeId);",
"public function del()\n {\n }",
"public function destroy($id, Request $request)\n {\n \n $deleteVM = VM::with('rework')->find($id);\n \n $path = storage_path('app/'.$deleteVM->dir);\n $process = new Process('terraform12 destroy -var=\"project='.$deleteVM->project.'\" -lock=false -no-color -auto-approve');\n //$process = new Process('ping -c 50 www.google.com');\n $process->setTimeout(3600);\n $process->setWorkingDirectory($path);\n $process->run();\n Log::debug($process->getOutput()); \n if ($process->isSuccessful()) {\n $deleteVM->active = 0;\n $deleteVM->jira = $deleteVM->jira.'/'.$request->jira;\n $deleteVM->deleted_by = Auth::user()->name;\n if($deleteVM->save()){\n\n if(count($deleteVM->rework)){\n $this->openstack->deleteVolume($deleteVM);\n }\n\n Mail::to('dcops-cloud-vssi@vodafone.com')->send(new IpUpdateNotification($deleteVM));\n $explodeHostname = explode('.',$deleteVM->hostname);\n $policy = $explodeHostname[0].'_'.$deleteVM->username;\n\n $cookieName = 'del-'.$deleteVM->name;\n $this->ipa->login($cookieName);\n // $this->ipa->deleteUser($deleteVM->username, $cookieName);\n $this->ipa->deleteHost($deleteVM->hostname, $cookieName);\n $this->ipa->deletePolicy($policy, $cookieName);\n $this->ipa->delDNS($explodeHostname[0], $cookieName);\n Log::info($deleteVM->vmname.'- VM deleted');\n return $deleteVM->id;\n }\n }else{\n dd('error');\n }\n\n\n \n }",
"public abstract function delete();",
"function delLogin(){\n unlink($this->fHtaccess);\n }",
"function delLogin(){\n unlink($this->fHtaccess);\n }",
"function deleteAbonne($code) {\n global $serv;\n $req = \"DELETE FROM abonnes WHERE Code = '$code';\";\n $res = db_execSQL($req,$serv);\n }",
"abstract function delete();",
"function deleteContactDirectory($cp_id) {\n $this->contact_id = $cp_id;\n try {\n $query1 = \"delete from Tbl_ContactDirectoryPerson where contactId = :cid\";\n $stmt = $this->db_connect->prepare($query1);\n $stmt->bindParam(':cid', $this->contact_id, PDO::PARAM_STR);\n $stmt->execute();\n $result['success'] = 1;\n $result['message'] = 'Data Successfully Deleted';\n return json_encode($result);\n } catch (PDOException $es) {\n $result['success'] = 0;\n $result['message'] = $es;\n return json_encode($result);\n }\n }",
"public function testDSTIdDelete()\n {\n }",
"function fn_divido_uninstall()\n{\n db_query(\"DELETE FROM ?:payment_processors WHERE processor_script = ?s\", 'divido.php');\n}",
"public static function deleteSite($code) {\n\t\t\\core\\Core::$db->exec('DELETE FROM \"ark_site\" WHERE si_code=?', array((string)$code));\n\t}",
"public function delete() {}",
"public function destroy($domainId, $id)\n {\n }",
"public function delete($domain) {\n\t\t$subDomain = explode('.', $domain);\n\t\tif (count($subDomain) < 2) {\n\t\t\tthrow new Exception(\"Invalid domain name!\");\n\t\t}\n\n\t\t// first get list of addon domains with extended attributes\n\t\t$list = $this->getList();\n\t\t$domainKey = '';\n\t\t$fullSubDomain = '';\n\t\t$ftpUser = '';\n\n\t\tforeach ($list as $addon) {\n\t\t\tif ($addon['domain'] !== $domain) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$domainKey = $addon['domainkey'];\n\t\t\t$fullSubDomain = $addon['fullsubdomain'];\n\t\t\t$ftpUser = $addon['subdomain'];\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->_api(array(\n\t\t\t'cpanel_jsonapi_apiversion' => 2,\n\t\t\t'cpanel_jsonapi_user' => $this->_username,\n\t\t\t'cpanel_jsonapi_module' => 'AddonDomain',\n\t\t\t'cpanel_jsonapi_func' => 'deladdondomain',\n\t\t\t'domain' => $domain,\n\t\t\t'subdomain' => $domainKey,\n\t\t\t'fullsubdomain' => $fullSubDomain // undocument parameter!\n\t\t));\n\n\t\t$json = json_decode($result, true);\n\n\t\t// error found?\n\t\tif ( isset($json['cpanelresult']['data'][0]['result'])\n\t\t\t&& trim($json['cpanelresult']['data'][0]['result']) == '0'\n\t\t) {\n\t\t\tthrow new Exception(\"cPanel: \" . $json['cpanelresult']['data'][0]['reason']);\n\t\t}\n\n\t\t/**\n\t\t * Delete FTP User\n\t\t * @link http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api2/ApiFtp#Ftp::delftp\n\t\t */\n\t\tif ($this->_createFTPUser) {\n\t\t\t$result = $this->_api(array(\n\t\t\t\t'cpanel_jsonapi_apiversion' => 2,\n\t\t\t\t'cpanel_jsonapi_user' => $this->_username,\n\t\t\t\t'cpanel_jsonapi_module' => 'Ftp',\n\t\t\t\t'cpanel_jsonapi_func' => 'delftp',\n\t\t\t\t'user' => $ftpUser,\n\t\t\t\t'destroy' => 0\n\t\t\t));\n\t\t}\n\n\t\treturn $json;\n\t}",
"public function delete() {}",
"public function delete() {}",
"function delete_question() {\r\n global $db;\r\n\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) || (!isset($_SESSION['session_survey']))) {\r\n logout();\r\n die();\r\n }\r\n\r\n $question = new Question();\r\n $question->get_from_db($_GET['question_id']);\r\n $survey = new Survey();\r\n $survey->get_from_db($question->getSurvey());\r\n\r\n if ($survey->getCreatedBy() != $user->getId()) {\r\n if ($user->getAdmin() != 1) {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $question->setIsActive(0);\r\n $question->update_in_db();\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте елемент от анкетата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n die();\r\n}",
"public static function delete()\n {\n\n $appart = func_get_arg(0);\n isset($_COOKIE[self::$NAME]) or exit('There is no cookie found.');\n if (!is_null($appart)) {\n is_numeric($appart) or exit('Value to delete must be numeric.');\n $parts = self::get(self::$FORMAT_ARRAY);\n $key = array_search($appart, $parts);\n unset($parts[$key]);\n self::create(implode(',', $parts), true);\n } else {\n $parts = self::get(self::$FORMAT_ARRAY);\n array_pop($parts);\n self::create(implode(',', $parts), true);\n }\n\n }",
"public function delete() {}",
"function hapus_pelanggan(){\n\t\t$id['kd_pelanggan'] = $this->uri->segment(3);\n\t\t$this->model_app->deleteData('tbl_pelanggan',$id);\n\t\tredirect('master_pelanggan');\n\t}",
"function clean_up1($res, $obj)\n{\n\t$res = $obj->query1(\"delete from reg_pro where pro_id in (\n'###############',\n'################',\n'##################',\n'**************',\n'****************')\");\n\twhile(odbc_fetch_row($res)){\n\t\techo 'deleted';\n\t}\t\t\n}",
"function delZenPubData($id, $item, $why)\n{\n $readitem = query_single_row($sql = 'SELECT id, `aux`, `data` FROM '.prefix('plugin_storage').\" WHERE `type` = 'iOS' AND `aux` = \".db_quote($id));\n $arr = $readitem['data'];\n if ($why) {\n query('DELETE FROM '.prefix('plugin_storage').\" WHERE `type` = 'iOS' AND `aux` = \".db_quote($id));\n } //$why\n else {\n unset($arr[$item]);\n query('UPDATE '.prefix('plugin_storage').' SET `data` = '.db_quote(json_encode($arr)).\", `type` = 'iOS' WHERE `aux` = \".db_quote($id).\" AND `type` = 'iOS'\");\n }\n}",
"function delete_(){\r\nglobal $mod_id;\r\nglobal $db;\r\n\r\n$sql =\"DELETE \";\r\n$sql .=\"FROM tbl_bhi \";\r\n$sql .=\"WHERE kode_bhi= '$_GET[kode_bhi]' \";\r\n\r\n$sqlresult = $db->Execute($sql);\r\n\r\n$user_id = base64_decode($_SESSION['UID']);\r\n $ip_now = $_SERVER['REMOTE_ADDR'];\r\n $sql2=\"INSERT INTO tbl_log (url, waktu, module, user_id ) VALUES ('$ip_now',now(),'Hapus data >> master BHI','$user_id') \";\r\n $db->Execute($sql2);\r\n}",
"public function destroy($id)\n {\n $program = HospitalProgram::find($id);\n\n $hospital_name = \\Auth::guard('merchant')->user()->name;\n $department_name = \\App\\HospitalDepartment::where('id', $program->hospital_department_id)->value('name');\n\n $content = [\n 'title' => 'Partner has deleted a Program',\n 'hospital_name' => $hospital_name,\n 'department' => $department_name,\n 'program' => $program->name,\n\n ];\n\n // $receiverAddress = $email_hospital;\n $receiverAddress = 'rully.arfan@gmail.com';\n\n // Mail::to($receiverAddress)->send(new ProgramDeleted($content));\n $program->delete();\n\n return redirect('merchant/hospital-programs');\n }",
"function teamdelete(){\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $contest_id = urldecode($this->uri->segment(4));\n $this->m_key->removeTeam($team_id);\n $this->m_team->delete($team_id, $contest_id);\n $this->teams($contest_id);\n }",
"public function delete($uuid, $webspaceKey);",
"function deleteData($db)\n{\n global $_REQUEST;\n $i = 0;\n foreach ($_REQUEST as $strIndex => $strValue) {\n if (substr($strIndex, 0, 5) == 'chkID') {\n $strSQL = \"DELETE FROM \\\"hrdTransportation\\\" WHERE id = '$strValue' \";\n $resExec = $db->execute($strSQL);\n $i++;\n }\n }\n if ($i > 0) {\n writeLog(ACTIVITY_DELETE, MODULE_PAYROLL, \"$i data\", 0);\n }\n}",
"public function deleteData()\n {\t\t\n \t$arrayId = $this->getAllUserId($this->readFromLocalFile());\n \tforeach($arrayId as $id)\n \t{\n \t\t$user = User::find()->where(['id' => $id])->one();\n \t\tif($user)\n \t\t{\n \t\t\t$user->delete();\n \t\t}\n \t}\n \t$this->deleteSelectedLocalItems('user');\n }",
"function ldap_delete($link_identifier, $dn)\n{\n}",
"function db_removeAuthEntry($auth_id)\n{\n $auth_id = db_esc($auth_id);\n db_run(\"DELETE FROM \".TBL_AUTH.\" WHERE auth_id='$auth_id'\");\n}",
"static public function del($name) {}",
"function delete_graphql_data()\n {\n }",
"public function delete_instance($uid) { \n\t\t\n\t\t$uid = Dba::escape($uid); \n\n\t\t// Go ahead and delete this mofo!\n\t\t$sql = \"DELETE FROM `localplay_mpd` WHERE `id`='$uid'\"; \n\t\t$db_results = Dba::query($sql); \n\n\t\treturn true; \n\n\t}",
"public function deleteWorklog(){\n\n }",
"function delLogin(){\r\n\t\tunlink($this->fHtaccess);\r\n\t}",
"public function delete_db($id){\n \t// find khusus untuk primary key di database\n \t$department = Department::find($id);\n \t$department->delete();\n\n \treturn redirect('department');\n }",
"function removedomain($user,$domain) {\n }"
]
| [
"0.6146624",
"0.61331975",
"0.6005995",
"0.60012925",
"0.59125257",
"0.58319265",
"0.57921696",
"0.578466",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.57806766",
"0.5774076",
"0.5774076",
"0.57256997",
"0.5702826",
"0.5686351",
"0.5667392",
"0.5649717",
"0.5638685",
"0.5631395",
"0.5629447",
"0.5612179",
"0.5593901",
"0.5593901",
"0.5584106",
"0.5572288",
"0.5566911",
"0.5560885",
"0.555804",
"0.5539086",
"0.55373895",
"0.5532817",
"0.5524104",
"0.55173725",
"0.5515694",
"0.5515694",
"0.5515694",
"0.5515694",
"0.55135995",
"0.54938245",
"0.54888886",
"0.5477434",
"0.5476728",
"0.547275",
"0.54600316",
"0.54583484",
"0.5457455",
"0.5456902",
"0.5452381",
"0.5450211",
"0.54467076",
"0.54408926",
"0.5414528",
"0.5414096",
"0.540522",
"0.540522",
"0.5391531",
"0.5379324",
"0.5379289",
"0.53726596",
"0.53718656",
"0.5371584",
"0.5371084",
"0.53710085",
"0.5370921",
"0.5370454",
"0.5370454",
"0.5370425",
"0.53691256",
"0.53686875",
"0.53672963",
"0.5364161",
"0.5363686",
"0.5354454",
"0.53487617",
"0.5347849",
"0.53420055",
"0.53417337",
"0.53336036",
"0.5333492",
"0.53309005",
"0.53274435",
"0.5325123",
"0.5324456",
"0.5312063",
"0.5306703",
"0.5305088",
"0.5303856"
]
| 0.80801284 | 0 |
/$i=10; $i=$i+10; echo $i.""; | function show(){ //不加static静态属性则一直输出20
static $i=10;
$i=$i+10;
echo $i."<br>";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function p3_ex4() {\n for ($i = 1; $i <= 10; $i = $i += ($i/2))\n $return .= $i.\" - \";\n\n return $return;\n}",
"function p3_ex1() {\n for ($i = 0; $i <= 10; $i++)\n $return .= $i.' ';\n \n return $return;\n}",
"public function print1To10()\n {\n for ($i = 1; $i <= 10; $i++) {\n echo \"$i\" . \" \";\n }\n }",
"function printN($i){\n if($i >=20){\n return;\n }\n echo $i.PHP_EOL;\n $i++;\n printN($i);\n}",
"function example_003($n = 0){\n\techo $n.'<br>';\n\t$n++;\n\tif($n < 10){\n\t\texample_003($n);\n\t}\n}",
"function call(){\n\n static $i = 0;\n\n echo $i . '';\n\n $i++;\n\n if($i<10){\n\n call();\n\n }\n\n}",
"function addTen(&$num){\n $num += 10;\n }",
"public function sum1To10()\n {\n $sum = 0;\n for ($i = 1; $i <= 10; $i++) {\n $sum += $i;\n }\n print_r($sum);\n }",
"function adiciona10(&$x) {\r\n\t\t\t$x = $x + 10;\r\n\t\t\techo \"<br> Dentro da função, a variave x = $x </br>\";\r\n\t\t}",
"function setCounter($num = 10): string\n{\n return \"Counter is \" . $num . \"<br/>\";\n}",
"function howManyTimes() {\n static $a = 0;\n echo ++$a . ', ';\n}",
"function increment(int $num)\n{\n\tif ($num <= 5) {\n\t\techo $num . PHP_EOL;\n\t\tincrement($num + 1);\n\t}\n}",
"function customPrint($input)\n{\n\n\tfor($i=0;$i<$input;$i=$i+2)\n\t{\n\t\techo $i.\" \";\n\t}\n}",
"function num(){\n\t\tif(!isset($x)){\n\t\t\tstatic $x=0;\n\t\t}\n\t\t\n\t\t$x++;\n\t\techo $x;\n\t\n\t\n\t}",
"function get_i($i = 0)\n {\n }",
"function p3_ex6() {\n function p3_ex6_loop() {\n for ($i = 20; $i >= 0; $i--)\n $return .= \"C'est presque bon.<br />\";\n return $return;\n }\n // Just add p3_ex6_loop().\"<br />\".\n return \"XX fois (si c'est le cas c'est en comm php)\"; // 21\n}",
"function iteration($i){\n switch ($i) {\n case 1:\n echo \"First Iteration\";\n break;\n case 2:\n echo \"Second Iteration\";\n break;\n case 3:\n echo \"Third Iteration\";\n break;\n case 4:\n echo \"Fourth Iteration\";\n break;\n case 5:\n echo \"Fifth Iteration\";\n break;\n case 6:\n echo \"Sixth Iteration\";\n break;\n case 7:\n echo \"Seventh Iteration\";\n break;\n case 8:\n echo \"Eight Iteration\";\n break;\n case 9:\n echo \"Ninth Iteration\";\n break;\n case 10:\n echo \"Tenth Iteration\";\n break;\n case 11:\n echo \"Eleventh Iteration\";\n break;\n case 12:\n echo \"Twelth Iteration\";\n break;\n case 13:\n echo \"Thirteenth Iteration\";\n break;\n case 14:\n echo \"Fourteenth Iteration\";\n break;\n case 15:\n echo \"Fifteenth Iteration\";\n break;\n case 16:\n echo \"Sixteenth Iteration\";\n break;\n case 17:\n echo \"Seventeenth Iteration\";\n break;\n case 18:\n echo \"Eighteenth Iteration\";\n break;\n case 19:\n echo \"Ninteenth Iteration\";\n break;\n case 20:\n echo \"Twentyth Iteration\";\n break;\n case 21:\n echo \"Twenty First Iteration\";\n break;\n case 22:\n echo \"Twenty Second Iteration\";\n break;\n case 23:\n echo \"Twenty Third Iteration\";\n break;\n case 24:\n echo \"Twenty Fourth Iteration\";\n break;\n case 25:\n echo \"Twenty Fifth Iteration\";\n break;\n case 26:\n echo \"Twenty Sixth Iteration\";\n break;\n case 27:\n echo \"Twenty Seventh Iteration\";\n break;\n case 28:\n echo \"Twenty Eight Iteration\";\n break;\n case 29:\n echo \"Twenty Ninth Iteration\";\n break;\n case 30:\n echo \"thirteeth Iteration\";\n break;\n case 31:\n echo \"Thirty First Iteration\";\n break;\n case 32:\n echo \"Thirty Second Iteration\";\n break;\n case 33:\n echo \"Thirty Third Iteration\";\n break;\n case 34:\n echo \"Thirty Fourth Iteration\";\n break;\n case 35:\n echo \"Thirty Fifth Iteration\";\n break;\n case 36:\n echo \"Thirty Sixth Iteration\";\n break;\n case 37:\n echo \"Thirty Seventh Iteration\";\n break;\n case 38:\n echo \"Thirty Eight Iteration\";\n break;\n case 39:\n echo \"Thirty Ninth Iteration\";\n break;\n case 40:\n echo \"Fouthy Iteration\";\n break;\n case 41:\n echo \"Fourty First Iteration\";\n break;\n case 42:\n echo \"Fourty Second Iteration\";\n break;\n case 43:\n echo \"Fourty Third Iteration\";\n break;\n case 44:\n echo \"Fourty Fourth Iteration\";\n break;\n case 45:\n echo \"Fourty Fifth Iteration\";\n break;\n case 46:\n echo \"Fourty Sixth Iteration\";\n break;\n case 47:\n echo \"Fourty Seventh Iteration\";\n break;\n case 48:\n echo \"Fourty Eight Iteration\";\n break;\n case 49:\n echo \"Fourty Ninth Iteration\";\n break;\n case 50:\n echo \"Fifty Iteration\";\n break;\n }\n \n }",
"function addFive($num){\n $num += 5;\n }",
"function garis($jum) {\n\tfor ($i=0; $i<= $jum; $i++) {\n\t\techo \"=\";\n\t\t}\n}",
"function digit_at($a, $i){\n\t$a = $a . \"\";\n\tif (strlen($a) <= $i)\n\t\treturn \"0\";\n\n//\tprintf(\"%10s %2d %2d\\n\", $a, strlen($a), $i);\n\n\t$a = strrev($a);\n\n\treturn $a[$i];\n}",
"public function test($i)\n\t{\n\t\treturn $i;\n\t}",
"function inc(int $x): int {\n $x = $x + 1;\n\n return $x;\n }",
"function x($i) {\n if ($i < 0)\n return 4294967296 - $i;\n else\n return $i;\n }",
"function getSum($n){\n \n $range =500;\n for($i=0;$i<$n;$i++){\n echo $range--.\" \";\n }\n}",
"function sum1()\n{\n\t$sum='';\n\tfor($i=1;$i<=100;$i++)\n\t{\n\t\t$sum=$sum+$i;\n\t}\n\techo $sum;\n}",
"function printStarts()\n{\n for ($i = 0; $i < 20; $i++) {\n echo \"*\";\n }\n}",
"function ydintIncr($incr)\n{\n\treturn $incr+1;\n}",
"function postdigit(string $c, int $n):void{\n global $i, $romanval;\n for($j = 0; $j < $n; $j++){\n $romanval[$i++] = $c;\n }\n}",
"function p3_ex7() {\n function p3_ex7_loop() {\n for ($i = 1; $i <= 100; $i += 15)\n $return .= \"C'est presque bon.<br />\";\n return $return;\n }\n // Just add p3_ex7_loop().\"<br />\".\n return \"XX fois (y'a aussi les boucles mais en comm aussi)\"; // 7\n}",
"function p3_ex8() {\n function p3_ex8_loop() {\n for ($i = 200; $i >= 0; $i -= 12)\n $return .= \"C'est presque bon.<br />\";\n return $return;\n }\n // Just add p3_ex8_loop().\"<br />\".\n return 'XX fois'; // 17\n}",
"function increase($num): void {\n $num +=2;\n}",
"function counter_statement() {\n echo \"Statement evaluated<br>\";\n $limit = 5;\n return $limit;\n }",
"function benc_int($i) {\n\treturn \"i\" . $i . \"e\";\n}",
"function simple_rec($n)\n{\n if($n == 1)\n {\n return \"1\";\n }\n ////from max to min\n // return $n .= fac($n - 1);\n ////from min to max\n return simple_rec($n - 1) . $n;\n}",
"public function getTenPlus()\n {\n $r = range(1, 10);\n\n return array_combine($r, $r) + [\n 11 => '10+',\n ];\n }",
"function counter($nbrincr = NULL)\n{\n static $a = 0;\n if($nbrincr === NULL)\n {\n return ($a);\n }\n else\n {\n $a = $a + $nbrincr;\n }\n}",
"function p3_ex5() {\n function p3_ex5_loop() {\n for ($i = 1; $i <= 15; $i++)\n $return .= \"On y arrive presque.<br />\";\n return $return;\n }\n // Just add loop().\"<br />\".\n return \"XX fois (il faut juste répondre à la question ?)\"; // 15\n}",
"function number_suffix($i) {\n\t\tif ($i%10 == 1 && $i%100 != 11) {\n\t\t\treturn \"st\";\n\t\t} else if ($i%10 == 2 && $i%100 != 12) {\n\t\t\treturn \"nd\";\n\t\t} else if ($i%10 == 3 && $i%100 != 13) {\n\t\t\treturn \"rd\";\n\t\t} else {\n\t\t\treturn \"th\";\n\t\t}\n\t}",
"function return10(){\r\n return 10;\r\n }",
"static function staticMethod() {\n echo self::$i;\n self::$i++;\n\n}",
"function syracuse($int) {\n if (!is_numeric($int) || $int <= 0) {\n return \"Error, $int n'est pas un entier positif\";\n }\n if ($int % 2) {\n $int *= 3;\n $int++;\n } else {\n $int /= 2;\n }\n return ($int == 1) ? 1 : $int.' '.syracuse($int);\n}",
"function int_to_str($i) {\n\treturn implode('.', int_to_digits($i));\n}",
"function makeInteger()\r\n{\r\n $array = array();\r\n for ($i = 0; $i < 10000; $i++) {\r\n $array[] = rand(100, 999);\r\n }\r\n\r\n return join(\"\\n\", $array);\r\n}",
"public function __invoke($num) {\n if ( ($num / 10) % 10 != 1 ) {\n switch( $num % 10 ) {\n case 1: return $num . 'st';\n case 2: return $num . 'nd';\n case 3: return $num . 'rd';\n }\n }\n return $num . 'th';\n }",
"public static function counter() {}",
"private function getControlNumber()\n {\n $total = 0;\n for ($i = 0; $i < 10; $i++) {\n $multiplier = $i + 1;\n $total += substr($this->code, $i, 1) * ($multiplier > 9 ? 1 : $multiplier);\n }\n\n $modulo = $total % 11;\n\n // Second round\n if ($modulo >= 10) {\n $total = 0;\n\n for ($i = 0; $i < 10; $i++) {\n $multiplier = $i + 3;\n $total += substr($this->code, $i, 1) * ($multiplier > 9 ? $multiplier - 9 : $multiplier);\n }\n\n $modulo = $total % 11;\n if ($modulo >= 10) {\n $modulo = 0;\n }\n }\n\n return $modulo;\n }",
"function func3($n) {\n for ($k = 0; $n; $n = (int) ($n / 10)) {\n $k = $n * 10;\n if ($k > $n)\n $n = $k;\n }\n return $n;\n}",
"function repeatStringNumTimes($str, $num) {\n return str_repeat($str, $num); // :D\n}",
"function int2vancode($i = 0) {\n\t\t$num = base_convert((int) $i, 10, 36);\n\t\t$length = strlen($num);\n\n\t\treturn chr($length + ord('0') - 1) . $num;\n\t}",
"function get_placeholder($num)\n\n{\n\n return \"\\x01\".str_repeat(\"\\x00\", $num+1).\"\\x01\";\n\n}",
"function create_style_prefix( $i = '' ) {\n switch ( $i ) :\n \n case 1:\n $prefix = 'one';\n break;\n \n case 2:\n $prefix = 'two';\n break;\n \n case 3:\n $prefix = 'three';\n break;\n \n case 4:\n $prefix = 'four';\n break;\n \n case 5:\n $prefix = 'five';\n break;\n \n case 6:\n $prefix = 'six';\n break;\n \n case 7:\n $prefix = 'seven';\n break;\n \n case 8:\n $prefix = 'eight';\n break;\n \n case 9:\n $prefix = 'nine';\n break;\n \n case 10:\n $prefix = 'ten';\n break;\n \n default:\n $prefix = 'zero';\n break;\n\n endswitch;\n\n return $prefix;\n}",
"function __renumber($node_id = 1, $i = 1)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'UPDATE '.$this->table_tree.' SET lft = %s WHERE child = %s';\n\t\t$res = $ilDB->manipulateF($query,array('integer','integer'),array(\n\t\t\t$i,\n\t\t\t$node_id));\n\n\t\t$childs = $this->getChilds($node_id);\n\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\t$i = $this->__renumber($child[\"child\"],$i+1);\n\t\t}\n\t\t$i++;\n\t\t\n\t\t// Insert a gap at the end of node, if the node has children\n\t\tif (count($childs) > 0)\n\t\t{\n\t\t\t$i += $this->gap * 2;\n\t\t}\n\t\t\n\t\t\n\t\t$query = 'UPDATE '.$this->table_tree.' SET rgt = %s WHERE child = %s';\n\t\t$res = $ilDB->manipulateF($query,array('integer','integer'),array(\n\t\t\t$i,\n\t\t\t$node_id));\n\t\treturn $i;\n\t}",
"function enunciadoEjercicio() {\r\n $num1 = 10;\r\n $num2 = 25;\r\n\r\n // TODO Aquí va el ejercicio\r\n\r\n echo \"$num1<br>\"; // 25\r\n echo \"$num2<br>\"; // 10\r\n }",
"public function getInt($i);",
"function add_zero($num){\n if((int)$num<10){\n return \"0\".(String)$num;\n }\n else\n return $num;\n }",
"function addZero( $value )\r\n {\r\n $ret = $value;\r\n if ( $ret < 10 )\r\n {\r\n $ret = \"0\". $ret;\r\n }\r\n\r\n return $ret;\r\n }",
"function addZero( $value )\r\n {\r\n $ret = $value;\r\n if ( $ret < 10 )\r\n {\r\n $ret = \"0\". $ret;\r\n }\r\n\r\n return $ret;\r\n }",
"function calcularReferencia(&$num){\n $num++;\n}",
"function miTabla($numero)\n\t{\n\t\tfor($multiplicador=0;$multiplicador<=10;$multiplicador++)\n\t\t{\n\t\t\techo $numero.\" x \".$multiplicador.\" = \".$numero*$multiplicador.\"<br>\";\n\t\t}\n\t}",
"private function nextID(): string\n {\n return 'i-' . dechex(self::$nextID++);\n }",
"public function Exec( $n )\n\t{\n if($n >= 1073741824){\n $n = round($n / 1073741824 * 100) / 100 . 'gb';\n }elseif($n >= 1048576){\n $n = round($n / 1048576 * 100) / 100 . 'mb';\n }elseif($n >= 1024){\n $n = round($n / 1024 * 100) / 100 . 'kb';\n }else{\n $n = $n . ' bytes';\n }\n return $n;\n }",
"function cuadrado(int $numero){\n return $numero * $numero;\n}",
"function Addnumber(int $x,int $y)\n{\n return $x + $y; \n}",
"function sumToNum($n=1)\n{\n echo $n, '<br>';\n\n if($n<100){\n return sumToNum($n+1);\n\n }\n}",
"function fill_zeroes_dots()\n{\n $generated = '';\n\n for ($i = 0; $i < 39; $i++) {\n if ($i % 10 == 9) {\n $generated .= '.';\n } else {\n $generated .= '#';\n }\n }\n\n return $generated;\n}",
"function fibonacciSequence($n)\n{\n\n $num1 = 0;\n $num2 = 1;\n\n for ($i = 0; $i <= $n; $i++) {\n echo ' ' . $num1;\n $num3 = $num2 + $num1;\n $num1 = $num2;\n $num2 = $num3;\n }\n}",
"function p3_ex3() {\n $hundred = 100;\n $rand = mt_rand(1, 100);\n for ($i = 20; $hundred >= $i; $hundred--) {\n if ($hundred % 5 == 0 && $hundred != 100)\n $return .= 'resultat : '.($hundred * $rand).'<br />';\n else\n $return .= 'resultat : '.($hundred * $rand).', ';\n }\n\n return $return;\n}",
"function show_ordinal($num) \n\t{\n\t\t$the_num = (string) $num;\n\t\t$last_digit = substr($the_num, -1, 1);\n\t\tswitch($last_digit) \n\t\t{\n\t\t\tcase \"1\":\n\t\t\t\t$the_num.=\"st\";\n\t\t\t\tbreak;\n\t\t\tcase \"2\":\n\t\t\t\t$the_num.=\"nd\";\n\t\t\t\tbreak;\n\t\t\tcase \"3\":\n\t\t\t\t$the_num.=\"rd\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$the_num.=\"th\";\n\t\t}\n\t\treturn $the_num;\n\t}",
"public function actionIndex()\n {\n$e=0;\n for ($a=0;$a<=9;$a++){\n for ($b=$a+1;$b<=9;$b++){\n for ($c=$b+1;$c<=9;$c++){\n for ($d=$c+1;$d<=9;$d++){\n print_r($a.$b.$c.$d);\n print_r(\"</br>\");\n $e++;\n }\n }\n }\n }\n\n dd($e);\n }",
"function addNumbers($end, $start = 0) {\r\n $sum = 0;\r\n for($i = $start; $i <= $end; $i++){\r\n $sum += $i;\r\n }\r\n echo(\"The sum of $start to $end = $sum<br \\>\");\r\n\r\n }",
"function rekursija() {\n static $k = 0;\n if ($k < 10) {\n echo \" $k -as kartas <br />\";\n $k++;\n rekursija();\n }\n}",
"function pager($count){\n //x if > 0 - decrement on num\n //y - number position of ouput increment on num\n //z - number of account increment on 1\n for($x=$count, $y=1, $z=1;\n $x>0;\n $x-=$this->num, $y+=$this->num ,$z++){\n if($this->pos == $y){\n echo $z;\n } else {\n echo \"<a href=?pos=\",$y,\"> \",$z,\" </a>\" ;\n }\n }\n }",
"function prepend_one($num) {\n\n\t\tif ($num < 10) {\n\t\t\t$num = \"0\" . $num;\n\t\t}\n\t\t\n\t\treturn $num;\n }",
"function ExampleCountFunction($count_to = 1000000, $message = 'No Message Was Specified.'){\n\t$report_at = round($count_to / 2);\n\t// iterate $i from 0 to $count_to and echo $message at 1/2 way\n\tfor($i=0;$i<$count_to;$i++){\n\t\tif($i == $report_at){\n\t\t\techo $message . PHP_EOL;\n\t\t}\n\t}\n}",
"function manoRekursija(){\nstatic $i = 0;\n$i++;\nif ($i<5) {\n echo \"$i <br />\";\n manoRekursija();\n}\n}",
"function armstrong_number(int $num){\n $temp = $num; // store the number in a temporary variable\n $result = 0; // variable to store the result\n\n // loop till the the temporary variable is not equal to zero\n while($temp != 0){\n $remainder = $temp%10; // get the remainder of temp variable divided by 10\n $result = $result + $remainder*$remainder*$remainder; // add the result with cube of the remainder\n\n $temp = $temp/10; // change the temp variable by dividing it by 10\n }\n\n return $result; // return result\n }",
"function jc1($n)\n{\n\t$sum=1;\n\tfor($i=1;$i<=$n;$i++)\n\t{\n\t\t$sum=$sum*$i;\n\t}\n\techo $sum;\n}",
"function generate($value){\n global $string;\n $length = count($string) - 1;\n return $string[intval($value * $length, 10)];\n }",
"function fibonacci($limit) {\n $first = 0;\n $second = 1;\n echo $first.\" \".$second.\" \";\n for($i=2;$i<$limit;$i++) {\n $next = $first + $second;\n $first = $second;\n $second = $next;\n echo $next. \" \";\n }\n}",
"function byVal($val) {\n $val++;\n return 1;\n}",
"function predigit(string $num1, string $num2):void{\n global $i, $romanval;\n $romanval[$i++] = $num1; // Stores $num1 in i'th cell and increase it to 1.\n $romanval[$i++] = $num2; // Stores $num2 in i'th cell and increase it to 1.\n}",
"function test()\n{\n static $count = 0;\n\n $count++;\n echo \"see:\".$count;\n if ($count < 10) {\n test();\n echo $count.\"<br>\";\n }\n $count--;\n}",
"function printMultipleTimes($times, $str = \"*\"){\r\n for($j = 1; $j <= $times; $j++){\r\n echo($str);\r\n }\r\n }",
"function number_increment_sign($value)\n {\n if($value >= 0) {\n return '+';\n } else {\n return '';\n }\n }",
"function potencias($base, $cant)\n{\n $retorno =\"\";\n\n for($i=1;$i<=$cant;$i++)\n {\n $retorno = \" \".$retorno.pow($base, $i).\" -\";\n }\n\n return $retorno;\n\n}",
"function total($n,$q){\r\n\treturn $n*$q;\r\n\r\n}",
"function increaseEnthusiasm($str)\n{\n return $str . \"!\";\n}",
"function fib($n) {\n $o = 0;\n $s = 1;\n\n //simpan string angka sekarang\n $hasil = \"$s\";\n\n for ($i=0; $i < $n-1 ; $i++) {\n\n //hitung fib\n $output = $s + $o;\n //simpan di $hasil\n $hasil = $hasil.\" $output\";\n\n //siapkan angka untuk perhitungan berikutnya\n $o = $s;\n $s = $output;\n }\n return $hasil;\n }",
"function stringChar($int) {\r\r\n $char = '-';\r\r\n $n = 1;\r\r\n while ($n < $int) {\r\r\n $char .= ' - ';\r\r\n $n++;\r\r\n }\r\r\n\r\r\n return $char;\r\r\n }",
"function getTable( $t , $b = null ) // Signature\n{\n // statements\n $table = 15;\n for ($a = 1; $a <= 25; $a += 2) {\n echo \"$table x $a = \" . ($table * $a) . \" <br>\";\n }\n}",
"function cuadrado($numero){\r\n $res=$numero*$numero;\r\n return $res;\r\n}",
"function test()\r\n{\r\n static $count = 0; //here a static variable is used to remember the count between\r\n //function calls. Static variables are initialized only in the\r\n //first call of function\r\n $count++;\r\n echo $count;\r\n if ($count < 10) {\r\n test(); //Recursively call the function your in test() while $count < 10\r\n } //it will call it recursively 9 times, when it reaches 10\r\n //there will be no more recursive calls and then it will begin\r\n $count--; //finishing off every unfinished rec call decreasing the count everytime\r\n echo $count;\r\n}",
"function StaticValue(){\n static $value=1;\n echo $value.\" static <br>\";\n $value++;\n }",
"function factorial($number=5, $print=false) {\t\n\t$factor = abs($number);\n\t$ret = 0;\n\t\n\twhile($factor != 1) {\n\t\tif($ret == 0)\n\t\t\t$ret = $factor;\n\t\t\t\n\t\t$ret *= ($factor - 1);\n\t\t--$factor;\n\t}\n\t\n\tif($print)\n\t\techo \"{$number}! is {$ret}\\n\\n\";\n\t\t\n\treturn $ret;\n}",
"function printt($node, $i){\n\tif($node == NULL)\n\t\treturn NULL;\n\n\tprintt($node->right, $i+1);\n\n\tfor($x = 0; $x < $i; $x++)\n\t\techo \" \";\n\techo \"[ \".$node->type.\" | \".$node->value.\" ]\\n\";\n\n\tprintt($node->left, $i+1);\n}",
"public function step($input) {\n\n \tif ( $this->isPrelim($input) ) {\n \t\treturn $input;\n \t}\n\n if ( !is_numeric($input) ) {\n throw new InvalidArgumentException(\"bad number: ${input}\");\n }\n\n $num = intval($input);\n\n if ( $num > $this->_min_page ) {\n $num = $num + $this->_increment;\n }\n\n return strval($num);\n }",
"function reverse_integer($n)\n {\n $reverse = 0;\n while ($n > 0)\n {\n $reverse = $reverse * 10;\n $reverse = $reverse + $n % 10;\n $n = (int)($n/10);\n }\n return $reverse;\n }",
"function test10($foo) {\n\n}",
"function item_depth($depth)\n{\n//dd($depth);\n return str_repeat('<span class=\"space\">»</span>', $depth);\n}",
"function incrementar(&$valor){\n $valor++;\n return $valor;\n }"
]
| [
"0.7296283",
"0.70713145",
"0.68269056",
"0.6741455",
"0.62114555",
"0.62011236",
"0.61997324",
"0.61769605",
"0.61496556",
"0.61419207",
"0.6100423",
"0.6017312",
"0.5936261",
"0.58621836",
"0.5856884",
"0.5850281",
"0.5799598",
"0.57483506",
"0.5644608",
"0.55799353",
"0.5579828",
"0.5547888",
"0.55249995",
"0.55238616",
"0.5515024",
"0.5506149",
"0.54970866",
"0.54925436",
"0.54497135",
"0.5444784",
"0.5414372",
"0.53909695",
"0.5381318",
"0.5337904",
"0.5333479",
"0.5326853",
"0.5321767",
"0.5301144",
"0.52888066",
"0.5236435",
"0.5233576",
"0.519941",
"0.51773506",
"0.5170312",
"0.5152293",
"0.5150532",
"0.51478845",
"0.510835",
"0.51058406",
"0.510104",
"0.5097564",
"0.5082013",
"0.5069212",
"0.5051097",
"0.50499195",
"0.50418454",
"0.50418454",
"0.5037047",
"0.50369966",
"0.5032315",
"0.50306755",
"0.50304174",
"0.50197464",
"0.5014364",
"0.5011621",
"0.5006864",
"0.49986738",
"0.49946126",
"0.49923736",
"0.49909493",
"0.49906814",
"0.49843064",
"0.49839494",
"0.49778032",
"0.49776864",
"0.49759972",
"0.49754897",
"0.49704424",
"0.49626893",
"0.4949535",
"0.49422628",
"0.49384457",
"0.49273115",
"0.49192646",
"0.49172962",
"0.49035433",
"0.4900699",
"0.4887346",
"0.48810267",
"0.48765612",
"0.48756477",
"0.4874695",
"0.48678672",
"0.4858778",
"0.48587614",
"0.485316",
"0.484854",
"0.48441952",
"0.48383412",
"0.48377213"
]
| 0.62474763 | 4 |
Action para salvar um novo registro | public function saveAction()
{
$id = $this->params()->fromRoute('id', null);
$row = null;
//Cria o formulário
$form = new RegeneracaoForm($this->objectManager);
//Verifica se a requisição utiliza o método POST
if ($this->getRequest()->isPost()) {
//Recebe os dados via POST
$data = $this->params()->fromPost();
//Preenche o form com os dados recebidos e o valida
$form->setData($data);
if ($form->isValid()) {
$data = $form->getData();
$repo = $this->entityManager->getRepository(Regeneracao::class);
$row = $repo->incluir_ou_editar($data, $id);
return $this->redirect()->toRoute('bag/regeneracao', ['action' => 'save', 'id' => $row->getId()]);
}
} else {
if ( !empty($id)){
$repo = $this->entityManager->getRepository(Regeneracao::class);
$row = $repo->find($id);
if ( !empty($row)) {
$form->setData($row->toArray());
$form->get('motivo')->setValue($row->getMotivos());
}
}
}
$caracteristicas = $this->entityManager->getRepository(Caracteristica::class)->getQuery()->getQuery()->getResult();
return new ViewModel([
'form' => $form,
'regeneracao' => $row,
'caracteristicas' => $caracteristicas
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function salvar()\r\n {\r\n $fabCtrl = new FabricanteController();\r\n $catCtrl = new CategoriaController();\r\n \r\n $fabObj = $fabCtrl->buscarNome($_POST['fabricante']);\r\n $catObj = $catCtrl->buscarNome($_POST['categoria']);\r\n \r\n $produto = new Produto;\r\n\r\n $produto->setNome($_POST['nomeProduto']);\r\n $produto->setDescricao($_POST['descricaoProduto']);\r\n $produto->setEstoque($_POST['estoque']);\r\n $produto->setPrecoCusto($_POST['precoCusto']);\r\n $produto->setPrecoVenda($_POST['precoVenda']);\r\n $produto->setImg($_POST['imgProduto']);\r\n $produto->setFabricante($fabObj);\r\n $produto->setCategoria($catObj);\r\n \r\n Produto::startConexao();\r\n $produto->salvar();\r\n \r\n Sessao::gravaIdObjeto($produto,'Produto');\r\n\r\n $this->redirect('/App/Views/caracteristica_view.php');\r\n }",
"public function action_salvar()\n\t{\n\t\t$this->requerer_autenticacao();\n\n\t\t$texto_secao = $this->obter_texto_secao();\n\t\t$secao = $texto_secao->secao;\n\t\t$aula = $secao->aula;\n\n\t\tif ($this->request->method() != 'POST') {\n\t\t\tHTTP::redirect(Route::url('alterar_texto_secao', array('id_aula' => $aula->pk(), 'id_secao' => $secao->pk(), 'id_secao_texto' => $texto_secao->pk())) . URL::query(array()));\n\t\t}\n\n\t\t$dados_texto_secao = array(\n\t\t\t'texto' => $this->request->post('texto'),\n\t\t);\n\n\t\t$rules = ORM::Factory('Secao_Texto')->rules();\n\t\t$post = Validation::factory($this->request->post())\n\t\t\t->rules('texto', $rules['texto']);\n\n\t\tif ( ! $post->check()) {\n\t\t\t$mensagens = array('atencao' => $post->errors('models/secao/texto'));\n\t\t\tSession::instance()->set('flash_message', $mensagens);\n\t\t\t$flash_data = array('texto_secao' => $dados_texto_secao);\n\t\t\tSession::instance()->set('flash_data', $flash_data);\n\n\t\t\tHTTP::redirect(Route::url('alterar_texto_secao', array('id_aula' => $aula->pk(), 'id_secao' => $secao->pk(), 'id_secao_texto' => $texto_secao->pk())) . URL::query(array()));\n\t\t}\n\n\t\t$bd = Database::instance();\n\t\t$bd->begin();\n\n\t\t$mensagens_sucesso = array();\n\t\ttry {\n\t\t\t$texto_secao->texto = $this->request->post('texto');\n\t\t\t$texto_secao->save();\n\t\t\t$mensagens_sucesso[] = 'Texto alterado com sucesso.';\n\n\t\t\t$bd->commit();\n\t\t} catch (ORM_Validation_Exception $e) {\n\t\t\t$bd->rollback();\n\n\t\t\t$mensagens = array('erro' => $e->errors('models', TRUE));\n\t\t\tSession::instance()->set('flash_message', $mensagens);\n\t\t\t$flash_data = array('texto_secao' => $dados_texto_secao);\n\t\t\tSession::instance()->set('flash_data', $flash_data);\n\n\t\t\tHTTP::redirect(Route::url('alterar_texto_secao', array('id_aula' => $aula->pk(), 'id_secao' => $secao->pk(), 'id_secao_texto' => $texto_secao->pk())) . URL::query(array()));\n\t\t} catch (Exception $e) {\n\t\t\t$bd->rollback();\n\n\t\t\t$mensagens = array('erro' => 'Erro inesperado ao alterar o texto. Por favor, tente novamente mais tarde.');\n\t\t\tSession::instance()->set('flash_message', $mensagens);\n\t\t\t$flash_data = array('texto_secao' => $dados_texto_secao);\n\t\t\tSession::instance()->set('flash_data', $flash_data);\n\n\t\t\tHTTP::redirect(Route::url('alterar_texto_secao', array('id_aula' => $aula->pk(), 'id_secao' => $secao->pk(), 'id_secao_texto' => $texto_secao->pk())) . URL::query(array()));\n\t\t}\n\n\t\t$mensagens = array('sucesso' => $mensagens_sucesso);\n\t\tSession::instance()->set('flash_message', $mensagens);\n\n\t\tHTTP::redirect(Route::url('listar_secoes', array('id_aula' => $aula->pk())));\n\t}",
"public function salvar(){\n \n\t\t/*\n\t\t\tReceber dados vindos do formulario.\n\t\t*/\n\n\t\t$login = $this->post(\"login\");\n\t\t$senha = $this->post(\"senha\");\n\t\t$senha = md5($senha);\n\t\t$tipo = 2;\n\n\t\t/*\n\t\t\tInserindo dados na tabela usuário.\n\t\t*/\n\t\t$campos = \"(login,senha,tipo)\";\t\t\n\t\t$valores = \"('\".$login.\"','\".$senha.\"','\".$tipo.\"')\";\t\t\n\t\t$tabela = \"usuarios\";\n\t\t\n\t\t$this->insert( $tabela, $campos, $valores );\t\n\t\t\n\t}",
"public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $idTipoCodigo = $this->request->getPost(\"idTipoCodigo\");\n $tipocodigo = Tipocodigo::findFirstByidTipoCodigo($idTipoCodigo);\n\n if (!$tipocodigo) {\n $this->flash->error(\"Tipo de Código no Existe \" . $idTipoCodigo);\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $tipocodigo->Descripciontipo = $this->request->getPost(\"descripcionTipo\");\n $tipocodigo->LongitudCodigo = $this->request->getPost(\"longitudCodigo\");\n $tipocodigo->Estadoregistro = $this->request->getPost(\"estadoRegistro\");\n \n\n if (!$tipocodigo->save()) {\n\n foreach ($tipocodigo->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'edit',\n 'params' => [$tipocodigo->idTipoCodigo]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Tipo de código se Actualizó Satisfactoriamente\");\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n }",
"public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"usuario\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $Cod_usuario = $this->request->getPost(\"Cod_usuario\");\n $usuario = Usuario::findFirstByCod_usuario($Cod_usuario);\n\n if (!$usuario) {\n $this->flash->error(\"usuario does not exist \" . $Cod_usuario);\n\n $this->dispatcher->forward([\n 'controller' => \"usuario\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $usuario->loginUsuario = $this->request->getPost(\"Login_usuario\");\n $usuario->senhaUsuario = $this->request->getPost(\"Senha_usuario\");\n $usuario->nomeUsuario = $this->request->getPost(\"Nome_usuario\");\n $usuario->idadeUsuario = $this->request->getPost(\"Idade_usuario\");\n $usuario->enderecoUsuario = $this->request->getPost(\"Endereco_usuario\");\n $usuario->cIDADECodCidade = $this->request->getPost(\"CIDADECod_cidade\");\n $usuario->tIPOUSUARIOCodTipoUsuario = $this->request->getPost(\"TIPO_USUARIOCod_tipo_usuario\");\n \n\n if (!$usuario->save()) {\n\n foreach ($usuario->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"usuario\",\n 'action' => 'edit',\n 'params' => [$usuario->Cod_usuario]\n ]);\n\n return;\n }\n\n $this->flash->success(\"usuario was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"usuario\",\n 'action' => 'index'\n ]);\n }",
"public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }",
"function saveAction()\n {\n\t\t$params = $this->_request->getParams();\n \t$id=(int)$params[\"id\"];\n\t\t$name = $params[\"txtName\"];\n\t\t$address = $params[\"txtAddress\"];\n\t\t$email = $params[\"txtEmail\"];\n\t\t$phone = $params[\"txtPhone\"];\n\n\t\t$customers = new CustomersModel();\n\t\tif($id > 0)\n\t\t{\n\t\t\t$customers->updateCustomersById($id, $name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t} else {\n\t\t\t$customers->insertCustomers($name, $address, $email, $phone);\n\t\t\t$this->_redirect('/qtht/customers');\n\t\t}\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $idEmpresa = $this->request->getPost(\"idEmpresa\");\n $empresa = Empresa::findFirstByidEmpresa($idEmpresa);\n\n if (!$empresa) {\n $this->flash->error(\"Empresa does not exist \" . $idEmpresa);\n\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $empresa->nombre = $this->request->getPost(\"nombre\");\n $empresa->nombreInterno = $this->request->getPost(\"nombreInterno\");\n $empresa->nit = $this->request->getPost(\"nit\");\n $empresa->idMunicipio = $this->request->getPost(\"idMunicipio\");\n $empresa->telefono = $this->request->getPost(\"telefono\");\n $empresa->cedulaRepresentante = $this->request->getPost(\"cedulaRepresentante\");\n $empresa->representanteLegal = $this->request->getPost(\"representanteLegal\");\n\n\n if (!$empresa->save()) {\n\n foreach ($empresa->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'edit',\n 'params' => [$empresa->idEmpresa]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Empresa editada exitosamente\");\n\n return $this->response->redirect(\"empresa/index\");\n }",
"public function saveAction()\n {\n $form = $this->getForm();\n $form->setData($_POST);\n try {\n $valid = $form->isValid();\n } catch (\\Exception $e) {\n $valid = false;\n }\n if (!$valid)\n {\n $this->getSessionStorage()->fromArray(['form' => $form]);\n return $this->redirect()->toRoute($this->routeName, ['action' => 'edit']);\n }\n $modelName = $this->modelName;\n $model = new $modelName();\n $model->exchangeArray($this->getDataFromRequest());\n $this->sm->get($this->mainTableFactory)->save($model);\n return $this->redirect()->toRoute($this->routeName);\n }",
"public function salvar()\n {\n //Executa a validação do formulário\n $validacao = self::validar('insert');\n\n //Verifica o status da validação do formulário\n //Se não houveram erros, insere no banco de dados\n //Caso contrário, informa ao usuário os erros de validação\n if($validacao)\n {\n //Obtem os dados do formulário preenchido\n $empresa = $this->input->post();\n\n //Insere no banco de dados a empresa e obtem o status da operação\n $status = $this->EmpresasModel->inserir($empresa);\n\n //Checa o status da operação\n //Se bem sucedida, carrega a tela de lista de empresas \n //Caso contrário, informa ao usuário\n if(!$status){\n\t\t\t\t$this->session->set_flashdata('error', 'Não foi possível cadastrar a empresa.');\n\t\t\t}else{\n //Lista todas as empresas\n $resultado = $this->EmpresasModel->getAll();\n $dados = array(\"empresas\" => $resultado, \"success\" => 'Empresa cadastrada com sucesso.');\n //Carrega a tela da lista de empresas enviando os dados da query\n $this->load->view(\"Empresas/lista\", $dados);\n\t\t\t}\n }\n else\n {\n\t\t\t$this->session->set_flashdata('error', validation_errors('<p>','</p>'));\n }\n //Carrega a tela de cadastro\n $this->load->view(\"Empresas/cadastro\");\n }",
"function Save(){\n $rowsAffected = 0;\n if(isset($this->legajo)){\n $rowsAffected = $this->UpdateSQL([\"legajo = \".$this->legajo]);\n }else{\n $rowsAffected = $this->InsertSQL();\n if($rowsAffected > 0){\n $this->legajo = $this->Max(\"legajo\");\n }\n }\n if($rowsAffected == 0){\n throw new \\Exception(\"Error al guardar Usuario\");\n }else{\n $this->Refresh();\n }\n }",
"public function salvar() {\n \t\n \tif (!db_utils::inTransaction()) {\n \t\tthrow new DBException('Não existe Transação Ativa');\n \t}\n \t\n \t$oDaoNotaIss = db_utils::getDao('notasiss');\n \t$oDaoNotaIss->q09_codigo = $this->iCodigo;\n \t$oDaoNotaIss->q09_nota = $this->sTipo;\n \t$oDaoNotaIss->q09_descr = $this->sDescricao;\n \t$oDaoNotaIss->q09_gruponotaiss = $this->iGrupo;\n \t\n \t/**\n \t * Verifica se já foi indormado algum codigo. Se já foi informada \n \t * realiza update caso contrário realiza insert\n \t */\n if (empty($this->iCodigo)) {\n\n \t\t$oDaoNotaIss->incluir(null);\n $this->iCodigo = $oDaoNotaIss->q09_codigo;\n\n \t} else {\n \t\t$oDaoNotaIss->alterar($this->iCodigo);\n \t}\n \t\n \tif ($oDaoNotaIss->erro_status == '0') {\n \t\tthrow new DBException($oDaoNotaIss->erro_msg);\n \t}\n \t\n \treturn true;\n }",
"public function store()\n\t{\n $data = Input::all();\n $dataCuotas = $data['cuota'];\n $prestamoRepo = $this->prestamosRepo->newPrestamo();\n $prestamoManager = new PrestamosManager($prestamoRepo,$data);\n $prestamoManager->save();\n\n $id = $prestamoRepo->id;\n\n $this->saveCuotas($dataCuotas, $id);\n\n OrdenesPago::save($id,1,$data['monto'],\"Pago de Prestamo $id\",$prestamoRepo->created_at);\n\n return Redirect::route('prestamos.edit',$id)->with('mensaje_exito','Prestamo Creado Correctamente!');\n\n\t}",
"public function saveAction(){\n \n $req=$this->getRequest();\n \n if ($req->getParam('id') === 'new') {\n $record = Doctrine::getTable('Users')->create();\n $usersOrg = Doctrine::getTable('UsersOrganizations')->create();\n } else {\n $record =\tDoctrine_Query::create()\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne();\n }\n \n //Aggiorna \n $password=szGenPass::generatePassword(Constants::PASSWORD_LENGHT); \n if ($req->getParam('id') === 'new') {\n $record->password=md5($password);\n $record->data_iscrizione=new Doctrine_Expression('NOW()');\n }else{\n $record->data_iscrizione=$req->getParam(\"data_iscrizione\");\n }\n $record->merge(array(\n \"nome\"=> $req->getParam(\"nome\"),\n \"cognome\" => $req->getParam(\"cognome\"),\n \"user\" => $req->getParam(\"user\"),\n \"active\" => $req->getParam(\"active\"),\n \"ID_role\" =>$req->getParam(\"ID_role\")\n ));\n \n if(!$record->trySave()){\n $this->errors->addValidationErrors($record); \n }\n //TO DO: se l'utente è nuovo devo conoscere la password\n if ($req->getParam('id') === 'new') {\n if($req->getParam('orgid')!=''){\n \t$usersOrg->merge(array(\n \"orgid\"=>$req->getParam('orgid'),\n \"ID_user\"=>$record->ID,\n \"active\"=>Constants::UTENTE_ATTIVO\n ));\n $usersOrg->save();\n }\n $this->emitSaveData(array(\"success\"=>true,\"message\"=>\"Password: \".$password));\n }else{\n $this->emitSaveData();\n }\n }",
"public function guardar()\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\t\t// Comprobar si es un registro nuevo o uno ya existente\n\t\tif ($this->update) {\n\n\t\t\t// Preparar la sentencia para actualizar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"UPDATE \". static::$tablaConsulta . \" SET medio= ? WHERE id= ?\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t'si',\n\t\t\t\t\t$this->medio,\n\t\t\t\t\t$this->id\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t// Preparar la sentencia para isertar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"INSERT INTO \". static::$tablaConsulta . \" VALUES (null, ?)\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t's',\n\t\t\t\t\t$this->medio\n\t\t\t);\n\t\t}\n\n\n // Ejecutar la sentencia\n\t\tif ( $sentencia->execute() ) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function store(){\n \n // comprueba que llegue el formulario con los datos\n if(empty($_POST['guardar']))\n throw new Exception('No se recibieron datos');\n \n $mascota = new Mascotas(); //crear el nuevo usuario\n \n $mascota->nombre = DB::escape($_POST['nombre']);\n $mascota->sexo = DB::escape($_POST['sexo']);\n $mascota->biografia = DB::escape($_POST['biografia']);\n $mascota->fechanacimiento = DB::escape($_POST['fechanacimiento']);\n $mascota->fechafallecimiento = DB::escape($_POST['fechafallecimiento']);\n $mascota->idusuario = Login::get()->id;\n $mascota->idraza = intval($_POST['raza']);\n \n \n \n if(!$mascota->guardar())\n throw new Exception(\"No se pudo guardar $mascota->nombre\");\n \n $mensaje=\"Guardado la mascota $mascota->nombre\";\n include 'views/exito.php'; //mostrar éxito\n }",
"public function actionPessoas(){\n\n $pessoa = Pessoa::findOne(2);\n $pessoa->nome = 'Thiago Doideira';\n $pessoa->save();\n var_dump($pessoa->nome . ' - ' . $pessoa->email);\n }",
"public function saveUsuario(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_usuario SET usuario = \"%s\" password = \"%s\" WHERE usuario_id = %d',\n $this->usuario,\n $this->password,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_usuario ( usuario, password) VALUES (\"%s\", \"%s\")',\n $this->usuario,\n $this->password );\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\n }\n }",
"public function save() {\n\t\t\t\n\t\t}",
"public function save(){\n\n \t$sql = \"INSERT INTO \" . self::TABLENAME . \" (ora_decolare, destinatia, \n \t compania)\n \t\t\tVALUES ('$this->ora_decolare', '$this->destinatia', \n \t\t\t'$this->compania')\";\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n \t$db->getConnection()->exec($sql);\n\n \treturn \"Datele au fost introduse cu succes.\";\n }",
"public function salvarAction()\n {\n\n if ($this->_request->isPost()) {\n $layout = Zend_Layout::getMvcInstance();\n $layout->disableLayout();\n\n $response = new Zend_Controller_Response_Http();\n $response->setHeader('Content-type', 'application/json');\n\n $form = new Admin_Form_Email;\n $data = $this->_request->getPost();\n\n if ($form->isValid($data)) {\n try {\n $email = new Email;\n $obj = new stdClass();\n\n $obj->empresa = $this->_session->empresa->id_empresa;\n $obj->grupo = $data['id_email_grupo'];\n\n if (empty($data['id_email'])) {\n $obj->email = (!empty($data['str_nome']) ? $data['str_nome'] : $data['str_email']) . ':' . $data['str_email'];\n\n $email->insere($obj);\n } else {\n $obj->id = $data['id_email'];\n $obj->email = $data['str_email'];\n $obj->nome = $data['str_nome'];\n\n $email->atualiza($obj);\n }\n\n $mensagem = array('success' => 'Salvo com sucesso.');\n $this->_helper->flashMessenger($mensagem);\n } catch (Exception $e) {\n $mensagem = array('error' => $e->getMessage());\n $this->_helper->flashMessenger($mensagem);\n }\n } else {\n $this->_session->formEmailCampos = $data;\n $this->_session->retorno = $form->getErrors();\n\n $mensagem = array('error', $form->getErrors());\n }\n\n echo Zend_Json::encode($mensagem);\n exit;\n }\n }",
"public function saveAction(): void\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $id = $this->request->getPost('id', 'int');\n \n $record = Ana::findFirstById($id);\n \n \n if (!$record) {\n $this->flash->error('ana does not exist');\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n\n return;\n }\n\n $data = $this->request->getPost();\n \n \n $form = new AnaForm();\n \n \n if (!$form->isValid($data, $record)) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error((string)$message);\n }\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'new',\n ]);\n\n return;\n }\n\n \n \n \n if (!$record->save()) {\n foreach ($record->getMessages() as $message) {\n $this->flash->error((string)$message);\n }\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'new',\n ]);\n\n return;\n }\n\n $form->clear();\n $this->flash->success('Ana se guardo con èxito');\n\n $this->dispatcher->forward([\n 'controller' => 'ana',\n 'action' => 'index',\n ]);\n }",
"public function persist() {\n $bd = BD::getConexion();\n $sqlInsertUsuario = \"insert into usuarios (nomUsuario, clave) values (:nomUsuario, :clave)\";\n $sthSqlInsertUsuario = $bd->prepare($sqlInsertUsuario);\n $result = $sthSqlInsertUsuario->execute([\":nomUsuario\" => $this->nomUsuario, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }",
"public function save()\n {\n // datos obligatorios para la insercion/modificacion\n $data = [\n \"propietario\" => $this->owner,\n \"estado\" => $this->state,\n \"nombre\" => $this->name\n ];\n\n // datos opcionales, que pueden no estar establecidos para la \n // insercion/modificacion\n if (isset($this->description)) $data[\"descripcion\"] = $this->description;\n\n // si idProduct no es null, entonces es un update\n if (isset($this->idProduct))\n return $this->dao->update($data, [\"idProducto\" => $this->idProduct]);\n\n // sino, es un insert\n return $this->dao->insert($data);\n }",
"public function save() {\n $db = Db::instance();\n // omit id \n $db_properties = array(\n 'firstName' => $this->firstName,\n 'lastName' => $this->lastName,\n 'description' => $this->description,\n 'user' => $this->user,\n 'password' => $this->password,\n 'image' => $this->image,\n 'gender' => $this->gender,\n 'topic_id' => $this->topic_id,\n 'topic_id1' => $this->topic_id1,\n 'role_id' => $this->role_id,\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function save()\r\n {\r\n //\r\n }",
"function act_tipo_salida(){\n\t\t$u= new Tipo_salida();\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han actualizado los datos del Tipo de Salida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}",
"public function save () {\n // Atualiza\n // @ verifico se o atributo \"id_emprestimo\" existe neste objeto.\n // lembrando que este atributo é apagado se criamos um novo emprestimo.\n if ( isset($this->id_emprestimo) ) {\n $this->db->update('emprestimos', $this, array('id_emprestimo' => $this->id_emprestimo));\n }\n\n // Salva\n else {\n $this->db->insert('emprestimos', $this);\n }\n }",
"public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function saveAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n\n try {\n //Get parameters\n $request = $this->get('request');\n $id = $request->get('id');\n $name = $request->get('name');\n $lastname = $request->get('lastname');\n $username = $request->get('username');\n $email = $request->get('email');\n $cellPhone = $request->get('cellPhone');\n $isActive = $request->get('isActive');\n $isCreating = false;\n\n $translator = $this->get(\"translator\");\n\n if( isset($id) && isset($name) && trim($name) != \"\"\n && isset($lastname) && trim($lastname) != \"\"\n && isset($username) && trim($username) != \"\") {\n $em = $this->getDoctrine()->getManager();\n $entity = new User();\n if($id != 0) { //It's updating, find the user\n $entity = $em->getRepository('TecnotekAsiloBundle:User')->find($id);\n }\n if( isset($entity) ) {\n $entity->setName($name);\n $entity->setLastname($lastname);\n $entity->setUsername($username);\n $entity->setCellPhone($cellPhone);\n $entity->setEmail($email);\n $entity->setIsActive( ($isActive==\"true\")? 1:0);\n $rawPassword = $this->generateStrongPassword();\n if($id == 0) { // If it's new must generates a new password\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($entity);\n $entity->setPassword($encoder->encodePassword($rawPassword, $entity->getSalt()));\n $isCreating = true;\n }\n\n if($em->getRepository(\"TecnotekAsiloBundle:User\")\n ->checkUniqueUsernameAndEmail($username, $email, $id) ) {\n\n $em->persist($entity);\n $em->flush();\n if($isCreating) { // If it's new must email the new account email including the password\n $roleEmployee = $em->getRepository('TecnotekAsiloBundle:Role')->findOneByRole(\"ROLE_EMPLOYEE\");\n $entity->getUserRoles()->add($roleEmployee);\n $em->persist($entity);\n $em->flush();\n $logger->info(\"Send Email for new Account with password: \" . $rawPassword);\n $this->sendEmailForNewAccount($entity, $rawPassword);\n }\n return new Response(json_encode(array(\n 'error' => false,\n 'msg' => $translator->trans('catalog.save.success'))));\n } else {\n return new Response(json_encode(array(\n 'error' => true,\n 'msg' => $translator->trans('user.username.and.email.must.be.uniques'))));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 2\")));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 1\")));\n }\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::saveAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'msg' => $info)));\n }\n }",
"public function saveAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre école n\\'a pas été enregistré.';\n\n\t\t$school = new School();\n\t\t$school->id = (int) $this->getRequest()->post('id');\n\t\t$school->name = Input::safe( $this->getRequest()->post('name') );\n\t\t$saved = $school->save();\n\n\t\tif ( $saved ) {\n\t\t\t$message = 'Votre école a correctement été enregistré.';\n\t\t}\n\t\t$this->render( View::make( 'schools/show' , array(\n\t\t\t'status' => $saved,\n\t\t\t'message' => $message,\n\t\t\t'title' => $school->name,\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }",
"public function save()\r\n {\r\n \r\n }",
"public function save() {\n $query = \"\";\n\n // Se for um novo registro, cria uma query INSERT INTO\n if($this->new_register) {\n $columns = array();\n $values = array();\n\n foreach($this->get_columns_information() as $column) {\n if(('id' == $column['column_name'] && $this->get_column_value($column['column_name']) > 0) || 'id' != $column['column_name']) {\n $columns[] = $column['column_name'];\n $values[] = $this->get_column_value($column['column_name']);\n }\n }\n\n $query = \"INSERT INTO {$this->get_table_name()}(\" . implode(', ', $columns) . \") VALUES(\" . implode(', ', $values) . \");\";\n\n unset($columns, $values);\n\n // Se o registro ja existe e foi alterado, cria uma query UPDATE\n } else {\n $sets = array();\n $conds = array();\n\n $changed = false;\n\n // Cria o trecho da query com os valores para SET e as condicoes para WHERE\n foreach($this->get_columns_information() as $column) {\n $value = $this->get_column_value($column['column_name']);\n $old_value = $this->get_column_value($column['column_name'], true);\n\n // Verifica se algum campo foi modificado\n if($value !== $old_value)\n $changed = true;\n\n $sets[] = \"{$column['column_name']} = {$value}\";\n $conds[] = ($old_value != 'NULL') ? (\"{$column['column_name']} = {$old_value}\")\n : (\"({$column['column_name']} IS NULL OR {$column['column_name']} = '')\");\n }\n\n // Cria query de atualizacao apenas se houve alguma modificacao\n if($changed)\n $query = \"UPDATE {$this->get_table_name()}\n SET \" . implode(', ', $sets) . \"\n WHERE \" . implode(' AND ', $conds) . \";\";\n\n unset($sets, $conds);\n }\n\n // Tenta salvar o registro\n // Se salvar corretamente, atualiza os dados do objeto para que da proxima vez ele seja atualizado, caso seja um registro novo\n if(DB::execute($query)) {\n $this->new_register = false;\n $data = array();\n\n foreach($this->get_columns_information() as $column) {\n $this->{'_' . $column['column_name']} = $this->$column['column_name'];\n $data[$column['column_name']] = $this->$column['column_name'];\n }\n\n return true;\n }\n\n return false;\n }",
"function salida_por_traspaso(){\n\t\t$e= new Salida();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cclientes_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}",
"public function saveAction() {\n parent::saveAction();\n }",
"public function save(){\n }",
"public function save() {\n }",
"public function save() {\n }",
"public function save() {\n }",
"public abstract function save();",
"public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }",
"public function save()\n {\n if (isset($_POST)) {\n \n #Validación Basica\n $nombre = isset($_POST['nombre']) ? $_POST['nombre'] : false;\n $apellidos = isset($_POST['apellidos']) ? $_POST['apellidos'] : false;\n $email = isset($_POST['email']) ? $_POST['email'] : false;\n $password = isset($_POST['password']) ? $_POST['password'] : false;\n\n if ($nombre && $apellidos && $email && $password) {\n #llamar al metodo save del modelo\n $usuario = new Usuario();\n\n #Pasar datos al modelo\n $usuario->setNombre($nombre);\n $usuario->setApellidos($apellidos);\n $usuario->setEmail($email);\n $usuario->setPassword($password);\n\n #guardar en BD\n $save = $usuario->save();\n\n if ($save) {\n #Crear una sesión\n $_SESSION['register'] = \"complete\";\n //echo \"<h4>Usuario Registrado Correctamente!!</h4>\";\n }else {\n #Crear una Sesión\n $_SESSION['register'] = \"failed\";\n //echo \"<h4>Error!! Fallo al registrar usuario</h4>\"; \n }\n } else {\n $_SESSION['register'] = \"failed\";\n }\n \n header(\"Location:\".base_url.'usuario/registro'); #Redirige al registro\n }\n }",
"public function save()\n {\n if (empty($this->id))\n {\n $sql =\n \"INSERT INTO rozvrhova_akcia (zaciatok, koniec, id_semester)\n\t\t\t\t VALUES (\".\n DateConvert::SKDateTime2DBTimestamp(\"$1\").\", \".\n DateConvert::SKDateTime2DBTimestamp(\"$2\").\",\n\t\t\t\t$3)\";\n $params = array($this->zaciatok, $this->koniec, $this->id_semester);\n }else\n {\n // save after edit\n $sql =\n \"UPDATE rozvrhova_akcia SET\n\t\t\t\t zaciatok=\".DateConvert::SKDateTime2DBTimestamp(\"$1\").\",\n\t\t\t\t koniec=\".DateConvert::SKDateTime2DBTimestamp(\"$2\").\",\n\t\t\t\t id_semester=$3\n\t\t\t\t WHERE id=$4\";\n $params = array($this->zaciatok, $this->koniec, $this->id_semester, $this->id);\n }\n $this->dbh->query($sql, $params);\n }",
"public function saveAction() {\n $request = $this->getRequest();\n if($request->isPost()) {\n $params = $request->getPost();\n if(!array_key_exists('company_id', $params)) {\n Default_Model_Company::create($params);\n } else {\n Default_Model_Company::update($params);\n }\n }\n \n $this->_redirect($this->view->actions['index']);\n }",
"public function save()\n {\n }",
"public function save() {\n $db = Db::instance();\n // omit id and any timestamps\n $db_properties = array(\n 'username' => $this->username,\n 'password_hash' => $this->password_hash,\n 'email' => $this->email,\n 'first_name' => $this->first_name,\n 'last_name' => $this->last_name,\n 'user_type' => $this->user_type,\n 'bio' => $this->bio,\n 'creation_date' => $this->creation_date,\n 'gender' => $this->gender,\n 'color' => $this->color\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $pelicula = Peliculas::findFirstByid($id);\n\n if (!$pelicula) {\n $this->flash->error(\"pelicula does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $pelicula->id = $this->request->getPost(\"id\");\n $pelicula->nombre = $this->request->getPost(\"nombre\");\n $pelicula->idGenero = $this->request->getPost(\"id_genero\");\n $pelicula->year = $this->request->getPost(\"year\");\n $pelicula->idIdioma = $this->request->getPost(\"id_idioma\");\n \n\n if (!$pelicula->save()) {\n\n foreach ($pelicula->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'edit',\n 'params' => [$pelicula->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"pelicula was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"peliculas\",\n 'action' => 'index'\n ]);\n }",
"public function store()\n\t{\n \n\t\t$sservicio = new Sservicio();\n\t\t$sservicio->marca_id = Input::get('marca_id');\n\t\t$sservicio->nombre = Str::title(Str::lower(Input::get('nombre')));\n\t\t$sservicio->save();\n\t\treturn Redirect::to('/sservicios')\n\t\t->with('alert-success', 'Se ha agregado el sservicio.');\n\t\t\n\t}",
"public function store()\n\t{ \n $nextId = OrdenEsM::nextId();\n $input = Input::all();\n $ordenD = new OrdenEsD();\n $ordenD->upc = $input['upc'];\n $ordenD->epc = $input['epc'];\n $ordenD->quantity = $input['quantity'];\n $ordenD->created_at = $input['created_at'];\n $ordenD->updated_at = $input['updated_at'];\n $ordenD->orden_es_m_id = $nextId;\n $ordenD->save();\n\t}",
"public function save(){\n\n \t$sql = \"INSERT INTO \" . self::TABLENAME . \" (ora_aterizare, de_la, \n \t compania)\n \t\t\tVALUES ('$this->ora_aterizare', '$this->de_la', \n \t\t\t'$this->compania')\";\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n \t$db->getConnection()->exec($sql);\n\n \treturn \"Datele au fost introduse cu succes.\";\n }",
"public function save(){\r\n\t\tif(empty($this->idPrestamoEjemplar)){\t\t\t\r\n\t\t\t$this->idPrestamoEjemplar = $this->con->autoInsert(array(\r\n\t\t\t\"Prestamo_idPrestamo\" => $this->prestamoIdPrestamo,\r\n\t\t\t\"Ejemplar_idEjemplar\" => $this->ejemplarIdEjemplar,\r\n\t\t\t),\"prestamo_has_ejemplar\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn $this->con->autoUpdate(array(\r\n\t\t\t\"Prestamo_idPrestamo\" => $this->prestamoIdPrestamo,\r\n\t\t\t\"Ejemplar_idEjemplar\" => $this->ejemplarIdEjemplar,\r\n\t\t\t),\"prestamo_has_ejemplar\",\"idPrestamo_Ejemplar=\".$this->getId());\r\n\t}",
"function save() {\n $conn = \\DB\\getConnection();\n\n $query = sprintf(\"INSERT INTO Payments (uid, typeid, token, amount)\n VALUES (%u, %u, '%s', %f)\",\n $this->uid, $this->typeid, $conn->escape_string($this->token), $this->amount);\n\n \n\n $result = $conn->query($query);\n\n // If this is a newly created user, then update the id with the\n // newly created one\n if (!isset($this->id)) {\n $this->id = $result->insert_id;\n }\n }",
"public function store()\n\t{\n\t\t$reserva = new Reserva;\n\t\t$reserva->persona_id = Input::get('persona_id');\n\t\t$reserva->puesto_id = Input::get('puesto_id');\n\t\t$reserva->start_date = Input::get('start_date');\n\t\t$reserva->end_date = Input::get('end_date');\n\t\t$reserva->save();\n\t}",
"function alta_tipo_salida(){\n\t\t$u= new Tipo_salida();\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos del Tipo de Salida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}",
"public function persist();",
"function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }",
"public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }",
"public function save()\n {\n //\n }",
"public function save()\n\t{\n\n\t}",
"public function save()\n {\n \treturn FactoryAbastract::dao(get_class($this))->save($this);\n }",
"public function store()\n {\n $this->filtrarCampos();\n\n // verifica se tem ID ou se existe na base de dados\n if (empty($this->data['id']) or (!$this->load($this->id))) {\n // incrementa o ID\n $this->id = $this->getLast() + 1;\n // cria uma instruo de insert\n $sql = new TSqlInsert;\n $sql->setEntity($this->getEntity());\n // percorre os dados do objeto\n foreach ($this->data as $key => $value) {\n // passa os dados do objeto para o SQL\n $sql->setRowData($key, $this->$key);\n }\n } else {\n // instancia instruo de update\n $sql = new TSqlUpdate;\n $sql->setEntity($this->getEntity());\n // cria um critrio de seleo baseado no ID\n $criteria = new TCriteria;\n $criteria->add(new TFilter('id', '=', $this->id));\n $sql->setCriteria($criteria);\n // percorre os dados do objeto\n foreach ($this->data as $key => $value) {\n if ($key !== 'id') // o ID no precisa ir no UPDATE\n {\n // passa os dados do objeto para o SQL\n $sql->setRowData($key, $this->$key);\n }\n }\n }\n // inicia transao\n if ($conn = TTransaction::get()) {\n\n // faz o log e executa o SQL\n TTransaction::log($sql->getInstruction());\n $result = $conn->exec($sql->getInstruction());\n\n // retorna o resultado\n return $result;\n } else {\n // se no tiver transao, retorna uma exceo\n throw new \\Exception('No h transao ativa !!');\n }\n }",
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $id = $this->request->getPost(\"id\");\n $holiday = Holidays::findFirstByid($id);\n\n if (!$holiday) {\n $this->flash->error(\"holiday does not exist \" . $id);\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $holiday->date = $this->request->getPost(\"date\");\n $holiday->name = $this->request->getPost(\"name\");\n \n\n if (!$holiday->save()) {\n\n foreach ($holiday->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'edit',\n 'params' => [$holiday->id]\n ]);\n\n return;\n }\n\n $this->flash->success(\"Запись успешно изменена\");\n\n $this->dispatcher->forward([\n 'controller' => \"holidays\",\n 'action' => 'index'\n ]);\n }",
"public function save() {\n\n }",
"public function guardarRegistro2(){\r\n $this->database->execute(\"INSERT INTO empleados (nombreApellido, dni, email, pass) VALUES ('rodri', '12345678', 'rodri@gmail.com', '123456'\");\r\n }",
"public function save()\n {\n }",
"public function save()\n {\n }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"public function store(Request $request)\n {\n $fecha_prestamo = date(\"Y-m-d H:i:s\");\n $fecha_devolucion_max = strtotime ( '+3 day' , strtotime ( $fecha_prestamo ) );\n $fecha_devolucion_max = date ( \"Y-m-d H:i:s\" , $fecha_devolucion_max );\n $usuario = Usuario::where('usuario',$request->usuario)->first();\n\n $prestamo = Prestamo::create([\n 'prestador_id' => Cache::get('usuario_id'),\n 'usuario_id' => $usuario->id,\n 'ejemplar_id' => $request->id,\n 'fecha_prestamo' => $fecha_prestamo,\n 'fecha_devolucion_max' => $fecha_devolucion_max,\n ]);\n\n if($prestamo){\n $ejemplar = Ejemplar::find($request->id);\n $ejemplar->estado = 1;\n $ejemplar->save();\n }\n \n return redirect('prestamo');\n }",
"public function save(){\n if($this->id == 0) {\n // Object is new and needs to be created\n return $this->insert();\n }\n }",
"public function store(Request $request)\r\r\n {\r\r\n //\r\r\n $this->validate($request,[\r\r\n 'grupo'=>'required',\r\r\n 'descripcion'=>'required',\r\r\n 'monto'=>'required',\r\r\n ]);\r\r\n $entradasSoda = new EntradaSoda();\r\r\n $entradasSoda->fk_grupo = $request->grupo;\r\r\n $entradasSoda->descripcion = $request->descripcion;\r\r\n $entradasSoda->monto= $request->monto;\r\r\n\r\r\n\r\r\n if($entradasSoda->save()){\r\r\n $log= new Logs();\r\r\n $log->fk_usuario= \\Auth::user()->id;\r\r\n $log->nombre_tabla=\"entrada_sodas\";\r\r\n $log->nombre_elemento= $entradasSoda->id;\r\r\n $log->accion=\"Agregar Entrada Soda\";\r\r\n $log->fecha=date ('y-m-d H:i:s');\r\r\n $log->save();\r\r\n return redirect()->back()->with('message','Entrada para '.$request->descripcion.' creada correctamente');\r\r\n }else{\r\r\n return redirect('/administrador.nuevaEntradasSoda');\r\r\n }\r\r\n }",
"public function createEmployeeSave()\n {\n $data = array();\n $data['name'] = $_POST['name'];\n $data['address'] = $_POST['address'];\n $this->model('Employee')->createEmployee($data);\n header(\"Location: \" . URL . \"public/employees/index\");\n }",
"public function save()\n {\n // If deposit is new, will get assigned database ID.\n $this->dbID = $this->db->saveDeposit($this);\n }",
"public function store()\n\t{\n\t\t$fbf_presenca = new FbfPresenca;\n\t\t$fbf_presenca->idpresenca = Input::get('idpresenca');\n$fbf_presenca->idcampeonatorodada = Input::get('idcampeonatorodada');\n$fbf_presenca->idatleta = Input::get('idatleta');\n\n\t\t$fbf_presenca->save();\n\n\t\t// redirect\n\t\tSession::flash('message', 'Registro cadastrado com sucesso!');\n\t\treturn Redirect::to('fbf_presenca');\n\t}"
]
| [
"0.70007145",
"0.69486153",
"0.68242323",
"0.6803166",
"0.6752438",
"0.6752438",
"0.67522126",
"0.67001617",
"0.66968584",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6684347",
"0.6673222",
"0.66651165",
"0.6626661",
"0.65995324",
"0.65983164",
"0.656618",
"0.6547029",
"0.65463847",
"0.65199435",
"0.6513019",
"0.6502852",
"0.6474156",
"0.64288443",
"0.6426328",
"0.64247036",
"0.6423895",
"0.6404982",
"0.6399966",
"0.6391706",
"0.6390742",
"0.63880265",
"0.63816077",
"0.6371269",
"0.6365506",
"0.6362863",
"0.63598233",
"0.63561684",
"0.6355252",
"0.63509965",
"0.63497573",
"0.6343376",
"0.63190585",
"0.63153815",
"0.6311877",
"0.6311877",
"0.6310478",
"0.6306294",
"0.6299053",
"0.6280316",
"0.6276726",
"0.6266836",
"0.62644184",
"0.6263629",
"0.6249423",
"0.6246255",
"0.6237833",
"0.6231398",
"0.6229663",
"0.62273633",
"0.6218041",
"0.62161565",
"0.620873",
"0.6206571",
"0.61992145",
"0.6191698",
"0.618724",
"0.6181741",
"0.6181476",
"0.6176442",
"0.6165693",
"0.61649793",
"0.61642456",
"0.61642456",
"0.615251",
"0.615251",
"0.615251",
"0.615251",
"0.615251",
"0.61513096",
"0.61483485",
"0.61340934",
"0.6130423",
"0.6127518",
"0.6124458"
]
| 0.0 | -1 |
implementar o carregamento dos dados do arquivo para o banco// | public function importarAction()
{
$modelJson = new JsonModel();
if ($this->getRequest()->isPost()) {
$repo = $this->entityManager->getRepository(Regeneracao::class);
$repoItem = $this->entityManager->getRepository(ItemRegeneracao::class);
$id = $this->params()->fromPost('regeneracaoId', null);
$nomeArquivo = $this->params()->fromPost('nomeArquivo', null);
$colunaCgs = $this->params()->fromPost('colunaCgs', null);
$colunaOrigem = $this->params()->fromPost('colunaOrigem', null);
$colunaEstaca = $this->params()->fromPost('colunaEstaca', null);
$regeneracao = $repo->find($id);
if ($regeneracao) {
$conteudo = fopen("/home/aplicacoes/bagarquivos/cadernetas/".$nomeArquivo, "r");
if ($conteudo) {
$linha = utf8_encode(trim(fgets($conteudo)));
$contaLinha = 0;
$dados = [];
while (!feof($conteudo)) {
$linha = utf8_encode(trim(fgets($conteudo)));
$colunas = explode(";", $linha);
if (count($colunas) > 1) {
$dados[$contaLinha]['material'] = preg_replace('/"/', '', $colunas[$colunaCgs]);
$dados[$contaLinha]['origem'] = preg_replace('/"/', '', $colunas[$colunaOrigem]);
$dados[$contaLinha]['estaca'] = preg_replace('/"/', '', $colunas[$colunaEstaca]);
$dados[$contaLinha]['quantidadePlantada'] = "V"; //ajustar
}
$contaLinha += 1;
}
$repoItem->incluir($dados, $regeneracao->getId());
$modelJson->setVariable('success', 1);
}
fclose($conteudo);
}
}
return $modelJson;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadDataIntoBD() : void{\n $consulta = new Consultas();\n try{\n $reader = new Csv();\n \n $reader->setInputEncoding('CP1252');\n $reader->setDelimiter(';');\n $reader->setEnclosure('');\n $reader->setSheetIndex(0);\n \n $spreadsheet = $reader->load('./files/' . $this->files['name']);\n \n $worksheet = $spreadsheet->getActiveSheet();\n \n //Se debe hacer lectura anticipada, o hacerle un next al iterador\n //Manera no encontrada\n //Se salta el primero para que no lea las cabeceras de las columnas\n \n $cutradaParaSaltarPrimero = 0;\n foreach ($worksheet->getRowIterator() as $row) {\n if($cutradaParaSaltarPrimero == 0){\n $cutradaParaSaltarPrimero++;\n continue;\n }\n\n $cellIterator = $row->getCellIterator();\n $cellIterator->setIterateOnlyExistingCells(FALSE);\n \n $arrayFila = array();\n foreach ($cellIterator as $cell) {\n $arrayFila[] = $this->utf8Decode(trim($cell->getValue()));\t\t\t\t\n }\n \n if($arrayFila[0] != '') {\n $consulta->insertarCompetidor($arrayFila);\n }\n \n }\n \n }catch(\\PhpOffice\\PhpSpreadsheet\\Reader\\Exception $e){\n die('Error loading file: ' . $e->getMessage());\n }\n }",
"public function processarArquivo() {\n\n /**\n * Cria uma instancia de DBLayoutReader referente ao arquivo a ser processado e o layout cadastrado\n */\n $this->oLayoutReader = new DBLayoutReader($this->iCodigoArquivo, $this->sNomeArquivo, true, false);\n\n $_SESSION[\"DB_usaAccount\"] = \"1\";\n\n /**\n * Remove da base todos os registros referentes a situação a ser processada. No caso, situacao 2 - BPC\n */\n $this->removerSituacao();\n $rsArquivo = fopen($this->sNomeArquivo, 'r');\n $iLinha = 0;\n\n /**\n * Percorre o arquivo para tratamento das linhas\n */\n while (!feof($rsArquivo)) {\n\n $iLinha++;\n $sLinha = fgets($rsArquivo);\n $oLinha = $this->oLayoutReader->processarLinha($sLinha, 0, true, false, false);\n\n if (!$oLinha) {\n continue;\n }\n\n /**\n * Salva a primeira linha do arquivo por se o cabeçalho do mesmo, adicionando no arquivo de não processados\n * Ou se o nome da pessoa ou data de nascimento estiverem vazias\n */\n if ($iLinha == 1 || empty($oLinha->nome_pessoa) || empty($oLinha->data_nascimento)) {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n continue;\n }\n\n $oDataNascimento = new DBDate($oLinha->data_nascimento);\n $dtNascimento = $oDataNascimento->convertTo(DBDate::DATA_EN);\n\n /**\n * Chama o método validar, responsavel por verificar se existe algum registro com os dados passados\n * Passamos o nome da pessoa da linha atual do arquivo, e a data de nascimento, já tratada, no formato do banco\n */\n $iCadastroUnico = $this->validar($oLinha->nome_pessoa, $dtNascimento);\n\n /**\n * Caso tenha sido retornado o sequencial do cidadao na validacao, chama o metodo insereSituacao para inserir o\n * registro para o cidadao com tipo de situacao 2\n */\n if ($iCadastroUnico != null) {\n $this->insereSituacao($iCadastroUnico);\n } else {\n\n $this->escreveArquivoRegistrosNaoProcessados($sLinha);\n $this->lTemNaoProcessado = true;\n }\n\n unset($oLinha);\n unset($oDataNascimento);\n }\n\n fclose($this->fArquivoLog);\n }",
"function dadosCadastros(){//função geral que será chamada na index\n pegaCadastrosJson();//pega os valores dos cadastros do arquivo JSON e salva em um array\n contaNumeroCadastros();//conta Quantos cadastros existem\n }",
"public function tratarDados(){\r\n\t\r\n\t\r\n }",
"public function importSanepar(){\n if(Input::hasFile('import_file')){\n $path = Input::file('import_file')->getRealPath();\n //array para valores a ser gravado no banco de dados\n $dataCad = array();\n //cadastro com sucesso\n $dataStore = array();\n //registra linhas sem doador (nao foi encontrado)\n $dataError = array();\n $dataReturn = array();\n \n //ver a competencia\n $dataCom = Excel::selectSheetsByIndex(0)->load($path, function($reader){\n $reader->takeColumns(19); //limita a quantidade de colunas \n // $reader->skipRows(3); //pula a linha\n // $reader->ignoreEmpty(); //ignora os campos null\n // $reader->takeRows(6); //limita a quantidade de linha\n // $reader->noHeading(); //ignora os cabecalhos \n })->get();\n\n //cria dados para salvar na base de retorno sanepar\n if(!empty($dataCom) && $dataCom->count()){\n foreach($dataCom as $data){\n //pesquisa doadores\n $data['matricula'] = intval($data['matricula']);\n\n //verifica se linha nao esta vazia\n if($data['matricula'] != '' && $data['nome'] != ''){\n\n $ddr = $this->doador->findWhere('ddr_matricula',$data['matricula'])->get();\n //pesquisa doacao\n if(count($ddr) > 0){\n\n //verifica se tem doacao\n if(!$ddr[0]->doacao){\n $doa_id = '';\n } else {\n $doa_id = $ddr[0]->doacao->doa_id;\n }\n\n $ddr[0]->doacao;\n $dataCad[] = [\n 'rto_ddr_id' => $ddr[0]->ddr_id,\n 'rto_doa_id' => $doa_id,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr\n ];\n } else {\n $dataError[] = [\n 'error' => 'Matricula/Doador não encontrado!',\n 'rto_ddr_id' => 0,\n 'rto_doa_id' => 0,\n 'rto_data' => Carbon::now()->toDateString(),\n 'rto_ur' => $data->ur,\n 'rto_local' => $data->local,\n 'rto_cidade' => $data->cidade,\n 'rto_matricula' => $data->matricula,\n 'rto_nome' => $data->nome,\n 'rto_cpf_cnpj' => $data->cpf_cnpj,\n 'rto_rg' => $data->rg,\n 'rto_uf' => $data->uf,\n 'rto_logr_cod' => $data->logr_cod,\n 'rto_logradouro' => $data->logradouro,\n 'rto_num' => $data->num,\n 'rto_complemento' => $data->complemento,\n 'rto_bai_cod' => $data->bai_cod,\n 'rto_bairro' => $data->bairro,\n 'rto_cep' => $data->cep,\n 'rto_categoria' => $data->categoria,\n 'rto_cod_servico' => $data->cod_servico,\n 'rto_vlr_servico' => $data->vlr_servico,\n 'rto_referencia_arr' => $data->referencia_arr,\n 'msg_erro' => 'Não foi encontrado o doador no sistema, verifique a matricula!'\n ];\n }\n }\n }\n }\n\n if($dataCad || $dataError){\n $dataReturn = [\n 'sucesso' => $dataCad,\n 'error' => $dataError\n ];\n return $dataReturn;\n } else {\n return 'Error';\n }\n }\n // return back();\n }",
"public function importarDocentes($archivo=$this->archivo){\n //cargamos el archivo\n $lineas = file($archivo); \n //inicializamos variable a 0, esto nos ayudará a indicarle que no lea la primera línea\n $i=0; \n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea)\n { \n //abrimos bucle\n /*si es diferente a 0 significa que no se encuentra en la primera línea \n (con los títulos de las columnas) y por lo tanto puede leerla*/\n if($i != 0) \n { \n //abrimos condición, solo entrará en la condición a partir de la segunda pasada del bucle.\n /* La funcion explode nos ayuda a delimitar los campos, por lo tanto irá \n leyendo hasta que encuentre un ; */\n $docente = explode(\";\",$linea);\n //Almacenamos los docente que vamos leyendo en una variable\n $dni=trim($docente[0]);\n $apellidos=trim($docente[1]);\n $nombre = trim($docente[2]);\n $facultad =trim($docente[3]);\n $telefono = trim($docente[4]);\n $correo = trim($docente[5]);\n $categoria = trim($docente[6]);\n $regimen = trim($docente[7]);\n $cargo= trim($docente[8]); \n //guardamos en base de docente la línea leida\n mysql_query(\"INSERT INTO docente(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$facultad','$telefono','$correo','$categoria','$regimen','$cargo')\"); \n //cerramos condición\n } \n /*Cuando pase la primera pasada se incrementará nuestro valor y a la siguiente pasada ya \n entraremos en la condición, de esta manera conseguimos que no lea la primera línea.*/\n $i++;\n //cerramos bucle\n }\n}",
"public function carga($archivo) {\n $public_path = storage_path();\n $url = $public_path.'/app/'.$archivo;\n DB::select(\"delete from temporal\");\n if (($gestor = fopen($url, \"r\")) !== FALSE) {\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n //dd(iconv('UCS-2', 'UTF-8', $datos[1].\"\\0\")) ;\n $datos[0]=utf8_encode ( $datos[0]);\n $datos[1]=utf8_encode ( $datos[1]);\n DB::insert(\"INSERT INTO temporal (nombre,apellido,correo,contrasena,puesto,jefe,departamento,permisos) VALUES ('$datos[0]', '$datos[1]', '$datos[2]', '$datos[3]', '$datos[4]', '$datos[5]', '$datos[6]', '$datos[7]')\");\n }\n fclose($gestor);\n //LLENAR TABLA USUARIOS Y PERMISOS\n DB::Select(\"delete from users where id>1\");\n DB::Select(\"delete from detallepermisos where id>8\");\n $tuplas=DB::Select(\"select * from temporal\");\n $total=0;\n foreach ($tuplas as $tupla)\n {\n $jefe=null;\n $departamento=0;\n $Usuario = new \\App\\User();\n $puesto = 0;\n //----------------departamento-----------------------\n $dep=DB::Select(\"select id from departamentos where nombredepartamento='\".$tupla->departamento.\"'\");\n if(count($dep)>0)\n {\n $departamento=$dep[0]->id;\n }\n else\n {\n DB::Insert(\"insert into departamentos (nombredepartamento) values('\".$tupla->departamento.\"')\");\n $dep=DB::Select(\"select id from departamentos where nombredepartamento='\".$tupla->departamento.\"'\");\n $departamento=$dep[0]->id;\n }\n //----------------puesto------------------------------\n $dep=DB::Select(\"select id from puestos where nombrepuesto='\".$tupla->puesto.\"'\");\n if(count($dep)>0)\n {\n $puesto=$dep[0]->id;\n }\n else\n {\n DB::Insert(\"insert into puestos (nombrepuesto) values('\".$tupla->puesto.\"')\");\n $dep=DB::Select(\"select id from puestos where nombrepuesto='\".$tupla->puesto.\"'\");\n $puesto=$dep[0]->id;\n }\n \n $Usuario->name = $tupla->nombre;\n $Usuario->lastname = $tupla->apellido;\n $Usuario->email = $tupla->correo;\n $Usuario->puesto = $puesto;\n $Usuario->departamento = $departamento;\n $Usuario->password = Hash::make($tupla->contrasena);;\n $Usuario->save();\n \n \n $permisos=$tupla->permisos;\n $permisos=str_replace(\"[\", \"\", $permisos);\n $permisos=str_replace(\"]\", \"\", $permisos);\n $numeros=explode(\",\",$permisos);\n \n $id=DB::Select(\"select id from users where email='\".$tupla->correo.\"'\");\n foreach ($numeros as $numero)\n {\n $DetallePermiso = new \\App\\Detallepermiso();\n $DetallePermiso->user_id = $id[0]->id;\n $DetallePermiso->permisos_id = $numero;\n $DetallePermiso->save();\n }\n }\n foreach ($tuplas as $tupla)\n {\n if($tupla->jefe != \"\")\n {\n $id=DB::Select(\"select id from users where name='\".$tupla->jefe.\"'\");\n if(count($id)>0)\n {\n DB::Select(\"update users set id_jefe='\".$id[0]->id.\"'where name='\".$tupla->nombre.\"'\");\n }\n }\n }\n dd(\"completado\");\n }}",
"protected function migrarDados()\n {\n $serviceDemanda = $this->getService('OrdemServico\\Service\\DemandaFile');\n try {\n $serviceDemanda->begin();\n $arrUsuario = $this->getService('OrdemServico\\Service\\UsuarioFile')->fetchPairs([], 'getNoUsuario', 'getIdUsuario');\n $OrdemSevicoSevice = $this->getService('OrdemServico\\Service\\OrdemServicoDemandaFile');\n $arrDemanda = $serviceDemanda->findBy([], ['id_demanda' => 'asc']);\n $serviceDemanda::setFlush(false);\n foreach ($arrDemanda as $demanda) {\n $intIdUsuario = $arrUsuario[$demanda->getNoExecutor()];\n if ($intIdUsuario) {\n $demanda->setVlComplexidade(null)\n ->setVlImpacto(null)\n ->setVlCriticidade(null)\n ->setVlFatorPonderacao(null)\n ->setVlFacim(null)\n ->setVlQma(null)\n ->setIdUsuario($intIdUsuario);\n $serviceDemanda->getEntityManager()->persist($demanda);\n $arrDemandaServico = $OrdemSevicoSevice->findBy(['id_demanda' => $demanda->getIdDemanda()]);\n if ($arrDemandaServico) {\n $ordemServicoDemanda = reset($arrDemandaServico);\n $ordemServicoDemanda->setIdUsuarioAlteracao($demanda->getIdUsuario())\n ->setDtAlteracao(Date::convertDateTemplate($demanda->getDtAbertura()));\n $OrdemSevicoSevice->getEntityManager()->persist($demanda);\n }\n }\n }\n $serviceDemanda::setFlush(true);\n $serviceDemanda->commit();\n } catch (\\Exception $exception) {\n $serviceDemanda->rollback();\n var_dump($exception->getMessage());\n die;\n }\n }",
"public function import()\n\t{\n\t\t$optionStart = $this->importOptions->getOptionValue(\"start\", \"0\");\n\t\t$optionLength = $this->importOptions->getOptionValue(\"length\", \"0\");\n\t\t$optionCols = $this->importOptions->getOptionValue(\"cols\", \"0\");\n\t\t$optionDelimiter = $this->importOptions->getOptionValue(\"delimiter\", \";\");\n\t\t$optionEnclosure = $this->importOptions->getOptionValue(\"enclosure\", \"\");\n\t\t$optionType = $this->importOptions->getOptionValue(\"objectType\", \"\");\n\t\tif($optionType == \"\")\n\t\t{\n\t\t\tthrow new FileImportOptionsRequiredException(gettext(\"Missing option objectType for file import\"));\n\t\t}\n\n\t\t//create object controller\n\t\t$objectController = ObjectController::create();\n\t\t$config = CmdbConfig::create();\n\n\t\t//get mapping of csv columns to object fiels\n\t\t$objectFieldConfig = $config->getObjectTypeConfig()->getFields($optionType);\n\t\t$objectFieldMapping = Array();\n\t\t$foreignKeyMapping = Array();\n $assetIdMapping = -1;\n $activeMapping = -1;\n\t\tfor($i = 0; $i < $optionCols; $i++)\n\t\t{\n\t\t\t$fieldname = $this->importOptions->getOptionValue(\"column$i\", \"\");\n\t\t\t//assetId mapping\n\t\t\tif($fieldname == \"yourCMDB_assetid\")\n\t\t\t{\n\t\t\t\t$assetIdMapping = $i;\n }\n\t\t\t//active state mapping\n\t\t\tif($fieldname == \"yourCMDB_active\")\n {\n\t\t\t\t$activeMapping = $i;\n\t\t\t}\n\t\t\t//foreign key mapping\n\t\t\telseif(preg_match('#^yourCMDB_fk_(.*)/(.*)#', $fieldname, $matches) == 1)\n\t\t\t{\n\t\t\t\t$foreignKeyField = $matches[1];\n\t\t\t\t$foreignKeyRefField = $matches[2];\n\t\t\t\t$foreignKeyMapping[$foreignKeyField][$foreignKeyRefField] = $i;\n\t\t\t}\n\t\t\t//fielf mapping\n\t\t\telseif($fieldname != \"\")\n\t\t\t{\n\t\t\t\t$objectFieldMapping[$fieldname] = $i;\n\t\t\t}\n\t\t}\n\n\t\t//open file\t\t\n\t\t$csvFile = fopen($this->importFilename, \"r\");\n\t\tif($csvFile == FALSE)\n\t\t{\n\t\t\tthrow new FileImportException(gettext(\"Could not open file for import.\"));\n\t\t}\n\n\t\t//create or update objects for each line in csv file\n\t\t$i = 0;\n\t\twhile(($line = $this->readCsv($csvFile, 0, $optionDelimiter, $optionEnclosure)) !== FALSE)\n\t\t{\n\t\t\t//\n\t\t\tif($i >= ($optionLength + $optionStart) && $optionLength != 0)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//check start of import\n\t\t\tif($i >= $optionStart)\n\t\t\t{\n\t\t\t\t//generate object fields\n\t\t\t\t$objectFields = Array();\n\t\t\t\tforeach(array_keys($objectFieldMapping) as $objectField)\n\t\t\t\t{\n\t\t\t\t\tif(isset($line[$objectFieldMapping[$objectField]]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$objectFields[$objectField] = $line[$objectFieldMapping[$objectField]];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//resolve foreign keys\n\t\t\t\tforeach(array_keys($foreignKeyMapping) as $foreignKey)\n\t\t\t\t{\n\t\t\t\t\tforeach(array_keys($foreignKeyMapping[$foreignKey]) as $foreignKeyRefField)\n\t\t\t\t\t{\n\t\t\t\t\t\t//set foreign key object type\n\t\t\t\t\t\t$foreignKeyType = Array(preg_replace(\"/^objectref-/\", \"\", $objectFieldConfig[$foreignKey]));\n\t\t\t\t\t\t$foreignKeyLinePosition = $foreignKeyMapping[$foreignKey][$foreignKeyRefField];\n\t\t\t\t\t\tif(isset($line[$foreignKeyLinePosition]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$foreignKeyRefFieldValue = $line[$foreignKeyLinePosition];\n\t\n\t\t\t\t\t\t\t//get object defined by foreign key\n\t\t\t\t\t\t\t$foreignKeyObjects = $objectController->getObjectsByField(\t$foreignKeyRefField, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyRefFieldValue, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$foreignKeyType, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnull, 0, 0, $this->authUser);\n\t\t\t\t\t\t\t//if object was found, set ID as fieldvalue\n\t\t\t\t\t\t\tif(isset($foreignKeyObjects[0]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$objectFields[$foreignKey] = $foreignKeyObjects[0]->getId();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n }\n\n //set active state\n $active = \"A\";\n if($activeMapping != -1 && isset($line[$activeMapping]))\n {\n if($line[$activeMapping] == \"A\" || $line[$activeMapping] == \"N\")\n {\n $active = $line[$activeMapping];\n }\n }\n\n\n\t\t\t\t//only create objects, if 1 or more fields are set\n\t\t\t\tif(count($objectFields) > 0)\n\t\t\t\t{\n\t\t\t\t\t//check if assetID is set in CSV file for updating objects\n\t\t\t\t\tif($assetIdMapping != -1 && isset($line[$assetIdMapping]))\n\t\t\t\t\t{\n $assetId = $line[$assetIdMapping];\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$objectController->updateObject($assetId, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if object was not found, add new one\n\t\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if not, create a new object\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//generate object and save to datastore\n\t\t\t\t\t\t$objectController->addObject($optionType, $active, $objectFields, $this->authUser);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//increment counter\n\t\t\t$i++;\n\t\t}\n\n\t\t//check, if CSV file could be deleted\n\t\t$deleteFile = false;\n\t\tif(feof($csvFile))\n\t\t{\n\t\t\t$deleteFile = true;\n\t\t}\n\n\t\t//close file\n\t\tfclose($csvFile);\n\n\t\t//delete file from server\n\t\tif($deleteFile)\n\t\t{\n\t\t\tunlink($this->importFilename);\n\t\t}\n\n\t\t//return imported objects\n\t\treturn $i;\n\t}",
"function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}",
"public function loadFile ($arquivo) {\n\t\t#################################################################################\n\t\t## Variáveis globais\n\t\t#################################################################################\n\t\tglobal $log;\n\t\t\n\t\t#################################################################################\n\t\t## Verifica se o arquivo existe\n\t\t#################################################################################\n\t\tif (!file_exists($arquivo)) \t{\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo não encontrado ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo não encontrado ('.$arquivo.') ');\n\t\t}\n\n\t\t#################################################################################\n\t\t## Verifica se o arquivo pode ser lido\n\t\t#################################################################################\n\t\tif (!is_readable($arquivo)) \t{\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo não pode ser lido ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo não pode ser lido ('.$arquivo.') ');\n\t\t}\n\n\t\t#################################################################################\n\t\t## Lê o arquivo\n\t\t#################################################################################\n\t\t$lines\t= file($arquivo);\n\t\t\n\t\t#################################################################################\n\t\t## Verifica se o arquivo tem informação\n\t\t#################################################################################\n\t\tif (sizeof($lines) < 2) {\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo sem informações ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo sem informações ('.$arquivo.') ');\n\t\t}\n\t\t \n\t\t#################################################################################\n\t\t## Percorre as linhas do arquivo\n\t\t#################################################################################\n\t\tfor ($i = 0; $i < sizeof($lines); $i++) {\n\t\t\t$codTipoReg\t\t= substr($lines[$i],7 ,1);\n\t\t\t//$log->info(\"Tipo de registro encontrado: $codTipoReg\");\n\t\t\tif ($codTipoReg == 3) {\n\t\t\t\t$codSegmento\t= substr($lines[$i],13 ,1);\n\t\t\t}else{\n\t\t\t\t$codSegmento\t= \"\";\n\t\t\t}\n\t\t\t$tipoReg\t\t= \"R\".$codTipoReg.$codSegmento;\n\t\t\t$linha\t\t\t= str_replace(array(\"\\n\", \"\\r\"), '', $lines[$i]); \n\t\t\t$reg\t\t\t= $this->adicionaRegistro($tipoReg);\n\t\t\tif ($reg === null) {\n\t\t\t\tcontinue;\n\t\t//\t\t$this->adicionaErro(0, $i+1, null, \"Linha fora do padrão definido\");\n\t\t//\t\treturn;\n\t\t\t}else{\n\t\t\t\t$ok\t\t\t= $this->registros[$reg]->carregaLinha($linha);\n\t\t\t}\n\t\t\t\n\t\t\tif ($ok !== true) \t{\n\t\t\t\t$log->err(\"Erro no tipo de registro: $codTipoReg, CodSegmento: $codSegmento, mensagem: $ok\");\n\t\t\t\t$this->adicionaErro(0, $this->registros[$reg]->getLinha(), $this->registros[$reg]->getTipoRegistro(), $ok);\n\t\t\t}\n\t\t}\n\n\t}",
"public function onReadAllDataExcelBeneficiarios()\n {\n if (!$this->archivoValido)\n return;\n $log = [\n 'Correcto' => $this->getImportSuccessLog(),\n 'Incorrecto' => $this->getImportErrorLog(),\n 'Guardar' => $this->getDataGuardar()\n ];\n\n $pathImportJson = Yii::getAlias('@ImportJson/beneficiarios/');\n $archivo = date('Ymd-His_') . Yii::$app->user->id . '_beneficiarios.json';\n file_put_contents($pathImportJson . $archivo, Json::encode($log));\n $this->redirect(['import/beneficiarios-paso2', 'archivo' => $archivo]);\n }",
"function escreveArquivo($aux_nome, $aux_tel, $aux_cpf, $aux_rg){\n\n $pessoa = new Individuo();\n\n /**\n * Para evitar que o usuario fique recarregando a pagina\n */\n \n $pessoa->setNome($aux_nome);\n if($pessoa->getNome() == '' || $pessoa->getNome() == null){\n session_destroy();\n die(\"Falha\");\n }\n /**\n * Gravando os dados\n */\n $pessoa->setTelefone($aux_tel);\n $pessoa->setCPF($aux_cpf);\n $pessoa->setRg($aux_rg);\n\n $dados = fopen(\"/home/mateus/Arquivos/dados_individual.csv\", \"a+\") or die(\"Failed\"); \n $conteudo = '';\n $conteudo = fread($dados, 1);\n\n if($conteudo == ''){\n escreveCabecalho($dados);\n }\n \n fwrite($dados, $pessoa->getNome());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getTelefone());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getCPF());\n fwrite($dados, \",\");\n fwrite($dados, $pessoa->getRg());\n fwrite($dados, \"\\n\");\n\n\n fclose($dados);\n }",
"function mudar_posicao_arquivo($ordem, $evento_arquivo_id, $direcao, $evento_id=0){\r\n\t$sql = new BDConsulta;\r\n\tif($direcao && $evento_arquivo_id) {\r\n\t\t$novo_ui_ordem = $ordem;\r\n\t\t$sql->adTabela('evento_arquivos');\r\n\t\t$sql->adOnde('evento_arquivo_id != '.(int)$evento_arquivo_id);\r\n\t\t$sql->adOnde('evento_arquivo_evento_id = '.(int)$evento_id);\r\n\t\t$sql->adOrdem('evento_arquivo_ordem');\r\n\t\t$membros = $sql->Lista();\r\n\t\t$sql->limpar();\r\n\t\t\r\n\t\tif ($direcao == 'moverParaCima') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem--;\r\n\t\t\t} \r\n\t\telseif ($direcao == 'moverParaBaixo') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem++;\r\n\t\t\t} \r\n\t\telseif ($direcao == 'moverPrimeiro') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem = 1;\r\n\t\t\t} \r\n\t\telseif ($direcao == 'moverUltimo') {\r\n\t\t\t$outro_novo = $novo_ui_ordem;\r\n\t\t\t$novo_ui_ordem = count($membros) + 1;\r\n\t\t\t}\r\n\t\tif ($novo_ui_ordem && ($novo_ui_ordem <= count($membros) + 1)) {\r\n\t\t\t$sql->adTabela('evento_arquivos');\r\n\t\t\t$sql->adAtualizar('evento_arquivo_ordem', $novo_ui_ordem);\r\n\t\t\t$sql->adOnde('evento_arquivo_id = '.(int)$evento_arquivo_id);\r\n\t\t\t$sql->exec();\r\n\t\t\t$sql->limpar();\r\n\t\t\t$idx = 1;\r\n\t\t\tforeach ($membros as $acao) {\r\n\t\t\t\tif ((int)$idx != (int)$novo_ui_ordem) {\r\n\t\t\t\t\t$sql->adTabela('evento_arquivos');\r\n\t\t\t\t\t$sql->adAtualizar('evento_arquivo_ordem', $idx);\r\n\t\t\t\t\t$sql->adOnde('evento_arquivo_id = '.(int)$acao['evento_arquivo_id']);\r\n\t\t\t\t\t$sql->exec();\r\n\t\t\t\t\t$sql->limpar();\r\n\t\t\t\t\t$idx++;\r\n\t\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\t$sql->adTabela('evento_arquivos');\r\n\t\t\t\t\t$sql->adAtualizar('evento_arquivo_ordem', $idx + 1);\r\n\t\t\t\t\t$sql->adOnde('evento_arquivo_id = '.(int)$acao['evento_arquivo_id']);\r\n\t\t\t\t\t$sql->exec();\r\n\t\t\t\t\t$sql->limpar();\r\n\t\t\t\t\t$idx = $idx + 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t$saida=atualizar_arquivo($evento_id);\r\n\t$objResposta = new xajaxResponse();\r\n\t$objResposta->assign(\"combo_arquivo\",\"innerHTML\", utf8_encode($saida));\r\n\treturn $objResposta;\r\n\t}",
"public function cadadastrarMembroDao(objetoMembro $ace){\r\n \r\n $pesquisaNome=$ace->getNome();\r\n require_once (\"conexao.php\");\r\n \r\n $obj = Connection::getInstance();\r\n $ret=3;\r\n \r\n $busca = mysql_query(\"Select Nome from membros where Nome like '%$pesquisaNome%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $reg = mysql_fetch_assoc($busca);\r\n \r\n\tif($reg != \"\"){\r\n $ret = 1;\r\n }\r\n else{\r\n $ace->setStatus(\"ATIVO\");\r\n \t$matricula = $ace->getMatricula(); $nome = $ace->getNome(); $sexo=$ace->getSexo(); $data=$ace->getData(); $rg=$ace->getRg(); $cpf=$ace->getCpf(); $estadocivil=$ace->getEstadocivil();\r\n\t\t$natural=$ace->getNatural(); $profissao=$ace->getProfissao(); $escola=$ace->getEscola(); $pai=$ace->getPai(); $mae=$ace->getMae(); $necessidade=$ace->getNecessidade();\r\n\t\t$fone=$ace->getFone(); $filho=$ace->getFilho(); $formacao=$ace->getFormacao(); $membrasia=$ace->getMembrasia(); $funcao=$ace->getFuncao(); $participou=$ace->getParticipou();\r\n\t\t$trabalhando=$ace->getTrabalhando(); $viajando=$ace->getViajando(); $congrega=$ace->getCongrega(); $rua=$ace->getRua(); $bairro=$ace->getBairro(); $casa=$ace->getCasa(); $status=$ace->getStatus(); $email=$ace->getEmail();\r\n $lider=$ace->getLider();\r\n $data1 = date($data);\r\n\r\n\t\t$inse = \"INSERT INTO membros (Matricula,Nome,Sexo,DataNascimento1,Naturalidade,Escolaridade,Profissao,Rg,Cpf,EstadoCivil,Pai,Mae,NecessidadeEspeciais,Filho,fone,formacaoEclesiatica,IntegracaoMembrasia,Funcao,JaParticipou,EstadoAtual,Trabalhando,Congrega,Rua,Casa,Bairro,Status,tx_email,LiderCelula )VALUES('','$nome','$sexo','$data1','$natural','$escola','$profissao','$rg','$cpf','$estadocivil','$pai','$mae','$necessidade','$filho','$fone','$formacao','$membrasia','$funcao','$participou','$viajando','$trabalhando','$congrega','$rua','$casa','$bairro','$status','$email','$lider')\";\r\n\r\n $result = mysql_query($inse) or die (\"Falha na insercao do membro\".mysql_error());\r\n\r\n if ($result)\r\n {\r\n $ret = 0;\r\n \r\n }else{\r\n\r\n $ret = 2;\r\n }\r\n }\r\n \r\n mysql_free_result($busca);\r\n $obj->freebanco();\r\n \r\n return $ret;\r\n }",
"public function recorrerArchivoTXT(){\n $array = [];\n\n for ($row = $this->filaDesde; $row <= $this->filaHasta; ++ $row) {\n $item = new ExtractoBancarioItemVO();\n $registro = $this->FILE[$row];\n if($this->idTipoBanco['valor'] == 5){\n //pongo como separador la coma.\n $registro = preg_replace('/ +/', \",\", $registro);\n }\n\n $registro = explode (\",\" , $registro);\n\n if($this->idTipoBanco['valor'] == 5){\n //la posición 4 del vector es un error al hacer el parseo, no hay que considerarlo.\n //arreglo los valores del array para sacar un caracter inválido que viene del archivo.\n $invalido = $registro[1][0].$registro[1][1]; //en esta posición encuentro el caracter inválido.\n foreach ($registro as &$valor){\n $valor = str_replace($invalido, \"\", $valor);\n $valor = trim ($valor);\n }\n }\n\n for ($col = $this->columnaDesde; $col < $this->columnaHasta; ++ $col) {\n //si la columna leída nos interesa continúo.\n if(in_array($col, $this->columnas)){\n $val = $registro[$col];\n array_push($array, trim($val));\n }\n }\n\n $item->asignarValores($array, $this->idTipoBanco['valor']); //asigno los valores al objeto.\n $this->mensaje['valor'] .= $item->idTipoBancoConcepto['referencia']->result->getMessage();\n //si el status no es OK, incremento el contador de erróneos.\n if($item->idTipoBancoConcepto['referencia']->result->getStatus() != STATUS_OK)\n $this->cantidadRegistrosError['valor']++;\n $this->extractoBancarioItemArray[] = $item; //agrego el registro al array.\n\n $array = [];\n $this->cantidadRegistros['valor']++;\n }\n }",
"function importar_operaciones_requerimientos(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $com_id = $this->security->xss_clean($post['com_id']); /// com id\n $componente = $this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']);\n $list_oregional=$this->model_objetivoregion->list_proyecto_oregional($fase[0]['proy_id']); /// Lista de Objetivos Regionales\n $tp = $this->security->xss_clean($post['tp']); /// tipo de migracion\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n $guardado=0;\n $no_guardado=0;\n $nro_prod=count($this->model_producto->list_prod($com_id));\n if($nro_prod!=0){\n $ope_ult=$this->model_producto->ult_operacion($com_id);\n $nro_prod=$ope_ult[0]['prod_cod']+1;\n }\n else{\n $nro_prod=1;;\n }\n\n if($tp==1){ /// Actividades\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n if(count($datos)==21){\n\n $cod_or = trim($datos[0]); // Codigo Objetivo Regional\n $cod_ope = $nro_prod; // Codigo Operacion\n $descripcion = utf8_encode(trim($datos[2])); //// descripcion Operacion\n $resultado = utf8_encode(trim($datos[3])); //// descripcion Resultado\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $indicador = utf8_encode(trim($datos[5])); //// descripcion Indicador\n $lbase = utf8_encode(trim($datos[6])); //// Linea Base\n if(trim($datos[6])==''){\n $lbase = 0; //// Linea Base\n }\n\n $meta = utf8_encode(trim($datos[7])); //// Meta\n if(trim($datos[7])==''){\n $meta = 0; //// Meta\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $mverificacion = utf8_encode(trim($datos[20])); //// Medio de verificacion\n\n $ae=0;\n $or_id=0;\n if(count($list_oregional)!=0){\n $get_acc=$this->model_objetivoregion->get_alineacion_proyecto_oregional($fase[0]['proy_id'],$cod_or);\n if(count($get_acc)!=0){\n $ae=$get_acc[0]['ae'];\n $or_id=$get_acc[0]['or_id'];\n }\n }\n\n /*--- INSERTAR DATOS OPERACIONES (ACTIVIDADES 2020) ---*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array(\n 'com_id' => $com_id,\n 'prod_producto' => strtoupper($descripcion),\n 'prod_resultado' => strtoupper($resultado),\n 'indi_id' => 1,\n 'prod_indicador' => strtoupper($indicador),\n 'prod_fuente_verificacion' => strtoupper($mverificacion), \n 'prod_linea_base' => $lbase,\n 'prod_meta' => $meta,\n 'prod_unidades' => $unidad,\n 'acc_id' => $ae,\n 'prod_ppto' => 1,\n 'fecha' => date(\"d/m/Y H:i:s\"),\n 'prod_cod'=>$cod_ope,\n 'or_id'=>$or_id,\n 'fun_id' => $this->fun_id,\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('_productos', $data_to_store);\n $prod_id=$this->db->insert_id(); \n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0){\n $this->model_producto->add_prod_gest($prod_id,$this->gestion,$p,$m[$p]);\n }\n }\n\n $producto=$this->model_producto->get_producto_id($prod_id);\n if(count($producto)!=0){\n $guardado++;\n }\n else{\n $no_guardado++;\n }\n\n $nro_prod++;\n }\n }\n $i++;\n }\n \n }\n else{ /// Requerimientos\n\n foreach ($lineas as $linea_num => $linea){\n if($i != 0){\n $datos = explode(\";\",$linea);\n //echo count($datos).'<br>';\n if(count($datos)==20){\n \n $prod_cod = (int)$datos[0]; //// Codigo Actividad\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[2])); //// descripcion\n $unidad = utf8_encode(trim($datos[3])); //// Unidad\n $cantidad = (int)$datos[4]; //// Cantidad\n $unitario = $datos[5]; //// Costo Unitario\n \n $p_total=($cantidad*$unitario);\n $total = $datos[6]; //// Costo Total\n\n $var=7; $sum_temp=0;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n $sum_temp=$sum_temp+$m[$i];\n }\n\n $observacion = utf8_encode(trim($datos[19])); //// Observacion\n $verif_cod=$this->model_producto->verif_componente_operacion($com_id,$prod_cod);\n \n //echo count($verif_cod).'--'.count($par_id).'--'.$cod_partida.'--'.round($sum_temp,2).'=='.round($total,2);\n\n if(count($verif_cod)!=0 & count($par_id)!=0 & $cod_partida!=0 & round($sum_temp,2)==round($total,2)){ /// Verificando si existe Codigo de Actividad, par id, Codigo producto\n // if($verif_cod[0]['prod_ppto']==1){ /// guardando si tiene programado presupuesto en la operacion\n $guardado++;\n /*-------- INSERTAR DATOS REQUERIMIENTO ---------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_unidad_medida' => $unidad, /// Unidad de Medida\n 'ins_gestion' => $this->gestion, /// Insumo gestion\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fun_id' => $this->fun_id, /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*--------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_cod[0]['prod_id'], /// prod id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array(\n 'ins_id' => $ins_id, /// Id Insumo\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('temporalidad_prog_insumo', $data_to_store4);\n }\n }\n // }\n\n }\n \n\n } /// end dimension (22)\n } /// i!=0\n\n $i++;\n\n }\n\n /// --- ACTUALIZANDO MONEDA PARA CARGAR PRESUPUESTO\n $this->update_ptto_operaciones($com_id);\n } /// end else\n\n $this->session->set_flashdata('success','SE REGISTRARON '.$guardado.' REQUERIMIENTOS');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n else{\n $this->session->set_flashdata('danger','SELECCIONE ARCHIVO ');\n redirect('admin/prog/list_prod/'.$com_id.'');\n }\n }\n else{\n echo \"Error !!\";\n }\n }",
"protected function importDatabaseData() {}",
"public function guardarDatos(){\n $contadorPadre = 0;\n $contadorHijo = 0;\n $contadorNieto = 0;\n $contadorHijoVector = 0;\n $contadorPadreVector = 0;\n $contadorNietoVector = 0;\n $contadorProducto = 1;\n $encontradoNieto = FALSE;\n // Imagenes\n $vectorImagenesPadre = $this->getImagenesIndexCategorias();\n $this->queryMarcasPrincipales(1);$this->queryMarcasPrincipales(2);$this->queryMarcasPrincipales(3);\n // csv\n $output = fopen('categories_import.csv', 'w');\n $vectorCategorias = array();\n $vectorCategoriasLabel = $this->getVectorLabelCategorias();\n array_push($vectorCategorias,$vectorCategoriasLabel);\n foreach ($this->categoriaPrincipal as $padre){\n $vectorCsv = $this->guardarPadre($contadorPadre,$vectorImagenesPadre[$contadorPadre],$this->padreContent[$contadorPadre]);\n $imagenesHijos = $this->listadoHijosNietosImagenes($this->padreContent[$contadorPadre]);\n // csv\n array_push($vectorCategorias,$vectorCsv);\n if (isset($padre[\"hijos\"])) {\n foreach($padre[\"hijos\"] as $hijo){\n $vectorCsv = $this->guardarHijo($contadorPadre,$contadorHijo,$imagenesHijos[$contadorHijo],$this->hijoContent[$contadorHijoVector]);\n $imagenesNietos = $this->listadoHijosNietosImagenes($this->hijoContent[$contadorHijoVector]);\n // csv\n array_push($vectorCategorias,$vectorCsv);\n if (isset($hijo[\"nietos\"])) {\n foreach($hijo[\"nietos\"] as $nieto){\n $vectorCsv = $this->guardarNieto($contadorPadre,$contadorHijo,$contadorNieto,$this->nietoContent[$contadorNietoVector],$imagenesNietos[$contadorNieto]);\n $this->guardarProductoNieto($contadorPadre,$contadorHijo,$contadorNieto,$this->nietoContent[$contadorNietoVector],$contadorProducto);\n $contadorProducto += $this->categoriaPrincipal[$contadorPadre][\"hijos\"][$contadorHijo][\"nietos\"][$contadorNieto][\"numeroProductos\"];\n // csv\n array_push($vectorCategorias,$vectorCsv);\n $contadorNieto++;\n $contadorNietoVector++;\n }\n $contadorNieto = 0;\n }else{\n $this->guardarProductoHijo($contadorPadre,$contadorHijo,false,$this->hijoContent[$contadorHijoVector],$contadorProducto);\n $contadorProducto += $this->categoriaPrincipal[$contadorPadre][\"hijos\"][$contadorHijo][\"numeroProductos\"];\n }\n $contadorHijo++;\n $contadorHijoVector++;\n }\n $contadorHijo = 0;\n }\n $contadorPadre++;\n }\n foreach ($vectorCategorias as $campo) {\n fputcsv($output, $campo,';');\n }\n fclose($output);\n $this->writeCsvMarcas();\n }",
"public function loadFromDB()\n {\n }",
"public function testarCarregamentoArquivo() {\n\n\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"Testando Registro importados do Arquivo\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n\n $oHeader = $this->oCabecalhoArquivo;\n\n $lAnoVazio = empty($oHeader->iAnoArquivo);\n $lMesVazio = empty($oHeader->iMesArquivo);\n $lDiaVazio = empty($oHeader->iDiaArquivo);\n $lNomeValido = empty($oHeader->sNomeArquivo);\n\n\n if ( $lAnoVazio || $lMesVazio || $lDiaVazio || $lNomeValido ) {\n\n $sErro = \"CABECALHO DO ARQUIVO INCONSISTENTE\";\n $this->oLog->escreverLog($sErro, DBLog::LOG_ERROR);\n\n if ( $lAnoVazio ) {\n $this->oLog->escreverLog(\" ANO VAZIO\", DBLog::LOG_ERROR);\n }\n if ( $lMesVazio ) {\n $this->oLog->escreverLog(\" MES VAZIO\", DBLog::LOG_ERROR);\n }\n if ( $lDiaVazio ) {\n $this->oLog->escreverLog(\" DIA VAZIO\", DBLog::LOG_ERROR);\n }\n if ( $lNomeValido ) {\n $this->oLog->escreverLog(\" NOME DO LOTE VAZIO OU DIFERENTE DO NOME DO ARQUIVO\", DBLog::LOG_ERROR);\n }\n return false;\n }\n\n $this->oLog->escreverLog(\"CABECALHO DO ARQUIVO SEM PROBLEMAS\", DBLog::LOG_INFO);\n\n\n /**\n * Testando Registros\n */\n $iTotalRegistros = $this->iRegistrosArquivo;\n\n if ( $this->oRodapeArquivo->iQuantidadeRegistros <> $iTotalRegistros ) {\n\n $this->oLog->escreverLog(\"Quantidade de Registros do Arquivo: {$iTotalRegistros}, Diferente da Quantidade Informada: {$this->oRodapeArquivo->iQuantidadeRegistros}\", DBLog::LOG_ERROR);\n return false;\n }\n \n \n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"Total de Registros: {$iTotalRegistros}\", DBLog::LOG_INFO);\n\n /**\n * Percorrendo registros e os validando\n */\n foreach ( $this->aRegistrosArquivo as $iCodigoRegistro => $oRegistro ) {\n\n $iLinha = $iCodigoRegistro + 2;//Linha + Linha Cabecalho + Array que começa em 0(zero)\n $sSequencial = trim( $oRegistro->sSequencial );\n $sCodigoLogradouro = trim( $oRegistro->iCodigoLogradouro );\n $sNomeLogradouro = trim( $oRegistro->sNomeLogradouro );\n\n $lSequencialVazio = empty( $sSequencial ); \n $lCodigoLogradouroVazio = empty( $sCodigoLogradouro );\n $lNomeLogradouroVazio = empty( $sNomeLogradouro );\n\n if ( $lSequencialVazio || $lCodigoLogradouroVazio || $lNomeLogradouroVazio ) {\n\n $this->oLog->escreverLog(\"[{$oHeader->sNomeArquivo}:$iLinha] - Removendo registro inconsistente da Fila de Processamento\", DBLog::LOG_NOTICE);\n if ( $lSequencialVazio ) {\n $this->oLog->escreverLog(\" Sequencial do Registro Vazio\", DBLog::LOG_NOTICE);\n }\n\n if ( $lCodigoLogradouroVazio ) {\n $this->oLog->escreverLog(\" Codigo do Logradouro Vazio \", DBLog::LOG_NOTICE);\n }\n\n if ( $lNomeLogradouroVazio ) {\n $this->oLog->escreverLog(\" Nome do Logradouro Vazio\", DBLog::LOG_NOTICE);\n }\n\n unset( $this->aRegistrosArquivo[$iCodigoRegistro] );\n continue;\n }\n\n\n /**\n * Definindo o Tipo de Logradouro atraves da Sigla\n */\n $oRegistro->iTipoLogradouro = $this->getTipoLogradouro($oRegistro->iTipoLogradouro);\n }\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\" Teste Finalizado com Sucesso. \", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"#######################################\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n $this->oLog->escreverLog(\"\", DBLog::LOG_INFO);\n return true;\n }",
"function listadeMembroativosDao(){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select Matricula,Nome,Naturalidade,Fone from membros where Status = 'ATIVO' order by Nome\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n \r\n while ($registro = mysql_fetch_array($resultado, MYSQL_ASSOC)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n\t $membro->setFone($registro['Fone']); \r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n\t}\r\n\r\n\t\treturn $listaMembro;\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco();\r\n \r\n }",
"public function __construct()\n {\n // require_once(\"../model/DAO/produtoDAO.php\");\n // require_once(\"../model/produtoClass.php\");\n\n require_once(__DIR__ . '/../model/DAO/produtoDAO.php');\n require_once(__DIR__ . '/../model/produtoClass.php');\n\n\n $this->produtoDAO = new ProdutoDAO();\n $this->produto = new Produto();\n $file = (String) null;\n\n if ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n \n\n // Enviando para os atributos da classe o post do form\n if(isset($_POST['txtNome'])){\n $this->produto->setNome($_POST['txtNome']);\n }\n if(isset($_POST['txtDescricao'])){\n $this->produto->setDescricao($_POST['txtDescricao']);\n }\n if(isset($_POST['txtPreco'])){\n $this->produto->setPreco($_POST['txtPreco']);\n }\n if(isset($_POST['txtDesconto'])){\n $this->produto->setDesconto($_POST['txtDesconto']);\n }\n if(isset($_POST['slcCategoria'])){\n $this->produto->setIdSubCategoria($_POST['slcCategoria']);\n }\n \n \n if(isset($_FILES['fileFoto'])){\n $imagem = $this->produtoDAO->uploadImagem($_FILES['fileFoto']);\n if($imagem != null){\n $this->produto->setImagem($imagem);\n }else{\n $this->produto->setImagem(null);\n }\n }\n }\n\n\n \n }",
"function geraClassesBDBase(){\n # Abre o template da classe BD e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.ModeloBDBase.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n $nomeClasse\t = $this->getCamelMode(ucfirst((string)$aTabela['NOME']));\n $objetoClasse = \"\\$o$nomeClasse\";\n # varre a estrutura dos campos da tabela em questao\n $aCampoInsert = $aValorInsert = $aCampoUpdate = $aChaveWhere = $aCampoConsulta = $aFKCampo = array();\n $aChaveAltera = $aChave = $aChaveWhereSel = $aChaveWhereDel = $aFKJoin = $aVerificaPK = array();\n \n $i = 2;\n\n foreach($aTabela as $oCampo){\n $nomeCampo = (string)$oCampo->NOME;\n\n # recupera valores a serem substituidos no modelo\n $aCampoInsert[] = $nomeCampo;\n if((int)$oCampo->CHAVE == 1){\n $aChaveWhere[] = \"$nomeCampo = {\\$reg['$nomeCampo']}\";\n $aChaveWhereSel[] = (string)$aTabela['NOME'].\".$nomeCampo = \\$$nomeCampo\";\n $aChaveWhereDel[] = \"$nomeCampo = \\$$nomeCampo\";\n $aChave[] = \"\\$$nomeCampo\";\n $aVerificaPK[] = $nomeCampo;\n $aChaveAltera[] = \"\\$cv == \\\"$nomeCampo\\\"\";\n if((string)$oCampo->FKTABELA != ''){\n $aCampoUpdate[] = \"$nomeCampo = \\\".\\$reg['$nomeCampo'].\\\"\";\n }\n }\n else{\n $aCampoUpdate[] = ((string)$oCampo->FKTABELA != '') ? \n \"$nomeCampo = \\\".\\$reg['$nomeCampo'].\\\"\" : \n \"$nomeCampo = '\\\".\\$reg['$nomeCampo'].\\\"'\";\t\t\t\t\n }\n\n if((string)$oCampo->FKTABELA != ''){\n $aValorInsert[] = (preg_match(\"#[dD]ata.*[Cc]adastro#is\", $nomeCampo)) ? \"\\\".\\$oConexao->data_cadastro_padrao.\\\"\" : \"\\\".\\$reg['$nomeCampo'].\\\"\";\n $tabelaFK = ((string)$aTabela['SCHEMA'] != \"\") ? (string)$aTabela['SCHEMA'].\".\".(string)$oCampo->FKTABELA : (string)$oCampo->FKTABELA;\n $aFKJoin[] = \"$tabelaFK \\n\\t\\t\\t\\t\\ton (\".(string)$aTabela['NOME'].\".$nomeCampo = \".(string)$oCampo->FKTABELA.\".\".(string)$oCampo->FKCAMPO.\")\";\n \n $i++;\n }\n else{\n $aValorInsert[] = ((int)$oCampo->CHAVE == 1) ? \n \"\\\".\\$reg['$nomeCampo'].\\\"\" : \n \"'\\\".\\$reg['$nomeCampo'].\\\"'\";\n }\n\n // =========== Montagem dos Campos da Consulta =============\n if((int)$oCampo->CHAVE != 1){\n $aCampoConsulta[] = (string)$aTabela['NOME'].\".$nomeCampo like '\\$valor'\";\n }\t\n }\n # =========== Monta demais valores a serem substituidos ========\n $aCampoInsert = join($aCampoInsert, \",\\n\\t\\t\\t\\t\\t\");\n $aValorInsert = join($aValorInsert, \",\\n\\t\\t\\t\\t\\t\");\n $aCampoUpdate = join($aCampoUpdate, \",\\n\\t\\t\\t\\t\\t\");\n $aChaveWhere = join($aChaveWhere, \" \\n\\t\\t\\t\\t\\tand \");\n $aChaveWhereSel = join($aChaveWhereSel, \" \\n\\t\\t\\t\\t\\tand \");\n $aChaveWhereDel = join($aChaveWhereDel, \" \\n\\t\\t\\t\\t\\tand \");\n $sCampoConsulta = join($aCampoConsulta, \" \\n\\t\\t\\t\\t\\tor \");\n $aChave = join($aChave,\t \",\");\n $aColuna = $this->getCamposSelect((string)$aTabela['NOME']);\n $aColuna = join($aColuna, \",\\n\\t\\t\\t\\t\\t\");\n\n $tabelaJoin = (((string)$aTabela['SCHEMA'] != \"\") ? (string)$aTabela['SCHEMA'].\".\".(string)$aTabela['NOME'] : (string)$aTabela['NOME']);\n\n $sVerificaPK = NULL;\n foreach($aVerificaPK as $v){\n $sVerificaPK .= \"\\t\\t\\$reg['$v'] = (\\$reg['$v'] != '') ? \\$reg['$v'] : \\\"null\\\";\\n\";\n }\n\n if(count($aFKJoin) > 0){\n $tabelaJoin .= \" \\n\\t\\t\\t\\tleft join \".join($aFKJoin,\"\\n\\t\\t\\t\\tleft join \");\n }\n \n $nomeTabela = (((string)$aTabela['SCHEMA'] != \"\") ? (string)$aTabela['SCHEMA'].\".\".(string)$aTabela['NOME'] : (string)$aTabela['NOME']);\n $chavesWhereConsulta = (($sCampoConsulta!='') ? $sCampoConsulta : '1=1');\n $sChaveAltera = (count($aChaveAltera)>0) ? \"if(\".implode(\" || \", $aChaveAltera).\") continue;\" : \"\";\n \n # ======== Substitui todas os parametros pelas variaveis ja processadas ==========\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%VERIFICA_PK%%', $sVerificaPK, $copiaModelo);\n $copiaModelo = str_replace('%%OBJETO_CLASSE%%', $objetoClasse, $copiaModelo);\n $copiaModelo = str_replace('%%TABELA%%', $nomeTabela, $copiaModelo);\n $copiaModelo = str_replace('%%CAMPOS_INS%%', $aCampoInsert, $copiaModelo);\n $copiaModelo = str_replace('%%VAL_CAMPOS_INS%%', $aValorInsert, $copiaModelo);\n $copiaModelo = str_replace('%%CAMPOS_UPD%%', $aCampoUpdate, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE%%', $aChaveWhere, $copiaModelo);\n $copiaModelo = str_replace('%%LISTA_CHAVES%%', $aChave, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE_SEL%%', $aChaveWhereSel, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE_DEL%%', $aChaveWhereDel, $copiaModelo);\n $copiaModelo = str_replace('%%TABELA_JOIN%%', $tabelaJoin, $copiaModelo);\n $copiaModelo = str_replace('%%CHAVES_WHERE_CONS%%', $chavesWhereConsulta, $copiaModelo);\n $copiaModelo = str_replace('%%COLUNAS%%', $aColuna, $copiaModelo); //Por Enquanto\n $copiaModelo = str_replace('%%CAMPOS_CHAVE_ALTERAR%%', $sChaveAltera, $copiaModelo);\n \n\n unset($sCampoConsulta);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/bdbase\";\n if(!file_exists($dir)) \n mkdir($dir);\n $fp = fopen(\"$dir/class.$nomeClasse\".\"BDBase.php\",\"w\");\n fputs($fp,$copiaModelo); \n fclose($fp);\n }\n return true;\n }",
"public function bajarArchivos()\n {\n $anio = date('Y');\n ////$mes = (int)date('m')-1;\n\n $mes = (int) date('m')-(int)\\Config::get('constants.constantes.mes_proceso');\n if($mes == 0){\n $anio = $anio - 1;\n $mes = 1;\n } \n\n ini_set('max_execution_time', 0);\n ini_set('memory_limit', '-1');\n ini_set('default_socket_timeout', 600);\n ini_set('upload_max_filesize ', '40M');\n ini_set('post_max_size ', '40M');\n \n $empresas = Empresa::all()->sortBy(\"codigo\");\n\n //Ver con tavo como seria la query para no traer TODOS\n\n $i=0;\n $msg=\"\";\n foreach ($empresas as $empresa) {\n //Veo si existe un procesamiento para el anio, mes, codigo\n //$existeProcesamientoArchivoFinalizado = ProcesamientoArchivo::where('anio','=',$anio)->where('mes','=',$mes)->where('codigo','=', $empresa->codigo)->where('estado','=', 'Finalizado')->count();\n $existeProcesamientoArchivoFinalizado = $this->procesamientoArchivoRepository->existeProcesamientoArchivoPorEstado($anio, $mes, $empresa->codigo, \"Fin bajada de archivo\");\n if($existeProcesamientoArchivoFinalizado == 0){\n //if($i<4 && $empresa->codigo!=\"YPF\"){\n if($i<6){\n $i++;\n $this->procesamientoArchivoRepository->crearProcesamientoArchivoEstado($anio, $mes, $empresa->codigo, \"Inicio bajada de archivo\", \"\", $empresa->id);\n\n $PozoService = new PozoService($anio, $empresa->codigo, $mes);\n \\Log::info('init descarga');\n $nombreArchivo = $anio.\"-\".$mes.\"-\".$empresa->codigo.\"-ddjj.xlsx\";\n\n $msg.=\"Codigo empresa bajado ==> \".$empresa->codigo;\n\n $excel = $PozoService->processPozos($nombreArchivo);\n \\Log::info('fin descarga');\n \n $this->procesamientoArchivoRepository->crearProcesamientoArchivoEstado($anio, $mes, $empresa->codigo, \"Fin bajada de archivo\", \"Pendiente\", $empresa->id);\n if($excel == \"\"){\n $msg.=\" ==> No existe excel para esta empresa en este mes.\";\n $this->procesamientoArchivoRepository->crearProcesamientoArchivoEstado($anio, $mes, $empresa->codigo, \"No hay DDJJ (sin Excel)\", \"\", $empresa->id); \n } \n $msg.=\"<br>\";\n }\n }\n } \n\n if($i==0)\n echo \"No quedan archivos por bajar este mes\";\n else\n echo \"Se bajaron \".$i.\" archivos. \".$msg.\" Aun quedan archivos por bajar\";\n }",
"public function CargarIngredientes()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_FILES[\"sel_file\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n //Aquí es donde seleccionamos nuestro csv\n $fname = $_FILES['sel_file']['name'];\n //echo 'Cargando nombre del archivo: '.$fname.' ';\n $chk_ext = explode(\".\",$fname);\n \n if(strtolower(end($chk_ext)) == \"csv\")\n {\n //si es correcto, entonces damos permisos de lectura para subir\n $filename = $_FILES['sel_file']['tmp_name'];\n $handle = fopen($filename, \"r\");\n \n while (($data = fgetcsv($handle, 1000, \";\")) !== FALSE)\n {\n //Insertamos los datos con los valores...\n\t\t\t \n$query = \" insert into ingredientes values (null, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $data[0]);\n\t\t$stmt->bindParam(2, $data[1]);\n\t\t$stmt->bindParam(3, $data[2]);\n\t\t$stmt->bindParam(4, $data[3]);\n\t\t$stmt->bindParam(5, $data[4]);\n\t\t$stmt->bindParam(6, $data[5]);\n\t\t$stmt->bindParam(7, $data[6]);\n\t\t$stmt->execute();\n\n\t\t$query = \" insert into kardexingredientes values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproceso);\n\t\t$stmt->bindParam(2, $codresponsable);\n\t\t$stmt->bindParam(3, $codproducto);\n\t\t$stmt->bindParam(4, $codingrediente);\n\t\t$stmt->bindParam(5, $movimiento);\n\t\t$stmt->bindParam(6, $entradas);\n\t\t$stmt->bindParam(7, $salidas);\n\t\t$stmt->bindParam(8, $stockactual);\n\t\t$stmt->bindParam(9, $preciounit);\n\t\t$stmt->bindParam(10, $costototal);\n\t\t$stmt->bindParam(11, $documento);\n\t\t$stmt->bindParam(12, $fechakardex);\n\t\t\n\t\t$codproceso = strip_tags($data[0]);\n\t\t$codresponsable = strip_tags(\"0\");\n\t\t$codproducto = strip_tags('0');\n\t\t$codingrediente = strip_tags($data[0]);\n\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t$entradas = strip_tags($data[2]);\n\t\t$salidas = strip_tags(\"0\");\n\t\t$stockactual = strip_tags($data[2]);\n\t\t$preciounit = strip_tags($data[3]);\n\t\t$costototal = rount($data[3]*$data[2],2);\n\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t$stmt->execute();\n\t\t\t\t\n }\n //cerramos la lectura del archivo \"abrir archivo\" con un \"cerrar archivo\"\n fclose($handle);\n\t \necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\necho \"<span class='fa fa-check-square-o'></span> LA CARGA MASIVA DE INGREDIENTES FUE REALIZADA EXITOSAMENTE </div>\";\necho \"</div>\";\nexit;\n \n }\n else\n {\n //si aparece esto es posible que el archivo no tenga el formato adecuado, inclusive cuando es cvs, revisarlo para ver si esta separado por \" , \"\n echo \"2\";\n\t\t exit;\n } \n}",
"function salva()\n\t{\n\t\trestauraConObj($this->mapa,$this->postgis_mapa);\n\t\t$this->mapa->save($this->arquivo);\n\t}",
"public function recorrerArchivoCSV(){\n $array = [];\n for ($row = $this->filaDesde; $row <= $this->filaHasta; ++ $row) {\n $item = new ExtractoBancarioItemVO();\n $registro = $this->FILE[$row];\n $registro = explode (\",\", $registro);\n\n //este IF es por si tiene \",\" en algún lugar del nro, pasa en MACRO.\n if ($this->idTipoBanco['valor'] == 3){\n $aux = [];\n //arreglamos el formato de la fecha.\n $date = new DateTime($registro[0]);\n $aux[0] = $date->format(\"Y-m-d\");\n\n //asigno los valores que están bien en $aux.\n $aux[1] = $registro[1];\n $aux[2] = $registro[2];\n $aux[3] = $registro[3];\n\n //arreglamos el registro para que los nros queden en la posición del array que les corresponden.\n //analizo el campo Débito.\n $i=4;\n if(strlen($registro[$i]) > 0 && $registro[$i][strlen($registro[$i])-1]!='\"' ){\n $aux[4] = $registro[$i].$registro[$i+1];\n $i++;\n }else{\n $aux[4] = $registro[$i];\n }\n //sacamos las \" de los nros.\n $aux[4] = str_replace('\"', \"\", $aux[4]);\n\n //incremento el valor de $i.\n $i++;\n //analizo el campo Crédito.\n if(strlen($registro[$i]) > 0 && $registro[$i][strlen($registro[$i])-1]!='\"' ){\n $aux[5] = $registro[$i].$registro[$i+1];\n $i++;\n }else{\n $aux[5] = $registro[$i];\n }\n //sacamos las \" de los nros.\n $aux[5] = str_replace('\"', \"\", $aux[5]);\n\n //incremento el valor de $i.\n $i++;\n //analizo el campo Saldo.\n if(strlen($registro[$i]) > 0 && $registro[$i][strlen($registro[$i])-1]!='\"' ){\n $aux[6] = $registro[$i].$registro[$i+1];\n $i++;\n }else{\n $aux[6] = $registro[$i];\n }\n //sacamos las \" de los nros.\n $aux[6] = str_replace('\"', \"\", $aux[6]);\n\n $registro = $aux;\n }\n\n for ($col = $this->columnaDesde; $col < $this->columnaHasta; ++ $col) {\n //si la columna leída nos interesa continúo.\n if(in_array($col, $this->columnas)){\n $val = $registro[$col];\n array_push($array, trim($val));\n }\n }\n\n $item->asignarValores($array, $this->idTipoBanco['valor']); //asigno los valores al objeto.\n $this->mensaje['valor'] .= $item->idTipoBancoConcepto['referencia']->result->getMessage();\n //si el status no es OK, incremento el contador de erróneos.\n if($item->idTipoBancoConcepto['referencia']->result->getStatus() != STATUS_OK)\n $this->cantidadRegistrosError['valor']++;\n $this->extractoBancarioItemArray[] = $item; //agrego el registro al array.\n\n $array = [];\n $this->cantidadRegistros['valor']++;\n }\n }",
"public function tratarDados($especificacoes, $valor, $posicao, $config, $identifica)\n {\n $util = new Util();\n $arquivoValidacao = new ArquivoValidacao();\n\n\n if ($especificacoes[1] == 'livre') {\n return $valor;\n }\n\n switch ($especificacoes[1]) {\n\n case 'doc':\n $valorFormatado = $util->somenteNumeros($valor);\n $arquivoValidacao->validaTamanhoNum($valorFormatado, $especificacoes[0], $posicao, $identifica);\n $valor = $util->adicionarZerosEsq($valorFormatado, $especificacoes[0]);\n break;\n\n case 'num':\n $valorFormatado = $util->somenteNumeros($valor);\n $arquivoValidacao->validaTamanhoNum($valorFormatado, $especificacoes[0], $posicao, $identifica);\n $valor = $util->adicionarZerosEsq($valorFormatado, $especificacoes[0]);\n break;\n\n case 'valor':\n $valor = $util->adicionarZerosEsq($util->trataValor($valor), $especificacoes[0]);\n\n $arquivoValidacao->validaTamanhoNum($valor, $especificacoes[0], $posicao, $identifica);\n break;\n\n case 'data-Ymd': case 'data-ymd': case 'data-dmY': case 'data-dmy':\n\n if (empty($valor)) {\n $valor = $util->adicionarZerosEsq('0', $especificacoes[0]);\n } else {\n\n $valorCru = $util->somenteNumeros($valor);\n\n if (strlen($valorCru) > 8) {\n $valorCru = substr($valorCru, 0, 8);\n }\n\n $arquivoValidacao->validaData($valorCru, $posicao, $especificacoes[0], $identifica);\n\n $partes = explode('-', $especificacoes[1]);\n\n $valor = (new \\DateTime($valor))->format($partes[1]);\n }\n\n break;\n\n default :\n $case = null;\n\n if (isset($config['case'])) {\n $case = strtolower($config['case']);\n }\n\n $valorPreparado = $util->preparaTexto($valor, $case);\n\n $valor = $util->adicionarEspacosDir($valorPreparado, $especificacoes[0]);\n break;\n }\n\n\n return $valor;\n }",
"public function store()\n\t{\n\t\t$importador = new ImportadorProyecto('/uploads/proyectos/temp.txt');\n\t\t$importador->extraer();\n\n\t\t$urg = Urg::whereUrg($importador->urg)->get(array('id'));\n\t\t$fondo = Fondo::whereFondo($importador->fondo)->get(array('id'));\n\n\t\t$arr_inicio = explode(\"/\", $importador->inicio);\n\t\t$arr_fin = explode(\"/\", $importador->fin);\n\n\t\t$proyecto = new Proyecto();\n\t\t$proyecto->proyecto = $importador->proy;\n\t\t$proyecto->d_proyecto = $importador->d_proyecto;\n\t\t$proyecto->monto = $importador->monto_proy;\n\t\t$proyecto->urg_id = $urg[0]->id;\n\t\t$proyecto->tipo_proyecto_id = 1;\n\t\t$proyecto->aaaa = $importador->aaaa;\n\t\t$proyecto->inicio = $arr_inicio[2].\"-\".$arr_inicio[1].\"-\".$arr_inicio[0];\n\t\t$proyecto->fin = $arr_fin[2].\"-\".$arr_fin[1].\"-\".$arr_fin[0];\n\t\t$proyecto->save();\n\n\t\t//Inserta datos @fondo_proyecto\n\t\t$proyecto->fondos()->attach($fondo[0]->id);\n\n\t\t$arr_objetivos = array();\n\t\tforeach($importador->arr_recursos as $partida => $val){\n\t\t\t//Buscar objetivo en key del arreglo\n\t\t\t$objetivo_id = array_search($val['objetivo'], $arr_objetivos);\n\n\t\t\t//Si no se encuentra\n\t\t\tif( empty($objetivo_id) ) {\n\t\t\t\t$objetivo = new Objetivo();\n\t\t\t\t$objetivo->objetivo = $val['objetivo'];\n\t\t\t\t$objetivo->d_objetivo = $val['d_objetivo'];\n\t\t\t\t$objetivo->save();\n\t\t\t\t$objetivo_id = $objetivo->id;\n\t\t\t\t$arr_objetivos[$objetivo->id] = $val['objetivo'];\n\t\t\t}\n\n\t\t\t$cog = Cog::whereCog($val['cog'])->get();\n\t\t\t$rm = new Rm();\n\t\t\t$rm->rm = $partida;\n\t\t\t$rm->proyecto_id = $proyecto->id;\n\t\t\t$rm->objetivo_id = $objetivo_id;\n\t\t\t$rm->actividad_id = 1;\n\t\t\t$rm->cog_id = $cog[0]->id;\n\t\t\t$rm->fondo_id = $fondo[0]->id;\n\t\t\t$rm->monto = $val['monto'];\n\t\t\t$rm->d_rm = \"\";\n\t\t\t$rm->save();\n\t\t}\n\n\t\treturn redirect()->action('ProyectosController@index');\n\t}",
"public function CargarProductos()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_FILES[\"sel_file\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n //Aquí es donde seleccionamos nuestro csv\n $fname = $_FILES['sel_file']['name'];\n //echo 'Cargando nombre del archivo: '.$fname.' ';\n $chk_ext = explode(\".\",$fname);\n \n if(strtolower(end($chk_ext)) == \"csv\")\n {\n //si es correcto, entonces damos permisos de lectura para subir\n $filename = $_FILES['sel_file']['tmp_name'];\n $handle = fopen($filename, \"r\");\n \n while (($data = fgetcsv($handle, 1000, \";\")) !== FALSE)\n {\n //Insertamos los datos con los valores...\n\t\t\t \n$query = \" insert into productos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $data[0]);\n\t\t$stmt->bindParam(2, $data[1]);\n\t\t$stmt->bindParam(3, $data[2]);\n\t\t$stmt->bindParam(4, $data[3]);\n\t\t$stmt->bindParam(5, $data[4]);\n\t\t$stmt->bindParam(6, $data[5]);\n\t\t$stmt->bindParam(7, $data[6]);\n\t\t$stmt->bindParam(8, $data[7]);\n\t\t$stmt->bindParam(9, $data[8]);\n\t\t$stmt->bindParam(10, $data[9]);\n\t\t$stmt->bindParam(11, $data[10]);\n\t\t$stmt->bindParam(12, $data[11]);\n\t\t$stmt->bindParam(13, $data[12]);\n\t\t$stmt->execute();\n\n\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproceso);\n\t\t$stmt->bindParam(2, $codresponsable);\n\t\t$stmt->bindParam(3, $codproducto);\n\t\t$stmt->bindParam(4, $movimiento);\n\t\t$stmt->bindParam(5, $entradas);\n\t\t$stmt->bindParam(6, $salidas);\n\t\t$stmt->bindParam(7, $devolucion);\n\t\t$stmt->bindParam(8, $stockactual);\n\t\t$stmt->bindParam(9, $preciounit);\n\t\t$stmt->bindParam(10, $costototal);\n\t\t$stmt->bindParam(11, $documento);\n\t\t$stmt->bindParam(12, $fechakardex);\n\t\t\n\t\t$codproceso = strip_tags($data[0]);\n\t\t$codresponsable = strip_tags(\"0\");\n\t\t$codproducto = strip_tags($data[0]);\n\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t$entradas = strip_tags($data[5]);\n\t\t$salidas = strip_tags(\"0\");\n\t\t$devolucion = strip_tags(\"0\");\n\t\t$stockactual = strip_tags($data[6]);\n\t\t$preciounit = strip_tags($data[4]);\n\t\t$costototal = rount($data[4]*$data[6],2);\n\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t$stmt->execute();\n\t\t\t\t\n }\n //cerramos la lectura del archivo \"abrir archivo\" con un \"cerrar archivo\"\n fclose($handle);\n\t \necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\necho \"<span class='fa fa-check-square-o'></span> LA CARGA MASIVA DE PRODUCTOS FUE REALIZADA EXITOSAMENTE </div>\";\necho \"</div>\";\nexit;\n \n }\n else\n {\n //si aparece esto es posible que el archivo no tenga el formato adecuado, inclusive cuando es cvs, revisarlo para ver si esta separado por \" , \"\n echo \"2\";\n\t\t exit;\n } \n}",
"private function importar_ordenes_rafam($ejercicio,$numero){\n // $stid = oci_parse($conn, $sql);\n // oci_execute($stid);\n \n // // echo \"<table border='1'>\\n\";\n // // while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {\n // // echo \"<tr>\\n\";\n // // foreach ($row as $key=>$item) {\n // // echo \" <td>\" . ($item !== null ? htmlentities($key.'-'.$item, ENT_QUOTES) : \"\") . \"</td>\\n\";\n // // }\n // // echo \"</tr>\\n\";\n // // }\n // // echo \"</table>\\n\";\n // die();\n // $conn = oci_connect('OWNER_RAFAM', 'OWNERDBA', \"(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.0.18)(PORT = 1521)))(CONNECT_DATA=(SID=HMABB)))\");\n \n // if (!$conn) {\n // $e = oci_error();\n // trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);\n // }\n $connection_rafam = \\Yii::$app->dbRafam;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n\n //Importo los Ordenes de Compra\n $sql= \"SELECT oc.NRO_OC,oc.EJERCICIO,TO_CHAR(oc.FECH_OC, 'YYYY-MM-DD') as FECHA_OC,\n oc.COD_PROV, oci.item_oc,oci.descripcion,oci.cantidad,oci.imp_unitario,\n pci.inciso, pci.par_prin, pci.par_parc, pci.clase, pci.tipo\n FROM orden_compra oc, oc_items oci, adjudicaciones a, ped_cotizaciones pc, ped_cotizaciones_items pci\n WHERE oc.ejercicio=oci.ejercicio AND oc.nro_oc=oci.nro_oc AND oc.uni_compra=2 AND oc.estado_oc<>'A' AND oci.uni_compra=2\n AND oc.ejercicio=a.ejercicio AND oc.nro_adjud=a.nro_adjudic AND a.deleg_solic=2 AND a.estado<>'A'\n AND pc.ejercicio=a.ejercicio AND a.nro_coti=pc.nro_coti AND pc.deleg_solic=2 AND pc.estado<>'A' AND pc.nro_llamado=a.nro_llamado\n AND pci.nro_llamado=pc.nro_llamado\n AND pci.ejercicio=pc.ejercicio AND pci.nro_coti=pc.nro_coti AND pci.item_real=oci.item_real \n AND oc.EJERCICIO=$ejercicio AND oc.NRO_OC=$numero\n ORDER BY oc.EJERCICIO,oc.NRO_OC,oci.item_oc\";\n\n $command = $connection_rafam->createCommand($sql);\n $orden = $command->queryAll();\n\n $oc_nro_actual='';\n foreach ($orden as $key => $row) {\n \n $oc_nro = $row['EJERCICIO'].str_pad( $row['NRO_OC'], 6, \"0\", STR_PAD_LEFT);\n $oc_proveed = $row['COD_PROV'];\n $oc_fecha = $row['FECHA_OC'];\n \n if ($oc_nro!=$oc_nro_actual){\n $orden_compra_existente = false;\n $orden_compra = OrdenCompra::findOne($oc_nro);\n if (!isset($orden_compra)){\n $oc_nro_actual = $oc_nro;\n $orden_compra = new OrdenCompra();\n $orden_compra->OC_NRO = $oc_nro;\n $orden_compra->OC_PROVEED = $oc_proveed;\n $this->verificar_proveedor($oc_proveed);\n $orden_compra->OC_FECHA = $oc_fecha;\n $orden_compra->OC_FINALIZADA = 0; \n if (!$orden_compra->save()){\n $mensaje = \"\"; \n foreach ($orden_compra->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n \n }else{\n $orden_compra_existente = true;\n }\n }\n \n if (!$orden_compra_existente){\n $codigo_rafam_articulo = $row['INCISO'].'.'.$row['PAR_PRIN']\n .'.'.$row['PAR_PARC']\n .'.'.str_pad( $row['CLASE'], 5, \"0\", STR_PAD_LEFT)\n .'.'.str_pad( $row['TIPO'], 4, \"0\", STR_PAD_LEFT);\n\n $renglon = new OrdenCompra_renglones(); \n $renglon->EN_NROOC = $oc_nro;\n $renglon->EN_ITEM = $row['ITEM_OC'];\n $renglon->EN_CANT = $row['CANTIDAD'];\n $renglon->EN_COSTO = $row['IMP_UNITARIO'];\n $renglon->EN_CODRAFAM = $codigo_rafam_articulo;\n if (!$renglon->save()){\n $mensaje = \"\"; \n foreach ($renglon->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n }\n }\n\n $transaction->commit();\n return true;\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }",
"public function __construct($data, $archivo)\n {\n $this->nombre = $data[\"nombre\"];\n $this->apellido = $data[\"telefono\"];\n $this->domicilio = $data[\"domicilio\"];\n $this->cp = $data[\"cp\"];\n $this->provincia = $data[\"provincia\"];\n $this->localidad = $data[\"localidad\"];\n $this->nacionalidad = $data[\"nacionalidad\"];\n $this->dni = $data[\"dni\"];\n $this->fecha = $data[\"fecha\"];//nacimiento\n $this->estado = $data[\"estado\"];//civil\n $this->email = $data[\"email\"];\n $this->telefono = $data[\"telefono\"];\n $this->postular = $data[\"postular\"];//OBJ\n //ARRAY\n $this->puesto_trabajos = $data[\"puesto_trabajos\"];\n //$this->trabajos_seniority = $data[\"trabajos_seniority\"];\n $this->empresa_trabajos = $data[\"empresa_trabajos\"];\n $this->trabajos_pais = $data[\"trabajos_pais\"];\n $this->industria_trabajos = $data[\"industria_trabajos\"];\n $this->area_trabajos = $data[\"area_trabajos\"];\n $this->actual_trabajos = isset($data[\"actual_trabajos\"]) ? $data[\"actual_trabajos\"] : [];\n $this->desde_trabajos = $data[\"desde_trabajos\"];\n $this->hasta_trabajos = isset($data[\"hasta_trabajos\"]) ? $data[\"hasta_trabajos\"] : [];\n $this->descripcion_trabajos = $data[\"descripcion_trabajos\"];\n $this->titulo_educacion = $data[\"titulo_educacion\"];\n $this->educacion_pais = $data[\"educacion_pais\"];\n $this->educacion_area = $data[\"educacion_area\"];\n $this->educacion_nivel = $data[\"educacion_nivel\"];\n $this->educacion_estado = $data[\"educacion_estado\"];\n $this->desde_educacion = $data[\"desde_educacion\"];\n $this->hasta_educacion = isset($data[\"hasta_educacion\"]) ? $data[\"hasta_educacion\"] : [];\n $this->descripcion_educacion = $data[\"descripcion_educacion\"];\n $this->url_redes = $data[\"url_redes\"];\n\n $this->remuneracion = $data[\"remuneracion\"];\n $this->mensaje = $data[\"mensaje\"];\n\n $this->archivo = $archivo;\n }",
"function importar_archivo_sigepp(){\n if ($this->input->post()) {\n $post = $this->input->post();\n \n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n \n /*--------------------------------------------------------------*/\n $i=0;\n $nro=0;$nroo=0;\n $lineas = file($archivotmp);\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){ \n\n $datos = explode(\";\",$linea);\n //echo count($datos).\"<br>\";\n if(count($datos)==7){\n\n $da=$datos[0]; /// Da\n $ue=$datos[1]; /// Ue\n $prog=$datos[2]; /// Aper Programa\n $proy=trim($datos[3]);\n if(strlen($proy)==2){\n $proy='00'.$proy; /// Aper Proyecto\n }\n $act=trim($datos[4]); /// Aper Actividad\n if(strlen($act)==2){\n $act='0'.$act;\n }\n $cod_part=trim($datos[5]); /// Partida\n if(strlen($cod_part)==3){\n $cod_part=$cod_part.'00';\n }\n\n $importe=(float)$datos[6]; /// Monto\n\n // echo $this->gestion.\"<br>\";\n echo $prog.'- ('.strlen($prog).') -> '.$proy.' ('.strlen($proy).') -> '.$act.' ('.strlen(trim($act)).') ----'.$importe.'-- CODIGO PARTIDA '.is_numeric($cod_part).'<br>';\n if(strlen($prog)==2 & strlen($proy)==4 & strlen(trim($act))==3 & $importe!=0 & is_numeric($cod_part)){\n // echo \"INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n $nroo++;\n // echo \"string<br>\";\n $aper=$this->model_ptto_sigep->get_apertura($prog,$proy,$act);\n if(count($aper)!=0){\n $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }\n\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n else{\n echo \"INSERTS : \".$nroo.\" -\".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*-------------------- Guardando Datos ------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => $aper[0]['aper_id'],\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n $nro++;\n }\n else{\n echo \"NO INGRESA : \".$prog.'-'.$proy.'-'.$act.'..'.$importe.\"<br>\";\n /* $partida = $this->minsumos->get_partida_codigo($cod_part); //// DATOS DE LA PARTIDA\n $par_id=0;\n if(count($partida)!=0){\n $par_id=$partida[0]['par_id'];\n }*/\n /*-------------------- Guardando Datos ------------------*/\n /* $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'aper_id' => 0,\n 'da' => $da,\n 'ue' => $ue,\n 'aper_programa' => $prog,\n 'aper_proyecto' => $proy,\n 'aper_actividad' => $act,\n 'par_id' => $par_id,\n 'partida' => $cod_part,\n 'importe' => $importe,\n 'g_id' => $this->gestion,\n 'fun_id' => $this->session->userdata(\"fun_id\"),\n );\n $this->db->insert('ptto_partidas_sigep', $data_to_store);\n $sp_id=$this->db->insert_id();*/\n /*-------------------------------------------------------*/ \n }\n }\n elseif(strlen($prog)==2 & strlen($proy)==4 & strlen($act)==3 & $importe==0){\n $ptto=$this->model_ptto_sigep->get_ptto_sigep($prog,$proy,$act,$cod_part);\n if(count($ptto)!=0){\n echo \"UPDATES 0->VALOR : \".$prog.'-'.$proy.'-'.$act.' cod '.$cod_part.'-- PAR ID : '.$par_id.' ->'.$importe.\"<br>\";\n /*------------------- Update Datos ----------------------*/\n /*$query=$this->db->query('set datestyle to DMY');\n $update_ptto = array(\n 'aper_id' => $aper[0]['aper_id'],\n 'importe' => $importe,\n 'fun_id' => $this->session->userdata(\"fun_id\")\n );\n\n $this->db->where('sp_id', $ptto[0]['sp_id']);\n $this->db->update('ptto_partidas_sigep', $update_ptto);*/\n /*-------------------------------------------------------*/\n }\n }\n }\n }\n\n $i++;\n }\n\n /*--------------------------------------------------------------*/\n } \n elseif (empty($file_basename)) {\n echo \"<script>alert('SELECCIONE ARCHIVO .CSV')</script>\";\n } \n elseif ($filesize > 100000000) {\n //redirect('');\n } \n else {\n $mensaje = \"Sólo estos tipos de archivo se permiten para la carga: \" . implode(', ', $allowed_file_types);\n echo '<script>alert(\"' . $mensaje . '\")</script>';\n }\n\n } else {\n show_404();\n }\n }",
"public function importarAdministrativos($archivo=$this->archivo){\n $lineas = file($archivo); \n $i=0; \n foreach ($lineas as $linea_num => $linea)\n { \n if($i != 0) \n { \n $administrativos = explode(\";\",$linea);\n $dni=trim($administrativos[0]);\n $apellidos=trim($administrativos[1]);\n $nombre = trim($administrativos[2]);\n $dependencia =trim($administrativos[3]);\n $telefono = trim($administrativos[4]);\n $correo = trim($administrativos[5]);\n $categoria = trim($administrativos[6]);\n $cargo= trim($administrativos[7]); \n mysql_query(\"INSERT INTO administrativos(nombre,edad,profesion) \n VALUES('$dni,'$apellidos','$nombre','$dependencia','$telefono','$correo','$categoria','$cargo')\");\n } \n $i++;\n }\n}",
"function cargar_archivo($data) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"init\">\r\n $ruta = $data[\"archivo\"];\r\n $tipo_archivo = $data[\"tipo_archivo\"];\r\n $lectura = false;\r\n $buffer = array();\r\n $canalTemp = \"\";\r\n $indicadorTemp = \"\";\r\n $fechaTemp = \"\";\r\n $horaInicioTemp = \"\";\r\n $horaFinTemp = \"\";\r\n $descripcionTemp = \"\";\r\n // </editor-fold>\r\n\r\n try {\r\n $archivo = new SplFileObject($ruta, \"r\");\r\n } catch (Exception $exc) {\r\n throw new Exception(\"No se pudo cargar el archivo.\");\r\n echo $exc->getTraceAsString();\r\n }\r\n\r\n switch ($tipo_archivo) {\r\n case self::tipo_archivo_emisiones:\r\n if (isset($archivo)) {\r\n foreach ($archivo as $linea) {\r\n $valores = explode(\"|\", $linea);\r\n if ($this->limpiar_valores($valores[0]) == \"Channel\") {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"comprobar estructura de archivo\">\r\n if (\r\n $this->limpiar_valores($valores[0]) != \"Channel\" ||\r\n $this->limpiar_valores($valores[1]) != \"Date\" ||\r\n $this->limpiar_valores($valores[2]) != \"Description\" ||\r\n $this->limpiar_valores($valores[4]) != \"Start time\" ||\r\n $this->limpiar_valores($valores[5]) != \"End time\" ||\r\n $this->limpiar_valores($valores[8]) != \"Target\\Variable\" ||\r\n $this->limpiar_valores($valores[9]) != \"SHR %\" ||\r\n $this->limpiar_valores($valores[10]) != \"AMR\" ||\r\n $this->limpiar_valores($valores[11]) != \"AMR %\" ||\r\n $this->limpiar_valores($valores[12]) != \"RCH [Not cons. - TH: 0min.]\" ||\r\n $this->limpiar_valores($valores[13]) != \"ATS\"\r\n ) {\r\n throw new Exception(\"Estructura de archivo Inválida\");\r\n }\r\n // </editor-fold>\r\n $lectura = true;\r\n }\r\n if ($lectura) {\r\n if (isset($valores[1])) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Canal\">\r\n if ($this->limpiar_canal($valores[0]) != \"\") {\r\n $valores[0] = $this->limpiar_canal($valores[0]);\r\n $canalTemp = $valores[0];\r\n } else {\r\n $valores[0] = $canalTemp;\r\n }\r\n // </editor-fold>\r\n // // <editor-fold defaultstate=\"collapsed\" desc=\"Fecha\">\r\n if (isset($valores[1]) && $valores[1] != \"\") {\r\n $valores[1] = $this->formatea_fecha($valores[1]);\r\n $fechaTemp = $valores[1];\r\n } else {\r\n $valores[1] = $fechaTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"descripcion programa\">\r\n if ($this->limpiar_canal($valores[2]) != \"\") {\r\n $valores[2] = $this->limpiar_canal($valores[2]);\r\n $descripcionTemp = $valores[2];\r\n } else {\r\n $valores[2] = $descripcionTemp;\r\n }// </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"hora inicio\">\r\n if ($this->limpiar_canal($valores[4]) != \"\") {\r\n $valores[4] = $this->limpiar_canal($valores[4]);\r\n $horaInicioTemp = $valores[4];\r\n } else {\r\n $valores[4] = $horaInicioTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"hora fin\">\r\n if ($this->limpiar_canal($valores[5]) != \"\") {\r\n $valores[5] = $this->limpiar_canal($valores[5]);\r\n $horaFinTemp = $valores[5];\r\n } else {\r\n $valores[5] = $horaFinTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"valores indicadores\">\r\n $valores[8] = $this->limpiar_canal($valores[8]); // indicador\r\n $valores[9] = $this->limpiar_valores($valores[9]); //shr %\r\n $valores[10] = $this->limpiar_valores($valores[10]); //amr\r\n $valores[11] = $this->limpiar_valores($valores[11]); //amr %\r\n $valores[12] = $this->limpiar_valores($valores[12]); //rch\r\n $valores[13] = $this->limpiar_valores($valores[13]); //ats\r\n // </editor-fold>\r\n array_push($buffer, $valores);\r\n }\r\n }\r\n }\r\n } else {\r\n throw new Exception(\"No se pudo cargar el archivo\");\r\n }\r\n break;\r\n case self::tipo_archivo_totales:\r\n if (isset($archivo)) {\r\n foreach ($archivo as $linea) {\r\n $valores = explode(\"|\", $linea);\r\n if ($this->limpiar_valores($valores[0]) == \"Channel\") {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"comprobar estructura de archivo\">\r\n if (\r\n $this->limpiar_valores($valores[0]) != 'Channel' ||\r\n $this->limpiar_valores($valores[1]) != 'Target' ||\r\n $this->limpiar_valores($valores[3]) != 'Date\\Variable' ||\r\n $this->limpiar_valores($valores[4]) != 'SHR %' ||\r\n $this->limpiar_valores($valores[5]) != 'AMR' ||\r\n $this->limpiar_valores($valores[6]) != 'AMR %' ||\r\n $this->limpiar_valores($valores[7]) != 'RCH [Not cons. - TH: 0min.]' ||\r\n $this->limpiar_valores($valores[8]) != 'ATS'\r\n ) {\r\n throw new Exception(\"Estructura de archivo Inválida\");\r\n }\r\n // </editor-fold>\r\n\r\n $lectura = true;\r\n }\r\n if ($lectura) {\r\n /* Verificando que la linea está completa */\r\n if (isset($valores[1])) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Canal\">\r\n if ($this->limpiar_canal($valores[0]) != \"\") {\r\n $valores[0] = $this->limpiar_canal($valores[0]);\r\n $canalTemp = $valores[0];\r\n } else {\r\n $valores[0] = $canalTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Indicador\">\r\n if ($this->limpiar_canal($valores[1]) != \"\") {\r\n $valores[1] = $this->limpiar_canal($valores[1]);\r\n $indicadorTemp = $valores[1];\r\n } else {\r\n $valores[1] = $indicadorTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Fecha\">\r\n if (isset($valores[3])) {\r\n $valores[3] = $this->formatea_fecha($valores[3]);\r\n $fechaTemp = $valores[3];\r\n } else {\r\n $valores[3] = $fechaTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Valores indicador\">\r\n $valores[4] = $this->limpiar_valores($valores[4]);\r\n $valores[5] = $this->limpiar_valores($valores[5]);\r\n $valores[6] = $this->limpiar_valores($valores[6]);\r\n $valores[7] = $this->limpiar_valores($valores[7]);\r\n $valores[8] = $this->limpiar_valores($valores[8]);\r\n // </editor-fold>\r\n array_push($buffer, $valores);\r\n }\r\n }\r\n }\r\n /* Elimino la fila de encabezado */\r\n } else {\r\n throw new Exception(\"No se pudo cargar el archivo\");\r\n }\r\n break;\r\n case self::tipo_archivo_medias_horas:\r\n if (isset($archivo)) {\r\n foreach ($archivo as $linea) {\r\n $valores = explode(\"|\", $linea);\r\n if ($this->limpiar_valores($valores[0]) == \"Month\") {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"comprobar estructura de archivo\">\r\n if (\r\n $this->limpiar_valores($valores[1]) != 'Date' ||\r\n $this->limpiar_valores($valores[2]) != 'Channel' ||\r\n $this->limpiar_valores($valores[3]) != 'Target' ||\r\n $this->limpiar_valores($valores[4]) != 'Day Part\\Variable' ||\r\n $this->limpiar_valores($valores[5]) != 'SHR %' ||\r\n $this->limpiar_valores($valores[6]) != 'AMR' ||\r\n $this->limpiar_valores($valores[7]) != 'AMR %' ||\r\n $this->limpiar_valores($valores[8]) != 'RCH [Not cons. - TH: 0min.]' ||\r\n $this->limpiar_valores($valores[9]) != 'ATS'\r\n ) {\r\n throw new Exception(\"Estructura de archivo Inválida\");\r\n }\r\n // </editor-fold>\r\n\r\n $lectura = true;\r\n }\r\n if ($lectura) {\r\n /* Verificando que la linea está completa */\r\n if (isset($valores[1])) {\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Fecha\">\r\n if (isset($valores[1]) && $valores[1] != \"\") {\r\n $valores[1] = $this->formatea_fecha($valores[1]);\r\n $fechaTemp = $valores[1];\r\n } else {\r\n $valores[1] = $fechaTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Canal\">\r\n if ($this->limpiar_canal($valores[2]) != \"\") {\r\n $valores[2] = $this->limpiar_canal($valores[2]);\r\n $canalTemp = $valores[2];\r\n } else {\r\n $valores[2] = $canalTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Indicador\">\r\n if ($this->limpiar_canal($valores[3]) != \"\") {\r\n $valores[3] = $this->limpiar_canal($valores[3]);\r\n $indicadorTemp = $valores[3];\r\n } else {\r\n $valores[3] = $indicadorTemp;\r\n }\r\n // </editor-fold>\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"Valores indicador\">\r\n $valores[4] = $this->limpiar_valores($valores[4]);\r\n $valores[5] = $this->limpiar_valores($valores[5]);\r\n $valores[6] = $this->limpiar_valores($valores[6]);\r\n $valores[7] = $this->limpiar_valores($valores[7]);\r\n $valores[8] = $this->limpiar_valores($valores[8]);\r\n $valores[9] = $this->limpiar_valores($valores[9]);\r\n // </editor-fold>\r\n array_push($buffer, $valores);\r\n }\r\n }\r\n }\r\n /* Elimino la fila de encabezado */\r\n } else {\r\n throw new Exception(\"No se pudo cargar el archivo\");\r\n }\r\n break;\r\n default :\r\n throw new Exception(\"Operacion invalida\");\r\n break;\r\n }\r\n /* Elimino encabezado de tabla */\r\n unset($buffer[0]);\r\n return $buffer;\r\n }",
"public function procesarDatos()\n {\n $anio = date('Y');\n ////$mes = (int)date('m')-1;\n $mes = (int) date('m')-(int)\\Config::get('constants.constantes.mes_proceso');\n if($mes == 0){\n $anio = $anio - 1;\n $mes = 1;\n } \n\n\n ini_set('max_execution_time', 0);\n ini_set('memory_limit', '-1');\n ini_set('default_socket_timeout', 600);\n ini_set('upload_max_filesize ', '40M');\n ini_set('post_max_size ', '40M');\n\n //$empresas = Empresa::all();\n $procesamientos_sin_procesar = $this->procesamientoArchivoRepository->archivosBajadosSinProcesar($anio, $mes);\n $i=0;\n foreach ($procesamientos_sin_procesar as $procesamiento) {\n if($i<1){\n $PozoService = new PozoService($anio, $procesamiento->codigo, $mes);\n //\\Log::info('init descarga');\n $nombreArchivo = $anio.\"-\".$mes.\"-\".$procesamiento->codigo.\"-ddjj.xlsx\";\n// if(!file_exists(storage_path(\"app\\\\\".$nombreArchivo))){\n if(!file_exists(storage_path(\"app/\".$nombreArchivo))){\n $this->procesamientoRepository->crearProcesamientoEstado($anio, $mes, $procesamiento->codigo, \"No existe archivo\", $procesamiento->empresa_id, $procesamiento->id); \n $this->procesamientoRepository->crearProcesamientoEstado($anio, $mes, $procesamiento->codigo, \"Finalizado\", $procesamiento->empresa_id, $procesamiento->id); \n echo \"no existe archivo \".$nombreArchivo.\"<br>\";\n\n $this->procesamientoArchivoRepository->finalizarProcesamiento($procesamiento->id);\n } else{\n //PROCESAR EL XLS\n $procesamiento_id = $this->procesamientoRepository->crearProcesamientoEstado($anio, $mes, $procesamiento->codigo, \"Inicio Procesamiento Archivo\", $procesamiento->empresa_id, $procesamiento->id); \n\n\t\t\t\t\t//PONGO finalizado aunque no termine de procesar\n $this->procesamientoArchivoRepository->finalizarProcesamiento($procesamiento->id);\n //para q no quede colgado\n\t\t\t\t\t\n $this->procesamientoRepository->procesar($nombreArchivo, $anio, $mes, $procesamiento->empresa_id, $procesamiento_id);\n\n $this->procesamientoRepository->crearProcesamientoEstado($anio, $mes, $procesamiento->codigo, \"Finalizado\", $procesamiento->empresa_id, $procesamiento->id); \n\n ////$this->procesamientoArchivoRepository->finalizarProcesamiento($procesamiento->id);\n \n echo \"finalizado \".$nombreArchivo.\"<br>\";\n\n $i++;\n } \n }\n }\n\n if($i==0)\n echo \"<br>No quedar archivos por procesar\";\n else\n echo \"Se procesaron \".$i.\" archivos. Aun quedan archivos para procesar\";\n }",
"public function __construct()\n {\n $this->setColumnsList(array(\n 'tipoId'=>'tipoId',\n 'tipo'=>'tipo',\n 'tipo_eu'=>'tipoEu',\n 'tipo_es'=>'tipoEs',\n 'createdOn'=>'createdOn',\n 'updateOn'=>'updateOn',\n ));\n\n $this->setColumnsMeta(array(\n 'tipo'=> array('ml'),\n ));\n\n $this->setMultiLangColumnsList(array(\n 'tipo'=>'Tipo',\n ));\n\n $this->setAvailableLangs(array('es', 'eu'));\n\n $this->setParentList(array(\n ));\n\n $this->setDependentList(array(\n 'IncidenciasIbfk2' => array(\n 'property' => 'Incidencias',\n 'table_name' => 'Incidencias',\n ),\n ));\n\n\n $this->setOnDeleteSetNullRelationships(array(\n 'incidencias_ibfk_2'\n ));\n\n $this->_defaultValues = array(\n 'tipo' => '',\n 'tipoEu' => '',\n 'tipoEs' => '',\n 'createdOn' => '0000-00-00 00:00:00',\n 'updateOn' => 'CURRENT_TIMESTAMP',\n );\n\n $this->_initFileObjects();\n parent::__construct();\n }",
"public function __construct(){\n require_once(IMPORT_AVALIACAO);\n\n //Import da classe DAO, para inserir no BD\n require_once(IMPORT_AVALIACAO_DAO);\n }",
"public function persist() {\n\n $classenta = new cl_assenta();\n\n $classenta->h16_regist = $this->getMatricula();\n $classenta->h16_assent = $this->getTipoAssentamento();\n $classenta->h16_dtconc = ($this->getDataConcessao() instanceof DBDate ? $this->getDataConcessao()->getDate() : $this->getDataConcessao());\n $classenta->h16_histor = $this->getHistorico();\n $classenta->h16_nrport = $this->getCodigoPortaria();\n $classenta->h16_atofic = $this->getDescricaoAto();\n $classenta->h16_quant = $this->getDias();\n $classenta->h16_perc = ($this->getPercentual()) ? $this->getPercentual() : '0';\n $classenta->h16_dtterm = ($this->getDataTermino() instanceof DBDate ? $this->getDataTermino()->getDate() : $this->getDataTermino());\n $classenta->h16_hist2 = $this->getSegundoHistorico();\n $classenta->h16_login = ($this->getLoginUsuario()) ? $this->getLoginUsuario() : '1';\n $classenta->h16_dtlanc = ($this->getDataLancamento() instanceof DBDate ? $this->getDataLancamento()->getDate() : $this->getDataLancamento());\n $classenta->h16_conver = ((bool)(int)$this->isConvertido()) == false ? 'false' : 'true';\n $classenta->h16_anoato = $this->getAnoPortaria();\n $classenta->h16_hora = $this->getHora();\n\n if(empty($this->iCodigo)) {\n\n $classenta->incluir(null);\n\n if ($classenta->erro_status == \"0\") {\n return $classenta->erro_msg;\n }\n\n $this->setCodigo($classenta->h16_codigo);\n } else {\n\n $classenta->h16_codigo = $this->getCodigo();\n $classenta->alterar($this->getCodigo());\n\n if ($classenta->erro_status == \"0\") {\n return $classenta->erro_msg;\n }\n }\n\n return $this;\n }",
"function loadAndInsert($filename,$dbObject,$extraData,$tag)\n{\n $db = $dbObject->getConnection();\n $row = 1;\n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 7000, \",\")) !== FALSE) {\n if ($row == 1) {\n $row++;\n } else {\n $input = [];\n $num = count($data);\n for ($c=0; $c < $num; $c++) {\n $temp = [];\n $temp['general'] = $data[$c];\n $input[] = $temp;\n }\n //add extra data\n foreach ($extraData as $temp) {\n $input[] = $temp;\n }\n // insert in DB\n doInsert($dbObject, $tag, $input,$db);\n }\n }\n }\n $db = null;\n fclose($handle);\n}",
"function importar_requerimientos_operaciones(){\n if ($this->input->post()) {\n $post = $this->input->post();\n $proy_id = $post['proy_id']; /// proy id\n $pfec_id = $post['pfec_id']; /// pfec id\n $com_id = $post['com_id']; /// com id\n \n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// DATOS DEL PROYECTO\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// DATOS DE LA FASE ACTIVA\n\n $monto_asig=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],1);\n $monto_prog=$this->model_ptto_sigep->suma_ptto_accion($proyecto[0]['aper_id'],2);\n $saldo=round(($monto_asig[0]['monto']-$monto_prog[0]['monto']),2);\n\n $tipo = $_FILES['archivo']['type'];\n $tamanio = $_FILES['archivo']['size'];\n $archivotmp = $_FILES['archivo']['tmp_name'];\n\n $filename = $_FILES[\"archivo\"][\"name\"];\n $file_basename = substr($filename, 0, strripos($filename, '.'));\n $file_ext = substr($filename, strripos($filename, '.'));\n $allowed_file_types = array('.csv');\n if (in_array($file_ext, $allowed_file_types) && ($tamanio < 90000000)) {\n\n $lineas = file($archivotmp);\n if($this->suma_monto_total($lineas)<=$saldo){\n /*------------------- Migrando ---------------*/\n $lineas = file($archivotmp);\n $i=0;\n $nro=0;\n //Recorremos el bucle para leer línea por línea\n foreach ($lineas as $linea_num => $linea){ \n if($i != 0){\n $datos = explode(\";\",$linea);\n \n if(count($datos)==21){\n $cod_ope = (int)$datos[0]; //// Codigo Operacion\n $cod_partida = (int)$datos[1]; //// Codigo partida\n $verif_com_ope=$this->model_producto->verif_componente_operacion($com_id,$cod_ope);\n $par_id = $this->minsumos->get_partida_codigo($cod_partida); //// DATOS DE LA FASE ACTIVA\n\n $detalle = utf8_encode(trim($datos[3])); //// descripcion\n $unidad = utf8_encode(trim($datos[4])); //// Unidad\n $cantidad = (int)$datos[5]; //// Cantidad\n $unitario = (float)$datos[6]; //// Costo Unitario\n $total = (float)$datos[7]; //// Costo Total\n if(!is_numeric($unitario)){\n if($cantidad!=0){\n $unitario=round(($total/$cantidad),2); \n }\n }\n\n $var=8;\n for ($i=1; $i <=12 ; $i++) {\n $m[$i]=(float)$datos[$var]; //// Mes i\n if($m[$i]==''){\n $m[$i]=0;\n }\n $var++;\n }\n\n $observacion = utf8_encode(trim($datos[20])); //// Observacion\n\n if(count($verif_com_ope)==1 & count($par_id)!=0 & $cod_partida!=0){\n $nro++;\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store = array( \n 'ins_codigo' => $this->session->userdata(\"name\").'/REQ/'.$this->gestion, /// Codigo Insumo\n 'ins_fecha_requerimiento' => date('d/m/Y'), /// Fecha de Requerimiento\n 'ins_detalle' => strtoupper($detalle), /// Insumo Detalle\n 'ins_cant_requerida' => round($cantidad,0), /// Cantidad Requerida\n 'ins_costo_unitario' => $unitario, /// Costo Unitario\n 'ins_costo_total' => $total, /// Costo Total\n 'ins_tipo' => 1, /// Ins Tipo\n 'ins_unidad_medida' => strtoupper($unidad), /// Insumo Unidad de Medida\n 'par_id' => $par_id[0]['par_id'], /// Partidas\n 'ins_observacion' => strtoupper($observacion), /// Observacion\n 'fecha_creacion' => date(\"d/m/Y H:i:s\"),\n 'fun_id' => $this->session->userdata(\"fun_id\"), /// Funcionario\n 'aper_id' => $proyecto[0]['aper_id'], /// aper id\n 'num_ip' => $this->input->ip_address(), \n 'nom_ip' => gethostbyaddr($_SERVER['REMOTE_ADDR']),\n );\n $this->db->insert('insumos', $data_to_store); ///// Guardar en Tabla Insumos \n $ins_id=$this->db->insert_id();\n\n /*----------------------------------------------------------*/\n $data_to_store2 = array( ///// Tabla InsumoProducto\n 'prod_id' => $verif_com_ope[0]['prod_id'], /// act_id\n 'ins_id' => $ins_id, /// ins_id\n );\n $this->db->insert('_insumoproducto', $data_to_store2);\n /*----------------------------------------------------------*/\n $gestion_fase=$fase[0]['pfec_fecha_inicio'];\n\n /*---------------- Recorriendo Gestiones de la Fase -----------------------*/\n for ($g=$fase[0]['pfec_fecha_inicio']; $g <=$fase[0]['pfec_fecha_fin'] ; $g++){\n $data_to_store = array( \n 'ins_id' => $ins_id, /// Id Insumo\n 'g_id' => $g, /// Gestion\n 'insg_monto_prog' => $total, /// Monto programado\n );\n $this->db->insert('insumo_gestion', $data_to_store); ///// Guardar en Tabla Insumo Gestion\n $insg_id=$this->db->insert_id();\n\n $ptto_fase_gestion = $this->model_faseetapa->fase_gestion($fase[0]['id'],$g); //// DATOS DE LA FASE GESTION\n $fuentes=$this->model_faseetapa->fase_presupuesto_id($ptto_fase_gestion[0]['ptofecg_id']);\n\n if(count($fuentes)==1){\n /*------------------- Guardando Fuente Financiamiento ------*/\n $query=$this->db->query('set datestyle to DMY');\n $data_to_store3 = array( \n 'insg_id' => $insg_id, /// Id Insumo gestion\n 'ifin_monto' => $total, /// Monto programado\n 'ifin_gestion' => $g, /// Gestion\n 'ffofet_id' => $fuentes[0]['ffofet_id'], /// ffotet id\n 'ff_id' => $fuentes[0]['ff_id'], /// ff id\n 'of_id' => $fuentes[0]['of_id'], /// ff id\n 'nro_if' => 1, /// Nro if\n );\n $this->db->insert('insumo_financiamiento', $data_to_store3); ///// Guardar en Tabla Insumo Financiamiento\n $ifin_id=$this->db->insert_id();\n\n for ($p=1; $p <=12 ; $p++) { \n if($m[$p]!=0 & is_numeric($unitario)){\n $data_to_store4 = array( \n 'ifin_id' => $ifin_id, /// Id Insumo Financiamiento\n 'mes_id' => $p, /// Mes \n 'ipm_fis' => $m[$p], /// Valor mes\n );\n $this->db->insert('ifin_prog_mes', $data_to_store4); ///// Guardar en Tabla Insumo Financiamiento Programado Mes\n }\n }\n /*-----------------------------------------------------------*/ \n }\n }\n\n }\n\n }\n\n }\n $i++;\n }\n\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'');\n /*--------------------------------------------*/\n }\n else{\n $this->session->set_flashdata('danger','COSTO PROGRAMADO A SUBIR ES MAYOR AL SALDO POR PROGRAMAR. VERIFIQUE PLANTILLA A MIGRAR');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n } \n elseif (empty($file_basename)) {\n $this->session->set_flashdata('danger','POR FAVOR SELECCIONE ARCHIVO CSV');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n elseif ($filesize > 100000000) {\n $this->session->set_flashdata('danger','TAMAÑO DEL ARCHIVO');\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n } \n else {\n $mensaje = \"SOLO SE PERMITEN ESTOS ARCHIVOS : \" . implode(', ', $allowed_file_types);\n $this->session->set_flashdata('danger',$mensaje);\n redirect('admin/prog/list_prod/1/'.$pfec_id.'/'.$proy_id.'/'.$com_id.'/false');\n }\n\n } else {\n show_404();\n }\n }",
"function extraerConversacion(){\n $fp = fopen(\"../conversacion/conversacion.txt\",\"rb\");\n $conversacion = new Conversacion(); \n $numeroLinea = 0;\n $listaConversaciones = array();\n while (!feof($fp)){\n $linea = fgets($fp);\n $linea = trim($linea);\n if($numeroLinea == 0){\n $conversacion->setId($linea);\n }\n else{\n if($linea != \"\"){\n $conversacion->agregarMensaje($linea);\n }\n }\n $numeroLinea++;\n //. strlen(trim($linea)), strlen logitud de la cadena, trim borra las cadenas vacias al principio y al final\n\n if($linea == \"\"){\n // echo \" aqui empieza una nueva conversacion <br>\"; \n //$listaConversaciones debo agregarle la $conversacion\n array_push($listaConversaciones,$conversacion);\n $conversacion = new Conversacion(); \n $numeroLinea = 0;\n }\n }\n array_push($listaConversaciones,$conversacion);\n return $listaConversaciones;\n\n fclose($fp);\n \n }",
"protected function entidades(){\n\t\tfor($i=1; $i < 6;$i++) $niveis[$i] = \"nivel de busca {$i}\";\n\t\t$this->visualizacao->nivel = VComponente::montar(VComponente::caixaCombinacao, 'nivel', isset($_POST['nivel']) ? $_POST['nivel'] : 1 ,null,$niveis);\n\t\t$this->visualizacao->filtro = isset($_POST['filtro']) ? $_POST['filtro'] : null;\n\t\t$this->visualizacao->listagens = false;\n\t\tif(!$this->visualizacao->filtro) return;\n\t\t$d = dir(\".\");\n\t\t$negocios = new colecao();\n\t\t$controles = new colecao();\n\t\twhile (false !== ($arquivo = $d->read())) {\n\t\t\tif( is_dir($arquivo) && ($arquivo{0} !== '.') ){\n\t\t\t\tif(is_file($arquivo.'/classes/N'.ucfirst($arquivo).'.php')){\n\t\t\t\t\t$negocio = 'N'.ucfirst($arquivo);\n\t\t\t\t\t$obNegocio = new $negocio();\n\t\t\t\t\tif( $obNegocio instanceof negocioPadrao ) {\n\t\t\t\t\t\t$ordem[$arquivo] = array(\n\t\t\t\t\t\t\t'nome'=>$obNegocio->pegarInter()->pegarNome(),\n\t\t\t\t\t\t\t'caminho'=>$arquivo.'/classes/N'.ucfirst($arquivo).'.php'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$negocios->$arquivo = $obNegocio;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t\tasort($ordem);\n\t\t$this->visualizacao->ordem = $ordem;\n\t\t$listagens = array();\n\t\tforeach($ordem as $idx => $arquivo){\n\t\t\t$obNegocio = $negocios->pegar($idx);\n\t\t\t$nome['controle'] = definicaoEntidade::controle($obNegocio, 'verPesquisa');\n\t\t\tif($this->exibirListagem($arquivo)){\n\t\t\t\t$colecao = $obNegocio->pesquisaGeral($this->pegarFiltro(),$this->pegarPagina(),isset($_POST['nivel']) ? $_POST['nivel'] : 1);\n\t\t\t\tcall_user_func_array(\"{$nome['controle']}::montarListagem\", array($this->visualizacao,$colecao,$this->pegarPagina(),$nome['controle']));\n\t\t\t\t$this->visualizacao->listagem->passarControle($nome['controle']);\n\t\t\t\tif($colecao->contarItens()){\n\t\t\t\t\t$listagens[$idx]['listagem'] = $this->visualizacao->listagem;\n\t\t\t\t\t$listagens[$idx]['ocorrencias'] = $colecao->contarItens();\n\t\t\t\t\t$listagens[$idx]['nome'] = $arquivo['nome'];\n\t\t\t\t\t$listagens[$idx]['controlePesquisa'] = $nome['controle'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tunset($this->visualizacao->listagem);\n\t\t$this->visualizacao->listagens = $listagens;\n\t}",
"public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sSqlSubsidio = \"select c16_mes, \";\n $sSqlSubsidio .= \" c16_ano,\";\n $sSqlSubsidio .= \" c16_subsidiomensal,\";\n $sSqlSubsidio .= \" c16_subsidioextraordinario,\";\n $sSqlSubsidio .= \" z01_nome, \";\n $sSqlSubsidio .= \" z01_cgccpf \";\n $sSqlSubsidio .= \" from padsigapsubsidiosvereadores \"; \n $sSqlSubsidio .= \" inner join cgm on z01_numcgm = c16_numcgm \"; \n $sSqlSubsidio .= \" where c16_ano = {$iAno} \";\n $sSqlSubsidio .= \" and c16_mes <= $iMes\"; \n $sSqlSubsidio .= \" and c16_instit = {$sListaInstit}\";\n $sSqlSubsidio .= \" order by c16_ano, c16_mes\";\n $rsSubsidio = db_query($sSqlSubsidio); \n $iTotalLinhas = pg_num_rows($rsSubsidio);\n for ($i = 0; $i < $iTotalLinhas; $i++) {\n \n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n $oSubSidio = db_utils::fieldsMemory($rsSubsidio, $i);\n \n $oRetorno = new stdClass();\n $oRetorno->subCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oRetorno->subMesAnoMovimento = $sDiaMesAno;\n $iUltimoDiaMes = cal_days_in_month(CAL_GREGORIAN, $oSubSidio->c16_mes, $oSubSidio->c16_ano); \n $oRetorno->subMesAnoReferencia = $oSubSidio->c16_ano.\"-\".str_pad($oSubSidio->c16_mes, 2, \"0\", STR_PAD_LEFT).\"-\".\n str_pad($iUltimoDiaMes, 2, \"0\", STR_PAD_LEFT);\n $oRetorno->subNomeVereador = substr($oSubSidio->z01_nome, 0, 80); \n $oRetorno->subCPF = str_pad($oSubSidio->z01_cgccpf, 11, \"0\", STR_PAD_LEFT); \n $oRetorno->subMensal = $this->corrigeValor($oSubSidio->c16_subsidiomensal, 13); \n $oRetorno->subExtraordinario = $this->corrigeValor($oSubSidio->c16_subsidioextraordinario, 13); \n $oRetorno->subTotal = $this->corrigeValor(($oSubSidio->c16_subsidioextraordinario+\n $oSubSidio->c16_subsidiomensal), 13);\n array_push($this->aDados, $oRetorno); \n }\n return true;\n }",
"public function uploadNormaHargaBorong($params = array())\n {\n $data = array();\n $datachk = array();\n $newdata_region = array();\n $total_rec = $ins_rec = $lastBaCode = $update_rec = 0;\n \n if ($_FILES[file][size] > 0) {\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************\n //1. ****************** Check BA dari CSV FILE\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n $arrba = array();\n do {\n if (($datachk[0])&&($total_rec > 1)) {\n array_push($arrba,$datachk[1]);\n }\n $total_rec++;\n } while($datachk = fgetcsv($handle,1000,\";\",\"'\"));\n $arrbadis = array_values(array_unique($arrba, SORT_REGULAR)); //variabel array list BA pada CSV\n \n //2. ****************** Baca Urutan Upload dari T_SEQ\n $sqlCurTask=\"SELECT SEQ_NUM FROM T_SEQ WHERE TABLE_NAME='TN_HARGA_BORONG'\";\n $seqNum = $this->_db->fetchOne($sqlCurTask);\n $sqlSeq=\"SELECT * FROM T_SEQ WHERE SEQ_NUM < ($seqNum) ORDER BY SEQ_NUM, TASK_NAME\";\n $rows = $this->_db->fetchAll($sqlSeq);\n if (!empty($rows)) {\n foreach ($rows as $idx => $row) { \n $tablechk = $row['REMARKS'];\n //2.1 ****************** get BA CODE yang sudah dimasukan pada table di awal sequence\n $sqlba = \"SELECT DISTINCT BA_CODE FROM \".$row['TABLE_NAME'];\n $arrnormaba = array();\n $arrlockba = array();\n $rowsba = $this->_db->fetchAll($sqlba);\n foreach ($rowsba as $idxba => $rowba) {\n array_push($arrnormaba,$rowba['BA_CODE']); //variabel array list BA pada masing2 norma\n //2.2 ****************** get STATUS LOCK masing2 BA CODE di T_SEQ\n $sqlba1 = \"SELECT STATUS FROM T_SEQ_CHECK WHERE BA_CODE='\".$rowba['BA_CODE'].\"' AND TASK_NAME='\".$row['TABLE_NAME'].\"'\";\n \n $arrlockba[$rowba['BA_CODE']] = $this->_db->fetchOne($sqlba1);\n } \n $arrNotFound=array();\n for($x=0;$x<count($arrbadis);$x++){\n if(!in_array($arrbadis[$x],$arrnormaba)){ //check apakah data ba csv ada di data ba norma?\n $arrNotFound[]=$arrbadis[$x];\n }elseif($arrlockba[$arrbadis[$x]]==\"LOCKED\"){\n $arrNotFound[]=$arrbadis[$x];\n }\n }\n if($arrNotFound) break;\n }\n }\n $arrNotFound =array();\n if($arrNotFound){\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'ba_notfound' => implode(\",\",$arrNotFound),\n 'task_err' => $tablechk\n );\n return $return;\n }\n //********************************* VALIDASI SEQUENCE UPLOAD DATA BUDGET ***************************************//\n //get the csv file\n $file = $_FILES[file][tmp_name];\n $handle = fopen($file,\"r\");\n \n $total_rec = 0;\n \n //loop through the csv file and insert into database\n do {\n if (($data[0])&&($total_rec > 1)) {\n \n if ($lastBaCode <> addslashes($data[0])){\n /*\n try {\n //remove data\n $sqlDelete = \"\n DELETE FROM TN_HARGA_BORONG \n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n \";\n //log file penghapusan data\n $this->_global->deleteDataLogFile($sqlDelete); \n $this->_db->query($sqlDelete); \n } catch (Exception $e) {\n \n }*/\n //get region code\n $region_code = $this->_formula->get_RegionCode(addslashes($data[0]));\n \n $newdata_region[] = $region_code;\n } \n \n //cek data\n $sql = \"\n SELECT COUNT(*) \n FROM TN_HARGA_BORONG\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND ACTIVITY_CODE = TRIM('\".addslashes($data[1]).\"')\n AND ACTIVITY_CLASS = TRIM('\".addslashes($data[2]).\"')\n \";\n $count = $this->_db->fetchOne($sql);\n if ($count == 0) {\n try {\n //insert data\n $sql = \"\n INSERT INTO TN_HARGA_BORONG\n (PERIOD_BUDGET, REGION_CODE, BA_CODE, ACTIVITY_CODE, ACTIVITY_CLASS, SPESIFICATION, PRICE, INSERT_USER, INSERT_TIME, PRICE_SITE)\n VALUES (\n TO_DATE('{$this->_period}','DD-MM-RRRR'),\n '\".$region_code.\"',\n TRIM('\".addslashes($data[0]).\"'),\n TRIM('\".addslashes($data[1]).\"'),\n TRIM('\".addslashes($data[2]).\"'),\n '\".addslashes($data[3]).\"',\n REPLACE('\".addslashes($data[4]).\"', ',', ''),\n '{$this->_userName}',\n SYSDATE,\n REPLACE('\".addslashes($data[5]).\"', ',', '')\n )\n \";\n $this->_db->query($sql);\n $this->_db->commit();\n $ins_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA HARGA BORONG', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA HARGA BORONG', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n // cek apakah data non-aktif\n $sql = \"\n SELECT COUNT(*) \n FROM TN_HARGA_BORONG\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"' )\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND ACTIVITY_CODE = TRIM('\".addslashes($data[1]).\"')\n AND ACTIVITY_CLASS = TRIM('\".addslashes($data[2]).\"')\n AND DELETE_USER IS NULL\n \";\n $count = $this->_db->fetchOne($sql);\n \n if ($count == 0) {\n // update data menjadi aktif jika sebelumnya telah dinon-aktifkan\n try {\n $sql = \"\n UPDATE TN_HARGA_BORONG\n SET PRICE = REPLACE('\".addslashes($data[4]).\"', ',', ''),\n PRICE_SITE = REPLACE('\".addslashes($data[5]).\"', ',', ''),\n SPESIFICATION = '\".addslashes($data[3]).\"',\n UPDATE_USER = '{$this->_userName}',\n UPDATE_TIME = SYSDATE,\n DELETE_USER = NULL,\n DELETE_TIME = NULL\n WHERE BA_CODE = TRIM('\".addslashes($data[0]).\"')\n AND to_char(PERIOD_BUDGET,'DD-MM-RRRR')= '{$this->_period}'\n AND ACTIVITY_CODE = TRIM('\".addslashes($data[1]).\"')\n AND ACTIVITY_CLASS = TRIM('\".addslashes($data[2]).\"')\n \";\n $this->_db->query($sql);\n $this->_db->commit(); \n $update_rec++;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA SUCCESS', 'NORMA HARGA BORONG', '', '');\n } catch (Exception $e) {\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n \n //log DB\n $this->_global->insertLog('UPLOAD DATA FAILED', 'NORMA HARGA BORONG', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n }\n }else{\n //menampilkan data yang tidak ditambahkan\n $data_error[] = $total_rec;\n }\n }\n $lastBaCode = addslashes($data[0]);\n }\n $total_rec++;\n } while ($data = fgetcsv($handle,1000,\",\",\"'\"));\n //\n $return = array(\n 'status' => 'done',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }else{\n $return = array(\n 'status' => 'failed',\n 'total' => $total_rec - 2,\n 'inserted' => $ins_rec,\n 'updated' => $update_rec,\n 'data_failed' => $data_error\n );\n }\n \n // ********************************************** HITUNG SEMUA HASIL UPLOAD **********************************************\n // Sabrina / 2013-08-23\n \n if (!empty($newdata_region)) {\n try {\n $auto_calc = new Application_Model_NormaHargaBorong();\n \n foreach ($newdata_region as $idx => $region_code) {\n $auto_calc->calculateAllItem($region_code);\n }\n \n //log DB\n $this->_global->insertLog('UPDATE SUCCESS', 'NORMA HARGA BORONG', '', '');\n } catch (Exception $e) {\n //log DB\n $this->_global->insertLog('UPDATE FAILED', 'NORMA HARGA BORONG', '', $e->getCode());\n \n //error log file\n $this->_global->errorLogFile($e->getMessage());\n \n //return value\n $result = false;\n } \n } \n // ********************************************** END OF HITUNG SEMUA HASIL UPLOAD **********************************************\n \n return $return;\n }",
"abstract public function loadData();",
"public function __construct(){\r\n require_once(IMPORT_CLIENTE);\r\n\r\n //Import da classe nivelDAO, para inserir no BD\r\n require_once(IMPORT_CLIENTE_DAO);\r\n }",
"public function run()\n {\n $file = fopen(\"./public/migrasi/blok.csv\",\"r\");\n\n\t while(! feof($file)){\n\t \t$csv_line = fgetcsv($file);\n\t \tif ( $csv_line != \"\" ) {\n\t \t\tif ( $csv_line[1] != NULL ){\n\t \t\t\t$cluster = Modules\\Project\\Entities\\ProjectKawasan::where(\"cluster_id\",$csv_line[1])->get();\n\t \t\t\tif ( count($cluster) > 0 ){\n\t \t\t\t\t$cluster_id = $cluster->first()->id;\n\t \t\t\t}else{\n\t \t\t\t\t$cluster_id = NULL;\n\t \t\t\t}\n\t \t\t}else{\n\t \t\t\t$cluster_id = NULL;\n\t \t\t}\n\n \t\t\t\t$newblok = new Modules\\Project\\Entities\\Blok;\n \t\t\t\t$newblok->project_id = $csv_line[0];\n\t\t\t\t$newblok->project_kawasan_id = $cluster_id;\n\t\t\t\t$newblok->name = $csv_line[2];\n\t\t\t\t$newblok->luas = 0;\n\t\t\t\t$newblok->kode = $csv_line[3];\n\t\t\t\t$newblok->description = \"Migration from Erem based export at 18 Oct 2018\";\n\t\t\t\t$newblok->created_at = date(\"Y-m-d H:i:s\");\n\t\t\t\t$newblok->block_id = $csv_line[4];\n\t\t\t\t$newblok->save();\n\t \t\t\t\t\t \t\t\n\t \t\t}\t \t\t\t\n\t \t}\n\n fclose($file);\n }",
"public function crear() {\n /**\n * guardamos la consulta en $sql\n * ejecutamos la consulta en php \n * asignamos el id del objeto = al ultimo id que añadimos a la bd, asi coincidiran el id objeto con tupla\n * lista de atributos a introducir valores de atributos a introducir\n * formato insertar datos INSERT INTO NombreTabla (NombreAtributo1, NombreAtributo2) VALUES (ValorAtributo1, ValorAtributo2)\n */\n // para acceder a una cosntante de la clase NombreClase::NOMBRECONSTANTE\n \n try {\n $sql=\"INSERT INTO \".Bebidas::TABLA[0].\" (nombre, descripcion, tipo, estado, foto) VALUES ('$this->nombre', '$this->descripcion', '$this->tipo', '$this->estado', '$this->foto')\";\n $this->conexion->query($sql);\n $this->__set(\"id_bebida\", $this->conexion->insert_id);\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n }",
"public function AdicionarConvenio($file, $id, $nomeEmpresa,){\n $formatP = array(\"pdf\");\n\n \n $extensao = pathinfo($file['name'], PATHINFO_EXTENSION);\n\n // echo \"$extensao\";\n\n if(in_array($extensao,$formatP)){\n // $caminho = \"../docs/\".$tipo.\"/\";\n $temp = $file['tmp_name'];\n\n $this->PrepraDiretorioDoc($id);\n\n $inserirDOC = \"UPDATE empresa set DOC_Convenio = :nomeArquivo WHERE CD_Empresa = :idEmpresa\";\n $caminho = \"C:/xampp/htdocs/projeto_final/startechlds/docs/DOC_Convenio/\";\n $doc = \"DOC_Curriculo\";\n\n $nomeArquivo = $nomeEmpresa.\"_Convenio\";\n if(move_uploaded_file($temp, $caminho.$nomeArquivo.\".pdf\")){\n try{\n $conn = new ConexaoBD();\n $conect = $conn->ConDB();\n\n $result = $conect->prepare($inserirDOC);\n $result->bindParam(':nomeArquivo', $nomeArquivo, PDO::PARAM_STR);\n $result->bindParam(':idEmpresa', $id, PDO::PARAM_INT);\n $result->execute();\n\n \n\n $funcionou = $result->rowCount();\n \n \n if($funcionou > 0){\n return true;\n }\n else{\n // echo\"não retornou linha nenhuma\";\n return false;\n }\n }\n catch(PDOException $e){\n echo \"erro de PDO \".$e->getMessage();\n }\n\n }\n else{\n echo\"erro ao mover para pasta<br/>\";\n // var_dump(move_uploaded_file($temp, $this->caminhoCurriculo.$nomeAluno.\".pdf\"));\n }\n\n }\n else{\n echo \"Formato inválido\";\n }\n\n }",
"public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}",
"function readFile(){\n $this->setHeaders();\n $this->readContent();\n\n }",
"public function ambilData() {\n // read file & get the data (file_get_contents)\n $data = file_get_contents($this->file);\n $this->daftar_barang = json_decode($data, true);\n $this->daftar_barang = array_values($this->daftar_barang);\n }",
"public function postCargarInformacion(){\n\t\t$fecha = date(\"Y-d-m H:i:s\");\n\t\t$registro = DB::SELECT(\"SELECT ident_current('MODBID_INFORMACIONPUBLIC') AS [LastID_1]\");\t\t\n\t\t$id_foto = (($registro[0]->LastID_1)+1).\".jpg\";\n\t\t\t\t\n\t\tDB::table('MODBID_INFORMACIONPUBLIC')->insert(\n\t\t \tarray(\n\t\t \t\t'id_usuario' => Auth::user()->id,\t\t \t\t\n\t\t \t\t'titulo' => Input::get('titulo'),\n\t\t \t\t'foto' => $id_foto,\n\t\t \t\t'tipo' => Input::get('tipo'),\n\t\t \t\t'texto' => Input::get('texto'),\t\t\t \t\t\n\t\t \t\t'created_at' => $fecha,\n\t \t\t\t'updated_at' => $fecha,\n\t \t\t\t'fecha_noticia' => Input::get('fecha_info')\n\n\t\t \t)\n\t\t);\n\n\t\t$path_foto = public_path().'/assets/bid/informacion/'.(($registro[0]->LastID_1)+1).\"/\";\n\t\tInput::file('foto')->move($path_foto,$id_foto);\n\t\treturn Redirect::to('vista1_bid')->with('status', 'ok_estatus');\n\t}",
"public function getFile($conn){\n\t\t//preparo lo statement che mi ricava tutte le informazioni \n\t\t//dalla tabella Filmato_Presentazione.\n\t\t$sth = $conn->prepare(\"select * from Filmato_Presentazione\");\n\t\t$sth->execute();\n\t\treturn $sth; \n\t}",
"public function gerarDados() {\n \n if (empty($this->sDataInicial)) {\n throw new Exception(\"Data inicial nao informada!\");\n }\n \n if (empty($this->sDataFinal)) {\n throw new Exception(\"Data final não informada!\");\n }\n /**\n * Separamos a data do em ano, mes, dia\n */\n list($iAno, $iMes, $iDia) = explode(\"-\",$this->sDataFinal);\n \n $oInstituicao = db_stdClass::getDadosInstit(db_getsession(\"DB_instit\"));\n $sListaInstit = db_getsession(\"DB_instit\");\n $sWhere = \"o70_instit in ({$sListaInstit})\";\n $iAnoUsu = (db_getsession(\"DB_anousu\")-1);\n $sDataIni = $iAnoUsu.\"-01-01\";\n $sDataFim = $iAnoUsu.\"-12-31\";\n $sSqlBalAnterior = db_receitasaldo(11, 1, 3, true, $sWhere, $iAnoUsu, $sDataIni, $sDataFim, true);\n \n $sSqlAgrupado = \"select case when fc_conplano_grupo($iAnoUsu, substr(o57_fonte,1,1) || '%', 9000 ) is false \"; \n $sSqlAgrupado .= \" then substr(o57_fonte,2,14) else substr(o57_fonte,1,15) end as o57_fonte, \";\n $sSqlAgrupado .= \" o57_descr, \";\n $sSqlAgrupado .= \" saldo_inicial, \";\n $sSqlAgrupado .= \" saldo_arrecadado_acumulado, \"; \n $sSqlAgrupado .= \" x.o70_codigo, \";\n $sSqlAgrupado .= \" x.o70_codrec, \";\n $sSqlAgrupado .= \" coalesce(o70_instit,0) as o70_instit, \";\n $sSqlAgrupado .= \" fc_nivel_plano2005(x.o57_fonte) as nivel \"; \n $sSqlAgrupado .= \" from ({$sSqlBalAnterior}) as x \";\n $sSqlAgrupado .= \" left join orcreceita on orcreceita.o70_codrec = x.o70_codrec and o70_anousu={$iAnoUsu} \";\n $sSqlAgrupado .= \" order by o57_fonte \"; \n $rsBalancete = db_query($sSqlAgrupado);\n $iTotalLinhas = pg_num_rows($rsBalancete);\n for ($i = 1; $i < $iTotalLinhas; $i++) {\n \n $oReceita = db_utils::fieldsMemory($rsBalancete, $i);\n $sDiaMesAno = \"{$iAno}-\".str_pad($iMes, 2, \"0\", STR_PAD_LEFT).\"-\".str_pad($iDia, 2, \"0\", STR_PAD_LEFT);\n \n $oReceitaRetorno = new stdClass();\n \n $oReceitaRetorno->braCodigoEntidade = str_pad($this->iCodigoTCE, 4, \"0\", STR_PAD_LEFT);\n $oReceitaRetorno->braMesAnoMovimento = $sDiaMesAno;\n $oReceitaRetorno->braContaReceita = str_pad($oReceita->o57_fonte, 20, 0, STR_PAD_RIGHT);\n $oReceitaRetorno->braCodigoOrgaoUnidadeOrcamentaria = str_pad($oInstituicao->codtrib, 4, \"0\", STR_PAD_LEFT);\n $nSaldoInicial = $oReceita->saldo_inicial;\n $oReceita->saldo_inicial = str_pad(number_format(abs($oReceita->saldo_inicial),2,\".\",\"\"), 13,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaOrcada = $oReceita->saldo_inicial;\n $oReceita->saldo_arrecadado_acumulado = str_pad(number_format(abs($oReceita->saldo_arrecadado_acumulado) \n ,2,\".\",\"\"), 12,'0', STR_PAD_LEFT);\n $oReceitaRetorno->braValorReceitaRealizada = $oReceita->saldo_arrecadado_acumulado;\n $oReceitaRetorno->braCodigoRecursoVinculado = str_pad($oReceita->o70_codigo, 4, \"0\", STR_PAD_LEFT); \n $oReceitaRetorno->braDescricaoContaReceita = substr($oReceita->o57_descr, 0, 255); \n $oReceitaRetorno->braTipoNivelConta = ($oReceita->o70_codrec==0?'S':'A'); \n $oReceitaRetorno->braNumeroNivelContaReceita = $oReceita->nivel;\n $this->aDados[] = $oReceitaRetorno; \n }\n return true;\n }",
"public function executeProcesarfile(sfWebRequest $request)\n {\n // Redirige al inicio si no tiene acceso\n if (!$this->getUser()->getGuardUser()->getIsSuperAdmin())\n $this->redirect('ingreso');\n\n $archivo = Doctrine_Core::getTable('Actualizacionestrat')->find(array($request['id']));\n // $archivo = Doctrine_Core::getTable('Actualizaciones')->find(array(5));\n\n $nombre_archivo = sfConfig::get('app_pathfiles_folder').\"/../actualizacionestrat\".'/'.$archivo->getImagefile();\n\n // DATOS conexion\n $dbhost = 'localhost';$dbname = 'circulo'; $dbuser = 'root'; $dbpass = 'root911';\n\n $sqlTruncate = \"TRUNCATE TABLE tmp_tratamiento;\";\n\n $sqlLoadInput = \"LOAD DATA LOCAL INFILE '\".$nombre_archivo.\"'\n INTO TABLE tmp_tratamiento\n CHARACTER SET UTF8\n FIELDS TERMINATED BY ';'\n OPTIONALLY ENCLOSED BY '\\\"'\n LINES TERMINATED BY '\\n'\n IGNORE 1 LINES;\";\n\n\n $pdo = new \\PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass, array(\n \\PDO::MYSQL_ATTR_LOCAL_INFILE => true\n ));\n\n //TRUNCAR TABLA TEMPORAL\n $query = $pdo->prepare($sqlTruncate);\n $query->execute();\n\n //PROCESAR INFORMACON DEL ARCHIVO\n $query = $pdo->prepare($sqlLoadInput);\n $query->execute();\n\n // POR DEFECTO ESTAN TODOS PARA INSERTAR, prepararRegistros marca los que son para actualizar\n Doctrine_Core::getTable('Actualizacionestrat')->prepararRegistros();\n\n return true;\n\n }",
"public function buscarDocumento( $txtCodigoCarrera ){\n\t\t\t$sql = \"SELECT E.idestudiantegeneral, ET.codigoestudiante, E.numerodocumento, E.tipodocumento,\n \t\t\tDATE_FORMAT(E.fechanacimientoestudiantegeneral,'%Y-%m-%d') AS fechanacimientoestudiantegeneral, E.telefonoresidenciaestudiantegeneral,\n\t\t\t\tE.telefono2estudiantegeneral, E.tipodocumento, E.nombresestudiantegeneral, E.apellidosestudiantegeneral , E.emailestudiantegeneral, E.celularestudiantegeneral,\n\t\t\t\tD.nombredocumento, E.codigogenero, G.nombregenero\n \t\t\tFROM estudiantegeneral E\n \t\t\tINNER JOIN estudiante ET ON ( ET.idestudiantegeneral = E.idestudiantegeneral )\n \t\t\tINNER JOIN carrera C ON ( C.codigocarrera = ET.codigocarrera )\n \t\t\tINNER JOIN documento D ON ( D.tipodocumento = E.tipodocumento )\n \t\t\tINNER JOIN genero G ON ( G.codigogenero = E.codigogenero )\n \t\t\tWHERE numerodocumento = ? \n \t\t\tAND C.codigocarrera = ? \";\n\t\t\t\n\t\t\t\n\t\t\t$this->persistencia->crearSentenciaSQL( $sql );\n\t\t\t$this->persistencia->setParametro( 0 , $this->getDocumento( ) , false );\n\t\t\t$this->persistencia->setParametro( 1 , $txtCodigoCarrera , false );\n\t\t\t//echo $this->persistencia->getSQLListo( );\n\t\t\t$this->persistencia->ejecutarConsulta( );\n\t\t\t\n\t\t\tif( $this->persistencia->getNext( ) ){\n\t\t\t\t$this->setId( $this->persistencia->getParametro( \"codigoestudiante\" ) );\n\t\t\t\t$this->setNombres( $this->persistencia->getParametro( \"nombresestudiantegeneral\" ) );\n\t\t\t\t$this->setApellidos( $this->persistencia->getParametro( \"apellidosestudiantegeneral\" ) );\n\t\t\t\t\n\t\t\t\t$tipoDocumento = new TipoDocumento( null );\n\t\t\t\t$tipoDocumento->setIniciales( $this->persistencia->getParametro( \"tipodocumento\" ) );\n\t\t\t\t$tipoDocumento->setDescripcion( $this->persistencia->getParametro( \"nombredocumento\" ) );\n\t\t\t\t$this->setTipoDocumento( $tipoDocumento );\n\t\t\t}\n\t\t}",
"public function CapturaCalificacionDescargar()\n {\n $dbmi = $this->get(\"db_manager\");\n $dbm = new DbmControlescolar($dbmi->getEntityManager());\n $content = trim(file_get_contents(\"php://input\"));\n $decoded = json_decode($content, true);\n //$dataRaw=json_decode('',true);\n //*\n $decoded[\"showAsistencias\"] = ($decoded[\"showAsistencias\"] == true ? \"true\" : \"false\");\n $dataRaw = self::CCCapturaCalificacionGrupoProcess($dbmi, $decoded);\n $dataarray = &$dataRaw[2];\n $dataarray[\"arraydato\"] = $dataarray[\"arraydato\"][0];\n\n $ultimoperiodo = $dataarray[\"ultimoperiodo\"];\n $conjuntope = $ultimoperiodo->getConjuntoperiodoevaluacionid();\n $ciclo = $conjuntope->getCicloid();\n\n $arraymateria = $dataarray[\"arraymateria\"];\n $planestudio = $arraymateria->getPlanestudioid();\n $grado = $planestudio->getGradoid();\n $nivel = $grado->getNivelid();\n\n $omateria = $arraymateria->getMateriaid();\n $omateriaid = $omateria->getMateriaid();\n $omaterianame = $omateria->getNombre();\n\n $arraydato = &$dataarray[\"arraydato\"];\n $arraydato[\"ciclo\"] = $ciclo->getNombre();\n $arraydato[\"nivel\"] = $nivel->getNombre();\n $arraydato[\"grado\"] = $grado->getGrado();\n $arraydato[\"planestudio\"] = $planestudio->getNombre();\n unset($dataarray[\"arraymateria\"]);\n unset($dataarray[\"ultimoperiodo\"]);\n //echo json_encode($dataRaw);exit;\n //*/\n list($status, $code, $data) = $dataRaw;\n $header = $data[\"arraydato\"];\n $alumnos = $data[\"arrayalumno\"];\n $jtable = [];\n\n foreach ($alumnos as $ialumno) {\n $ialumnonum = \"\" . $ialumno['numerolista'];\n $ialumnoname = $ialumno['nombre'];\n $irowname = $ialumnonum . \" - \" . $ialumnoname;\n $iacalperiodo = $ialumno['calificacionperiodo'][0];\n $iscoreperiodo = $iacalperiodo['calificacionperiodo'];\n $iscoreaperiodo = $iacalperiodo['calificacionantesredondeo'];\n $iscoreperiodof = $iacalperiodo['calificacionfinal'];\n $iponderacionraw = $iacalperiodo['opcionperiodo']; //Ponderacion periodo\n $iponderacionfraw = $iacalperiodo['opcionfinal']; //Ponderacion final\n\n $iaponderacionraw = (!$iponderacionraw || is_array($iponderacionraw) || empty($iponderacionraw)\n ? null : $dbm->getPonderacionopcionById($iponderacionraw));\n $iaponderacionfraw = (!$iponderacionfraw || is_array($iponderacionfraw) || empty($iponderacionfraw)\n ? null : $dbm->getPonderacionopcionById($iponderacionfraw));\n\n $iaponderacion = ($iaponderacionraw ? $iaponderacionraw['opcion'] : null);\n $iaponderacionf = ($iaponderacionfraw ? $iaponderacionfraw['opcion'] : null);\n\n $isubmaterias = (isset($ialumno['submaterias']) && !empty($ialumno['submaterias'])\n ? $ialumno['submaterias'] : null);\n $imaterias = $isubmaterias;\n if (!$isubmaterias) {\n $ialumno['materiaid'] = $omateriaid;\n $ialumno['nombre'] = $omaterianame;\n $imaterias = [$ialumno];\n }\n $imi = 0;\n foreach ($imaterias as $imateria) {\n $imaterianame = $imateria[\"nombre\"];\n $irow1name = $imaterianame; //($isubmaterias ? $imaterianame : \"\");\n $jtable[] = $this->buildJTableCell(\"Matrícula\", $irowname, $irow1name, $ialumno['matricula']);\n $icriterios = $imateria['criterios'];\n $imcalperiodo = $imateria['calificacionperiodo'][0];\n foreach ($icriterios as $icriterio) {\n $icapturas = $icriterio['calificacioncaptura'];\n $icriterioname = $icriterio['aspecto'];\n $icriteriodata = $icriterio['porcentajecalificacion'] . \"% 0 a \" . $icriterio['puntajemaximo'];\n $totalCapturas = 0;\n foreach ($icapturas as $icaptura) {\n $totalCapturas = $totalCapturas + $icaptura['calificacion'];\n $jtable[] = $this->buildJTableCell($icriterioname, $irowname, $irow1name, $icaptura['calificacion'], $icriteriodata, \"\" . $icaptura['numerocaptura']);\n }\n\n $jtable[] = $this->buildJTableCell(\"Promedio \" . $icriterioname, $irowname, $irow1name, ($totalCapturas/count($icapturas)), \"\", \"\");\n $jtable[] = $this->buildJTableCell(\"Porcentaje \" . $icriterioname, $irowname, $irow1name, ((($totalCapturas/count($icapturas))*$icriterio['porcentajecalificacion'])/$icriterio['puntajemaximo']), \"\", \"\");\n }\n $imponderacionraw = $imcalperiodo['opcionperiodo'];\n $imaponderacionraw = (!$imponderacionraw || is_array($imponderacionraw) || empty($imponderacionraw)\n ? null : $dbm->getPonderacionopcionById($imponderacionraw));\n $imaponderacion = ($imaponderacionraw ? $imaponderacionraw['opcion'] : null);\n $iobservacion = (!isset($imcalperiodo['observacion']) || empty(trim($imcalperiodo['observacion']))\n ? null : trim($imcalperiodo['observacion']));\n if ($iobservacion) {\n $jtable[] = $this->buildJTableCell(\"Observaciones\", $irowname, $irow1name, $iobservacion);\n }\n if ($imaponderacion && $isubmaterias) {\n $jtable[] = $this->buildJTableCell(\"Evaluacion\", $irowname, $irow1name, $imaponderacion);\n }\n if($iscoreaperiodo){\n $jtable[] = $this->buildJTableCell(\"Calificación antes de redondeo\", $irowname, $irow1name, $iscoreaperiodo);\n }\n if ($iscoreperiodo) {\n $jtable[] = $this->buildJTableCell(\"Calificación periodo\", $irowname, $irow1name, $iscoreperiodo);\n }\n if ($iaponderacion) {\n $jtable[] = $this->buildJTableCell(\"Ponderacion periodo\", $irowname, $irow1name, $iaponderacion);\n }\n if ($iscoreperiodof && ENTORNO == 1) {\n $jtable[] = $this->buildJTableCell(\"Calificación final\", $irowname, $irow1name, $iscoreperiodof);\n }\n if ($iaponderacionf) {\n $jtable[] = $this->buildJTableCell(\"Ponderacion final\", $irowname, $irow1name, $iaponderacionf);\n }\n \n if($imateria[\"totalfaltas\"]){\n $jtable[] = $this->buildJTableCell(\"Faltas\", $irowname, $irow1name, $imateria[\"totalfaltas\"]);\n }else{\n if($imi == 0){\n $jtable[] = $this->buildJTableCell(\"Faltas\", $irowname, $irow1name, $ialumno[\"totalfaltas\"]);\n }\n \n }\n $imi++;\n }\n\n }\n $result = [\n \"header\" => $header,\n \"score\" => $jtable\n ];\n //echo json_encode($result);exit;\n\n\n $done = false;\n $name = \"R\" . rand();\n $report = \"ReporteCalificacionesDetalle\";\n $input = $output = \"ReporteCalificacionesDetalle_$name\";\n\n $pdf = new LDPDF($this->container, $report, $output, array('driver' => 'jsonql', 'jsonql_query' => '\"\"', 'data_file' => $input), [], ['xlsx']);\n $inputPath = $pdf->fdb_r;\n $outputPath = $pdf->output_r;\n\n $resultenc = json_encode($result);\n $file = LDPDF::fileRead($inputPath);\n LDPDF::fileWrite($file, $resultenc);\n LDPDF::fileClose($file);\n $toremove = [$inputPath];\n\n if (!$pdf->execute()) {\n $toremove[] = $outputPath;\n $done = true;\n }\n\n $reporteSize = filesize($outputPath);\n $reporte = file_get_contents($outputPath);\n foreach ($toremove as $i) {\n LDPDF::fileDelete($i);\n }\n return ($done ? new Response($reporte, 200, array(\n 'Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8',\n 'Content-Length' => $reporteSize\n )) : Api::Error(Response::HTTP_PARTIAL_CONTENT, \"La impresion no esta disponible.\"));\n }",
"function __construct() {\n $txt = fopen(\"./data/data.txt\", \"w+\") or die(\"Kunde ej öppna filen.\");\n fwrite($txt, \"\");\n fclose($txt);\n\n if(filesize(\"./data/array.obj\")>0) {\n $this->gastbok = unserialize(file_get_contents(\"./data/array.obj\"));\n $this->loadTxtFile();\n }\n\n }",
"public function __construct()\n {\n $this->setColumnsMeta(array(\n 'ubicacion'=> array('enum:poste|puntoRecogida|centroEmergencia'),\n ));\n\n $this->setMultiLangColumnsList(array(\n ));\n\n $this->setAvailableLangs(array('es', 'eu'));\n\n $this->setParentList(array(\n 'CubosIbfk1'=> array(\n 'property' => 'Contribuyente',\n 'table_name' => 'Contribuyentes',\n ),\n 'CubosIbfk3'=> array(\n 'property' => 'CubosTipos',\n 'table_name' => 'CubosTipos',\n ),\n 'CubosIbfk4'=> array(\n 'property' => 'PuntosRecogida',\n 'table_name' => 'PuntosRecogida',\n ),\n 'CubosIbfk5'=> array(\n 'property' => 'Poste',\n 'table_name' => 'Postes',\n ),\n 'CubosIbfk6'=> array(\n 'property' => 'CentrosEmergencia',\n 'table_name' => 'CentrosEmergencia',\n ),\n ));\n\n $this->setDependentList(array(\n 'IncidenciasIbfk1' => array(\n 'property' => 'Incidencias',\n 'table_name' => 'Incidencias',\n ),\n 'RecogidasIbfk2' => array(\n 'property' => 'Recogidas',\n 'table_name' => 'Recogidas',\n ),\n ));\n\n\n\n\n $this->_defaultValues = array(\n 'ubicacion' => 'poste',\n );\n\n $this->_initFileObjects();\n parent::__construct();\n }",
"function listadeMembrodaDao($nome){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select * from membros where Nome LIKE '%$nome%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n $achou=FALSE;\r\n \r\n if($resultado != \"\"){\r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setSexo($registro['Sexo']); \r\n $membro->setData($registro['DataNascimento1']); \r\n $membro->setRg($registro['Rg']);\r\n $membro->setCpf($registro['Cpf']); \r\n $membro->setEstadocivil($registro['EstadoCivil']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n $membro->setProfissao($registro['Profissao']); \r\n $membro->setEscola($registro['Escolaridade']); \r\n $membro->setPai($registro['Pai']); \r\n $membro->setMae($registro['Mae']); \r\n $membro->setNecessidade($registro['NecessidadeEspeciais']);\r\n\t $membro->setFone($registro['Fone']); \r\n $membro->setFilho($registro['Filho']); \r\n $membro->setFormacao($registro['FormacaoEclesiatica']);\r\n $membro->setMembrasia($registro['IntegracaoMembrasia']); \r\n $membro->setFuncao($registro['Funcao']); \r\n $membro->setParticipou($registro['JaParticipou']);\r\n\t $membro->setTrabalhando($registro['Trabalhando']); \r\n $membro->setViajando($registro['EstadoAtual']); \r\n $membro->setCongrega($registro['Congrega']); \r\n $membro->setRua($registro['Rua']); \r\n $membro->setBairro($registro['Bairro']); \r\n $membro->setCasa($registro['Casa']); \r\n $membro->setStatus($registro['Status']);\r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n $achou = true;\r\n\t}\r\n \r\n }\r\n\t\treturn $listaMembro;\r\n if($achou){\r\n mysql_free_result($registro);\r\n }\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco(); \r\n }",
"function geraClassesBD(){\n # Abre o template da classe BD e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.ModeloBD.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeTabela = ucfirst((string)$aTabela['NOME']);\n $nomeClasse = $this->getCamelMode($nomeTabela);\n $modeloTemp = NULL;\n $copiaModelo = $modelo;\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%NOME_CLASSE%%',$nomeClasse,$copiaModelo);\n\n # Complementos adicionais para classes especificas\n switch($nomeClasse){\n case 'Grupoprograma':\n case 'Modulo':\n case 'Programa':\n case 'Usuario':\n case 'Usuariogrupo':\n $modeloTemp = Util::getConteudoTemplate(\"class.Modelo.$nomeClasse\".\"BD.php\");\t\t\t\n $copiaModelo = str_replace('%%COMPLEMENTO%%',$modeloTemp,$copiaModelo);\n break;\n\n default: \n $copiaModelo = str_replace('%%COMPLEMENTO%%','',$copiaModelo);\t\n break;\n }\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/bd\";\n if(!file_exists($dir)) \n mkdir($dir);\n $fp = fopen(\"$dir/class.$nomeClasse\".\"BD.php\",\"w\");\n fputs($fp, $copiaModelo);\n fclose($fp);\n }\n return true;\t\n }",
"function cargarDatostxt(){\n // Si no existe lo creo\n $tabla=[]; \n if (!is_readable(FILEUSER) ){\n // El directorio donde se crea tiene que tener permisos adecuados\n $fich = @fopen(FILEUSER,\"w\") or die (\"Error al crear el fichero.\");\n fclose($fich);\n }\n $fich = @fopen(FILEUSER, 'r') or die(\"ERROR al abrir fichero de usuarios\"); // abrimos el fichero para lectura\n \n while ($linea = fgets($fich)) {\n $partes = explode('|', trim($linea));\n // Escribimos la correspondiente fila en tabla\n $tabla[]= [ $partes[0],$partes[1],$partes[2],$partes[3]];\n }\n fclose($fich);\n return $tabla;\n}",
"public function read($id) {\n\n var_dump($id);\n echo 'read()NEXT'; \n \n $this->pdo->beginTransaction();\n \n $stmt = $this->pdo->prepare(\"SELECT id, file_data, mime_type \"\n . \"FROM company_files \"\n . \"WHERE id= :id\");\n\n //var_dump($stmt); exit;\n \n // query blob from the database\n $stmt->execute([$id]);\n \n $stmt->bindColumn('file_data', $fileData, \\PDO::PARAM_STR);\n $stmt->bindColumn('mime_type', $mimeType, \\PDO::PARAM_STR);\n $stmt->fetch(\\PDO::FETCH_BOUND);\n $stream = $this->pdo->pgsqlLOBOpen($fileData, 'r');\n \n // output the file\n header(\"Content-type: \" . $mimeType);\n fpassthru($stream);\n }",
"function gerar(){\r\n\t\tif(strlen($this->estabelecimento->getdircontabil()) == 0){\r\n\t\t\t$_SESSION[\"ERROR\"] = \"Informe o diretório de integração contábil para o estabelecimento.<br><a onclick=\\\"$.messageBox('close'); openProgram('Estabel','codestabelec=\".$this->estabelecimento->getcodestabelec().\"')\\\">Clique aqui</a> para abrir o cadastro de estabelecimento.\";\r\n\t\t\techo messagebox(\"error\", \"\", $_SESSION[\"ERROR\"]);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif($this->gerar_financeiro){\r\n\t\t\t$query = \"SELECT codlancto, data, debito, credito, LPAD(valorliquido::text,17,'0') AS valorliquido, historicopadrao, complemento, ccdb, cccr, pagrec FROM \";\r\n\r\n\t\t\t$query .= \"( \";\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"contaparceiro.contacontabil as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorparcela AS valorliquido, historicopadrao.descricao AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contaparceiro on (v_parceiro.codconta = contaparceiro.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao ON (contaparceiro.codhistorico = historicopadrao.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' AND (SUBSTR(lancamento.serie,1,3) != 'TRF' OR lancamento.serie is null) \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT codlancto AS codlancto, \tlpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"(SELECT contacontabil FROM planocontas WHERE codconta=(SELECT codconta FROM banco WHERE codbanco=(SELECT codbanco FROM lancamento AS lanc_aux WHERE lanc_aux.dtliquid=lancamento.dtliquid AND serie='TRF' AND lanc_aux.horalog=lancamento.horalog AND pagrec='R' limit 1))) AS debito, \";\r\n\t\t\t$query .= \"(CASE WHEN pagrec='P' THEN contabanco.contacontabil END) AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorparcela AS valorliquido, \";\r\n\t\t\t$query .= \"historicopadrao.descricao AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, \";\r\n\t\t\t$query .= \"'' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR, \";\r\n\t\t\t$query .= \"'T' AS pagrec \";\r\n\t\t\t$query .= \"FROM lancamento INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contaparceiro on (v_parceiro.codconta = contaparceiro.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao ON (contaparceiro.codhistorico = historicopadrao.codhistorico) \";\r\n\t\t\t$query .= \"WHERE SUBSTR(lancamento.serie,1,3)='TRF' AND lancamento.pagrec = 'P' \";\r\n\t\t\t$query .= \" AND EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\t\t\t$query .= \"GROUP BY 1,2,3,4,5,6,7,8 \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valorjuros AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valorjuros_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valorjuros_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valorjuros > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valordescto AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valordescto_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valordescto_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valordescto > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\r\n\t\t\t$query .= \"union all \";\r\n\r\n\t\t\t$query .= \"SELECT lancamento.codlancto, lpad(Extract('Day' From lancamento.dtliquid::date)::text,2,'0')|| '/' || lpad(Extract('Month' From lancamento.dtliquid::date)::TEXT, 2, '0') AS data, \";\r\n\t\t\t$query .= \"CASE WHEN lancamento.pagrec = 'P' THEN conta_p.contacontabil ELSE conta_r.contacontabil END as debito, contabanco.contacontabil AS credito, \";\r\n\t\t\t$query .= \"lancamento.valoracresc AS valorliquido, CASE WHEN lancamento.pagrec = 'P' THEN h_p.descricao ELSE h_r.descricao END AS historicopadrao, \";\r\n\t\t\t$query .= \"lancamento.numnotafis || v_parceiro.nome AS complemento, '' as CCDB, \";\r\n\t\t\t$query .= \"'' AS CCCR , lancamento.pagrec \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\t$query .= \"INNER join banco on (lancamento.codbanco = banco.codbanco) \";\r\n\t\t\t$query .= \"LEFT JOIN paramplanodecontas ON (paramplanodecontas.codestabelec = lancamento.codestabelec) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_p on (paramplanodecontas.codconta_valordescto_pag = conta_p.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS conta_r on (paramplanodecontas.codconta_valordescto_rec = conta_r.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN planocontas AS contabanco on (banco.codconta = contabanco.codconta) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_p ON (conta_p.codhistorico = h_p.codhistorico) \";\r\n\t\t\t$query .= \"LEFT JOIN historicopadrao h_r ON (conta_r.codhistorico = h_r.codhistorico) \";\r\n\t\t\t$query .= \"WHERE EXTRACT(YEAR FROM lancamento.dtliquid) = '{$this->ano}' AND lancamento.codestabelec = {$this->estabelecimento->getcodestabelec()} AND lancamento.valoracresc > 0 \";\r\n\t\t\t$query .= \" AND EXTRACT(MONTH FROM lancamento.dtliquid) = '{$this->mes}' \";\r\n\t\t\t$query .= \")AS tmp ORDER BY tmp.data, tmp.complemento, tmp.historicopadrao ASC \";\r\n\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\r\n\t\t\t$arr_linha_contimatic = array();\r\n\t\t\t$cont = 1;\r\n\t\t\tforeach($arr as $row){\r\n\r\n\t\t\t\t$linha = $this->valor_numerico($cont, 0, 7); //\r\n\t\t\t\t$linha .= $this->valor_texto($row[\"data\"], 5); //\r\n\r\n\t\t\t\tif($row[\"pagrec\"] == \"R\"){\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"credito\"], 0, 7);\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"debito\"], 0, 7);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"debito\"], 0, 7);\r\n\t\t\t\t\t$linha .= $this->valor_numerico($row[\"credito\"], 0, 7);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$linha .= $row[\"valorliquido\"]; //\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"historicopadrao\"],0,5);\r\n\t\t\t\t$linha .= $this->valor_texto(removespecial($row[\"complemento\"].\" Chave:\".$row[\"codlancto\"]), 200); //\r\n\t\t\t\tif($row[\"pagrec\"] == \"R\"){\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"cccr\"], 42);\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"ccdb\"], 42);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"ccdb\"], 42);\r\n\t\t\t\t\t$linha .= $this->valor_texto($row[\"cccr\"], 42);\r\n\t\t\t\t}\r\n\t\t\t\t$cont++;\r\n\t\t\t\t$arr_linha_contimatic[] = $linha;\r\n\t\t\t}\r\n\r\n\t\t\tif(strlen($this->apelidocontimatic) > 0){\r\n\t\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->apelidocontimatic.\".\".\"M\".substr($this->ano,-2);\r\n\t\t\t}else{\r\n\t\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->estabelecimento->getnome().\"_financeiro_\".$this->mes.\".txt\";\r\n\t\t\t}\r\n\t\t\t$arquivo = fopen($nomearq, \"w\");\r\n\t\t\tforeach($arr_linha_contimatic as $linha){\r\n\t\t\t\tfwrite($arquivo, $linha.\"\\r\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($arquivo);\r\n\t\t\techo messagebox(\"success\", \"\", \"Arquivo gerado com sucesso!\");\r\n\t\t\techo download($nomearq);\r\n\t\t}\r\n\r\n\t\t// Gera o planod e contas\r\n\t\tif($this->gerar_planodecontas){\r\n\t\t\t//******************************************************************\r\n\t\t\t//\t\t\t\t\t\tRegistro Plano de Contas\r\n\t\t\t//******************************************************************\r\n\t\t\t$where = array();\r\n\t\t\t$this->setprevreal(\"R\");\r\n\t\t\t$this->setstatus(\"L\");\r\n\r\n\t\t\t$query = \"SELECT lancamento.codlancto, lancamento.dtlancto, lancamento.valorliquido, \";\r\n\t\t\t$query .= \"(SELECT numconta FROM planocontas WHERE lancamento.codcontadeb = codconta AND tpconta IN ('D','A')) AS numcontadeb, \";\r\n\t\t\t$query .= \"(SELECT numconta FROM planocontas WHERE lancamento.codcontacred = codconta AND tpconta IN ('C','A')) AS numcontacred, \";\r\n\t\t\t$query .= \"lancamento.numnotafis, lancamento.serie, v_parceiro.nome as parceiro \";\r\n\t\t\t$query .= \"FROM lancamento \";\r\n\t\t\t$query .= \"INNER JOIN v_parceiro ON (lancamento.codparceiro = v_parceiro.codparceiro AND lancamento.tipoparceiro = v_parceiro.tipoparceiro) \";\r\n\t\t\tif(strlen($this->ano) > 0){\r\n\t\t\t\t$where[] = \"EXTRACT(YEAR FROM dtliquid) = '{$this->ano}'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->mes) > 0){\r\n\t\t\t\t$where[] = \"EXTRACT(MONTH FROM dtliquid) ='\".$this->mes.\"'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->codestabelec) > 0){\r\n\t\t\t\t$where[] = \"codestabelec = \".$this->codestabelec;\r\n\t\t\t}\r\n\t\t\tif(strlen($this->prevreal) > 0){\r\n\t\t\t\t$where[] = \"prevreal = '\".$this->prevreal.\"'\";\r\n\t\t\t}\r\n\t\t\tif(strlen($this->status) > 0){\r\n\t\t\t\t$where[] = \"status = '\".$this->status.\"'\";\r\n\t\t\t}\r\n\t\t\tif(sizeof($where) > 0){\r\n\t\t\t\t$query .= \"WHERE (lancamento.codcontacred > 0 OR lancamento.codcontadeb > 0) AND \".implode(\" AND \", $where).\" \";\r\n\t\t\t}\r\n\t\t\techo $query;\r\n\t\t\t$arr_linha_contimatic = array();\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\r\n\t\t\tif(count($arr) == 0){\r\n\t\t\t\tdie(messagebox(\"error\", \"\", \"Nenhum lancamento encontrado.\"));\r\n\t\t\t}\r\n\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$linha = $this->valor_numerico($row[\"codlancto\"], 0, 7); // Codigo do lancamento\r\n\t\t\t\t$linha .= $this->valor_data_planodecontas($row[\"dtlancto\"]); // Data do lancamento\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"numcontadeb\"], 0, 7); // Codigo reduzido da conta a ser debitada\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"numcontacred\"], 0, 7); // Codigo reduzido da conta a ser creditada\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"valorliquido\"], 2, 17); // Valor\r\n\t\t\t\t$linha .= $this->valor_numerico($row[\"codcontacred\"], 0, 5); // Historico padrao\r\n\t\t\t\t$linha .= $this->valor_texto(\"{$row[\"numnotafis\"]} {$row[\"serie\"]} - {$row[\"parceiro\"]}\", 200); // Complemento\r\n\t\t\t\t$arr_linha_contimatic[] = $linha;\r\n\t\t\t}\r\n\r\n\t\t\t$nomearq = $this->estabelecimento->getdircontabil().$this->estabelecimento->getnome().$this->mes.\".txt\";\r\n\t\t\t$arquivo = fopen($nomearq, \"w\");\r\n\t\t\tforeach($arr_linha_contimatic as $linha){\r\n\t\t\t\tfwrite($arquivo, $linha.\"\\r\\n\");\r\n\t\t\t}\r\n\t\t\tfclose($arquivo);\r\n\t\t\techo download($nomearq);\r\n\t\t\t//******************************************************************\r\n\t\t}\r\n\r\n\t\t// Busca os mapas resumo\r\n\t\t$this->arr_maparesumo = array();\r\n\t\tif($this->gerar_cupomfiscal){\r\n\t\t\tsetprogress(0, \"Carregando mapas resumo\", TRUE);\r\n\t\t\t$res = $this->con->query(\"SELECT codmaparesumo FROM maparesumo WHERE codestabelec = \".$this->estabelecimento->getcodestabelec().\" AND EXTRACT(YEAR FROM dtmovto) = \".$this->ano.\" AND EXTRACT(MONTH FROM dtmovto) = \".$this->mes.\" ORDER BY dtmovto, caixa\");\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\t$arr_codmaparesumo = array();\r\n\t\t\tforeach($arr as $i => $row){\r\n\t\t\t\t$arr_codmaparesumo[] = $row[\"codmaparesumo\"];\r\n\t\t\t}\r\n\t\t\t$this->arr_maparesumo = object_array_key(objectbytable(\"maparesumo\", NULL, $this->con), $arr_codmaparesumo);\r\n\t\t}\r\n\r\n\t\t// Busca os impostos dos mapas resumo\r\n\t\t$this->arr_maparesumoimposto = array();\r\n\t\t$i = 1;\r\n\t\t$n = sizeof($this->arr_maparesumo);\r\n\t\tforeach($this->arr_maparesumo as $maparesumo){\r\n\t\t\tsetprogress(($i / $n * 100), \"Carregando impostos dos mapas resumo: \".$i.\" de \".$n);\r\n\t\t\t$query = \"SELECT tptribicms, aliqicms, SUM(totalliquido) AS totalliquido, SUM(totalicms) AS totalicms \";\r\n\t\t\t$query .= \"FROM maparesumoimposto \";\r\n\t\t\t$query .= \"WHERE codmaparesumo = \".$maparesumo->getcodmaparesumo().\" \";\r\n\t\t\t$query .= \"\tAND totalliquido > 0 \";\r\n\t\t\t$query .= \"GROUP BY tptribicms, aliqicms \";\r\n\t\t\t$query .= \"ORDER BY tptribicms, aliqicms \";\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$maparesumoimposto = objectbytable(\"maparesumoimposto\", NULL, $this->con);\r\n\t\t\t\t$maparesumoimposto->setcodmaparesumo($maparesumo->getcodmaparesumo());\r\n\t\t\t\t$maparesumoimposto->settptribicms($row[\"tptribicms\"]);\r\n\t\t\t\t$maparesumoimposto->setaliqicms($row[\"aliqicms\"]);\r\n\t\t\t\t$maparesumoimposto->settotalliquido($row[\"totalliquido\"]);\r\n\t\t\t\t$maparesumoimposto->settotalicms($row[\"totalicms\"]);\r\n\t\t\t\t$this->arr_maparesumoimposto[$maparesumo->getcodmaparesumo()][] = $maparesumoimposto;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\r\n\t\t// Busca operacoes de nota fiscal\r\n\t\t$this->arr_operacaonota = array();\r\n\t\tsetprogress(0, \"Buscando operacoes de nota fiscal\", TRUE);\r\n\t\t$operacaonota = objectbytable(\"operacaonota\", NULL, $this->con);\r\n\t\t$arr_operacaonota = object_array($operacaonota);\r\n\t\tforeach($arr_operacaonota as $operacaonota){\r\n\t\t\t$this->arr_operacaonota[$operacaonota->getoperacao()] = $operacaonota;\r\n\t\t}\r\n\r\n\t\t// Busca as notas fiscais\r\n\t\t$this->arr_notafiscal = array();\r\n\t\tif($this->gerar_notafiscal){\r\n\t\t\tsetprogress(0, \"Carregando notas fiscais\", TRUE);\r\n\t\t\t$res = $this->con->query(\"SELECT idnotafiscal FROM notafiscal WHERE codestabelec = \".$this->estabelecimento->getcodestabelec().\" AND EXTRACT(YEAR FROM dtentrega) = \".$this->ano.\" AND EXTRACT(MONTH FROM dtentrega) = \".$this->mes);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\t$arr_idnotafiscal = array();\r\n\t\t\tforeach($arr as $i => $row){\r\n\t\t\t\t$arr_idnotafiscal[] = $row[\"idnotafiscal\"];\r\n\t\t\t}\r\n\t\t\t$this->arr_notafiscal = object_array_key(objectbytable(\"notafiscal\", NULL, $this->con), $arr_idnotafiscal);\r\n\t\t}\r\n\r\n\t\t// Busca os impostos das notas fiscais\r\n\t\t$this->arr_notafiscalimposto = array();\r\n\t\t$i = 1;\r\n\t\t$n = sizeof($this->arr_notafiscal);\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\tsetprogress(($i / $n * 100), \"Carregando impostos das notas fiscais: \".$i.\" de \".$n);\r\n\t\t\t$this->arr_notafiscalimposto[$notafiscal->getidnotafiscal()] = array();\r\n\t\t\t$query = \"SELECT idnotafiscal, aliquota, SUM(base) AS base, SUM(valorimposto) AS valorimposto, SUM(reducao) AS reducao, SUM(isento) AS isento \";\r\n\t\t\t$query .= \"FROM notafiscalimposto \";\r\n\t\t\t$query .= \"WHERE idnotafiscal = \".$notafiscal->getidnotafiscal().\" \";\r\n\t\t\t$query .= \"\tAND tipoimposto LIKE 'ICMS%' \";\r\n\t\t\t$query .= \"\tAND tipoimposto != 'ICMS_F' \";\r\n\t\t\t$query .= \"GROUP BY idnotafiscal, aliquota \";\r\n\t\t\t$query .= \"ORDER BY aliquota \";\r\n\t\t\t$res = $this->con->query($query);\r\n\t\t\t$arr = $res->fetchAll(2);\r\n\t\t\tforeach($arr as $row){\r\n\t\t\t\t$notafiscalimposto = objectbytable(\"notafiscalimposto\", NULL, $this->con);\r\n\t\t\t\t$notafiscalimposto->setidnotafiscal($notafiscal->getidnotafiscal());\r\n\t\t\t\t$notafiscalimposto->settipoimposto(\"ICMS\");\r\n\t\t\t\t$notafiscalimposto->setaliquota($row[\"imposto\"]);\r\n\t\t\t\t$notafiscalimposto->setbase($row[\"base\"]);\r\n\t\t\t\t$notafiscalimposto->setvalorimposto($row[\"valorimposto\"]);\r\n\t\t\t\t$notafiscalimposto->setreducao($row[\"reducao\"]);\r\n\t\t\t\t$notafiscalimposto->setisento($row[\"isento\"]);\r\n\t\t\t\t$this->arr_notafiscalimposto[$notafiscal->getidnotafiscal()][] = $notafiscalimposto;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\t// Busca os cliente\r\n\t\t$this->arr_cliente = array();\r\n\t\tsetprogress(0, \"Buscando clientes\", TRUE);\r\n\t\t$arr_codcliente = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"C\"){\r\n\t\t\t\t$arr_codcliente[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codcliente = array_merge(array_unique($arr_codcliente));\r\n\t\tforeach($arr_codcliente as $i => $codcliente){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codcliente) * 100), \"Carregando clientes: \".($i + 1).\" de \".sizeof($arr_codcliente));\r\n\t\t\t$this->arr_cliente[$codcliente] = objectbytable(\"cliente\", $codcliente, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca os estabelecimentos\r\n\t\t$this->arr_estabelecimento = array();\r\n\t\tsetprogress(0, \"Buscando estabelecimentos\", TRUE);\r\n\t\t$arr_codestabelec = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"E\"){\r\n\t\t\t\t$arr_codestabelec[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codestabelec = array_merge(array_unique($arr_codestabelec));\r\n\t\tforeach($arr_codestabelec as $i => $codestabelec){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codestabelec) * 100), \"Carregando estabelecimentos: \".($i + 1).\" de \".sizeof($arr_codestabelec));\r\n\t\t\t$this->arr_estabelecimento[$codestabelec] = objectbytable(\"estabelecimento\", $codestabelec, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca os fornecedores\r\n\t\t$this->arr_fornecedor = array();\r\n\t\tsetprogress(0, \"Buscando fornecedores\", TRUE);\r\n\t\t$arr_codfornec = array();\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$operacaonota = $this->arr_operacaonota[$notafiscal->getoperacao()];\r\n\t\t\tif($operacaonota->getparceiro() == \"F\"){\r\n\t\t\t\t$arr_codfornec[] = $notafiscal->getcodparceiro();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$arr_codfornec = array_merge(array_unique($arr_codfornec));\r\n\t\tforeach($arr_codfornec as $i => $codfornec){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codfornec) * 100), \"Carregando fornecedores: \".($i + 1).\" de \".sizeof($arr_codfornec));\r\n\t\t\t$this->arr_fornecedor[$codfornec] = objectbytable(\"fornecedor\", $codfornec, $this->con);\r\n\t\t}\r\n\r\n\t\t// Busca as cidades\r\n\t\t$this->arr_cidade = array();\r\n\t\tsetprogress(0, \"Buscando cidades\", TRUE);\r\n\t\t$arr_codcidade = array();\r\n\t\t$arr_codcidade[] = $this->estabelecimento->getcodcidade();\r\n\t\tforeach($this->arr_cliente as $cliente){\r\n\t\t\t$arr_codcidade[] = $cliente->getcodcidaderes();\r\n\t\t}\r\n\t\tforeach($this->arr_estabelecimento as $estabelecimento){\r\n\t\t\t$arr_codcidade[] = $estabelecimento->getcodcidade();\r\n\t\t}\r\n\t\tforeach($this->arr_fornecedor as $fornecedor){\r\n\t\t\t$arr_codcidade[] = $fornecedor->getcodcidade();\r\n\t\t}\r\n\t\t$arr_codcidade = array_merge(array_unique($arr_codcidade));\r\n\t\tforeach($arr_codcidade as $i => $codcidade){\r\n\t\t\tsetprogress((($i + 1) / sizeof($arr_codcidade) * 100), \"Carregando cidades: \".($i + 1).\" de \".sizeof($arr_codcidade));\r\n\t\t\t$this->arr_cidade[$codcidade] = objectbytable(\"cidade\", $codcidade, $this->con);\r\n\t\t}\r\n\r\n\t\tsetprogress(0, \"Gerando arquivo\", TRUE);\r\n\t\t$arr_registro = array();\r\n\t\tforeach($this->arr_maparesumo as $maparesumo){\r\n\t\t\t$arr_registro[] = $this->registro_r1($maparesumo, FALSE);\r\n\t\t\t$arr_registro[] = $this->registro_r1($maparesumo, TRUE);\r\n\t\t}\r\n\t\tforeach($this->arr_notafiscal as $notafiscal){\r\n\t\t\t$arr_registro[] = $this->registro_r1($notafiscal);\r\n\t\t}\r\n\r\n\t\t$arr_linha_e = array(); // Linhas para criar arquivo de entrada\r\n\t\t$arr_linha_s = array(); // Linhas para criar arquivo de saida\r\n\t\tforeach($arr_registro as $registro){\r\n\t\t\tif(!is_null($registro)){\r\n\t\t\t\t$linha = implode(\"|\", $registro);\r\n\t\t\t\tswitch($registro[\"02\"]){\r\n\t\t\t\t\tcase \"E\": $arr_linha_e[] = $linha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"S\": $arr_linha_s[] = $linha;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->criar_arquivo($arr_linha_e, \"E\");\r\n\t\t$this->criar_arquivo($arr_linha_s, \"S\");\r\n\r\n\t\techo messagebox(\"success\", \"\", \"Arquivo gerado com sucesso!\");\r\n\t}",
"private function _agregarArchivosEntregaPractica($file, $id_entrega_lp, $id_practica, $titulo, $id_seg_arch = NULL) {\n $_objUsuarioPractica = new DAO_UsuariosPracticas();\n $_objUsuarioPractica->set_id_practica($id_practica);\n $_objUsuarioPractica->consultar();\n $estadoPractica = $_objUsuarioPractica->get_estado_practica();\n if ($estadoPractica != 3) {\n throw new ControllerException(\"La practica debe estar en estado 'Entrega'\");\n }\n $_objArchivoSe = new DAO_RelArchivosSeguimiento();\n $id_archivo = NULL;\n if (!empty($id_seg_arch)) {// modificar el archivo subido\n $_objArchivoSe->set_id_seg_arc($id_seg_arch);\n $_objArchivoSe->consultar();\n $id_archivo = $_objArchivoSe->get_id_archivos();\n }\n $_objArchivoSe->set_id_entre_lp($id_entrega_lp);\n try {\n $this->_validarArchivo($file);\n $_objArchivo = $this->_guardarArchivo($file, $id_archivo);\n } catch (ControladorArchivosException $e) {\n throw new ControllerException($e->getMessage());\n }\n $arrSeguimiento = $this->_agregarSeguimiento($id_practica, $titulo);\n $_objArchivoSe->set_id_archivos($_objArchivo->get_id_archivo());\n $_objArchivoSe->set_id_segui($arrSeguimiento['id_segui']);\n $_objArchivoSe->set_estado_archivo(1);\n if (!$_objArchivoSe->guardar()) {\n $this->_mensaje = $_objArchivoSe->getMysqlError();\n throw new ControllerException(\"No se pudo actualizar vinculacion de archivo a practica\");\n }\n $this->_guardarLog($_SESSION['id_usu_cent'], ['accion' => 'insertar', 'metodo' => get_class() . ':_agregarArchivosEntregaPractica', 'parametros' => ['file' => $file['name'], 'id_arch_lp' => $id_arch_lp, 'id_practica' => $id_practica, 'titulo' => $titulo, 'id_seg_arch' => $id_seg_arch]]);\n return $_objArchivoSe->getArray();\n }",
"public function actionCreate()\n {\n $model = new Jadwal();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->file = UploadedFile::getInstance($model,'file');\n $uploadExists = 0;\n\n if($model->file){\n $imagepath = 'upload/files/';\n $model->U_PESERTA= $imagepath .rand(10,100).'-'.str_replace('','-',$model->file->name);\n \n $bulkInsertArray = array();\n $random_date = Yii::$app->formatter->asDatetime(date(\"dmyyhis\"), \"php:dmYHis\");\n $random = $random_date.rand(10, 100);\n $userId = \\Yii::$app->user->identity->id;\n $now = new Expression('NOW()');\n \n $uploadExists = 1; \n }\n\n if($uploadExists){\n $model->file->saveAs($model->U_PESERTA);\n\n $handle = fopen($model->U_PESERTA,'r');\n if($handle){\n $model->jadwal=$random;\n if($model->save()){\n #var_dump($model->errors);\n\n while(($line=fgetcsv($handle, 1000,\",\")) != FALSE){\n $bulkInsertArray[]=[\n 'pes_id' => $model,\n 'r_id' => $model,\n 'pes_nama' => $model,\n 'pes_alamat' => $model,\n 'pes_email' => $model,\n 'pes_jurusan' => $model,\n 'pes_username' => $model,\n 'pes_password' => $model,\n\n ];\n }\n }\n fclose($handle);\n\n $tableName = 'peserta';\n $columnNameArray = ['pes_id','r_id', 'pes_nama', 'pes_alamat', 'pes_email', 'pes_jurusan', 'pes_username', 'pes_password'];\n Yii::$app->db->createCommand()->jadwalInsert($tableName, $columnNameArray, $bulkInsertArray)->execute();\n #print_r($bulkInsertArray);\n }\n\n }\n\n return $this->redirect(['view', 'id' => $model->U_ID]);\n } \n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function pesquisarMembroDao($obj){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objConexao = Connection::getInstance();\r\n $objMembro = new objetoMembro();\r\n \r\n $busca = mysql_query(\"Select * from membros where Nome like '%$obj%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $reg = mysql_fetch_assoc($busca);\r\n \r\n\tif($reg != \"\"){\r\n\r\n $objMembro->setMatricula($reg['Matricula']); $objMembro->setNome($reg['Nome']);\r\n $objMembro->setSexo($reg['Sexo']); $objMembro->setData($reg['DataNascimento1']); $objMembro->setRg($reg['Rg']);\r\n $objMembro->setCpf($reg['Cpf']); $objMembro->setEstadocivil($reg['EstadoCivil']);\r\n $objMembro->setNatural($reg['Naturalidade']); $objMembro->setProfissao($reg['Profissao']); $objMembro->setEscola($reg['Escolaridade']); \r\n $objMembro->setPai($reg['Pai']); $objMembro->setMae($reg['Mae']); $objMembro->setNecessidade($reg['NecessidadeEspeciais']);\r\n\t $objMembro->setFone($reg['Fone']); $objMembro->setFilho($reg['Filho']); $objMembro->setFormacao($reg['FormacaoEclesiatica']);\r\n $objMembro->setMembrasia($reg['IntegracaoMembrasia']); $objMembro->setFuncao($reg['Funcao']); $objMembro->setParticipou($reg['JaParticipou']);\r\n\t $objMembro->setTrabalhando($reg['Trabalhando']); $objMembro->setViajando($reg['EstadoAtual']); $objMembro->setCongrega($reg['Congrega']); \r\n $objMembro->setRua($reg['Rua']); $objMembro->setBairro($reg['Bairro']); $objMembro->setCasa($reg['Casa']); $objMembro->setStatus($reg['Status']);\r\n $objMembro->setEmail($reg['tx_email']);\r\n $objMembro->setLider($reg['LiderCelula']);\r\n\r\n return $objMembro;\r\n }\r\n else{\r\n \r\n }\r\n \r\n mysql_free_result($busca); //limpa o resultado da pesquisa libera a memoria ocupado\r\n $objConexao->freebanco(); // fecha a conec��o com o banco\r\n\r\n }",
"function readData()\r\n\t{\r\n\t\tif( !file_exists( $this->source_file ) )\r\n\t\t{\r\n\t\t\tdie( \"Can not proceed: Can not locate data file: '\" . $this->source_file . \"'\" );\r\n\t\t}\r\n\t\t$this->m_aData = fopen( $this->source_file , 'r');\r\n\t}",
"function Import() {\n // Fichier sql\n $filename = 'http://localhost/alumnus/alumnus.sql';\n\n // Connexion\n $bdd = new PDO('mysql:host=localhost; dbname=alumnus', 'root', '');\n // Variable temporaire stockant la requête (ligne par ligne)\n $templine = '';\n // Lecture entière du fichier\n $lines = file($filename);\n // Boucle à travers chaque ligne\n foreach ($lines as $line){\n // Passage à la ligne suivante si c'est un commentaire ('--' et '/* */') ou si la ligne est vide\n if (substr($line, 0, 2) == '--' || substr($line, 0, 2) == '/*' || $line == '')\n continue;\n\n // Ajout ou concaténation de la ligne au segment actuel\n $templine .= $line;\n // Détection de fin de ligne avec le point-virgule\n if (substr(trim($line), -1, 1) == ';') {\n // Exécution de la requête\n $bdd->exec($templine);\n // Réinitialisation de la variable temporaire\n $templine = '';\n }\n }\n\n // Déconnexion\n $bdd = null;\n}",
"public function darBaixa($nomeIdb,$nomeb,$qteb,$codb,$dtCadastrob,$valorb){\n\n\t\t//$stmt = $conn->prepare(\"UPDATE tb_produtos SET nome = :NOME, qte = :QTE, cod = :COD, dtCadastro = :DTCADASTRO, preco = :PRECO, valorTotal = :VALORTOTAL WHERE nome = :NOMEID OR cod = :NOMEID \");\n\n\t\t$this->nomeId = $nomeIdb;\n\t\t$this->nome = $nomeb;\n\t\t$this->qte = $qteb;\n\t\t$this->cod = $codb;\n\t\t$this->ordCod = $this->cod;\n\t\t$this->dtCadastro = $dtCadastrob;\n\t\t$this->preco = $valorb;\n\t\t$this->valorTotal = ($this->qte * $this->preco);\n\n\t\t//var_dump($this->nomeId);\n\t\t//var_dump($this->nome);\n\t\t//var_dump($this->qte);\n\t\t//var_dump($this->cod);\n\t\t//var_dump($this->dtCadastro);\n\t\t//var_dump($this->preco);\n\t\t//var_dump($this->valorTotal);\n\n\n\t\t//$stmt->bindParam(\":NOME\", $this->nome);\n\t\t//$stmt->bindParam(\":QTE\", $this->qte);\n\t\t//$stmt->bindParam(\":COD\", $this->cod);\n\t\t//$stmt->bindParam(\":DTCADASTRO\", $this->dtCadastro);\n\t\t//$stmt->bindParam(\":PRECO\", $this->preco);\n\t\t//$stmt->bindParam(\":VALORTOTAL\", $this->valorTotal);\n\t\t//$stmt->bindParam(\":NOMEID\", $this->nomeId);\n\n\t\t//$stmt->execute();\n\n\n\t\t$conn = new Sql();\n\n\t\t$stmt = $conn->query(\"UPDATE tb_produtos SET nome = :NOME, qte = :QTE, cod = :COD, ordCod = :ORDCOD, dtCadastro = :DTCADASTRO, preco = :PRECO, valorTotal = :VALORTOTAL WHERE nome = :NOMEID OR cod = :NOMEID \", array(\n\t\t\t':NOMEID'=>$this->nomeId,\n\t\t\t':NOME'=>$this->nome,\n\t\t\t':QTE'=> $this->qte,\n\t\t\t':COD' => $this->cod,\n\t\t\t':ORDCOD'=>$this->ordCod,\n\t\t\t':DTCADASTRO' => $this->dtCadastro,\n\t\t\t':PRECO'=> $this->preco,\n\t\t\t':VALORTOTAL'=>$this->valorTotal\n\t\t));\n\t}",
"function relatorioDeCelulaPart1Dao(){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetocelula.php\");\r\n \r\n $objDao = Connection::getInstance(); \r\n $resultado = mysql_query(\"Select c.Codigo,m.Matricula,NomeCelula,c.Rua,c.Casa,c.Bairro,c.DiadaCelula,c.Status,m.Nome as Lider from celulas c join membros m on c.codLider = m.Matricula order by c.NomeCelula\") or die (\"Nao foi possivel realizar a busca 1\".mysql_error());\r\n \r\n $listaCelula = array();\r\n \r\n $i=0;\r\n// Select m.Nome from celulas c join celulamembro e on e.CodCelula = c.Codigo join membros m on e.CodMembro = m.Matricula where e.CodCelula = 7\r\n if($resultado){\r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){ \r\n\t $celula = new objetocelula();\r\n $celula->setId($registro['Codigo']);\r\n $celula->setIdMembro($registro['Matricula']);\r\n $celula->setNome($registro['NomeCelula']); $celula->setRua($registro['Rua']);\r\n $celula->setCasa($registro['Casa']); $celula->setBairro($registro['Bairro']);\r\n $celula->setDia($registro['DiadaCelula']); $celula->setStatus($registro['Status']);\r\n $celula->setNomeMembro($registro['Lider']);\r\n \r\n\t $listaCelula[$i] = $celula;\r\n\t $i++;\r\n\t}\r\n }\r\n return $listaCelula; \r\n\tmysql_free_result($resultado);\r\n $objDao->freebanco(); \r\n \r\n }",
"function inserirContato($dadosContato) {\n require_once('../modulo/config.php');\n\n //Import do arquivo de função para conectar no BD \n require_once('conexaoMysql.php');\n\n if(!$conex = conexaoMysql())\n {\n echo(\"<script> alert('\".ERRO_CONEX_BD_MYSQL.\"'); </script>\");\n //die; //Finaliza a interpretação da página\n }\n \n $nome = (string) null;\n $celular = (string) null;\n $email = (string) null;\n $estado = (int) null;\n $dataNascimento = (string) null;\n $sexo = (string) null;\n $obs = (string) null;\n $foto = \"noImage.png\";\n\n\n $nome = $dadosContato['nome'];\n $celular = $dadosContato['celular'];\n $email = $dadosContato['email'];\n $estado = $dadosContato['estado'];\n $dataNascimento =$dadosContato['dataNascimento'];\n\n $sexo = $dadosContato['sexo'];\n $obs = $dadosContato['obs'];\n //$foto = uploadFoto($_FILES['fleFoto']);\n\n\n\n // var_dump($arquivoUpload);\n\n $sql = \"insert into tblcontatos \n (\n nome, \n celular, \n email, \n idEstado, \n dataNascimento, \n sexo, \n obs,\n foto,\n statusContato\n )\n values\n (\n '\". $nome .\"',\n '\". $celular .\"',\n '\". $email .\"', \n \".$estado.\",\n '\". $dataNascimento .\"',\n '\". $sexo .\"', \n '\". $obs .\"',\n '\" . $foto . \"',\n 1\n )\n \";\n // Executa no BD o Script SQL\n\n if (mysqli_query($conex, $sql))\n \n return convertJson($dadosContato);\n else\n return false; \n \n}",
"public function buscarDatosDeCodigo($lote, $suc){\n $db = new My();\n $my = new My();\n $datos = array();\n $query = \"SELECT a.codigo AS Codigo,l.lote,CONCAT( a.descrip, '-', p.nombre_color) AS Descrip , s.suc, s.cantidad AS Stock, s.estado_venta,a.um AS UM,l.ancho AS Ancho,l.gramaje AS Gramaje,l.tara AS Tara,l.padre AS Padre,s.ubicacion AS U_ubic,\n l.img AS Img, l.kg_desc AS U_kg_desc,h.fecha_hora AS entDate\n\n FROM articulos a INNER JOIN lotes l ON a.codigo = l.codigo INNER JOIN stock s ON l.codigo = s.codigo AND l.lote = s.lote \n INNER JOIN pantone p ON l.pantone = p.pantone INNER JOIN historial h ON l.codigo = h.codigo AND l.lote = h.lote\n WHERE s.cantidad > 0 AND s.suc = '$suc' AND l.lote ='$lote' GROUP BY lote ORDER BY h.fecha_hora ASC LIMIT 1\";\n \n $my->Query($query);\n if($my->NextRecord()){\n $datos = $my->Record;\n if(count($datos)){\n $datos = array_map(\"utf8_encode\",$datos);\n // print_r($datos);\n \n $rem = \"SELECT CONCAT(fecha_cierre,' ',hora_cierre) AS fecha_ingreso FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado = 'Cerrada' AND n.suc_d = '$suc'\";\n \n $db->Query($rem);\n if($db->NumRows() > 0){ \n $db->NextRecord();\n $fecha_ingreso = $db->Record['fecha_ingreso'];\n $datos['entDate'] = $fecha_ingreso;\n }\n // Buscar si esta en una Remision Abierta o En Proceso\n $rem2 = \"SELECT n.n_nro, n.suc_d FROM nota_remision n, nota_rem_det d WHERE n.n_nro = d.n_nro AND lote = '$lote' AND n.estado != 'Cerrada' AND n.suc = '$suc'\";\n \n $db->Query($rem2);\n if($db->NumRows() > 0){ \n $db->NextRecord();\n $n_nro = $db->Record['n_nro'];\n $destino = $db->Record['suc_d'];\n $datos['NroRemision'] = $n_nro;\n $datos['Destino'] = $destino;\n $datos['Mensaje']=\"En Remision\";\n }else{\n $datos['Mensaje']=\"Ok\"; \n }\n \n }\n echo json_encode($datos);\n }else{\n echo '{\"Mensaje\":\"Error: Codigo no encontrado!\"}';\n } \n $my->Close();\n }",
"public function anexar(){\n// var_dump($_FILES);\n// var_dump($_POST);\n if(isset($_FILES) && isset($_POST['id']) && !empty($_FILES)){\n extract($_POST);\n $extensao = $this->validaExtensao($_FILES['arquivo']['name']);\n if($_FILES['arquivo']['size'] <= 4000000 && $extensao){\n $newName = md5(time()).\".\".$extensao;\n $this->validaPasta($tipo, $id);\n $caminho = \"arquivos/$tipo/$id/$newName\";\n if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $caminho)) {\n $arquivos = new Arquivos();\n $retorno = $arquivos->insereArquivoBD($_FILES['arquivo']['name'], $id, $caminho, $tipo);\n echo json_encode('ok');\n }else{\n echo json_encode(3);\n }\n \n } else {\n echo json_encode(2);\n }\n } else {\n echo json_encode(1);\n }\n }",
"public function loadFiles(){\n\n $files = array();\n\n if($this->id == -1 || empty($this->databasePath))\n return $series;\n\n\n $sqlQuery = 'SELECT D.* FROM data D , books B WHERE B.id = D.book AND B.id='.$this->id;\n\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $files[] = BookFile::_createFromRow($this->databasePath, $row); \n \n return $files;\n }",
"public function save(){\n\t\t$bd=baseDatos::getInstance();\n\t\t$bd=new baseDatos(BD_USUARIO, BD_CONTRASENA, BD_NOMBRE_BD, BD_SERVIDOR);\n\t\t$bd->connect();\n\t\tif($this->id<>null){\n\t\t$columnas= array('idHotel','nombre','descripcion','cantidadEstrellas','ciudad','direccion','telefono','email','ubicacionFotografia');\n\t\t$valores = array($this->id,$this->nombre, $this->descripcion, $this->cantidadEstrellas, $this->ciudad, $this->direccion, $this->telefono, $this->email, $this->ubicacionFotografia);\n\t\t$filtros=array('idHotel'=>$this->id!= null);\n\t\tif (is_numeric($this->id) && $this->id > 0) {\n\t\t\t$bd->update(self::$tabla, $columnas, $valores, $filtros);\n\t\t} else {\n\t\t\t$bd->insert(self::$tabla, $columnas, $valores);\n\t\t}\n\t\t}else{\n\t\t\t$columnas= array('nombre','descripcion','cantidadEstrellas','ciudad','direccion','telefono','email','ubicacionFotografia');\n\t\t\t$valores = array($this->nombre, $this->descripcion, $this->cantidadEstrellas, $this->ciudad, $this->direccion, $this->telefono, $this->email, $this->ubicacionFotografia);\n\t\t\t$filtros=array('idHotel'=>$this->id!= null);\n\t\t\tif (is_numeric($this->id) && $this->id > 0) {\n\t\t\t\t$bd->update(self::$tabla, $columnas, $valores, $filtros);\n\t\t\t} else {\n\t\t\t\t$bd->insert(self::$tabla, $columnas, $valores);\n\t\t\t}\n\t\t}$bd->disconnect();\n\n\t}",
"public function __construct(){\n require_once 'EntidadBase.php'; // Incluye el archivo EntidadBase\n require_once 'BaseModel.php'; // Incluye el archivo BaseModel\n foreach(glob('Model/*.php') as $file){ // Recorre todos los archivos de la carpeta Model con la extensión PHP.\n require_once($file); // Incluye el archivo\n }\n }",
"function EnviarArquivo($arquivo, $dados = null, $dmdid)\n{\n global $db;\n\n if (!$arquivo || !$dmdid)\n return false;\n\n // obtém o arquivo\n #$arquivo = $_FILES['arquivo'];\n if (!is_uploaded_file($arquivo['tmp_name'])) {\n redirecionar($_REQUEST['modulo'], $_REQUEST['acao'], $parametros);\n }\n // BUG DO IE\n // O type do arquivo vem como image/pjpeg\n if ($arquivo[\"type\"] == 'image/pjpeg') {\n $arquivo[\"type\"] = 'image/jpeg';\n }\n //Insere o registro do arquivo na tabela public.arquivo\n $sql = \"INSERT INTO public.arquivo \t\n\t\t\t(\n\t\t\t\tarqnome,\n\t\t\t\tarqextensao,\n\t\t\t\tarqdescricao,\n\t\t\t\tarqtipo,\n\t\t\t\tarqtamanho,\n\t\t\t\tarqdata,\n\t\t\t\tarqhora,\n\t\t\t\tusucpf,\n\t\t\t\tsisid\n\t\t\t)VALUES(\n\t\t\t\t'\" . current(explode(\".\", $arquivo[\"name\"])) . \"',\n\t\t\t\t'\" . end(explode(\".\", $arquivo[\"name\"])) . \"',\n\t\t\t\t'\" . $dados[\"arqdescricao\"] . \"',\n\t\t\t\t'\" . $arquivo[\"type\"] . \"',\n\t\t\t\t'\" . $arquivo[\"size\"] . \"',\n\t\t\t\t'\" . date('Y-m-d') . \"',\n\t\t\t\t'\" . date('H:i:s') . \"',\n\t\t\t\t'\" . $_SESSION[\"usucpf\"] . \"',\n\t\t\t\t\" . $_SESSION[\"sisid\"] . \"\n\t\t\t) RETURNING arqid;\";\n $arqid = $db->pegaUm($sql);\n\n //Insere o registro na tabela demandas.anexos\n $sql = \"INSERT INTO demandas.anexos \n\t\t\t(\n\t\t\t\tdmdid,\n\t\t\t\tarqid,\n\t\t\t\tanxdtinclusao,\n\t\t\t\tanxstatus\n\t\t\t)VALUES(\n\t\t\t \" . $dmdid . \",\n\t\t\t\t\" . $arqid . \",\n\t\t\t\tnow(),\n\t\t\t\t'A'\n\t\t\t);\";\n $db->executar($sql);\n\n if (!is_dir('../../arquivos/demandas/' . floor($arqid / 1000))) {\n mkdir(APPRAIZ . '/arquivos/demandas/' . floor($arqid / 1000), 0777);\n }\n $caminho = APPRAIZ . 'arquivos/' . $_SESSION['sisdiretorio'] . '/' . floor($arqid / 1000) . '/' . $arqid;\n switch ($arquivo[\"type\"]) {\n case 'image/jpeg':\n ini_set(\"memory_limit\", \"128M\");\n list($width, $height) = getimagesize($arquivo['tmp_name']);\n $original_x = $width;\n $original_y = $height;\n // se a largura for maior que altura\n if ($original_x > $original_y) {\n $porcentagem = (100 * 640) / $original_x;\n } else {\n $porcentagem = (100 * 480) / $original_y;\n }\n $tamanho_x = $original_x * ($porcentagem / 100);\n $tamanho_y = $original_y * ($porcentagem / 100);\n $image_p = imagecreatetruecolor($tamanho_x, $tamanho_y);\n $image = imagecreatefromjpeg($arquivo['tmp_name']);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $tamanho_x, $tamanho_y, $width, $height);\n imagejpeg($image_p, $caminho, 100);\n //Clean-up memory\n ImageDestroy($image_p);\n //Clean-up memory\n ImageDestroy($image);\n break;\n default:\n if (!move_uploaded_file($arquivo['tmp_name'], $caminho)) {\n $db->rollback();\n return false;\n }\n }\n\n\n $db->commit();\n return true;\n}",
"private function _loadDataToTemporaryTable(){\n\n }",
"public function Tutores(){\n if (isset($_FILES['file'])) {\n if (($gestor = fopen($_FILES['file']['tmp_name'], \"r\")) !== FALSE) {\n $coun = 0 ;\n\n while (($datos = fgetcsv($gestor, 1000, \";\")) !== FALSE) {\n if ($coun!=0) { \n $dato = explode('-',$datos['9']);\n $rut = $dato['0'];\n $dv = $dato['1'];\n $tutor=$datos['10'];\n $asignatura=$datos['11']; \n }\n $coun= $coun + 1;\n fclose($gestor);\n\n }\n $user = $this->session->userdata('logged_in');\n if(count($user['permisos']) > 0){\n if (in_array(1, $user['permisos'])) {\n redirect('Asesor_Controller/importar','refresh');\n }elseif (in_array(2, $user['permisos'])) {\n redirect('Asistente_Controller/importar','refresh');\n }\n }\n }\n }\n }",
"public function procesarPagos(){ \n\t\trequire_once './core/SimpleXLSX.php';\n\t\t$dato=\"\";\n\t\t$fecha=\"\";\n\t\t$reg=0;\n\t\t$act=0;\n\t\t$count1=0;\n\t\t$aporte0=new Aporte($this->adapter);\n\t\t$porCruzar= $aporte0->contarCruceAportes();\n\t\tif (isset($porCruzar) && count($porCruzar)>=1)\n {\n\t\t\t\t foreach($porCruzar as $aporte)\n\t\t\t\t {\n\t\t\t\t\t $count1 = $aporte->aporteID;\n\t\t\t\t }\n\t\t\t }\n\t\t\n\t\tif ( $xlsx = SimpleXLSX::parse( './uploads/Datos.xlsx' ) ) {\n\t\t\t \n\t foreach ( $xlsx->rows() as $r => $row ) {\n\t\t\n\t\tif ($r > 0)\n\t\t{\n\t\t\tif ($row[5]!= 'Depósito')\n\t\t\t{\n\t\t\t\t$fecha = substr($row[3], 0, 19) ;\n\t\t\t\t$fecha = str_replace(\".\",\":\",$fecha);\n\t\t\t\t$fecha = substr_replace($fecha, \" \", 10, 1);\n\t\t\t\t\t//echo $fecha.':'.$row[5].'|||'.$fecha .'<br/>';\n\t\t\t\t\t\n\t\t\t\t$aporte=new Aporte($this->adapter);\n\t\t\t\t$aporte->setTransactionID($row[4]);\n\t\t\t\t$aporte->setBank($row[14]);\n\t\t\t\t$aporte->setRegisteredDate($fecha);\n\t\t\t\t$aporte->setValue($row[6]);\n\t\t\t\t$aporte->setAccount($row[13]);\n\t\t\t\t\n\t\t\t\t$save=$aporte->updateCruce(); // Manda a actualizar la moto en el modelo\n\t\t\t\tif ($save == TRUE)\n\t\t\t\t{\n\t\t\t\t\t$act = $act+1;\n\t\t\t\t}\n\t\t\t\t$reg = $reg+1;\t\n\t\t\t\t//$dato = \"UPDATE aporte set \\\"transactionId\\\"='\".$row[4].\"', \\\"bank\\\"='\".$row[14].\"', \\\"registeredDate\\\"='\".$fecha.\"', \\\"bankValidated\\\"='true' WHERE \\\"account\\\"='\".$row[13].\"' AND \\\"value\\\"='\".$row[6].\"' AND \\\"bankValidated\\\"='false' AND \\\"callCenterValidated\\\"='false' AND \\\"transactionId\\\"= '0';\";\n\t\t\t\t//echo strval($save) . '<br/>';\n\t\t\t\ttry{\n\t\t\t\t$payment=new Payment($this->adapter);\n\t\t\t\t$payment->setTransactionID($row[4]);\n\t\t\t\t$payment->setValue($row[6]);\n\t\t\t\t$payment->setCedula($row[10]);\n\t\t\t\t$payment->setBank($row[14]);\n\t\t\t\t$payment->setAccount($row[13]);\n\t\t\t\t$payment->setRegisteredDate($fecha);\n\t\t\t\t$payment->setIsMatched('false');\n\t\t\t\t$payment->setIsActive('true');\n\t\t\t\t$save=$payment->save();\n\t\t\t\t}\n\t\t\t\tcatch (Exception $e) {\n\t\t\t\t\t//echo 'Excepción capturada: ', $e->getMessage(), \"\\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t}\n\t\t} else {\n\t\techo SimpleXLSX::parseError();\n\t\t}\n\t\t\t$count2=0;\n\t\t$aporte1=new Aporte($this->adapter);\n\t\t$porCruzar1= $aporte1->contarCruceAportes();\n\t\tif (isset($porCruzar1) && count($porCruzar1)>=1)\n {\n\t\t\t\t foreach($porCruzar1 as $aporte)\n\t\t\t\t {\n\t\t\t\t\t $count2 = $aporte->aporteID;\n\t\t\t\t }\n\t\t\t }\n\t\t$payment0=new Payment($this->adapter);\n\t $save=$payment0->updateMatch();\n\t\n\t\t$aporte1->phpAlert('Registros econtrados en excel: ' .$reg \n\t\t.'\\nRegistros procesados desde el excel: ' .$act\n\t\t.'\\nAportes pendientes por cruzar antes del cruce: ' .$count1\n\t\t.'\\nAportes pendientes de cruzar luego del cruce: ' .$count2\n\t\t.'\\nTOTAL CRUZADOS en esta carga: ' .($count1 - $count2),\n\t\t$this->baseUrl(\"BandejaCallcenters\", \"index\")); // Alerta y redirige\n //$this->redirect(\"BandejaBancos\", \"index\"); // COntrolador + Vista\n }",
"public function recorrerArchivoXLS(){\n $array = [];\n for ($row = $this->filaDesde; $row <= $this->filaHasta; ++ $row) {\n $item = new ExtractoBancarioItemVO();\n for ($col = $this->columnaDesde; $col < $this->columnaHasta; ++ $col) {\n //si la columna leída nos interesa continúo.\n if(in_array($col, $this->columnas)){\n $cell = $this->worksheet->getCellByColumnAndRow($col, $row);\n $val = $cell->getValue();\n if (PHPExcel_Shared_Date::isDateTime($cell)) {\n $val = date($format = \"Y-m-d\", PHPExcel_Shared_Date::ExcelToPHP($val));\n }\n array_push($array, $val);\n }\n }\n\n $item->asignarValores($array, $this->idTipoBanco['valor']); //asigno los valores al objeto.\n $this->mensaje['valor'] .= $item->idTipoBancoConcepto['referencia']->result->getMessage();\n //si el status no es OK, incremento el contador de erróneos.\n if($item->idTipoBancoConcepto['referencia']->result->getStatus() != STATUS_OK)\n $this->cantidadRegistrosError['valor']++;\n $this->extractoBancarioItemArray[] = $item; //agrego el registro al array.\n $array = [];\n $this->cantidadRegistros['valor']++;\n }\n }",
"function readOne(){\n $query = \"SELECT * FROM \" . $this->tableName . \" WHERE idNotaFiscal = ? LIMIT 0,1\";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of product to be updated\n $stmt->bindParam(1, $this->idNotaFiscal);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->idNotaFiscal = $row['idNotaFiscal'];\n $this->idEmitente = $row['idEmitente'];\n $this->numero = $row['numero'];\n $this->serie = $row['serie'];\n $this->chaveNF = $row['chaveNF'];\n $this->docOrigemTipo = $row['docOrigemTipo'];\n $this->docOrigemNumero = $row['docOrigemNumero'];\n $this->docOrigemParcela = $row['docOrigemParcela'];\n $this->idEntradaSaida = $row['idEntradaSaida'];\n $this->idTomador = $row['idTomador'];\n $this->cfop = $row['cfop'];\n $this->dataInclusao = $row['dataInclusao'];\n $this->dataEmissao = $row['dataEmissao'];\n $this->dataProcessamento = $row['dataProcessamento'];\n $this->situacao = $row['situacao'];\n $this->ambiente = $row['ambiente'];\n $this->textoResposta = $row['textoResposta'];\n $this->textoJustificativa = $row['textoJustificativa'];\n $this->dataCancelamento = $row['dataCancelamento'];\n $this->valorTotal = $row['valorTotal'];\n $this->valorOutrasDespesas = $row['valorOutrasDespesas'];\n $this->valorDesconto = $row['valorDesconto'];\n $this->obsImpostos = $row['obsImpostos'];\n $this->dadosAdicionais = $row['dadosAdicionais'];\n $this->linkNF = $row['linkNF'];\n $this->linkXml = $row['linkXml'];\n }",
"function datos_ficha_eu($id) {\n\t\t\n\t\t$query = \"SELECT eu.*, eu_descripcion.*\n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=$id\n\t\tAND eu.id_eu=eu_descripcion.id_eu\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $row;\n\t\t}\n\t}",
"public function run()\n { \n \n Empresa::truncate(); // Evita duplicar datos\n \n $empresa = new Empresa();\n $empresa->nombre = \"Hidrandina\";\n $empresa->descripcion = \"Descripcion 1\";\n $empresa->ruc = intval(20132023542);\n $empresa->user_id = 1;\n $empresa->save();\n\n $empresa = new Empresa();\n $empresa->nombre = \"Enel Distribucion\";\n $empresa->descripcion = \"Descripcion 2\";\n $empresa->ruc = intval(20269985902);\n $empresa->user_id = 1;\n $empresa->save();\n\n Tarifa::truncate(); // Evita duplicar datos\n\n $tarifa = new Tarifa();\n $tarifa->codigo = \"Tarifa 1\";\n $tarifa->tipo = \"Comercial\";\n $tarifa->save();\n\n $tarifa = new Tarifa();\n $tarifa->codigo = \"Tarifa 2\";\n $tarifa->tipo = \"Domestico\";\n $tarifa->save();\n\n Distrito::truncate(); // Evita duplicar datos\n\n $distrito = new Distrito();\n $distrito->nombre = \"San Blas\"; \n $distrito->save();\n\n $distrito = new Distrito();\n $distrito->nombre = \"Santa Luzmila\"; \n $distrito->save();\n\n Region::truncate(); // Evita duplicar datos\n\n $distrito = new Region();\n $distrito->nombre = \"San Martin\"; \n $distrito->save();\n\n $distrito = new Region();\n $distrito->nombre = \"Moyobamba\"; \n $distrito->save();\n\n Ficha::truncate(); // Evita duplicar datos\n \n $ficha = new Ficha();\n $ficha->localidad = \"Shucllapampa\";\n $ficha->D1FE = \"Potencia 65W, S\";\n $ficha->D2FE = \"Corriente 10A, S\";\n $ficha->D3FE = \"Capacidad 92Ah, S\";\n $ficha->D4FE = \"Potencia 85W, S\";\n $ficha->D1FF = \"Tension 16.7, N\";\n $ficha->D2FF = \"Tension 12.8, S\"; $ficha->D3FF = \"Tension 12.8, S\";\n $ficha->D4FF = \"Tension 11.8, N\";\n $ficha->Comentarios = \"Sin observaciones\"; \n $ficha->Resultado = \"Si Cumple\"; \n $ficha->tarifa_id = 1;\n $ficha->empresa_id = 1; \n $ficha->region_id = 1;\n // $ficha->distrito_id = 1;\n $ficha->save();\n\n $ficha->distritos()->attach([1]); //Relacionar la ficha a un distrito\n\n $ficha = new Ficha();\n $ficha->localidad = \"Contumasa\";\n $ficha->D1FE = \"Potencia 45W, S\";\n $ficha->D2FE = \"Corriente 8A, S\";\n $ficha->D3FE = \"Capacidad 72Ah, S\";\n $ficha->D4FE = \"Potencia 95W, S\";\n $ficha->D1FF = \"Tension 19.7, N\";\n $ficha->D2FF = \"Tension 11.8, S\"; $ficha->D3FF = \"Tension 10.8, S\";\n $ficha->D4FF = \"Tension 12.8, N\";\n $ficha->Comentarios = \"Se obtuvieron las siguientes observaciones: No cuenta con pararayos y 01 transformador averiado\";\n $ficha->Resultado = \"No Cumple\";\n $ficha->tarifa_id = 2;\n $ficha->empresa_id = 2; \n $ficha->region_id = 2;\n // $ficha->distrito_id = 2;\n $ficha->save();\n\n $ficha->distritos()->attach([2]); //Relacionar la ficha a un distrito\n\n }",
"public function make($file)\n {\n $data = Excel::toArray(new ProductImport, $file);\n $data=$data[0];\n //dd($data);\n\n foreach ($data as $row) {\n if (isset($row[2])) {\n if ($row[5]!=\"-\") {\n $Doctor= array(\n 'nombre' => $row[5],\n 'apellidopaterno' => $row[6],\n 'apellidomaterno' => $row[7],\n //'celular' => $row[1],\n //'mail' => $row[2],\n //'nacimiento' => $row[2],\n 'activo' => 1,\n //'deleted_at' => $row[2,]\n );\n $D=Doctor::updateOrCreate($Doctor, $Doctor);\n $ID_Doctor=$D['id'];\n }\n \n \n \n\n # code...\n \n if (isset($ID_Doctor)) {\n $Paciente= array(\n 'nombre' => $row[2],\n 'paterno' => $row[3],\n 'materno' => $row[4],\n \n //'nacimiento' => $row[3],\n 'rfc' => $row[19],\n 'celular' => $row[29],\n 'telefono' => $row[30],\n 'mail' => $row[28],\n 'doctor_id' => $ID_Doctor,\n 'nivel_id' => 1,\n 'oficina_id' => 1,\n //'homoclave' => $row[11],\n //'created_at' => date('Y-m-d h:m:s'),\n //'updated_at' => date('Y-m-d h:m:s'),\n );\n }else{\n $Paciente= array(\n 'nombre' => $row[2],\n 'paterno' => $row[3],\n 'materno' => $row[4],\n //'nacimiento' => $row[3],\n 'rfc' => $row[19],\n 'celular' => $row[29],\n 'telefono' => $row[30],\n 'mail' => $row[28],\n //'id_doctor' => $ID_Doctor,\n 'nivel_id' => 1,\n 'oficina_id' => 1,\n //'homoclave' => $row[11],\n //'created_at' => date('Y-m-d h:m:s'),\n //'updated_at' => date('Y-m-d h:m:s'),\n );\n }\n \n $P=Paciente::updateOrCreate(['nombre' => $row[2],'materno' => $row[4],'paterno' => $row[3]],$Paciente);\n $Precio_public=0;\n $Precio_public_iva=0;\n for ($i=0; $i <8 ; $i++) { \n if ( Producto::where('sku',$row[11+$i])->exists()) {\n $Precio_public+=Producto::where('sku',$row[11+$i])->value('precio_publico');\n $Precio_public_iva +=Producto::where('sku',$row[11+$i])->value('precio_publico_iva');\n }\n }\n if ($Precio_public>0) {\n $Venta= array(\n 'paciente_id'=>$P['id'],\n 'fecha'=> Carbon::instance(\\PhpOffice\\PhpSpreadsheet\\Shared\\Date::excelToDateTimeObject($row[1])),\n 'subtotal' => $Precio_public,\n 'total' => $Precio_public_iva,\n 'oficina_id' => 1,\n 'empleado_id' => 1,\n 'tipoPago' =>0\n );\n $V=Venta::updateOrCreate(['paciente_id'=>$P['id'],'subtotal' => $Precio_public,'total' => $Precio_public_iva,'empleado_id' => 1],$Venta);\n \n for ($i=0; $i < 8 ; $i++) {\n if ( Producto::where('sku',$row[11+$i])->exists()) { \n $V->productos()->attach(\n Producto::where('sku',$row[11+$i])->value('id'),array('cantidad'=>1,\n 'precio'=>Producto::where('sku',$row[11+$i])->value('precio_publico'), \n 'created_at' => date('Y-m-d h:m:s'), \n 'updated_at' => date('Y-m-d h:m:s')\n ));\n }\n }\n\n if ($row[19]!=\"-\") {\n $Factura= array(\n 'venta_id'=>$V['id'],\n 'nombre'=>$row[20],\n //'fisica'=>$row[],\n 'rfc'=>$row[30],\n //'regimen_fiscal'=>$row[],\n //'homoclave'=>$row[],\n 'correo'=>$row[28],\n 'calle'=>$row[21],\n 'num_ext'=>$row[22],\n 'num_int'=>$row[23],\n 'colonia'=>$row[24],\n 'cp' => $row[25],\n //'ciudad'=>$row[],\n 'municipio'=>$row[26],\n 'estado'=>$row[27],\n 'created_at' => date('Y-m-d h:m:s'), \n 'updated_at' => date('Y-m-d h:m:s')\n );\n Factura::updateOrCreate($Factura,$Factura);\n }\n \n \n }\n \n\n \n }\n /*$data = $data[0];\n \n if (!count($data)) {\n return redirect()->back()->withErrors(['error', 'Error al subir el archivo.']);\n }\n\n try {\n // OBTENEMOS LOS PRODUCTOS DEL EXCEL\n foreach ($data as $row) {\n $indice = $this->buscarPreciosenExcel($Precios, count($Precios), $row[0]);\n if ($indice != -1) {\n $arr[] = [\n 'nombre' => $row[2],\n 'materno' => $row[4],\n 'paterno' => $row[3],\n //'nacimiento' => $row[3], \n //'rfc' => number_format((float)$row[30], 2, '.', ''),\n 'rfc' => $row[30],\n 'celular' => $row[41],\n 'telefono' => $row[40],\n 'mail' => $row[39],\n //'otro_doctor' => $row[8],\n 'nivel_id' => \"1\",\n 'oficina_id' => $row[10],\n 'homoclave' => $row[11],\n 'created_at' => date('Y-m-d h:m:s'),\n 'updated_at' => date('Y-m-d h:m:s'),\n ];\n }\n }\n } catch (\\ErrorException $ee) {\n return redirect()->back()->withErrors(['status', 'error_create']);\n }\n\n if (empty($arr)) {\n return redirect()->back()->withErrors(['error', 'Error al subir el archivo.']);\n }\n\n foreach ($arr as $producto) {\n Producto::updateOrCreate($producto, $producto);\n }\n */\n }\n }",
"function insertarFicha($datos_joven, $datos_apoderado) {\n //log_message('error',print_r(3,true));\n //log_message('error',print_r($datos_joven,true));\n //log_message('error',print_r($datos_apoderado,true));\n $this->db->trans_start(); \n $sql= 'SELECT * FROM \"MDB_MODULOS\".\"MODULOS_INSDATOSJOVEN\"(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)';\n $result = $this->db->query($sql, $datos_joven);\n log_message('error',print_r($result->result()[0]->MODULOS_INSDATOSJOVEN,true));\n $data = explode('|',$result->result()[0]->MODULOS_INSDATOSJOVEN);\n\n if($data[2] != '0'){\n //log_message('error',print_r('abel hola',true));\n $this->db->trans_rollback();\n return array('error'=> EXIT_ERROR,'msj'=> 'El usuario tiene una ficha valida');\n }\n else if($data[0] == 'OK'){\n if($datos_apoderado != \"0\") {\n //log_message('error',print_r('abel hola2',true));\n $sql= 'SELECT * FROM \"MDB_MODULOS\".\"MODULOS_INSDATOSAPODERADO\"(?,?,?,?,?,?,?,?,?,?,?,?,?)';\n $result = $this->db->query($sql, $datos_apoderado);\n //log_message('error',print_r($result->result()[0]->MODULOS_INSDATOSAPODERADO,true));\n $data2 = explode('|',$result->result()[0]->MODULOS_INSDATOSAPODERADO);\n if($data2[0] == 'OK'){\n $this->db->trans_complete();\n return array('error'=> EXIT_SUCCESS,'codigo1'=>$data[1],'codigo2'=>$data2[1]);\n } else {\n $this->db->trans_rollback();\n return array('error'=> EXIT_ERROR);\n }\n } else {\n $this->db->trans_complete();\n return array('error'=> EXIT_SUCCESS,'codigo1'=>$data[1],'codigo2'=>\"0\");\n }\n } else {\n\n $this->db->trans_rollback();\n return array('error'=> EXIT_ERROR,'msj'=> 'Error');\n }\n }",
"function Cargar($recuperanombre,$recuperacif,$recuperavisible,$recuperacic,$recuperatipo,$recuperagrupo_gestion,$recuperadireccion,$recuperalocalidad,$recuperacodigo_postal,$recuperaprovincia,$recuperapais, $recuperatelefono,$recuperafax,$recuperamail,$recuperaresponsable,\r\n\t$recuperacargo_responsable,$recuperagrupo_comision,$recuperasituacion,$recuperaobservaciones,$recuperanombre_fiscal,$recuperadireccion_fiscal,$recuperalocalidad_fiscal,$recuperacodigo_postal_fiscal,\r\n\t$recuperapais_fiscal,$recuperaswift,$recuperacc_iban,$recuperanombre_banco,$recuperadireccion_banco,$recuperamail_contabilidad){\r\n\r\n\t\t$conexion = $this ->Conexion;\r\n\r\n\t\t//Consulta\r\n\t\t$Filadesde = $this ->Filadesde;\r\n\t\t$Usuario = $this ->Usuario;\r\n\r\n\t\t//ESPECIFICO: Cargamos las lineas solicitadas para esta pantalla\r\n\t\t$buscar_codigo = $this ->Buscar_codigo;\r\n\t\t$buscar_nombre = $this ->Buscar_nombre;\r\n\t\t$buscar_grupo_gestion = $this ->Buscar_grupo_gestion;\t\r\n\r\n\r\n\r\n\t\tif($buscar_codigo != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE ID = '\".$buscar_codigo.\"'\";\r\n\t\t}elseif($buscar_nombre != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE LIKE '%\".$buscar_nombre.\"%'\";\r\n\t\t}elseif($buscar_grupo_gestion != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE GRUPO_GESTION = '\".$buscar_grupo_gestion.\"'\";\r\n\t\t}else{\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE = 'XX' \";\r\n\t\t\t//$CADENA_BUSCAR = \"\";\r\n\t\t}\r\n\r\n\t\t$resultado =$conexion->query(\"SELECT id,nombre,cif,visible,cic,tipo,grupo_gestion,direccion,localidad,codigo_postal,provincia,pais,telefono,fax,mail,responsable,\r\n\tcargo_responsable,grupo_comision,situacion,observaciones,nombre_fiscal,direccion_fiscal,localidad_fiscal,codigo_postal_fiscal,provincia_fiscal,pais_fiscal,swift,cc_iban,nombre_banco,direccion_banco,mail_contabilidad FROM hit_minoristas \".$CADENA_BUSCAR.\" ORDER BY NOMBRE\");\r\n\r\n\t\t/*if ($resultado == FALSE){\r\n\t\t\techo('Error en la consulta');\r\n\t\t\t$resultado->close();\r\n\t\t\t$conexion->close();\r\n\t\t\texit;\r\n\t\t}*/\r\n\t\t//----------------------------------------------------------------\r\n\r\n\t\t//Guardamos el resultado en una matriz con un numero fijo de registros\r\n\t\t//que controlaremos por una tabla de configuracion de pantallas de usuarios. ESPECIFICO: Solo el nombre del formulario en la query\r\n\t\t$numero_filas =$conexion->query(\"SELECT LINEAS_MODIFICACION FROM hit_usuarios_formularios WHERE FORMULARIO = 'MINORISTAS' AND USUARIO = '\".$Usuario.\"'\");\r\n\t\t$Nfilas\t = $numero_filas->fetch_assoc();\t\t\t\t\t\t\t\t\t\t\t //------\r\n\r\n\t\t$minoristas = array();\r\n\t\tif($recuperanombre != null){\r\n\t\t\t$minoristas[0] = array (\"id\" => null, \"nombre\" => $recuperanombre, \"cif\" => $recuperacif, \"visible\" => $recuperavisible, \"cic\" => $recuperacic, \"tipo\" => $recuperatipo, \"grupo_gestion\" => $recuperagrupo_gestion, \"direccion\" => $recuperadireccion, \"localidad\" => $recuperalocalidad, \"codigo_postal\" => $recuperacodigo_postal, \"provincia\" => $recuperaprovincia, \"pais\" => $recuperapais, \"telefono\" => $recuperatelefono, \"fax\" => $recuperafax, \"mail\" => $recuperamail, \"responsable\" => $recuperaresponsable, \"cargo_responsable\" => $recuperacargo_responsable, \"grupo_comision\" => $recuperagrupo_comision, \"situacion\" => $recuperasituacion, \"observaciones\" => $recuperaobservaciones, \"v\" => $recuperanombre_fiscal, \"direccion_fiscal\" => $recuperadireccion_fiscal, \"localidad_fiscal\" => $recuperalocalidad_fiscal, \"codigo_postal_fiscal\" => $recuperacodigo_postal_fiscal, \"provincia_fiscal\" => $recuperaprovincia_fiscal, \"pais_fiscal\" => $recuperapais_fiscal, \"swift\" => $recuperaswift, \"cc_iban\" => $recuperacc_iban, \"nombre_banco\" => $recuperanombre_banco, \"direccion_banco\" => $recuperadireccion_banco, \"mail_contabilidad\" => $recuperamail_contabilidad);\r\n\t\t}else{\r\n\t\t\tfor ($num_fila = $Filadesde-1; $num_fila <= $Filadesde + $Nfilas['LINEAS_MODIFICACION']-2; $num_fila++) {\r\n\t\t\t\t$resultado->data_seek($num_fila);\r\n\t\t\t\t$fila = $resultado->fetch_assoc();\r\n\t\t\t\tarray_push($minoristas,$fila);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Liberar Memoria usada por la consulta\r\n\t\t$resultado->close();\r\n\t\t$numero_filas->close();\r\n\r\n\t\treturn $minoristas;\t\t\t\t\t\t\t\t\t\t\t\r\n\t}",
"public function executeGenerarfile(sfWebRequest $request)\n {\n\n // Variables\n $sqlUpdate='';\n\n // Redirige al inicio si no tiene acceso\n if (!$this->getUser()->getGuardUser()->getIsSuperAdmin())\n $this->redirect('ingreso');\n\n $archivo = Doctrine_Core::getTable('Actualizacionestrat')->find(array($request['id']));\n // $archivo = Doctrine_Core::getTable('Actualizaciones')->find(array(2));\n\n $arr = explode(\".\", $archivo->getImagefile(), 2);\n $first = $arr[0];\n\n $nombre_archivo_upd = sfConfig::get('app_pathfiles_folder').\"/../actualizacionestrat\".'/upd_'.$first.\".sql\";\n\n // DATOS conexion\n /*$dbhost = 'localhost';$dbname = 'circulo'; $dbuser = 'root'; $dbpass = 'root911';\n\n $pdo = new \\PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass, array(\n \\PDO::MYSQL_ATTR_LOCAL_INFILE => true\n ));*/\n\n\n // PRIMER PASO : ACTUALIZACION DE REGISTROS\n\n // SI existe el archivo previamente, lo borro\n if (file_exists($nombre_archivo_upd)) unlink($nombre_archivo_upd);\n\n // CONSULTA por registros a ACTUALIZAR (ya existe el email en la tabla de Pacientes)\n //$datoss = $archivo = Doctrine_Core::getTable('Actualizaciones')->obtenerRegistrosAActualizar();\n\n $fp=fopen($nombre_archivo_upd,\"w+\");\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('nombre','nombre','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('abreviacion','abreviacion','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idgrupotratamiento','idgrupotratamiento','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idobrasocial','idobrasocial','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idplan','idplan','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idontologia','idontologia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('garantia','garantia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importe','importe','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('coseguro','coseguro','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importeos','importeos','N');\n fwrite($fp,$sqlUpdate);\n\n\n\n fclose ($fp);\n\n return true;\n\n }",
"public function geraInterface(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modeloAdm = Util::getConteudoTemplate($this->gui.'/Modelo.adm.tpl');\n $modeloCad = Util::getConteudoTemplate($this->gui.'/Modelo.cad.tpl');\n $modeloEdit = Util::getConteudoTemplate($this->gui.'/Modelo.edit.tpl');\n\n $dir = '';\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n // === Nao gerar interface de tabelas n:m\n if((string)$aTabela['TIPO_TABELA'] == 'N:M')\n continue;\n\n $copiaModeloAdm = $modeloAdm;\n $copiaModeloCad = $modeloCad;\n $copiaModeloEdit = $modeloEdit;\n\n $nomeClasse\t = ucfirst($this->getCamelMode((string)$aTabela['NOME']));\n $objetoClasse = \"\\$o$nomeClasse\";\n\n # Varre a estrutura dos campos da tabela em questao\n $aPKRequest = $aCampoPK = $aCampoCad = $aCampoEdit = $aTituloAdm = $aCampoAdm = $aGetAll = array();\n $PK = $ID_PK = $label = $campoAdm = $componenteCad = $componenteEdit = NULL;\n\n foreach($aTabela as $oCampo){\n $nomeFKClasse = ucfirst($this->getCamelMode((string)$oCampo->FKTABELA));\n //$label = ((string)$oCampo->FKCAMPO != '') ? ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", (string)$oCampo->NOME)) : \n $label = ((string)$oCampo->FKCAMPO != '') ? $nomeFKClasse :\n ucfirst(str_replace((string)$aTabela['NOME'], \"\", (string)$oCampo->NOME));\n\n $campoAdm = ((string)$oCampo->FKCAMPO != '') ? $objetoClasse.\"->o$label\".\"->\".$this->getTituloCombo((string)$oCampo->FKTABELA) :\n $objetoClasse.\"->$oCampo->NOME\";\n\n if((int)$oCampo->CHAVE == 1){\n $aPKRequest[] = \"\\$_REQUEST['{$oCampo->NOME}']\";\n $aCampoPK[] = Form::geraHidden((string)$oCampo->NOME);\n\n if((string)$oCampo->FKTABELA != ''){ // Tabela cuja PK = FK => Relacao 1:1\n $PK = \"o$nomeFKClasse\".\"->\".$oCampo->FKCAMPO;\n $ID_PK = $oCampo->FKCAMPO;\n\n //print \"($objetoClasse, {$oCampo->NOME}, $label, $nomeFKClasse, \".$this->getTituloCombo((string)$oCampo->FKTABELA).\", 'CAD')\\n\";\n $componenteCad = Form::geraSelect($objetoClasse, (string)$oCampo->NOME, $label, $oCampo->FKCAMPO, $this->getTituloCombo((string)$oCampo->FKTABELA), 'CAD', $this->gui);\n $componenteEdit = Form::geraSelect($objetoClasse, (string)$oCampo->NOME, $label, $oCampo->FKCAMPO, $this->getTituloCombo((string)$oCampo->FKTABELA), 'EDIT', $this->gui);\n\n } else {\n $PK = (string)$oCampo->NOME;\n $ID_PK = (string)$oCampo->NOME;\n }\n } else {\n switch((string)$oCampo->TIPO){\n case \"date\":\n $componenteCad = Form::geraCalendario($objetoClasse, (string)$oCampo->NOME, $label, 'CAD');\n $componenteEdit = Form::geraCalendario($objetoClasse, (string)$oCampo->NOME, $label, 'EDIT');\n $campoAdm = Form::geraCalendario($objetoClasse, (string)$oCampo->NOME, $label, 'ADM');\n break;\n\n case \"datetime\":\n case \"timestamp\":\n $componenteCad = Form::geraCalendarioDataHora($objetoClasse, (string)$oCampo->NOME, $label, 'CAD');\n $componenteEdit = Form::geraCalendarioDataHora($objetoClasse, (string)$oCampo->NOME, $label, 'EDIT');\n $campoAdm = Form::geraCalendarioDataHora($objetoClasse, (string)$oCampo->NOME, $label, 'ADM');\n break;\n\n case \"text\": \n $componenteCad = Form::geraTextArea($objetoClasse, (string)$oCampo->NOME, $label, 'CAD', $this->gui);\n $componenteEdit = Form::geraTextArea($objetoClasse, (string)$oCampo->NOME, $label, 'EDIT', $this->gui);\n break;\n\n case \"tinyint(1)\": \n $componenteCad = Form::geraCheckBox($objetoClasse, (string)$oCampo->NOME, $label, 'CAD', $this->gui);\n $componenteEdit = Form::geraCheckBox($objetoClasse, (string)$oCampo->NOME, $label, 'EDIT', $this->gui);\n break;\n\n default:\n if($oCampo->FKCAMPO != ''){\n $componenteCad = Form::geraSelect($objetoClasse, (string)$oCampo->NOME, $label, $oCampo->FKCAMPO, $this->getTituloCombo((string)$oCampo->FKTABELA), 'CAD', $this->gui);\n $componenteEdit = Form::geraSelect($objetoClasse, (string)$oCampo->NOME, $label, $oCampo->FKCAMPO, $this->getTituloCombo((string)$oCampo->FKTABELA), 'EDIT', $this->gui);\n }\n else{\n $componenteCad = (preg_match(\"#(?:senha|password)#is\", $oCampo->NOME)) ? \n Form::geraPassword($objetoClasse, (string)$oCampo->NOME, $label, 'CAD', $this->gui) :\n Form::geraInput($objetoClasse, (string)$oCampo->NOME, $label, 'CAD', (string)$oCampo->TIPO, $this->gui);\n\n $componenteEdit = (preg_match(\"#(?:senha|password)#is\", $oCampo->NOME)) ? \n Form::geraPassword($objetoClasse, (string)$oCampo->NOME, $label, 'EDIT', $this->gui) :\n Form::geraInput($objetoClasse, (string)$oCampo->NOME, $label, 'EDIT', (string)$oCampo->TIPO, $this->gui);\n }\n # ============ Campo Enum =============\n if(preg_match(\"#enum#i\", (string)$oCampo->TIPO)){\n $componenteCad = Form::geraEnum($objetoClasse, (string)$oCampo->NOME, (string)$oCampo->TIPO, $label, 'CAD', $this->gui);\n $componenteEdit = Form::geraEnum($objetoClasse, (string)$oCampo->NOME, (string)$oCampo->TIPO, $label, 'EDIT', $this->gui);\t\n } \n break;\n }\n }\n $aCampoCad[] = $componenteCad;\n $aCampoEdit[] = $componenteEdit;\n $aTituloAdm[] = \"<th>$label</th>\";\n $aCampoAdm[] = \"<td><?=$campoAdm?></td>\";\n }\n\n # ===== Montar lista dos metodos Carregar Colecao =======\n $aTabelaFK = $this->retornaTabelasFK((string)$aTabela['NOME']);\n\n foreach($aTabelaFK as $oCampoFK => $oDadosTabelaFK){\n $nomeClasseFK\t = ucfirst($this->getCamelMode($oDadosTabelaFK['FKTABELA']));\n $nomeObjetoFK\t = ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", $oCampoFK));\n $aGetAll[] = \"\\$a$nomeClasseFK = \\$oControle->getAll$nomeClasseFK();\"; \n }\n\n # monta demais valores a serem substituidos\n $sPKRequest = join($aPKRequest, \", \");\n $sTituloAdm = join($aTituloAdm, \"\\n\\t\\t\\t\");\n $sCampoAdm = join($aCampoAdm, \"\\n\\t\\t\\t\");\n $sCampoCad = join($aCampoCad, \"\\n\");\n $sCampoEdit = join($aCampoEdit, \"\\n\");\n $sCampoPK = join($aCampoPK, \"\\n\");\n $sGetAll = (count($aGetAll)>0) ? join($aGetAll,\"\\n\") : \"\";\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModeloAdm = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModeloAdm);\n $copiaModeloAdm = str_replace('%%TITULOATRIBUTOS%%', $sTituloAdm, $copiaModeloAdm);\n $copiaModeloAdm = str_replace('%%VALORATRIBUTOS%%', $sCampoAdm, $copiaModeloAdm);\n $copiaModeloAdm = str_replace('%%ADM_EDIT%%', \t (($PK != '') ? Form::geraAdmEdit($nomeClasse, $ID_PK, $PK, $this->gui) : ''), $copiaModeloAdm);\n $copiaModeloAdm = str_replace('%%ADM_DELETE%%', (($PK != '') ? Form::geraAdmDelete($nomeClasse, $ID_PK, $PK, $this->gui) : ''), $copiaModeloAdm);\n\n /* ========= 2 devido as colunas Editar e Excluir ============= */\n $copiaModeloAdm = str_replace('%%NUMERO_COLUNAS%%', count($aTituloAdm)+2, $copiaModeloAdm);\n $copiaModeloAdm = str_replace('%%PK_REQUEST%%', $sPKRequest, $copiaModeloAdm);\t\t\t\n\n $copiaModeloCad = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModeloCad);\n $copiaModeloCad = str_replace('%%CARREGA_COLECAO%%', $sGetAll, $copiaModeloCad);\n $copiaModeloCad = str_replace('%%ATRIBUICAO%%', $sCampoCad, $copiaModeloCad);\n\n $copiaModeloEdit = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModeloEdit);\n $copiaModeloEdit = str_replace('%%CARREGA_COLECAO%%', $sGetAll, $copiaModeloEdit);\n $copiaModeloEdit = str_replace('%%ATRIBUICAO%%', $sCampoEdit, $copiaModeloEdit);\n $copiaModeloEdit = str_replace('%%CHAVE_PRIMARIA%%', $sCampoPK, $copiaModeloEdit);\n $copiaModeloEdit = str_replace('%%PK%%', $PK, $copiaModeloEdit);\n $copiaModeloEdit = str_replace('%%ID_PK%%', $ID_PK, $copiaModeloEdit);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/\";\n\n if(!file_exists($dir)) mkdir($dir);\n\n $fpAdm = fopen(\"$dir/adm$nomeClasse.php\", \"w\"); fputs($fpAdm, $copiaModeloAdm); fclose($fpAdm);\n $fpCad = fopen(\"$dir/cad$nomeClasse.php\", \"w\"); fputs($fpCad, $copiaModeloCad); fclose($fpCad);\n $fpEdit = fopen(\"$dir/edit$nomeClasse.php\", \"w\"); fputs($fpEdit, $copiaModeloEdit); fclose($fpEdit);\n\n // ======= Limpa arrays ======= \n unset($aGetAll);\n unset($aTituloAdm);\n unset($aCampoAdm);\n unset($aCampoCad);\n unset($aCampoEdit);\n unset($aPKRequest);\n unset($aCampoPK);\n }\n\n # ==== Alterar arquivo index =====\n $modeloIndex = Util::getConteudoTemplate($this->gui.'/index.php');\n $modeloIndex = str_replace('%%PROJETO%%', ucfirst($aBanco['NOME']), $modeloIndex);\n\n $fpIndex = fopen(\"$dir/index.php\", \"w\");\n fputs($fpIndex, $modeloIndex); \n fclose($fpIndex);\n \n # ============== Arquivo de titulo ===================\n $modeloTitulo = Util::getConteudoTemplate($this->gui.'/Modelo.titulo.tpl');\n $modeloTitulo = str_replace('%%DATABASE%%', ucfirst($aBanco['NOME']), $modeloTitulo);\n\n $fpTitulo = fopen($dir.\"includes/titulo.php\", \"w\");\n fputs($fpTitulo, $modeloTitulo); \n fclose($fpTitulo);\n \n // ========= Copiar arquivos adicionais do projeto ========\n copy(dirname(dirname(__FILE__)).\"/templates/{$this->gui}/resIndex.php\", \"$dir/resIndex.php\");\n copy(dirname(dirname(__FILE__)).\"/templates/{$this->gui}/principal.php\", \"$dir/principal.php\");\n copy(dirname(dirname(__FILE__)).\"/templates/{$this->gui}/logoff.php\", \"$dir/logoff.php\");\n\n return true;\t\n }",
"public function lerArquivoLog(){\n $ponteiro = fopen(\"C:\\\\temp\\\\teste2.txt\", \"r\");\n\n //Abre o aruqivo .txt\n while(!feof($ponteiro)) {\n $linha = fgets($ponteiro, 4096);\n //Imprime na tela o resultado\n $this->pulaLinha();\n }\n //Fecha o arquivo\n fclose($ponteiro);\n }",
"public function Connect() {\n\n try {\n //atribuindo usuario de acesso ao banco ao atributo user\n $this->user = \"root\";\n \n //atribuindo a senha de acesso ao banco no atributo pass\n $this->pass = \"\";\n\n //atribuindo o endereço do banco no atributoi host \n $this->host = \"localhost\";\n \n //atribuindo o nome do banco criado no atributo base\n $this->base = \"mydb\";\n\n\n\n $parametros = array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES UTF8\"); //Definimos a conexão com o banco no padrão URF-8\n\n\n\n // atribuindo os parametros de conexao no atrinuto file\n $this->file = \"mysql:host=\" . $this->host . \";dbname=\" . $this->base;\n\n //atribuido a linha de comando PDO(para iniciação na conexao) no atributo pdo\n $this->pdo = new PDO($this->file, $this->user, $this->pass, $parametros);\n\n\n\n //atribuindo os atributos complementares PDO no atributo pdo\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $this->pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n\n $this->pdo->setAttribute(PDO::ATTR_PERSISTENT, true);\n\n if (!$this->pdo) {\n echo \"Erro na conexão\";\n }\n \n return $this->pdo;\n } catch (PDOException $ex) {\n\n echo \"Erro no sistema\" . $ex->getMessage();\n }\n }",
"abstract function ActualizarDatos();",
"function importData($tabName, $filePath) \n{\n\tglobal $mysqli;\n\tif (!file_exists($filePath)) {\n\t\tdie(\"Error: El archivo \".$filePath.\" No existe!\");\n\t}\n\t$data = array();\n\tif (($gestor = fopen($filePath, \"r\")) !== FALSE) {\n\t\twhile ($datos = fgetcsv($gestor, 1000, \";\")) {\n\t\t\t$data[]=$datos;\n\t\t}\n\t \n\t fclose($gestor);\n\t}\t\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\n\t `id` int(8) NOT NULL AUTO_INCREMENT,\n\t `name` varchar(100) NOT NULL,\n\t `author` varchar(30) NOT NULL,\n\t `isbn` varchar(30) NOT NULL,\n\t PRIMARY KEY (`id`)\n\t) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1\";\n\n\t$insert = \"INSERT INTO $tabName (\";\n\n\t$create=\"CREATE TABLE IF NOT EXISTS `$tabName` (\";\n\tfor ($i=0; $i < count($data[0]) ; $i++) { \n\t\tif ($i==count($data[0])-1) {\n\t\t\t$insert.=strtolower($data[0][$i].\" )\");\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200)\";\n\t\t}else{\n\t\t\t$insert.=strtolower($data[0][$i].\",\");\n\n\t\t\t$create.=\" `\".$data[0][$i].\"` varchar(200),\";\n\t\t}\n\t}\n\t$create.=\") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;\";\n\n\t$insert.=\" VALUES \";\n\tfor ($j=1; $j < count($data); $j++) { \n\t\tif ($j != 1) {\n\t\t\t# code...\n\t\t\t$insert.=\", ( \";\n\n\t\t}else{\n\n\t\t\t$insert.=\" ( \";\n\t\t}\n\t\tfor ($i=0; $i < count($data[$j]) ; $i++) { \n\t\t\tif ($i==count($data[$j])-1) {\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"' )\");\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200)\";\n\t\t\t}else{\n\t\t\t\t$insert.=\"\n\t\t\t\t'\".strtolower($data[$j][$i].\"',\");\n\n\t\t\t\t//$create.=\" `\".$data[$j][$i].\"` varchar(200),\";\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!$mysqli->query($create)) {\n\t\tshowErrors();\n\t}\n\n\n\t\n\tif (!($mysqli->query($insert))) {\n\t echo \"\\nQuery execute failed: ERRNO: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t die;\n\t};\n\n\treturn true;\n}",
"public function importacionLinea($tipo) {\n //echo \"llego2\";\n $codLin = '02';\n $tipConsult = $tipo;\n $dtActFecha = date(\"Y-m\", strtotime(date()));//'2019-02';//\n //$dtAntFecha = date(\"Y-m\", strtotime(date()));//restarle 1 mes//'2019-01';//\n\t$dtAntFecha = date(\"Y-m\", strtotime('-1 month', strtotime(date())));//Se resta 1 mes.\n //Generar Manualmente\n //$dtActFecha ='2019-04';\n //$dtAntFecha ='2019-03';\n \n \n try {\n $obj_con = new cls_Base();\n $obj_var = new cls_Global();\n $con = $obj_con->conexionServidor();\n //$rawDataANT = array();\n $rawDataACT = array();\n \n $sql = \"SELECT A.COD_LIN, A.COD_TIP, A.COD_MAR, D.NOM_LIN, E.NOM_TIP, F.NOM_MAR,\"\n . \"SUM(A.P_PROME*B.EXI_TOT) AS COS_ACT, \";\n $sql .= \"IFNULL((SELECT X.COSTO_T FROM \" . $obj_con->BdServidor . \".IG0007 X \"\n . \" WHERE X.COD_LIN=A.COD_LIN AND X.COD_MAR=A.COD_MAR AND TIP_CON='$tipConsult' \"\n . \" AND ANO_MES='$dtAntFecha'),0) COS_ANT \"; \n $sql .= \" FROM \" . $obj_con->BdServidor . \".IG0020 A \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0022 B ON A.COD_ART=B.COD_ART \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0001 D ON A.COD_LIN=D.COD_LIN \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0002 E ON A.COD_TIP=E.COD_TIP \";\n $sql .= \" INNER JOIN \" . $obj_con->BdServidor . \".IG0003 F ON A.COD_MAR=F.COD_MAR \";\n $sql .= \" WHERE B.EXI_TOT <> 0 \"; \n $sql .=($codLin!='')?\" AND A.COD_LIN='$codLin' \":\"\";\n $sql .=($tipConsult!='TD')?\" AND A.COD_TIP='$tipConsult' \":\"\";\n $sql .=\" GROUP BY A.COD_LIN,A.COD_MAR ORDER BY COD_LIN,COD_MAR \";\n $sentencia = $con->query($sql);\n if ($sentencia->num_rows > 0) {\n while ($fila = $sentencia->fetch_assoc()) {//Array Asociativo\n $rawDataACT[] = $fila;\n }\n }\n //cls_Global::putMessageLogFile($sql);\n for ($i = 0; $i < sizeof($rawDataACT); $i++) {\n \n $sql=\"INSERT INTO \" . $obj_con->BdServidor . \".IG0007 \n (COD_LIN,COD_TIP,COD_MAR,NOM_MAR,COST_ANT,COST_ACT,COSTO_T,FEC_SIS,TIP_CON,ANO_MES)VALUES \n ('\" . $rawDataACT[$i]['COD_LIN'] . \"',\n '\" . $rawDataACT[$i]['COD_TIP'] . \"',\n '\" . $rawDataACT[$i]['COD_MAR'] . \"',\n '\" . $rawDataACT[$i]['NOM_MAR'] . \"',\n '\" . $rawDataACT[$i]['COS_ANT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $rawDataACT[$i]['COS_ACT'] . \"',\n '\" . $dtActFecha . \"-01',\n '\" . $tipConsult . \"',\n '\" . $dtActFecha . \"')\";\n //cls_Global::putMessageLogFile($rawDataACT[$i]['COS_ACT']);\n //cls_Global::putMessageLogFile($sql);\n $command = $con->prepare($sql); \n $command->execute();\n \n \n } \n\n $con->commit();\n $con->close();\n return true;\n } catch (Exception $e) { // se arroja una excepción si una consulta falla\n //return VSexception::messageSystem('NO_OK', $e->getMessage(), 41, null, null);\n $con->rollback();\n $con->close();\n throw $e;\n return false;\n }\n }",
"function dbobject_importConvertDataFile($inputfile,$outputfile) {\n\t## first we open the file\n\t\n\t$content = file_get_contents($inputfile);\n\t$content = str_replace(\"\\r\",\"\\n\",$content);\n\t## write the file\n\t## open the file\n\t## we need to split the file into sections-\n\t## we will cut it up in slices of 1000 entries\t\t\n\t$fp = fopen($outputfile,'w');\n\tif($fp) {\n\t\t## write the data\n\t\tfwrite($fp,$content);\n\t\tfclose($fp);\n\t}\n\n }",
"public function archivos (){\n\t\t$archivos = Archivos::where('estado' , '=', 'Pendiente')->get();\n\n\t\tforeach ($archivos as $archivo) {\n\t\t\t# code...\n\t\t\t\t$url = $archivo->archivo;\n\n\t\t\t\t$objPHPExcel = PHPExcel_IOFactory::load(\"uploads/archivos/$url\");\n\t\t\t\n\t\t\t\tforeach ($objPHPExcel->getWorksheetIterator() as $worksheet) {\n\t\t\t\t\t $worksheetTitle = $worksheet->getTitle();\n\t\t\t\t\t $highestRow = $worksheet->getHighestRow(); // e.g. 10\n\t\t\t\t\t $highestColumn = $worksheet->getHighestColumn(); // e.g 'F'\n\t\t\t\t\t $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn);\n\t\t\t\t\t $nrColumns = ord($highestColumn) - 64;\n\t\t\t\t\t \n\t\t\t\t\t for ($row = 2; $row <= $highestRow; ++ $row) {\n\t\t\t\t\t \t$contacto = new Contactos;\n\n\t\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(0, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->nombre = $val;\n\n\t\t\t $cell = $worksheet->getCellByColumnAndRow(1, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->apellido = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(2, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->sexo = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(3, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->fecha_nacimiento = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(4, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->tipo_documento = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(5, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->numero = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(6, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->telefono = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(7, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->mail = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(8, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->municipio_id = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(9, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->localidad_id = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(10, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->calle = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(11, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->numero_calle = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(12, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->complemento = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(13, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->entre_calles = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(14, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->instalacion_coccion = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(15, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->instalacion_aguaCaliente = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(16, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->instalacion_calefaccion = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(17, $row);\n\t\t\t\t $val = $cell->getValue();\n\t\t\t\t $contacto->posee_gas = $val;\n\n\t\t\t\t $cell = $worksheet->getCellByColumnAndRow(18, $row);\n\t\t\t\t $val = $cell->getValue();\n\n\t\t\t\t $contacto->estado = $val;\n\n\t\t\t\t $contacto->created_by = 6;\n\n\n\t\t\t\t $now = new DateTime('NOW');\n\n\t\t\t\t $contacto->created = $now;\n\t\t\t\t /*\n\t\t\t\t\t for ($col = 0; $col < $highestColumnIndex; ++ $col) {\n\t\t\t\t\t $dataType = PHPExcel_Cell_DataType::dataTypeForValue($val);\n\t\t\t\t\t echo '<td>' . $val . '<br>(Typ ' . $dataType . ')</td>';\n\t\t\t\t\t } */\n\t\t\t\t\t \n\t\t\t\t\t $contacto->save();\n\t\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\t$archivo->estado = \"Importado\";\n\t\t\t\t$archivo->save();\n\n\t\t}\n\n\t\t return Redirect::to('archivos');\n\n\t}"
]
| [
"0.70913935",
"0.658522",
"0.63133144",
"0.6292325",
"0.6103827",
"0.605265",
"0.6023895",
"0.6002479",
"0.59374315",
"0.5919965",
"0.5917771",
"0.59176826",
"0.5917541",
"0.5879064",
"0.5863032",
"0.5841714",
"0.58208495",
"0.57788134",
"0.5760772",
"0.57541937",
"0.5742328",
"0.5725629",
"0.5725409",
"0.57171017",
"0.5713047",
"0.5707877",
"0.5702758",
"0.56976634",
"0.5690628",
"0.56868047",
"0.5683682",
"0.5657708",
"0.5643952",
"0.563987",
"0.56377834",
"0.5627288",
"0.5615108",
"0.56098413",
"0.56037426",
"0.5602958",
"0.55936545",
"0.5587231",
"0.55858517",
"0.5563267",
"0.5561169",
"0.55556077",
"0.55545384",
"0.554228",
"0.55402505",
"0.55361104",
"0.55256027",
"0.552457",
"0.55198467",
"0.5502683",
"0.5499986",
"0.5498832",
"0.5494931",
"0.5494377",
"0.5491623",
"0.5486364",
"0.5479767",
"0.5479078",
"0.5474238",
"0.54727423",
"0.5468793",
"0.54576004",
"0.545691",
"0.5448563",
"0.54474884",
"0.5446641",
"0.544592",
"0.54391354",
"0.5436769",
"0.5434713",
"0.5433748",
"0.54254663",
"0.5420074",
"0.5417473",
"0.54136324",
"0.54079664",
"0.54070413",
"0.54054224",
"0.5404177",
"0.5401945",
"0.5396267",
"0.5394108",
"0.53921145",
"0.5391249",
"0.53872216",
"0.53852",
"0.5383443",
"0.5380574",
"0.53793025",
"0.5378961",
"0.5371655",
"0.53667754",
"0.5356123",
"0.5350366",
"0.5347746",
"0.5344979"
]
| 0.594061 | 8 |
Get all posts or post specified by slug from DB | public function get_posts($slug = FALSE)
{
if ($slug === FALSE )
{
//~ $this->db->select('*');
//~ $this->db->from('post');
//~ $this->db->join('user', 'user.id=author');
// TODO: limit # of posts -> pagination
$query = $this->db->get();
$this->db->query($sql);
return $query->result_array();
}
// TODO: validate slug, maybe via routing
//~ $query = $this->db->get_where('post', array('slug' => $slug));
// TODO: sanitize slug
$sql = "SELECT `post`.*, `user`.username, `user`.id as user_id
FROM `post`
INNER JOIN `user` ON `post`.author = `user`.id
WHERE `post`.slug = ?
AND `post`.active=1";
$query = $this->db->query($sql, array($slug));
//~ echo($query);
return $query->row_array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_posts($slug=FALSE) {\n if ($slug===FALSE) {\n $query= $this->db->get('posts');\n return $query->result();\n }\n $query= $this->db->get_where('posts',array('slug'=>$slug));\n return $query->row();\n }",
"static function get_post_by_slug($slug){\n\t\treturn self::$db->where('slug',$slug)->get('blog')->row();\n\t}",
"public function post($slug)\n\t{\n\t\treturn $this->postsRepo->findBySlug($slug);\n\t}",
"public function showPostBySlug($slug)\n{\n \n $sql = \"SELECT p.ID, p.media_id, p.post_author,\n p.post_date, p.post_modified, p.post_title,\n p.post_slug, p.post_content, p.post_summary, \n p.post_keyword, p.post_tags,\n p.post_status, p.post_type, p.comment_status, u.user_login\n FROM tbl_posts AS p\n INNER JOIN tbl_users AS u ON p.post_author = u.ID\n WHERE p.post_slug = :slug AND p.post_type = 'blog'\";\n\n $this->setSQL($sql);\n\n $postBySlug = $this->findRow([':slug' => $slug]);\n\n return (empty($postBySlug)) ?: $postBySlug;\n \n}",
"public function showPostsCms($slug)\n {\n return $this->model->with(['user', 'bookmarks', 'comments', 'videos','images', 'likes', 'bookmarks', 'hashTags', 'shares', 'draftPost','images.imageTags', 'images.imageTags.user'])->whereSlug($slug)->firstOrFail();\n }",
"public function findBySlug($slug);",
"public function findBySlug($slug);",
"public function findBySlug($slug);",
"public function findBySlug($slug);",
"public function findBySlug($slug);",
"public function getPageBySlug($slug)\n {\n return $this->findOneBy(array('slug' => $slug));\n }",
"function getPost($slug){\n\tglobal $conn;\n\t// Get single post slug\n\t$post_slug = $_GET['post-slug'];\n\t$sql = \"SELECT * FROM posts WHERE slug='$post_slug' AND published=true\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch query results as associative array.\n\t$post = mysqli_fetch_assoc($result);\n\tif ($post) {\n\t\t// get the topic to which this post belongs\n\t\t$post['topic'] = getPostTopic($post['id']);\n\t\tupdateView($post['id']);\n\t}\n\treturn $post;\n}",
"public function getAllpost(){\n return $slug=post::with('likes')->where('status',1)->orderBy('created_at','DESC')->paginate(4);\n\n }",
"public function get_one_post_joined_with_category_bySlug($postSlug){\n $db = \\Config\\Database::connect();\n $builder = $db->table('posts');\n $builder->select('posts.id, posts.category_id, posts.title, posts.slug, posts.body, posts.created_at, categories.name')->where('slug', $postSlug);\n $builder->join('categories', 'posts.category_id = categories.id');\n $query = $builder->get();\n $results = $query->getResult();\n \n return $results;\n }",
"public function getBlogContentForSlug($slug) {\n\t \n\t // Get content\n\t $sql = \"SELECT * FROM {$this->tableName}\n\t\t\t\t\tWHERE type = 'post' AND slug = ? AND published <= NOW()\n\t\t\t\t\tORDER BY updated DESC;\";\n\t\n\t\t$result = $this->db->ExecuteSelectQueryAndFetchAll($sql, array($slug));\n\t\treturn $result;\n }",
"protected function posts($post = NULL){\n\n\t\t\n\t\tif($posts = NULL){\n\n\t\t\t$posts = WinkPost::with('tags')\n\t ->live()\n\t ->orderBy('publish_date')\n\t ->simplePaginate(5);\n\n\t \treturn $posts;\n\n\t\t}else{\n\n\t\t\t$post = WinkPost::whereSlug($post)->firstOrFail();\n\n\t\t\treturn $post;\n\t\t} \n\n\t}",
"public function getPostBySlug($slug)\n {\n // Post for slug with user, tags and categories\n $post = $this->model->with([\n 'user' => function ($q) {\n $q->select('id', 'name', 'email');\n },\n 'tags' => function ($q) {\n $q->select('tags.id', 'tag');\n },\n 'categories' => function ($q) {\n $q->select('title', 'slug');\n }\n ])\n ->with(['parentComments' => function ($q) {\n $q->with('user')\n ->latest()\n ->take(config('app.numberParentComments'));\n }])\n ->withCount('validComments')\n ->withCount('parentComments')\n ->whereSlug($slug)\n ->firstOrFail();\n\n // Previous post\n $post->previous = $this->getPreviousPost($post->id);\n\n // Next post\n $post->next = $this->getNextPost($post->id);\n\n return compact('post');\n }",
"function oo_get_post_by_slug($slug) {\n $posts = get_posts(array(\n 'name' => $slug,\n 'post_type' => 'post',\n 'posts_per_page' => 1,\n 'post_status' => 'any',\n ));\n\n return count($posts) > 0 ? $posts[0] : null;\n}",
"public function findBySlug(string $slug);",
"public function findBySlug(string $slug);",
"public function getBySlug(string $slug);",
"public function findPostBySlug($post_id) {\n $sql = \"SELECT * \n FROM posts p \n INNER JOIN users u ON p.author_id = u.id \n INNER JOIN categories c ON p.cat_id = c.cat_id\n WHERE p.post_id = $post_id\";\n return mysqli_query($this->conn, $sql)->fetch_assoc();\n }",
"public function bySlug($slug);",
"public function getBySlug()\n {\n }",
"public function show($slug)\n {\n $column = is_numeric($slug) ? 'id' : 'slug';\n\n return Post::where($column, $slug)->firstOrFail();\n }",
"public function fetchBySlug($slug)\n {\n return $this->fetchByColumn('slug', $slug);\n }",
"public function blogpostActionGet($slug) : object\n {\n $page = $this->app->page;\n $title = \"BlogPost: ${slug}\";\n $db = $this->app->db;\n $filter = new MyTextFilter();\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE \n slug = ?\n AND type = ?\n AND (deleted IS NULL OR deleted > NOW())\n AND published <= NOW()\nORDER BY published DESC\n;\nEOD;\n $content = $db->executeFetch($sql, [$slug, \"post\"]);\n if (!($content)) {\n $page->add(\"cms/404\");\n } elseif ($content->filter) {\n $text = $content->data;\n $filters = explode(\",\", $content->filter);\n $filteredText = $filter->parse($text, $filters);\n $content->data = $filteredText;\n }\n $page->add(\"cms/blogpost\", [\n \"content\" => $content\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }",
"function get_post_by_slug($slug) {\n if (!$slug) return false;\n $args = array(\n 'name' => $slug,\n 'post_type' => 'post',\n 'post_status' => 'publish',\n 'posts_per_page' => 1\n );\n $my_posts = get_posts( $args );\n if ( $my_posts ) return $my_posts[0];\n}",
"function getSinglePost ( $slug ) {\n\n\t$connection = connectDB();\n\t$fecha_actual = date(\"Y-m-d\");\n\t$tabla = 'noticias';\n\n\t$query = \"SELECT * FROM \" .$tabla;\n\t$query .= \" WHERE post_url='\" . $slug . \"'\";\n\t$query .= \" AND post_fecha <= '\". $fecha_actual. \"'\";\n\t$query .= \" LIMIT 1\";\n\n\t$result = mysqli_query($connection, $query);\n\n\tif ( $result->num_rows == 0 ) {\n\t\tgetTemplate( '404' );\n\t} else {\n\n\t\t$post = mysqli_fetch_array($result);\n\n\t}\n\n\treturn $post;\n}",
"public function getPost(Request $request, $slug)\n {\n // The post\n $post = BlogPost::where([\n ['slug', '=', $slug],\n ['status', '=', 'PUBLISHED'],\n ])->whereDate('published_date', '<=', Carbon::now())\n ->firstOrFail();\n // Related posts (based on tags)\n $relatedPosts = [];\n if (! empty(trim($post->tags))) {\n $tags = explode(',', $post->tags);\n $relatedPosts = BlogPost::where([\n ['id', '!=', $post->id],\n ])->where(function ($query) use ($tags) {\n foreach ($tags as $tag) {\n $query->orWhere('tags', 'LIKE', '%'.trim($tag).'%');\n }\n })->limit(4)\n ->orderBy('created_at', 'desc')\n ->get();\n }\n\n return $this->makeResponse($request, \"{$this->viewPath}::modules/posts/post\", [\n 'post' => $post,\n 'relatedPosts' => $relatedPosts,\n ], (new BlogPostResource($post->load('authorId')))->additional(['meta' => [\n 'relatedPosts' => ($relatedPosts) ? BlogPostResource::collection($relatedPosts->load('authorId')): [],\n ]]));\n }",
"public function findBySlugWithCategory($slug);",
"public function show($slug)\n {\n //$website = General::query()->firstOrFail();\n\n //get the requested post, if it is published\n $post = Post::query()\n ->where('is_published', true)\n ->where('slug', $slug)\n ->firstOrFail();\n\n //get all the categories\n $categories = Category::all();\n\n //get all the tags\n $tags = Tag::all();\n\n //get the recent 5 posts\n $recent_posts = Post::query()\n ->where('is_published', true)\n ->orderBy('created_at', 'desc')\n ->take(5)\n ->get();\n\n //related posts\n $related_posts = Post::query()->where('is_published',true)->whereHas('tags', function ($q) use ($post) {\n return $q->whereIn('name', $post->tags->pluck('name'));\n })\n ->where('id', '!=', $post->id)->take(3)->get();\n\n //return the data to the corresponding view\n return view('post', [\n //'website' => $website,\n 'post' => $post,\n 'categories' => $categories,\n 'tags' => $tags,\n 'recent_posts' => $recent_posts,\n 'related_posts' => $related_posts,\n ]);\n\n }",
"public function findBySlugWithCategoryAndTags($slug);",
"public function getPosts();",
"public function getPosts();",
"public function getSingle($slug) {\n $post = Post::where('slug', '=', $slug)->first();\n $popular = Post::inRandomOrder()->get()->take(5);\n $categories = Category::all();\n $tags = Tag::all();\n $previous= Post::where('id', '<', $post->id)->orderBy('id','desc')->first();\n $next= Post::where('id', '>', $post->id)->orderBy('id')->first();\n // return the view and pass in the post object\n return view('blog.single')->with(compact('post','previous', 'next'))->withPopulars($popular)->withCategories\n ($categories)->withTags($tags);\n }",
"public function getPosts() {}",
"private function getPosts(){\n $posts = DB::connection('mysql')->select('\n SELECT e.title, eu.titleURL, e.teaser, Date_Format(e.publishAt, \"%b %e, %Y\") AS publishDate,\n c.name AS categoryName, cu.name AS categoryURL,\n count(distinct(ed.id)) AS discussionCount,\n fsp.squareURL AS imageURL, fsp.title AS imageTitle,\n group_concat(DISTINCT concat(\"<a href=\\'/category/\", cu.name ,\"\\'>\", c.name, \"</a>\")) AS categoryNames\n FROM entries e\n INNER JOIN entryurls eu ON eu.entryId = e.id AND eu.isActive = 1 AND eu.deletedAt IS NULL\n LEFT JOIN entrycategories ec ON ec.entryId = e.id AND ec.deletedAt IS NULL\n LEFT JOIN categories c ON c.id = ec.categoryId\n LEFT JOIN categoryurls cu ON cu.categoryId = c.id AND cu.isActive = 1 AND cu.deletedAt iS NULL\n LEFT JOIN entrydiscussions ed ON ed.entryId = e.id AND ed.deletedAt IS NULL\n LEFT JOIN entryflickrsets efs ON efs.entryId = e.id AND efs.deletedAt IS NULL\n LEFT JOIN flickrsets fs ON fs.id = efs.flickrSetId AND fs.deletedAt IS NULL\n LEFT JOIN flickrcollections fc ON fc.id = fs.flickrCollectionid AND fc.deletedAt IS NULL\n LEFT JOIN flickrsetphotos fsp ON fsp.flickrSetId = fs.id AND fsp.deletedAt IS NULL\n WHERE e.deletedAt IS NULL\n GROUP BY e.id\n ORDER BY e.publishAt desc\n LIMIT 10');\n\n return $posts;\n }",
"public function getPost($slug)\n {\n return view('pages.singlepost2')\n ->with('custompost', Custompost::where('slug', $slug)->first());\n }",
"public function blogSearchByCat($slug){\n\n\n $cats = Category::where('slug', $slug) -> first();\n\n return view('comet.category-blog', [\n 'all_posts' => $cats -> posts\n ]);\n\n\n\n }",
"static function get_serach_posts_or_page(){\n\t\t\n\t\tswitch ($_GET['pt']){\n\t\t\tcase 1 :\n\t\t\t\t$post_type = 'page';\n\t\t\t\tbreak;\n\t\t\tcase 2 :\n\t\t\t\t$post_type = 'post';\n\t\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\t$post_type = array('post', 'page');\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$tax_query = array();\n\t\tforeach(self::$taxonomies as $slug => $taxonomy){\n\t\t\tif(!empty($_GET[$slug]) && strlen($_GET[$slug]>0)){\n\t\t\t\t$tax_query[] = array(\n\t\t\t\t\t'taxonomy' => $slug,\n\t\t\t\t\t'field' => id,\n\t\t\t\t\t'terms' => array($_GET[$slug])\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args = array(\n\t\t\t'post_type' => $post_type,\n\t\t\t'tax_query' => $tax_query\n\t\t);\n\n\t\t$args['tax_query']['relation'] = 'AND';\n\t\t\n\t\t//var_dump($args);\n\t\t\n\t\treturn new WP_Query($args);\n\t\t\n\t}",
"public function getPage($slug)\n { \n $data = StaticPage::where('page_slug',$slug)->first();\n return $data;\n }",
"public function getOneBySlug($slug)\n {\n return reset($this->prepare(array(DB::findOne($this->table, 'slug = ?', array($slug)))));\n }",
"public function allblogpostsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla posts i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"post\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allblogposts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }",
"public function SinglePost($slug){\n $post = Post::where('slug', '=', $slug)->first();\n $tags = Tag::all();\n $categories = Category::all();\n $recposts = Post::orderBy('created_at','desc')->paginate(3);\n\n //return the view and pass the object\n return view('blog.single')->withPost($post)->withTags($tags)->withCategories($categories)->withRecposts($recposts);\n\n\n }",
"public function findCategoryBySlug($slug);",
"public function index($slug = '') {\n// $data = '*';\n// $contition_array = array('status' => 'publish');\n// $this->data['blog_detail'] = $this->common->select_data_by_condition('blog', $contition_array, $data, $sortby, $orderby, $limit, $offset, $join_str = array(), $groupby = '');\n\n $this->load->view('blogdata/index', $this->data);\n }",
"public static function find($slug)\n {\n return static::all()->firstWhere('slug', $slug);\n\n\n // if (!file_exists($path = resource_path(\"/posts/{$slug}.html\"))) {\n // throw new ModelNotFoundException();\n // }\n\n // return cache()->remember(\"posts.{$slug}\", 1200, fn () => file_get_contents($path));\n\n }",
"public function findBySlug($slug)\n\t{\n\t\treturn Article::where('slug', $slug)\n\t\t\t\t\t->active()\n\t\t\t\t\t->firstOrFail();\n\t}",
"public function show($slug)\n {\n $post = Post::whereSlug($slug)->get();\n dd($post);\n }",
"public function allPosts()\n {\n $query = 'SELECT blog_post.*,\n authors.author_name as author\n FROM \n blog_post\n JOIN authors USING(author_id)\n WHERE deleted = 0';\n\n $stmt = static::$dbh->query($query);\n\n $result = $stmt->fetchAll(\\PDO::FETCH_ASSOC);\n\n return $result;\n }",
"public function getAllPosts(){\n $query = \"SELECT * FROM `posts`;\";\n $result = $this->executeQuery($query);\n $result = $result->fetchAll();\n\n if($result != null && count($result)>0){\n return $result;\n } else {\n return null;\n }\n }",
"public function getAllPosts( $term )\n\t\t{\n\t\t\t// if a keyword is searched\n\t\t\tif( isset( $_POST[ \"term\" ] ) )\n\t\t\t{\n\t\t\t\ttry {\n //get the post that has the keyword in the title or description\n\t\t\t\t\t$query = $this->_db->prepare( \"SELECT post_id, post_title, post_description, post_date FROM blog_posts WHERE post_title OR post_description LIKE :term ORDER BY post_id DESC\" );\n\n\t\t\t\t\t$query->bindParam( \":term\", $term, PDO::PARAM_STR );\n\n\t\t\t\t\t$query->execute();\n\n\t\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\t\techo $e->getMessage();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\ttry{\n\n\t\t\t\t\t$query = $this->_db->query( \"SELECT post_id, post_title, post_description, post_date FROM blog_posts ORDER BY post_id DESC\" );\n\n\t\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\t\techo $e->getMessage();\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn $query;\n\t\t\t\n\t\t}",
"public function loadPostSlug($slug=null)\n {\n if($this->_post===null)\n {\n if($id!==null || isset($_GET['slug']))\n $this->_post=Post::model()->find('slug=:slug',array('slug'=>$slug!==null ? $slug : $_GET['slug']));\n if($this->_post===null)\n throw new CHttpException(404,'The requested page does not exist.');\n }\n\n return $this->_post;\n }",
"public function getPublishedPosts(){\n $query = \"SELECT * FROM `posts` WHERE `published`='1';\";\n $result = $this->executeQuery($query);\n $result = $result->fetchAll();\n\n if($result != null && count($result)>0){\n return $result;\n } else {\n return null;\n }\n }",
"public function findBySlug($slug)\n {\n $result = $this->_model->where('news_slug', '=', $slug)->first();\n\n return $result;\n }",
"public function getAllPosts() \n\t{\n $q = \"SELECT * FROM in_posts\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }",
"function getAllPostings() {\n return getAll(\"select * from posting\");\n}",
"public function getRecord($slug){\n return $this->where(\"slug\", $slug)->first();\n }",
"public static function getAll()\n {\n try {\n $db = static::getDB();\n $stmt = $db->query('SELECT id, title, content FROM posts ORDER BY created_at');\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n \n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n }",
"public function getSingle($slug) {\n if(App::getLocale() == 'fr') {\n $post = Post::where('slug', '=', $slug)->first();}\n\n if(App::getLocale() == 'en') {\n $post = enPost::where('slug', '=', $slug)->first();}\n\n\n //$post->load('translations');\n\n // return the view ans pass in the post object\n return view('view')->withPost($post);\n }",
"public function showPostPage($slug)\n {\n $post = Post::whereSlug($slug)->firstOrFail();\n $last_posts = Post::orderBy('id', 'desc')->limit(5)->get();\n\n return view('post.show',compact('post','last_posts'));\n }",
"public function allPosts()\n {\n return Post::all();\n }",
"public function getSingle($slug) {\n // get() fetch a collection of object, must be iterated or collection[0]\n // first() get a single object\n $post = Post::where('slug', '=', $slug)->first();\n\n $comments = $post->comments->sortByDesc('id');\n \n // return the view and pass in the post object\n return view('blog.single')->withPost($post)->withComments($comments);\n\n }",
"public function findPublishedTitleAndSlug()\n {\n return $this->createPublishedSortedQueryBuilder()\n ->select('title', 'slug')\n ->getQuery()\n ->execute();\n }",
"function get_product_by_slug($slug)\n{\n $db = get_connection();\n\n $sql = <<<SQL\n SELECT *\n FROM products\n WHERE\n slug = :slug\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->execute([\n ':slug' => $slug,\n ]);\n\n $product = (array) $statement->fetch(PDO::FETCH_ASSOC);\n $product['images'] = get_images($product['id']);\n\n return $product;\n}",
"public function getPost($slug, $lang = NULL)\n\t{\n\t\t$sql = \"SELECT * FROM `{$this->table}` \";\n\t\t$whereFields = array();\n\t\t$whereValues = array();\n\n\t\tif(!empty($this->slugField))\n\t\t{\n\t\t\t$whereFields[] = \"`{$this->slugField}` = :{$this->slugField}\";\n\t\t\t$whereValues[\":{$this->slugField}\"] = $slug;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn NULL;\n\t\t}\n\t\tif(!empty($this->langField) && !empty($lang))\n\t\t{\n\t\t\t$whereFields[] = \"`{$this->langField}` = :{$this->langField}\";\n\t\t\t$whereValues[\":{$this->langField}\"] = $lang;\n\t\t}\n\t\telse if(!empty($this->langField) && !empty($this->match))\n\t\t{\n\t\t\t$whereFields[] = \"`{$this->langField}` = :{$this->langField}\";\n\t\t\t$whereValues[\":{$this->langField}\"] = $this->match->getLocale();\n\t\t}\n\n\t\tif(!empty($whereFields))\n\t\t\t$sql .= \" WHERE \".implode(\" AND \", $whereFields);\n\n\t\t$sql .= \" LIMIT 1\";\n\n\t\t$statement = $this->pdo->prepare($sql);\n\t\t$statement->execute($whereValues);\n\n\t\tif($this->model == self::MODEL_ASSOC)\n\t\t{\n\t\t\t$post = $statement->fetch();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post = $statement->fetchObject($this->model);\n\t\t}\n\t\treturn $post;\n\t}",
"function getPosts() {\n $connection = websterUser();\n try {\n $sql = 'SELECT blog.blogTitle, blogName, blogDate, blogPost FROM blog ORDER BY blogTitle, blogDATE';\n $stmt = $connection->prepare($sql);\n $stmt->execute();\n $blogPosts = $stmt->fetchAll();\n $stmt->closeCursor();\n } catch (PDOException $ex) {\n return FALSE;\n }\n return $blogPosts;\n}",
"public function getBySlug($slug)\n\t{\n\t\treturn $this->model->where('slug',$slug)->firstOrFail();\n\t}",
"public function blogDetail( $slug ) {\n\t\t$data[\"blog\"] = SM::getCache( 'blog_' . $slug, function () use ( $slug ) {\n\t\t\treturn Blog::with( \"categories\", \"user\" )\n\t\t\t ->where( \"slug\", $slug )\n\t\t\t ->where( \"status\", 1 )\n\t\t\t ->first();\n\t\t} );\n\t\tif ( count( $data[\"blog\"] ) > 0 ) {\n\t\t\t$data['smAdminBarId'] = $data[\"blog\"]->id;\n\n\t\t\t$data[\"blog\"]->increment( \"views\" );\n\n\t\t\t$data[\"relatedBlog\"] = SM::getCache( 'blog_related_blog_' . $slug, function () use ( $data ) {\n\t\t\t\t$blog_related_posts_per_page = SM::smGetThemeOption( \"blog_related_posts_per_page\", 2 );\n\t\t\t\t$cats = SM::get_ids_from_data( $data['blog']->categories );\n\n\t\t\t\treturn DB::table( \"blogs\" )\n\t\t\t\t ->select( 'blogs.*', DB::raw( \"CONCAT(firstname, ' ', lastname) as fname\" ),\n\t\t\t\t\t 'users.username', 'users.image as author_image' )\n\t\t\t\t ->join( \"categoryables\", function ( $join ) {\n\t\t\t\t\t $join->on( \"categoryables.categoryable_id\", \"=\", \"blogs.id\" )\n\t\t\t\t\t ->where( \"categoryables.categoryable_type\", '=', 'App\\Model\\Common\\Blog' );\n\t\t\t\t } )\n\t\t\t\t ->join( \"users\", 'blogs.created_by', '=', 'users.id' )\n\t\t\t\t ->whereIn( \"categoryables.category_id\", $cats )\n\t\t\t\t ->where( \"blogs.id\", '!=', $data[\"blog\"]->id )\n\t\t\t\t ->where( \"blogs.status\", 1 )\n\t\t\t\t ->orderBy( \"blogs.id\", \"desc\" )\n\t\t\t\t ->limit( $blog_related_posts_per_page )\n\t\t\t\t ->get();\n\t\t\t} );\n\t\t\t/**\n\t\t\t * If related blog not found then show post from all post\n\t\t\t */\n\t\t\tif ( count( $data[\"relatedBlog\"] ) < 1 ) {\n\t\t\t\t$data[\"relatedBlog\"] = SM::getCache( 'blog_related_all_blog_' . $slug, function () use ( $data ) {\n\t\t\t\t\t$blog_related_posts_per_page = SM::smGetThemeOption( \"blog_related_posts_per_page\", 2 );\n\n\t\t\t\t\treturn DB::table( \"blogs\" )\n\t\t\t\t\t ->select( 'blogs.*', DB::raw( \"CONCAT(firstname, ' ', lastname) as fname\" ),\n\t\t\t\t\t\t 'users.username', 'users.image as author_image' )\n\t\t\t\t\t ->join( \"users\", 'blogs.created_by', '=', 'users.id' )\n\t\t\t\t\t ->where( \"blogs.id\", '!=', $data[\"blog\"]->id )\n\t\t\t\t\t ->where( \"blogs.status\", 1 )\n\t\t\t\t\t ->orderBy( \"blogs.id\", \"desc\" )\n\t\t\t\t\t ->limit( $blog_related_posts_per_page )\n\t\t\t\t\t ->get();\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$data[\"commnetsCount\"] = SM::getCache( 'blog_comments_0_count_' . $slug, function () use ( $data ) {\n\t\t\t\treturn Comment::where( \"commentable_id\", $data[\"blog\"]->id )\n\t\t\t\t ->where( \"commentable_type\", 'App\\Model\\Common\\Blog' )\n\t\t\t\t ->where( \"p_c_id\", 0 )\n\t\t\t\t ->where( \"status\", 1 )\n\t\t\t\t ->count();\n\t\t\t}, [ 'blog_comments_count_' . $slug ] );\n\t\t\t$blogId = $data[\"blog\"]->id;\n\t\t\t$data[\"commnets\"] = SM::getCache( 'blog_comments_0_0_' . $blogId, function () use ( $data ) {\n\t\t\t\treturn SM::getCommentList( $data[\"blog\"]->id, 'App\\Model\\Common\\Blog', 0, 0 );\n\t\t\t}, [ 'blog_comments_' . $blogId ] );\n\t\t\t$data['seo_title'] = $data['blog']->seo_title;\n\t\t\t$data[\"meta_key\"] = $data[\"blog\"]->meta_key;\n\t\t\t$data[\"meta_description\"] = $data[\"blog\"]->meta_description;\n\t\t\t$data[\"image\"] = asset( SM::sm_get_the_src( $data[\"blog\"]->image, 750, 560 ) );\n\n\t\t\treturn view( \"blogs/blog_detail\", $data );\n\t\t} else {\n\t\t\treturn abort( 404 );\n\t\t}\n\t}",
"public function findBySlug(string $slug) {\n return $this->getFirstBy('slug', $slug);\n }",
"public function getPost(){\r\n $stmt = self::$con->prepare(\"SELECT * FROM posts\");\r\n $stmt->execute();\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n return $results;\r\n }",
"public function searchAll($slug)\n {\n $user = User::where('name','like','%'.$slug.'%')->get();\n return $user;\n }",
"protected function getRelatedSlugs($slug, $id = 0)\n {\n return call_user_func(array($this->table_model, 'select'), $this->table_column)->where($this->table_column, 'like', $slug . '%')\n ->where('id', '<>', $id)\n ->get();\n }",
"public function getAllPost()\n {\n return Post::get();\n }",
"public function articleBySlug(string $slug)\n {\n return Post::query()->where('slug', $slug)->related('author')->get_one();\n }",
"public function getBySlug($slug)\n {\n if (is_array($slug)) {\n $slug = reset($slug);\n }\n return [\n $this->table->findOneBy(['slug' => $slug])\n ];\n }",
"public function getSekolah($slug = false)\n {\n if ($slug == false) {\n return $this->findAll();\n }\n\n return $this->where(['slug' => $slug])->first();\n }",
"public function get_post_slugs()\n\t{\n\t\t// assign the slugs to the $options...\n\t\t$options = $this->db->select('date_posted, title, url_title')->get($this->_table['posts'])->result();\n\n\t\t// there's one outside of normal possibilities in the db\n\t\t// so I add it here.\n\t\t$return[null] = lang('nav_form_choose_post');\n\n\t\t// foreach through them and add the url_title as key\n\t\t// and title as option text.\n\t\tforeach ($options as $opt)\n\t\t{\n\t\t\t$return[$opt->url_title] = $opt->title;\n\n\t\t}\n\n\t\t// return the obj\n\t\treturn $return;\n\t}",
"public static function findBySlug(string $slug, array $columns = ['*']);",
"public function findWorkBySlug($slug)\n {\n $qb = $this->createQueryBuilder('w')\n ->join('w.artist', 'a')\n ->join('w.pictures', 'p')\n ->addSelect('a')\n ->addSelect('p')\n ->andWhere('w.slug = :slug')\n ->andWhere('p.mainView = TRUE')\n ->setParameter('slug', $slug);\n\n return $qb->getQuery()->getArrayResult();\n }",
"public function getSingle($slug)\n {\n // fetch from db based on slug\n $event = Event::where('slug', '=', $slug)->where('status', '=', 1)->firstOrFail();\n $comments = $event->comments()->paginate(4);\n $threeRecentEvent = Event::orderBy('created_at', 'desc')->where('status', '=', 1)->take(3)->get();\n //$comment = $event->comment->paginate(15);\n\n // return the view and pass in the post object\n return view('event')\n ->withEvent($event)\n ->withComments($comments)\n ->withThreeRecentEvent($threeRecentEvent);\n }",
"public function GetPost($slug)\n {\n dd($slug);\n }",
"public static function getPublishedPostBySlug(string $slug)\n {\n return Post::where('slug', $slug)\n ->whereDate('published_at', '<=', now())\n ->first();\n }",
"public static function getSlugList(){\n return Arr::flatten(self::all('slug')->toArray());\n }",
"public function findBySlug($slug)\n {\n $data = $this->model\n ->bySlug($slug)\n ->first();\n\n if(!$data)\n throw new Exception(\"{$slug} does not exists in our database. Please contact us to add it for you.\");\n\n\n $apps = $data->apps()->paginate(4);\n return [\n 'apps' => $apps,\n 'featured_app' => $data\n ];\n }",
"public function findAllPublishedPosts()\n {\n $posts = [];\n $query = \"\"\n . \"SELECT post.*, user.name as author \"\n . \"FROM post \"\n . \"LEFT JOIN user ON post.id_user = user.id \"\n . \"WHERE status > 0 \"\n . \"ORDER BY post.date_created DESC\";\n $result = $this->db->query($query);\n if ($result) {\n // Cycle through results\n while ($row = $result->fetch_assoc()) {\n $posts[] = [\n 'id' => $row['id'],\n 'title' => $row['title'],\n 'content' => $row['content'],\n 'author' => $row['author'],\n 'id_user' => $row['id_user'],\n 'date_created' => $row['date_created'],\n 'tags' => '' //$row['firstname']\n ];\n }\n // Free result set\n $result->close();\n } else {\n echo($this->db->error);\n }\n return $posts;\n }",
"static function get_post_by_id($post){\n\t\treturn self::$db->where('token_id',$post)->get('blog')->results();\n\t}",
"public function findBySlug(string $slug)\n {\n /** @psalm-suppress LessSpecificReturnStatement */\n return $this->findOneBy([ 'slug' => $slug ]);\n }",
"function fetchAllBlogPosts()\r\n{\r\n return showAllBlogPosts();\r\n}",
"public function findBySlug($slug)\n {\n return $this->model->where('slug', $slug)->first();\n }",
"public function findBySlug($slug)\n {\n return $this->model->where('slug', $slug)->first();\n }",
"public function fetchByTag($tagSlug)\n {\n $from = \"FROM `blog_categories` AS `c` LEFT JOIN `blog_category_has_articles` AS `link` ON `link`.`category_id` = `c`.`id` LEFT JOIN `blog_articles` AS `a` ON `a`.`id` = `link`.`article_id` AND `a`.`published` < NOW()\";\n $where = \"WHERE `c`.`type` = 'tag' AND `c`.`slug` = :slug\";\n $params = [ 'slug' => $tagSlug ];\n return $this->listArticles(\"`a`.`id`, `a`.`title`, `a`.`slug`, `a`.`lead`, `a`.`image_url`, `a`.`published`\", $from, $where, $params);\n }",
"public function show($slug) {\n $post = Post::where('slug', $slug)->first();\n\n // verifico se la select fatta sul DB mi ha ritornato un post tramite lo slug\n // ad esempio l'utente potrebbe modificare la stringa nella barra indirizzi, alterando il nome\n // dello slug e scrivendo un qualcosa che non ha corrispondenza con alcun post del DB\n if (!empty($post)) {\n // ritorna una view con i dati del singolo post ricercato\n return view('public.posts.show', ['post' => $post]);\n } else {\n // ritorno la pagina di errore \"Page not found\" poichè lo slug ricevuto in ingresso\n // non corrisponde a nessuna post presente nel mio DB (tabella 'posts')\n return abort(404);\n }\n }",
"function tmiGetContentAreas() {\n global $wpdb;\n\n $postType = 'tmi-content-area'; // define your custom post type slug here\n\n $results = $wpdb->get_results( $wpdb->prepare( \"SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type = %s and post_status = 'publish'\", $postType ));\n\n // Return null if we found no results\n if ( ! $results )\n return;\n return $results;\n}",
"public function singlepost($slug)\n {\n $post = POST::with('category', 'tag', 'user')\n ->where('slug', $slug)\n ->firstOrFail();\n // $posts = Post::where('category_id', $post->category_id)->inRandomOrder()->limit(3)->get();\n $posts = Post::where('category_id', $post->category_id)\n ->where('slug', '!=', $slug)\n ->inRandomOrder()\n ->limit(3)\n ->with('comment')\n ->get();\n $prev = Post::where('id', '<', $post->id)\n ->orderBy('id', 'desc')\n ->first();\n // $prev = Post::where('id', '<', $post->id)->get()->sortByDesc('id')->first();\n $next = Post::where('id', '>', $post->id)\n ->orderBy('id')\n ->first();\n $categories = Category::all();\n if (count($post->tag) >= 10) {\n $tags = $post->tag->random(10);\n } else {\n $tags = $post->tag;\n }\n $main_menu_id = Menus::where('name', 'main-menu')\n ->with('items')\n ->first();\n if (isset($main_menu_id)) {\n $main_menu_id = $main_menu_id->id;\n }\n $main_menu = MenuItems::where('menu', $main_menu_id)\n ->orderBy('sort')\n ->get();\n $setting = Setting::all()->first();\n $post_visitor = Post::where('slug', $post->slug)->first()->visitor;\n DB::table('posts')\n ->where('slug', $post->slug)\n ->update(['visitor' => $post_visitor + 1]);\n $popular_posts = Post::orderBy('visitor', 'desc')\n ->take(10)\n ->with('category')\n ->inRandomOrder()\n ->limit(4)\n ->get();\n $most_visit = Post::orderBy('visitor', 'desc')->first();\n $post_id = Post::where('slug', $slug)->first()->id;\n $comments = Comment::where('p_id', 0)\n ->where('post_id', $post_id)\n ->where('status', 1)\n ->get();\n $comment_count = count(\n Comment::where('post_id', $post_id)\n ->where('status', 1)\n ->get()\n );\n $socials = Social::all();\n\n return view('front.view', compact('post', 'posts', 'categories', 'prev', 'next', 'tags', 'setting', 'main_menu', 'popular_posts', 'most_visit', 'comments', 'comment_count', 'socials'));\n }",
"public function index()\n {\n return PostShort::collection(\n BlogPost::orderByRaw('(CASE WHEN publication = 0 THEN id END) DESC')\n ->orderBy('publication_date', 'desc')\n ->paginate(20)\n );\n }",
"public function show(Request $request)\n {\n //\n \n $input = $request->all();\n \n $validator = Validator::make($input, [ \n 'slug' => 'required' \n ]);\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors()); \n }\n \n $result = Post::where('slug','=',$request->slug)->get();\n \n return $this->sendResponse($result, 'Post search result.');\n }",
"public function posts()\n {\n \treturn $this->morphedByMany(Post::class, 'videoable');\n }",
"public function getBySlug($slug)\n\t{\n\t\treturn $this->doll->with('DollTypes')->where('slug', $slug)->firstOrFail();\n\t}"
]
| [
"0.76624423",
"0.7337012",
"0.7336686",
"0.7136821",
"0.6884522",
"0.6804324",
"0.6804324",
"0.6804324",
"0.6804324",
"0.6804324",
"0.6758746",
"0.6732866",
"0.6718587",
"0.66863006",
"0.66697943",
"0.6649162",
"0.6630051",
"0.6627281",
"0.66053224",
"0.66053224",
"0.6550084",
"0.654017",
"0.6511857",
"0.6455256",
"0.6448318",
"0.6438205",
"0.64279735",
"0.64178777",
"0.6399581",
"0.6359187",
"0.63173664",
"0.6295114",
"0.62934875",
"0.62925106",
"0.62925106",
"0.6260344",
"0.6210634",
"0.6181596",
"0.61532056",
"0.61331844",
"0.6126547",
"0.6103298",
"0.6097047",
"0.60885257",
"0.60781187",
"0.6072475",
"0.6070951",
"0.6067437",
"0.606579",
"0.60651934",
"0.6041394",
"0.6040728",
"0.6040341",
"0.6034784",
"0.6027044",
"0.60269386",
"0.6012996",
"0.5998819",
"0.5993574",
"0.5987787",
"0.59866387",
"0.5981969",
"0.5972326",
"0.59700644",
"0.5952463",
"0.5944096",
"0.5933453",
"0.59265435",
"0.59249425",
"0.59224576",
"0.59215504",
"0.59168535",
"0.59130085",
"0.5912913",
"0.5909651",
"0.5908487",
"0.5906789",
"0.59060305",
"0.58940125",
"0.5874888",
"0.58713305",
"0.58590215",
"0.58559054",
"0.5854475",
"0.58509326",
"0.58505034",
"0.5829086",
"0.5826204",
"0.5821415",
"0.58176446",
"0.58164364",
"0.58164364",
"0.58107305",
"0.5807529",
"0.57943636",
"0.57930416",
"0.5787634",
"0.5773275",
"0.5771354",
"0.57672125"
]
| 0.7375072 | 1 |
uses a regular expression to check a field's value. | public function patternMatches($fieldName,$validation){
if (isSet($_SESSION[$fieldName])){
return preg_match($validation,$_SESSION[$fieldName]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function match($field, $value);",
"public static function _regex($value, $field, $regex) {\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"function validate_field($field)\n {\n }",
"public function check($field, $exp) {\n\t\treturn (preg_match($exp, $_POST[$field['name']]));\n\t}",
"function hobbyFormat ($value, $regex){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match($regex,$value)){\n return false;\n }\n \n return true;\n}",
"public function validate($field, $value)\n {\n return preg_match('/^(?=.*[!@#$%^&*-])(?=.*[0-9])(?=.*[A-Z]).{8,20}$/', $value) == 1;\n }",
"function filterphone($field) {\n $pattern = \"/^[0-9\\_]{9,10}/\";\n //validate phone number\n if (preg_match($pattern,$field)){ \n return $field;\n }else{\n return FALSE;\n }\n}",
"public function func_regexp($fieldname, $value)\n {\n $placeholder = QueryPart::placeholder($fieldname);\n $negate = ($value[0] == '!') ? 'NOT ':'';\n if ($value[0] == '!') {\n $value = substr($value, 1);\n }\n $parameter = [$placeholder => $value];\n\n return new QueryPart(\"{$fieldname} {$negate} REGEXP {$placeholder}\", $parameter);\n }",
"function validarNombre($variable, $pattern){\n if (preg_match($pattern, $variable)) {\n return \tTrue;\n }\n return false;\n }",
"function acf_validate_value($value, $field, $input)\n{\n}",
"function validate_phone($field_input, array &$field): bool\n{\n $default = \"/\\+3706(\\d{7})$/\";\n\n if (!empty($field_input)) {\n if (!preg_match_all($default, $field_input)) {\n $field['error'] = 'Number must be like +3706XXXXXXX';\n }\n }\n\n return true;\n\n}",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_value($valid, $value, $field, $input)\n {\n }",
"function validate_user_field($field)\n {\n }",
"function is_money($field){\n\t\tif(preg_match('/valor/',$field)){\n\t\t\treturn(true);\n\t\t}else{\n\t\t\treturn(false);\n\t\t}\n\t}",
"public function validate($value) {\n return preg_match($this->options[\"pattern\"], $value) ? $value : Filter::ERR_INVALID;\n }",
"function formato($valor, $regex = '//')\r\n{\r\n return preg_match($regex, $valor);\r\n}",
"function validarExpresion($variable, $expresion){\n\t\t$validar = array(\n\t\t\t\t \"options\" => array(\"regexp\"=>$expresion)\n\t\t\t);\n\t\tif(!filter_var($variable, FILTER_VALIDATE_REGEXP, $validar)){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t}",
"function pfb_match_filter_field($flent, $fields) {\n\tif (isset($fields)) {\n\t\tforeach ($fields as $key => $field) {\n\t\t\tif (empty($field)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (strpos($field, '!') !== FALSE) {\n\t\t\t\t$field = substr($field, 1);\n\t\t\t\t$field_regex = str_replace('/', '\\/', str_replace('\\/', '/', $field));\n\t\t\t\tif (@preg_match(\"/{$field_regex}/i\", $flent[$key])) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$field_regex = str_replace('/', '\\/', str_replace('\\/', '/', $field));\n\t\t\t\tif (!@preg_match(\"/{$field_regex}/i\", $flent[$key])) {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn TRUE;\n}",
"function validate_email($field_input, array &$field): bool\n{\n $pattern = '/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,})$/i';\n if (!preg_match_all($pattern, $field_input)) {\n $field['error'] = 'Such email address is not valid';\n return false;\n }\n return true;\n}",
"function test($value) {\n\t\t// php doesn't have g modifier so we remove it if it's there and call preg_match_all()\n\t\tif(strpos($this->modifiers, 'g') !== false){\n\t\t\t$this->modifiers = str_replace('g', '', $this->modifiers);\n\t\t\treturn preg_match_all($this->getRegex(), $value);\n\t\t}\n\t\treturn preg_match($this->getRegex(), $value);\n\t}",
"public function match($value);",
"private function alpha($field, $value) {\n if (!preg_match(self::REGEX_ALPHA, $value)) {\n $this->errors[$field][] = self::ERROR_ALPHA;\n }\n }",
"protected function _validateData_test_value( &$value ) {\n\t\tif(!$this->validation_regexp) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif( !preg_match($this->validation_regexp, $value) ) {\n\t\t\tthrow new Config_Exception(\n\t\t\t\t\"Configuration property \".get_class($this->_configuration).\"::\".$this->_name.\" has invalid format. Valid regexp: {$this->validation_regexp}, current value: {$value}\",\n\t\t\t\tConfig_Exception::CODE_CONFIG_CHECK_ERROR\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isValid($value) {\n return parent::isValid($value) || preg_match($this->_pattren, $value);\n }",
"abstract protected function validateValue($value);",
"abstract protected function filterFieldvalue();",
"function valid_input($myinput, $good_input) {\n if (preg_match(\"/$good_input/\", $myinput, $regs)) {\n return true;\n }\n else {\n return false;\n }\n}",
"function valid_input($myinput, $good_input) {\n if (preg_match(\"/$good_input/\", $myinput, $regs)) {\n return true;\n }\n else {\n return false;\n }\n}",
"function character_validations($value, $isPhone, $isEmail, $isUsername){\n //Possible regex expressions for:\n //phone: -> '/^[0-9]{3}[-][0-9]{3}[-][0-9]{4}$/'\n //email: -> '/^[^0-9.\\_][A-Za-z0-9]+[@][A-Za-z0-9_]+[.][a-z]{3}'\n if($isPhone){\n //if the string mathces this pattern then it will return true or\n return preg_match('/^[0-9]{3}[-][0-9]{3}[-][0-9]{4}$/', $value);\n } elseif($isEmail){\n //this condition is if its for an email\n return preg_match(\"/^[A-Za-z0-9._\\%-]+@[A-Za-z0-9.-]+\\.[a-z]{3}$/\", $value);\n } elseif($isUsername){\n //check if username has proper characters\n return !(preg_match(\"/[\\W]/\", $value));\n }\n }",
"public function getPatternedField(string $field);",
"public function validate($value);",
"public function validate($value);",
"public static function validate($value);",
"public static function _email($value, $field) {\n\t\t$regex = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"public static function _postalcode($value, $field) {\n\t\t$regex = '/^[A-Za-z][0-9][A-Za-z] ?[0-9][A-Za-z][0-9]$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"function filterName($field){\n // Sanitize user name\n $field = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if(filter_var($field, FILTER_VALIDATE_REGEXP, array(\"options\"=>array(\"regexp\"=>\"/^[a-zA-Z\\s]+/\")))){\n return $field;\n }else{\n return FALSE;\n }\n}",
"public function RegexValidation($value,$regex){\r\n\t\t$validation = \"\";\r\n\t\tif($value==\"\"){\r\n\t\t\t$validation = 'null';\r\n\t\t}elseif($value!=\"\"){\r\n\t\t\tif(!preg_match($regex, $value)){\r\n\t\t\t\t$validation = 'invalid';\r\n\t\t\t}else{\r\n\t\t\t\t$validation = 'valid';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $validation;\r\n\t}",
"function checkTypeForFilter($field, $value){\n\t\tif (get_magic_quotes_gpc()){\n\t\t\t$value = stripslashes($value);\n\t\t}\n\t\t\n\t\t$type=$this->types[$field];\n\t\t\n\t\tswitch ($type){\n\t\t\tcase \"date\":\n\t\t\t\t\n\t\t\t\t$value=date_ymd($value);\n\t\t\t\t$return=\" = '$value'\";\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\t$return=\"= $value\";\n\t\t\t\tbreak;\n\t\t\tcase \"progressbar\":\n\t\t\t\t$pje=$value/100;\n\t\t\t\treturn \"= $pje\";\n\t\t\t\tbreak;\n\t\t\tcase \"string\":\n\t\t\tdefault:\n\t\t\t\t$return=\"LIKE \".db::checkRealEscapeString($value,true);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $return;\n\t}",
"public function isRegex()\n {\n return filter_var($this->_value, FILTER_VALIDATE_REGEXP);\n }",
"function isEmail($field_data) \n{ \n\t$fields_ok=preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $field_data); \n\treturn $fields_ok; \n}",
"private function process_regex($value, $param = null)\n {\n return (bool) preg_match($param, $value);\n }",
"function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}",
"function validateMobileNumber($field)\n{\n if (preg_match(\"/^(\\s*|(009665|9665|\\+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7}))$/\", $field)) {\n return $field;\n } else {\n return false;\n }\n}",
"public function filter($regexp) {\n return filter_var($this->__value, FILTER_VALIDATE_REGEXP, array('options'=>array('regexp'=>$regexp)));\n }",
"function validate_space($field_input, &$field)\n{\n if (!strpos($field_input, ' ')) {\n $field['error'] = 'Name must contain Name and Surname';\n return false;\n }\n return true;\n}",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function testGetRegex(): void\n {\n $this->class->setRegex($this->value);\n\n self::assertSame($this->value, $this->class->getRegex());\n }",
"public function test($field, $value);",
"public static function _alphanum($value, $field, $allow_whitespaces = true) {\n\t\t$regex = $allow_whitespaces ? '/^[A-Za-z0-9\\s]+$/' : '/^[A-Za-z0-9]+$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"function textFormat ($value){\n \n if(!preg_match(VALID_TEXT_FORMAT,$value)){\n return false;\n }\n \n return true;\n}",
"public function hasValue(string $field): bool;",
"public abstract function matches($value);",
"protected function accept_regex() {\n return true;\n }",
"public function testMatchingRegexp()\n {\n $configDefaultField = json_decode(sprintf($this->regexpConfigStub, '/^Foo/', '', 'false'), true);\n $matchingRegexpFilterWithDefaultField = new Regexp($configDefaultField);\n\n $configCustomField = json_decode(sprintf($this->regexpConfigStub, '/Unit/', 'name', 'false'), true);\n $matchingRegexpFilterWithCustomField = new Regexp($configCustomField);\n\n $this->assertTrue($matchingRegexpFilterWithDefaultField->accept($this->logEvent));\n $this->assertTrue($matchingRegexpFilterWithCustomField->accept($this->logEvent));\n }",
"public function regexp($regexp)\n {\n\n }",
"private function email($field, $value) {\n if (!preg_match(self::REGEX_EMAIL, $value)) {\n $this->errors[$field][] = self::ERROR_EMAIL;\n }\n }",
"function validateAlphanum($value) {\n\tif(ereg(\"^[a-zA-Z0-9]+$\", $value, $regs)) {\n\t\techo \"true\";\n\t} else {\n\t\techo \"false\";\n\t}\n}",
"function filter_pattern($value)\n {\n global $pattern;\n return !strncmp($pattern, $value, strlen($pattern));\n }",
"function testIfmatch(){\n\t\t#mdx:ifmatch\n\t\tParam::get('name')\n\t\t\t->filters()\n\t\t\t->ifmatch('/\\d/', 'Name cannot contain digits');\n\n\t\t$error = Param::get('name')->process(['name'=>'M4ry'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Name cannot contain digits\", $error);\n\n\t}",
"public function validateValue()\n {\n return (preg_match('/' . $this->preference->value . '/', $this->value) == 1 ? true : false);\n }",
"function acf_get_valid_field($field = \\false)\n{\n}",
"public function matches($str, $field)\n\t{\n\t\tif ( ! isset($_POST[$field]))\n\t\t{\n\t\t\treturn FALSE;\t\t\t\t\n\t\t}\n\t\t\n\t\t$field = $_POST[$field];\n\n\t\treturn ($str !== $field) ? FALSE : TRUE;\n\t}",
"private function alpha_num($field, $value) {\n if (!preg_match(self::REGEX_ALPHA_NUM, $value)) {\n $this->errors[$field][] = self::ERROR_ALPHA_NUM;\n }\n }",
"public function regx(string $regx, string $message = \"\"): static\r\n {\r\n if (!empty($regx)) {\r\n if (!preg_match($regx, $this->field)) $this->message($message ?: \"is not valid\");\r\n }\r\n return $this;\r\n }",
"function validarNombreEstricto($valor) {\r\n $patron= \"/^[[:alpha:]]+$/\";\r\n if (preg_match($patron, $valor)) {\r\n return true;\r\n } else {\r\n return false;\r\n } \r\n}",
"function validate()\n {\n if ( $this->options['required'] && $this->value == '' )\n {\n $this->validationError = $this->label . ' is required!';\n fWarn::getInstance()->add('Validation failed for ' . $this->name . ', field is required.');\n return false;\n }\n if ( isset($this->regex) )\n {\n $return = preg_match($this->regex, $this->value);\n if ( !$return )\n $this->fDebug->add('Could not validate \"' . $this->value . '\" against \"' . $this->regex . '\"', 1);\n return $return;\n }\n return true;\n }",
"function regex_username($uname){\n return preg_match('/^[a-zA-Z0-9]+$/',$uname);\n}",
"function acf_validate_field( $field ) {\n\t\t\n\t\t// 5.5.6 - changed filter name\n\t\t$field = apply_filters( \"acf/get_valid_field/type={$field['type']}\", $field );\n\t\t$field = apply_filters( \"acf/get_valid_field\", $field );\n\t\t\n\t\t\n\t\t// return\n\t\treturn $field;\n\t\t\n\t}",
"function _valid_match($field, $param = array())\r\n\t{\r\n\t\treturn in_array($this->{$field}, $param);\r\n\t}",
"public static function isFieldValid(Field $field): bool\n {\n return $field instanceof PatternField;\n }",
"function RegexMatch($regex, $input)\r\n{\r\n if (preg_match($regex, $input)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}",
"function validate_campaign_notification_field( $valid, $value, $field, $input ){\n\n\t// bail early if value is already invalid\n\tif( !$valid ) {\n\t\treturn $valid;\n\t}\n\n\tif (strpos($value, ' ') !== false)\n\t{\n\t\t$valid = \"Name of the campaign should be a text without space.\";\n\t}\n\n\treturn $valid;\n}",
"function nameFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_NAME_FORMAT,$value)){\n return false;\n }\n \n return true;\n}",
"function test_subcategory_input($data, $regex) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n if (preg_match($regex,$data)) {\n return $data;\n }else{\n return $data = \"\";\n } \n }",
"public function alphaNum($field) {\n\t\treturn (preg_match('/^[a-zA-Z0-9]+$/', $_POST[$field['name']]));\n\t}",
"protected function validateRegex($value, $parameters){\n\t\treturn preg_match($parameters[0], $value);\n\t}",
"private function emailValidation($field) {\t\r\n\t \t\t$sent = $this->getSentData($field);\r\n\t \t\t\r\n\t \t\t$email_pattern = '/^[^@\\s<&>]+@([-a-z0-9]+\\.)+[a-z]{2,}$/i';\r\n\t\t\tif (preg_match($email_pattern, $sent)) \r\n \t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t \t}",
"function phoneNum($value) {\n\t$reg = \"/^\\([1-9]\\d{2}\\)\\s?\\d{3}\\-\\d{4}$/\";\n\treturn preg_match($reg,$value);\n}",
"function getFieldValue($field);",
"public static function _alpha($value, $field, $allow_whitespaces=true) {\n\t\t$regex = $allow_whitespaces ? '/^[A-Za-z\\s]+$/' : '/^[A-Za-z]+$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}",
"function validate($data, $field){\n\t\tswitch($field){\n\t\t\tcase 'email': {\n\t\t\t\tif(!empty($data)){\n\t\t\t\t\tif(!filter_var($data, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t\treturn \"Invalid email address.\";\n\t\t\t\t\t}//if\n\t\t\t\t}else{\n\t\t\t\t\treturn \"Email address is required.\";\n\t\t\t\t}//ifelse\n\t\t\t\treturn \"\";\n\t\t\t}//case email\n\n\t\t\tdefault: break;\n\n\t\t}//switch statement\n\t}",
"function test_value($text, $type){\n global $varregex, $labelregex, $intregex, $stringregex, $boolregex, $typeregex;\n if($type == 'var'){\n if(preg_match($varregex, $text)) {\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu var.\\n\", 21));\n }\n elseif ($type == 'label') {\n if(preg_match($labelregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu label.\\n\", 21));\n }\n elseif ($type == 'int') {\n if(preg_match($intregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu int.\\n\", 21));\n }\n elseif ($type == 'string') {\n if(preg_match($stringregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu string.\\n\", 21));\n }\n elseif ($type == 'bool') {\n if(preg_match($boolregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu bool.\\n\", 21));\n }\n elseif ($type == 'type') {\n if(preg_match($typeregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu type.\\n\", 21));\n }\n }",
"private function validateField($fieldValue, $field, $length = 65535){\r\n\t\treturn $this->attr($field, 'required') == 1 ? DataValidator::validateData($fieldValue, $this->attr($field, 'type'), $length): true;\r\n\t}",
"public function passes($attribute, $value)\n {\n return preg_match('/^[\\pL\\.\\-\\_\\d+]+$/u', $value);\n }",
"function filterName($field) {\n // Limpiar el nombre del usuario\n $sanitizeField = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n // Validate user name\n if (filter_var($sanitizeField, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"/^[a-zA-Z\\s]+$/\")))) {\n return $sanitizeField;\n } else {\n return false;\n }\n}",
"function filterRequiredString($field)\n{\n $field = filter_var(trim($field), FILTER_SANITIZE_STRING);\n\n if (empty($field)) {\n return false;\n } else {\n return $field;\n }\n}",
"function spamcheck($field)\r\n {\r\n //address using FILTER_SANITIZE_EMAIL\r\n $field=filter_var($field, FILTER_SANITIZE_EMAIL);\r\n\r\n //filter_var() validates the e-mail\r\n //address using FILTER_VALIDATE_EMAIL\r\n if(filter_var($field, FILTER_VALIDATE_EMAIL))\r\n {\r\n return TRUE;\r\n }\r\n else\r\n {\r\n return FALSE;\r\n }\r\n }",
"function check( $value, $type='text' )\n {\n return Pgg_Validate::is( $value, $type );\n }",
"function _valid_date($field)\r\n\t{\r\n\t\t// Ignore if empty\r\n\t\tif (empty($this->{$field}))\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\r\n\t\t$date = date_parse($this->{$field});\r\n\r\n\t\treturn checkdate($date['month'], $date['day'],$date['year']);\r\n\t}",
"public function match(mixed $value);",
"public static function getRegularExpression();",
"public function validateValue($value)\n {\n }",
"public function checkForField( $field, $table );",
"function acf_validate_field($field = array())\n{\n}",
"public static function _number($value, $field) {\n\t\treturn (bool)preg_match('/^-?[0-9]+(\\.[0-9]+)?$/', $value);\n\t}",
"function placeFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_PLACE_FORMAT,$value)){\n return false;\n }\n \n return true;\n}"
]
| [
"0.6932917",
"0.6498333",
"0.6494174",
"0.64492947",
"0.64306784",
"0.6397223",
"0.6342156",
"0.6338036",
"0.63072354",
"0.62368613",
"0.6210926",
"0.62077636",
"0.62077636",
"0.62077636",
"0.62077636",
"0.61476254",
"0.61170125",
"0.6070334",
"0.6048059",
"0.6041619",
"0.6012915",
"0.5940788",
"0.5918075",
"0.59070486",
"0.5896961",
"0.5881287",
"0.5873125",
"0.58589786",
"0.58569485",
"0.5839891",
"0.5839891",
"0.5819269",
"0.5801558",
"0.5794497",
"0.5794497",
"0.57931334",
"0.5788221",
"0.5783028",
"0.57565457",
"0.5752228",
"0.5747931",
"0.573532",
"0.5732141",
"0.5723912",
"0.57217735",
"0.5718468",
"0.571484",
"0.57078284",
"0.5706774",
"0.5704965",
"0.5701273",
"0.56852615",
"0.5658499",
"0.5655602",
"0.5648208",
"0.56471384",
"0.56416076",
"0.56312126",
"0.5631159",
"0.5609442",
"0.56081086",
"0.56017697",
"0.55965793",
"0.5587265",
"0.5576559",
"0.55734295",
"0.5572773",
"0.5570894",
"0.55593896",
"0.5550596",
"0.5544623",
"0.5544322",
"0.5537886",
"0.5534351",
"0.5527787",
"0.5517943",
"0.551678",
"0.5512577",
"0.549347",
"0.54932386",
"0.5487719",
"0.54873896",
"0.54799616",
"0.5476571",
"0.54739285",
"0.5473349",
"0.5469586",
"0.5459893",
"0.54501545",
"0.54430485",
"0.5434448",
"0.5427215",
"0.54233307",
"0.5422924",
"0.54228806",
"0.54207504",
"0.5420021",
"0.5414572",
"0.54114527",
"0.54073334"
]
| 0.6445829 | 4 |
determines if the trimmed value is not the empty string. | public function checkFieldLength($field){
if (isSet($_SESSION[$fieldName])){
return strLen(trim($_SESSION[$fieldName]));
}
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}",
"function is_blank($value) {\n return !isset($value) || trim($value) === '';\n}",
"function is_blank( $value ) {\n return !isset( $value ) || trim( $value ) === '';\n}",
"public function isEmpty()\n {\n return empty(trim($this->_value));\n }",
"private function isNullOrEmpty($value) {\n\t\treturn (!isset($value) || trim($value) === '');\n\t}",
"function has_presence($value){\r\n $trimmed_value = trim($value);\r\n return isset($trimmed_value) && $trimmed_value !== \"\";\r\n\r\n}",
"public function isBlank()\n {\n return $this->matchesPattern('^[[:space:]]*$');\n }",
"function blank($value)\n {\n if (is_null($value)) {\n return true;\n }\n if (is_string($value)) {\n return trim($value) === '';\n }\n if (is_numeric($value) || is_bool($value)) {\n return false;\n }\n if ($value instanceof Countable) {\n return count($value) === 0;\n }\n return empty($value);\n }",
"function is_blank($value): bool\n {\n if (is_null($value)) {\n return true;\n }\n\n if (is_string($value)) {\n return trim($value) === '';\n }\n\n if (is_numeric($value) || is_bool($value)) {\n return false;\n }\n\n if (is_array($value)) {\n return count($value) === 0;\n }\n\n return empty($value);\n }",
"public static function _empty($value)\n\t{\n\t\treturn (is_null($value) || empty($value) || $value == \"\");\n\t}",
"public function isEmpty()\n {\n return '' === $this->getValue();\n }",
"public static function isEmpty($value)\n {\n return $value === '' || $value === [] || $value === null || is_string($value) && trim($value) === '';\n }",
"function notEmpty($string) {\n return strlen(trim($string)) > 0;\n }",
"public function blank($value){\r\n if(is_string($value)){\r\n $value = str_replace(array(\" \", \"\\t\", \"\\n\", \"\\r\"), \"\", $value);\r\n }\r\n return empty($value);\r\n }",
"protected static function validate_not_empty( $value ){\n\t\treturn ( $value !== null && $value !== '' );\n\t}",
"public function isEmpty()\n {\n return $this->_value === '' || $this->_value === null;\n }",
"function is_blank($value) {\n if (is_object($value) && method_exists($value, 'is_blank')) return $value->is_blank();\n if (is_string($value)) $value = trim($value);\n return is_empty($value);\n}",
"function tep_not_null ($value) {\n\treturn !empty ($value) && trim ($value);\n}",
"public static function isBlank($input)\r\n\t{\r\n\t\t$i = trim($input);\r\n\t\treturn strlen($i) == 0;\r\n\t}",
"public function is_empty_attribute_value( $value ) {\n\t\treturn ! isset( $value ) || '' === $value;\n\t}",
"public function isNotEmpty() {\n\t\treturn !empty($this->_value);\n\t}",
"public static function isEmpty($data){\n return (empty(trim($data))) ? true : false;\n }",
"public function isEmpty() {\r\n\t\treturn $this->getValue() == null || $this->getValue() == '' || $this->getValue() == 0;\r\n\t}",
"public function isEmpty(): bool\n {\n return 0 === \\mb_strlen($this->getValue());\n }",
"private function isEmpty($val){\n return strlen($val) <= 0 ? true : false;\n }",
"function IsNullOrEmptyString($s){\r\n\t return (!isset($s) || trim($s)==='');\r\n\t}",
"public function blank($value)\n {\n if (is_null($value)) {\n return true;\n }\n\n if (is_string($value)) {\n return trim($value) === '';\n }\n\n if (is_numeric($value) || is_bool($value)) {\n return false;\n }\n\n if ($value instanceof Countable) {\n return count($value) === 0;\n }\n\n return empty($value);\n }",
"function is_empty($str, $incl_zero = true)\n{\n if (strlen(trim($str)) === 0 || !isset($str)) { // if the string length is 0 or it isn't set\n return true;\n } elseif ($incl_zero && empty($str) && $str != '0') { // if the string is empty and not 0, it's empty\n return true;\n } elseif (!$incl_zero && empty($str)) {\n return true;\n } else {\n return false;\n }\n}",
"function is_blank($value) {\n\t\t\n\t\treturn empty($value) && !is_numeric($value);\n\t\t\n\t}",
"private static function is_empty($value)\n {\n foreach ((array)$value as $v) {\n if (((string)$v) !== '') {\n return false;\n }\n }\n\n return true;\n }",
"function is_empty($str, $incl_zero = true)\n{\n if (strlen(trim($str)) === 0 || !isset($str)) { // if the string length is 0 or it isn't set\n return true;\n } elseif ($incl_zero === true && empty($str) && $str != '0') { // if the string is empty and not 0, it's empty\n return true;\n } elseif (empty($str)) {\n return true;\n } else {\n return false;\n }\n}",
"function IsNullOrEmptyString($inputString) {\n return (!isset($inputString) || trim($inputString) == '');\n}",
"private function isEmpty($line) {\n\t//--\n\treturn (trim($line) === '');\n\t//--\n}",
"public function ignoreEmpty($value): bool;",
"function isNotEmpty($string){\n\t\treturn !empty($string);\n\t}",
"function is_element_empty($element) {\n $element = trim($element);\n return !empty($element);\n}",
"public function notempty($field)\n {\n return is_string($field) && trim($field) !== '';\n }",
"protected function notEmpty($string)\r\n {\r\n return trim($string) !== '';\r\n }",
"function strictEmpty($var) {\n $var = trim($var); \n if((isset($var) === true && $var === '') || (isset($var) === true && $var === 'undefined')) { \t\t\n return true; \n }\n else { \n return false;\n }\n}",
"function isEmpty($str = null){\n if ($str) {\n $cleanstr = trim($str);\n if (strlen($cleanstr)<=0) {\n echo \"input is Empty<br>\";\n return true;\n }else\n return false;\n}}",
"function stringIsNullOrWhitespace($text){\n\t return ctype_space($text) || $text === \"\" || $text === null;\n\t}",
"function validateEmpty($string)\n\t\t{\n\t\t\t$string\t=\ttrim($string);\n\t\t\tif($string ==\"\" || is_null($string)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function isEmpty() {\n return empty($this->__value);\n }",
"public function isEmpty() {\n\t\treturn empty($this->_value);\n\t}",
"public function not_blank(string $element=null) :bool\n {\n if(is_null($element))\n {\n \treturn false;\n }\n \t$element = trim($element);\n return (strlen($element) > 0);\n }",
"function is_element_empty($element) {\n\t$element = trim($element);\n\treturn !empty($element);\n}",
"function isEmpty($var)\n {\n if (empty($var) && strlen(trim($var))==0)\n {\n $result=true;\n }\n else\n {\n $result=false;\n }\n\n return $result;\n }",
"function IsNullOrEmptyString($question){\n return (!isset($question) || trim($question)==='');\n}",
"function has_presence($value) {\n return ((isset($value)) && ($value !== \"\"));\n }",
"public function isEmpty($key)\n {\n\n if (isset($this->data[$key]))\n return ('' == trim($this->data[$key]));\n else\n return true;\n\n }",
"function not_empty(mixed $value): bool\n\t{\n\t\treturn !empty($value);\n\t}",
"function IsNullOrEmptyString($question){\n return (!isset($question) || trim($question)==='');\n }",
"private function isCurrentLineBlank()\n {\n return '' == trim($this->currentLine, ' ');\n }",
"private static function betterEmpty($value)\n {\n return empty($value) && !is_numeric($value);\n }",
"protected function isEmpty($value): bool\n {\n return $value === null || $value === '' || $value === false;\n }",
"public static function notEmpty($value)\n {\n if(is_array($value)){return (sizeof($value) != 0)?:false;}\n if(is_string($value)){return (strlen($value) != 0)?:false;}\n return false;\n }",
"public static function isEmptyString($input) {\n\treturn strlen((string)$input) === 0;\n }",
"public static function is_non_empty( $variable ) {\n\t\treturn is_string( $variable ) && '' !== $variable;\n\t}",
"function isEmpty($value) {\n return !isset($value) || strlen($value) < 1;\n}",
"function validate_empty($val) {\n\tif ($val === NULL || $val === '') {\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function isEmpty()\n {\n return $this->length === 0;\n }",
"public function isEmpty() {\n return $this->getLength() == 0;\n }",
"public static function is_empty($str): bool\n {\n return empty($str);\n }",
"public function isEmpty()\n {\n return \\strlen($this->toNative()) == 0;\n }",
"public static function isEmpty($value)\r\n\t{\r\n\t\treturn $value === false || $value === null || $value === '' || (is_array($value) && !count($value));\r\n\t}",
"public static function isNullOrEmptyString($var)\n {\n try {\n (string) $var;\n } catch (\\Exception $e) {\n return false;\n }\n\n return !isset($var) || trim($var) === '';\n }",
"protected function isEmpty($value)\n {\n if (is_null($value) || $value === '')\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function isEmpty() {\n \n return $this->_value ? FALSE : TRUE;\n }",
"private static function isNullOrEmptyString($question){\n return (!isset($question) || trim($question)==='');\n }",
"protected function isEmptyString($key): bool\n\t{\n\t\t$value = $this->get($key);\n\t\t$boolOrArray = is_bool($value) || is_array($value);\n\n\t\treturn !$boolOrArray && trim((string) $value) === '';\n\t}",
"function emptyNot0(&$var) {\n\t// Let's face it: a string that just contains whitespace is empty.\n\tif (gettype($var) == 'string') {\n\t\t$var = trim($var);\n\t}\n\t\n\treturn (($var !== 0) && ($var !== 0.0) && ($var !== \"0\") && (empty($var)));\n}",
"function is_empty()\n {\n }",
"public static function is_blank(string $str): bool\n {\n if (self::$SUPPORT['mbstring'] === true) {\n return \\mb_ereg_match('^[[:space:]]*$', $str);\n }\n\n return self::str_matches_pattern($str, '^[[:space:]]*$');\n }",
"public static function isNullOrWhiteSpace(?string $subject): bool\n\t{\n\t\treturn $subject === null || Strings::trim($subject) === Strings::EMPTY_STRING;\n\t}",
"function blank($subject): bool\n{\n if (\\is_null($subject)) {\n return true;\n }\n\n if (\\is_string($subject)) {\n return empty(\\trim($subject));\n }\n\n if (\\is_numeric($subject) or \\is_bool($subject)) {\n return false;\n }\n\n if ($subject instanceof Countable) {\n return (bool) \\count($subject);\n }\n\n return empty($subject);\n}",
"public function testIsEmptyStringBlank()\n {\n $this->assertTrue(StringUtils::isBlank(StringUtils::EMPTY_STR));\n }",
"public function isNotEmpty()\n {\n return ! $this->isEmpty();\n }",
"public function isNotEmpty()\n {\n return ! $this->isEmpty();\n }",
"function checkEmptyField($field) {\n\t return isset($field) && $field !== \"\" && $field !== '';\n }",
"public function IsNullOrEmptyString($question)\n {\n return (!isset($question) || trim($question) === '');\n }",
"function is_empty ($subject) {\n\t\n\t\treturn !(isset($subject) && !is_null($subject) && ($subject!==''));\n\t\n\t}",
"function has_presence($value) {\n\t\treturn isset($value) && $value != \"\";\n\t\t}",
"public static function validateHasNoWhitespace( $value ) {\n\t\t\tif ( !is_string( $value ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( preg_match( '/\\s/', $value ) ) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}",
"public static function trim($value)\r\n {\r\n return is_null($value) ? '' : trim($value);\r\n }",
"public function testIsStringBlank()\n {\n $this->assertFalse(StringUtils::isBlank(static::TEST_STRING));\n }",
"public function isEmpty($value)\n {\n return ($value === null || $value === false || $value === '') ||\n (is_array($value) && empty($value));\n }",
"public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }",
"private function nullable($value)\n {\n return is_null($value) || $value === '';\n }",
"public function isNotEmpty(): bool\n {\n return ! $this->isEmpty();\n }",
"public static function isNotEmpty()\n {\n return self::logicalNot(self::isEmpty());\n }",
"function has_presence($value) {\n\treturn isset($value) && $value !== \"\";\n}",
"function has_presence($value) {\n\treturn isset($value) && $value !== \"\";\n}",
"function has_presence($value) {\n\treturn isset($value) && $value !== \"\";\n}",
"private function _isNull() {\n if (is_null($this->value)) {\r\n return true;\r\n }\n if (empty($this->value) && (in_array($this->type, array('multiple', 'ordered', 'string')))) {\n return true;\n }\n return false;\n }",
"public function req($value)\n {\n return '' != $value || empty($value);\n }",
"public function isEmpty(): bool\n {\n return is_null($this->value);\n }",
"public static function isEmpty(&$value)\n {\n return $value === null || $value === '' || (array) $value === array() ;\n }",
"private function check_Null_Or_Empty($word){\r\n return ($word == '' || $word == null) ? true : false;\r\n }",
"function issetandfilled($data) {\n if (!isset($data))\n return false;\n\n if (empty(trim($data)))\n return false;\n \n return true;\n}",
"function filled($value)\n {\n return !blank($value);\n }",
"public function isNotEmpty(): bool\n {\n return !$this->isEmpty();\n }"
]
| [
"0.7959964",
"0.7936388",
"0.7922469",
"0.7884495",
"0.7659588",
"0.7586155",
"0.7579845",
"0.75720394",
"0.7551584",
"0.7482593",
"0.7429865",
"0.7408544",
"0.73816127",
"0.73742217",
"0.7355284",
"0.7336866",
"0.7292185",
"0.72741604",
"0.7264649",
"0.7228066",
"0.7190748",
"0.7155636",
"0.71525687",
"0.71464545",
"0.7125208",
"0.71032417",
"0.7093736",
"0.7078258",
"0.70780754",
"0.70507836",
"0.7049259",
"0.7047063",
"0.70272213",
"0.7022344",
"0.6986507",
"0.69815683",
"0.6979783",
"0.6975126",
"0.69620305",
"0.69328964",
"0.68743396",
"0.6869878",
"0.6854257",
"0.68503904",
"0.6834717",
"0.6833984",
"0.68031657",
"0.67850834",
"0.67834306",
"0.67739016",
"0.6746247",
"0.6745951",
"0.6726473",
"0.6725771",
"0.6694233",
"0.66846836",
"0.66761976",
"0.6674082",
"0.6659434",
"0.66565156",
"0.6646115",
"0.6631205",
"0.663112",
"0.66221976",
"0.6609965",
"0.6595791",
"0.6593683",
"0.6578937",
"0.6578564",
"0.6575483",
"0.6555417",
"0.6552604",
"0.65519315",
"0.6545852",
"0.65255374",
"0.6520264",
"0.64962673",
"0.64962673",
"0.64923686",
"0.64875364",
"0.64831626",
"0.648043",
"0.6477183",
"0.6470871",
"0.64690095",
"0.6459163",
"0.6447834",
"0.6447624",
"0.64254355",
"0.6416424",
"0.64099056",
"0.64099056",
"0.64099056",
"0.640776",
"0.64036226",
"0.6402528",
"0.63821864",
"0.63386",
"0.6333797",
"0.6332202",
"0.63238645"
]
| 0.0 | -1 |
Method to match the JQuery style validation on the backend | public function checkElementByClassName($field,$className){
$classArray = split($className,' ');
foreach ($classArray as $classItem){
$pattern = $this->determinePattern($classItem);
if($pattern && !$this->patternMatches($field,$pattern)){
$this->determineErrorMessage($classItem);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function doGenerateJqueryValidation()\n {\n }",
"public static function setup_jquery_validation_js() {\n // In the following block, we set the validation plugin's error class to our template.\n // We also define the error label to be wrapped in a <p> if it is on a newline.\n if (self::$validated_form_id && !self::$validationInitialised) {\n self::$validationInitialised = TRUE;\n global $indicia_templates;\n self::$javascript .= \"\nindiciaData.controlWrapErrorClass = '$indicia_templates[controlWrapErrorClass]';\nvar validator = $('#\" . self::$validated_form_id . \"').validate({\n ignore: \\\":hidden:not(.date-text),.inactive\\\",\n errorClass: \\\"$indicia_templates[error_class]\\\",\n \" . (in_array('inline', self::$validation_mode) ? \"\" : \"errorElement: 'p',\") .\"\n highlight: function(el, errorClass) {\n var controlWrap = $(el).closest('.ctrl-wrap');\n if (controlWrap.length > 0) {\n $(controlWrap).addClass(indiciaData.controlWrapErrorClass);\n }\n if ($(el).is(':radio') || $(el).is(':checkbox')) {\n //if the element is a radio or checkbox group then highlight the group\n var jqBox = $(el).parents('.control-box');\n if (jqBox.length !== 0) {\n jqBox.eq(0).addClass('ui-state-error');\n } else {\n $(el).addClass('ui-state-error');\n }\n } else {\n $(el).addClass('ui-state-error');\n }\n },\n unhighlight: function(el, errorClass) {\n var controlWrap = $(el).closest('.ctrl-wrap');\n if ($(el).is(':radio') || $(el).is(':checkbox')) {\n //if the element is a radio or checkbox group then highlight the group\n var jqBox = $(el).parents('.control-box');\n if (jqBox.length !== 0) {\n jqBox.eq(0).removeClass('ui-state-error');\n } else {\n $(el).removeClass('ui-state-error');\n }\n } else {\n $(el).removeClass('ui-state-error');\n }\n if (controlWrap.length > 0 && $(controlWrap).find('.ui-state-error').length === 0) {\n $(controlWrap).removeClass(indiciaData.controlWrapErrorClass);\n }\n },\n invalidHandler: $indicia_templates[invalid_handler_javascript],\n messages: \" . json_encode(self::$validation_messages) . \",\".\n // Do not place errors if 'message' not in validation_mode\n // if it is present, put radio button messages at start of list:\n // radio and checkbox elements come before their labels, so putting the error after the invalid element\n // places it between the element and its label.\n // most radio button validation will be \"required\"\n (in_array('message', self::$validation_mode) ? \"\n errorPlacement: function(error, element) {\n var jqBox, nexts;\n // If using Bootstrap input-group class, put the message after the group\n var inputGroup = $(element).closest('.input-group');\n if (inputGroup.length) {\n element = inputGroup;\n } else {\n if (element.is(':radio')||element.is(':checkbox')) {\n jqBox = element.parents('.control-box');\n element=jqBox.length === 0 ? element : jqBox;\n }\n nexts=element.nextAll(':visible');\n if (nexts) {\n $.each(nexts, function() {\n if ($(this).hasClass('deh-required') || $(this).hasClass('locked-icon') || $(this).hasClass('unlocked-icon')) {\n element = this;\n }\n });\n }\n }\n error.insertAfter(element);\n }\" : \"\n errorPlacement: function(error, element) {}\") .\"\n});\n//Don't validate whilst user is still typing in field\nif (typeof validator!=='undefined') {\n validator.settings.onkeyup = false;\n}\n\\n\";\n }\n }",
"public function javascript_validation() {\n return false;\n }",
"function includeValidation() {\n\t\t$formID = $this->form->FormName();\n\n\t\t$params = '';\n/*\n\t\t$rules = self::json_encode($this->getRulesForJavaScript());\n\t\t$messages = self::json_encode($this->getMessages());\n*/\n\n\n\t\t$rules = $this->getRulesForJavaScript();\n\t\t$messages = $this->getMessages();\n\t\t$options = $this->getJavascriptOptionsWithDefaults();\n\n\t\t$options = array_merge(array('rules' => $rules, 'messages' => $messages), $options);\n\n\t\t$optionsJSON = self::json_encode($options);\n\n\t\t$script = <<<JS\n\t\t\t$().ready(function() {\n\t\t\t\t$(\"#{$formID}\").validate({$optionsJSON});\n\t\t\t});\nJS\n;\n\n\t\tRequirements::customScript($script, $formID.'_Validation');\n\t}",
"function includeJQueryValidate() {\n\t\tif ($this->jQueryValidateLocation) {\n\t\t\tRequirements::javascript($this->jQueryValidateLocation);\n\t\t} else if (self::$jquery_validate_location) {\n\t\t\tRequirements::javascript(self::$jquery_validate_location);\n\t\t}\n\t}",
"public function ajaxValidationAction()\n {\n if($this->_request->getPost('ajax_submit',false, Request::FILTER_INT))\n $result = 'ok_ajax';\n else\n $result = 'ok';\n $messages = array();\n\n if(!$this->validate())\n {\n $this->collectValidateErrors(); \n foreach($this->_view->getFormErrors() as $k => $v)\n {\n $messages['__data'.$k] = $v;\n }\n $result = 'error';\n }\n $tpl = '';\n if($result == 'error')\n {\n $tpl = $this->fetchElementTemplate('messages_summary');\n }\n $this->_view->sendJson( array('result'=>$result, 'messages'=>$messages, 'tpl'=>$tpl) );\n }",
"function javascript_validation() {\n return false;\n }",
"function javascript_validation() {\n return false;\n }",
"public function setJqueryValidation($value) { $this->_jqueryValidation = self::forceBool($value); }",
"public function jQueryValidationEngine($html)\n\t{\n\t\t$validation = array();\n\t\tif($this->required===true)\n\t\t{\n\t\t\t$validation[] = 'required';\n\t\t}\n\t\tif(!empty($validation))\n\t\t\t$html = str_replace(\"<input\", \"<input class=\\\"validate[\".implode(',', $validation).\"]\\\"\", $html);\n\t\treturn $html;\n\t}",
"function javascript_validation() {\r\n return false;\r\n }",
"public function getJqueryValidation() { return $this->_jqueryValidation; }",
"function jsValidation(){\n\t\t$fs = $this->FieldSet();\n\t\t$validationCode = '';\n\t\t\n\t\tforeach($fs as $subfield) {\n\t\t\tif($value = $subfield->jsValidation()) {\n\t\t\t\t$validationCode .= $value;\n\t\t\t}\n\t\t}\n\t\treturn $validationCode;\n\t}",
"function jsValidation() {\n\t\tif($this->getLocale() != 'en_NZ') return;\n\t\t\n\t\t$formID = $this->form->FormName();\n\n\t\tif(Validator::get_javascript_validator_handler() == 'none') return true;\n\n\t\tif($this->getConfig('dmyfields')) {\n\t\t\t$error = _t('DateField.VALIDATIONJS', 'Please enter a valid date format.');\n\t\t\t// Remove hardcoded date formats from translated strings\n\t\t\t$error = preg_replace('/\\(.*\\)/', '', $error);\n\t\t\t$error .= ' (' . $this->getConfig('dateformat') .')';\n\t\t\t\n\t\t\t$jsFunc =<<<JS\nBehaviour.register({\n\t\"#$formID\": {\n\t\tvalidateDMYDate: function(fieldName) {\n\t\t\tvar day_value = \\$F(_CURRENT_FORM.elements[fieldName+'[day]']);\n\t\t\tvar month_value = \\$F(_CURRENT_FORM.elements[fieldName+'[month]']);\n\t\t\tvar year_value = \\$F(_CURRENT_FORM.elements[fieldName+'[year]']);\n\n\t\t\t// TODO NZ specific\n\t\t\tvar value = day_value + '/' + month_value + '/' + year_value;\n\t\t\tif(value && value.length > 0 && !value.match(/^[0-9]{1,2}\\/[0-9]{1,2}\\/([0-9][0-9]){1,2}\\$/)) {\n\t\t\t\tvalidationError(_CURRENT_FORM.elements[fieldName+'[day]'],\"$error\",\"validation\",false);\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t}\n});\nJS;\n\t\t\tRequirements :: customScript($jsFunc, 'func_validateDMYDate_'.$formID);\n\n\t\t\treturn <<<JS\n\tif(\\$('$formID')){\n\t\tif(typeof fromAnOnBlur != 'undefined'){\n\t\t\tif(fromAnOnBlur.name == '$this->name')\n\t\t\t\t\\$('$formID').validateDMYDate('$this->name');\n\t\t}else{\n\t\t\t\\$('$formID').validateDMYDate('$this->name');\n\t\t}\n\t}\nJS;\n\t\t} else {\n\t\t\t$error = _t('DateField.VALIDATIONJS', 'Please enter a valid date format (DD/MM/YYYY).');\n\t\t\t$jsFunc =<<<JS\nBehaviour.register({\n\t\"#$formID\": {\n\t\tvalidateDate: function(fieldName) {\n\n\t\t\tvar el = _CURRENT_FORM.elements[fieldName];\n\t\t\tif(el)\n\t\t\tvar value = \\$F(el);\n\n\t\t\tif(Element.hasClassName(el, 'dmydate')) {\n\t\t\t\t// dmy triple field validation\n\t\t\t\tvar day_value = \\$F(_CURRENT_FORM.elements[fieldName+'[day]']);\n\t\t\t\tvar month_value = \\$F(_CURRENT_FORM.elements[fieldName+'[month]']);\n\t\t\t\tvar year_value = \\$F(_CURRENT_FORM.elements[fieldName+'[year]']);\n\n\t\t\t\t// TODO NZ specific\n\t\t\t\tvar value = day_value + '/' + month_value + '/' + year_value;\n\t\t\t\tif(value && value.length > 0 && !value.match(/^[0-9]{1,2}\\/[0-9]{1,2}\\/([0-9][0-9]){1,2}\\$/)) {\n\t\t\t\t\tvalidationError(_CURRENT_FORM.elements[fieldName+'[day]'],\"$error\",\"validation\",false);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// single field validation\n\t\t\t\tif(value && value.length > 0 && !value.match(/^[0-9]{1,2}\\/[0-9]{1,2}\\/[0-90-9]{2,4}\\$/)) {\n\t\t\t\t\tvalidationError(el,\"$error\",\"validation\",false);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}\n});\nJS;\n\t\t\tRequirements :: customScript($jsFunc, 'func_validateDate_'.$formID);\n\n\t\t\treturn <<<JS\nif(\\$('$formID')){\n\tif(typeof fromAnOnBlur != 'undefined'){\n\t\tif(fromAnOnBlur.name == '$this->name')\n\t\t\t\\$('$formID').validateDate('$this->name');\n\t}else{\n\t\t\\$('$formID').validateDate('$this->name');\n\t}\n}\nJS;\n\t\t}\n\t}",
"public function validation();",
"function renderValidationJS()\r\n {\r\n if ($this->isRequired() && $eltname = $this->getName()) {\r\n //$eltname = $this->getName();\r\n $eltcaption = $this->getCaption();\r\n $eltmsg = empty($eltcaption) ? sprintf( _FORM_ENTER, $eltname ) : sprintf( _FORM_ENTER, $eltcaption );\r\n $eltmsg = str_replace('\"','\\\"', stripslashes( $eltmsg ) );\r\n $ret = \"\\n\";\r\n $ret.= \"if ( tinyMCE.get('{$eltname}').getContent() == \\\"\\\" || tinyMCE.get('{$eltname}').getContent() == null) \";\r\n $ret.= \"{ window.alert(\\\"{$eltmsg}\\\"); tinyMCE.get('{$eltname}').focus(); return false; }\";\r\n return $ret;\r\n }\r\n return '';\r\n }",
"public function validate()\n {\n // Tipo de validación\n $type = $this->request->get('type');\n $type = ($type == 'email') ? 'email' : 'username';\n \n Core::getService('account.validate')->$type($this->request->get('value'));\n $status = 'taken';\n \n if (Core_Error::isPassed())\n {\n $status = 'ok'; \n }\n \n $this->call(\"var obj = $('#\" . $this->request->get('obj') . \"'); signup.show_status(obj, '{$status}');\");\n }",
"function validate() {\n\t return parent::validate();\n\t}",
"function validate() {\n\t return parent::validate();\n\t}",
"public function rules()\n {\n $rules = parent::rules();\n if ($this->required && isset($rules['required'])) {\n $rules['required']['whenClient'] = \"function (attribute, value) { return \\\"\\\" == $('input[name=\\\"{$this->model->formName()}[$this->attribute]\\\"]').val(); }\"; // Hacking the whenClient to work with the Filepond style hidden input\n }\n\n return $rules;\n }",
"public static function getFormValidationCustomErrorHandlerJs()\n {\n $LANG = Core::$L;\n\n $js =<<< END\nfunction fb_validate(f, error_info) {\n if (!error_info.length) {\n return true;\n }\n var first_el = null;\n var error_str = \"<ul>\";\n for (var i=0; i<error_info.length; i++) {\n error_str += \"<li>\" + error_info[i][1] + \"</li>\";\n if (first_el == null) {\n first_el = error_info[i][0];\n }\n }\n error_str += \"</ul>\";\n\n ft.create_dialog({\n title: \"{$LANG[\"phrase_validation_error\"]}\",\n popup_type: \"error\",\n width: 450,\n content: error_str,\n buttons: [{\n text: \"{$LANG[\"word_close\"]}\",\n click: function() {\n $(this).dialog(\"close\");\n $(first_el).focus().select();\n }\n }]\n })\n\n return false;\n}\nEND;\n\n return $js;\n }",
"public abstract function validation();",
"protected function _validate() {\n\t}",
"public static function enable_validation($form_id) {\n self::$validated_form_id = $form_id;\n self::$javascript .= \"indiciaData.validatedFormId = '\" . self::$validated_form_id . \"';\\n\";\n // Prevent double submission of the form.\n self::$javascript .= \"$('#$form_id').submit(function(e) {\n if (typeof $('#$form_id').valid === 'undefined' || $('#$form_id').valid()) {\n if (typeof indiciaData.formSubmitted==='undefined' || !indiciaData.formSubmitted) {\n indiciaData.formSubmitted = true;\n } else {\n e.preventDefault();\n return false;\n }\n }\n});\\n\";\n self::add_resource('validation');\n // Allow i18n on validation messages.\n if (lang::get('validation_required') != 'validation_required') {\n self::$late_javascript .= \"$.validator.messages.required = \\\"\" . lang::get('validation_required') . \"\\\";\\n\";\n }\n if (lang::get('validation_max') != 'validation_max') {\n self::$late_javascript .= \"$.validator.messages.max = $.validator.format(\\\"\" . lang::get('validation_max') . \"\\\");\\n\";\n }\n if (lang::get('validation_min') != 'validation_min') {\n self::$late_javascript .= \"$.validator.messages.min = $.validator.format(\\\"\" . lang::get('validation_min') . \"\\\");\\n\";\n }\n if (lang::get('validation_number') != 'validation_number') {\n self::$late_javascript .= \"$.validator.messages.number = $.validator.format(\\\"\" . lang::get('validation_number') . \"\\\");\\n\";\n }\n if (lang::get('validation_digits') != 'validation_digits') {\n self::$late_javascript .= \"$.validator.messages.digits = $.validator.format(\\\"\" . lang::get('validation_digits') . \"\\\");\\n\";\n }\n if (lang::get('validation_integer') != 'validation_integer') {\n self::$late_javascript .= \"$.validator.messages.integer = $.validator.format(\\\"\" . lang::get('validation_integer') . \"\\\");\\n\";\n }\n }",
"function jsformvalid() {\n\t\t$validpath = INC_FOLDER .'mg2_jsformvalid.php';\n\t\tif (($this->commentsets & 128) && is_readable($validpath)) {\n\t\t\tinclude($validpath);\n\t\t} else {\n\t\t\techo '<script language=\"JavaScript\" type=\"text/javascript\">\n\t\t\t\t\t<!--\n\t\t\t\t\t\tfunction validateCompleteForm(a,b) { return true; }\n\t\t\t\t\t-->\n\t\t\t\t\t</script>';\n\t\t}\n\t}",
"function tz_contact_validate() {\n\tif (is_page_template('template-contact.php')) { ?>\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery(document).ready(function(){\n\t\t\t\tjQuery(\"#contactForm\").validate();\n\t\t\t});\n\t\t</script>\n\t<?php }\n}",
"function validate() {\n $errors = parent::validate();\n // Verify that search fields are set up.\n $style_options = $this->get_option('style_options');\n if (!isset($style_options['search_fields'])) {\n $errors[] = t('Display \"@display\" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title));\n }\n else {\n // Verify that the search fields used actually exist.\n //$fields = array_keys($this->view->get_items('field'));\n $fields = array_keys($this->handlers['field']);\n foreach ($style_options['search_fields'] as $field_alias => $enabled) {\n if ($enabled && !in_array($field_alias, $fields)) {\n $errors[] = t('Display \"@display\" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));\n }\n }\n }\n return $errors;\n }",
"function validateForm($rules, $messages = \"\", $formId = \"formInput\") {\n $html = script(array(\"text\" => \"application/javascript\"), \"\n \\$(document).ready (function () { \\$('#$formId').validate({\n rules: {\n {$rules}\n },\n messages : {\n {$messages}\n },\n highlight: function(element) {\n $(element).closest('.form-group').addClass('has-error');\n },\n unhighlight: function(element) {\n $(element).closest('.form-group').removeClass('has-error');\n },\n errorElement: 'div',\n errorClass: 'col-sm-12 label label-danger',\n errorPlacement: function(error, element) {\n if(element.parent('.input-group').length) {\n error.insertAfter(element.parent());\n } else {\n error.insertAfter(element);\n }\n },\n invalidHandler: function(form, validator) {\n var errors = validator.numberOfInvalids();\n if (errors) {\n validator.errorList[0].element.focus();\n }\n }\n });\n\n\n });\n \");\n return $html;\n }",
"public function ajax_email(){\n\t\t//loading the form validation library\n\t\t$this->load->library('form_validation');\n\t\t//validation rules\n\t\t$this->form_validation->set_rules('em', 'Email', 'valid_email');\n\t\t//check the validation throws any errors\n\t\tif ($this->form_validation->run() == FALSE)\n\t\t{\n\t\t\t//echoing the respond to the div that specified in the javascript\n\t\t\techo 'Invalid Email';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//echoing the respond to the div that specified in the javascript\n\t\t\techo 'Valid';\n\t\t}\n\t}",
"public function getJqueryValidateScript() {\n return $this->getGestionnaireValidateur()->getScript($this->getName());\n }",
"function validate(){\n }",
"public function _on_validate()\n {\n return true;\n }",
"public function ajaxValidation()\n {\n if (!Yii::$app->request->isPost)\n return;\n\n if (!Yii::$app->request->isAjax)\n return;\n\n //Bu, PJAX formalarda uchun kerak\n //shu holatda, postValidation ishlaydi\n if (Yii::$app->request->isPjax)\n return;\n\n if (!$this->load(Yii::$app->request->post())) {\n throw new NotFoundHttpException();\n }\n\n $response = Yii::$app->response;\n $response->format = Response::FORMAT_JSON;\n $result = ActiveForm::validate($this);\n if ($result !== null) {\n $response->data = $result;\n }\n\n Yii::$app->end();\n }",
"function jquery_validate_scripts() {\n wp_enqueue_script( 'jquery-validate', plugins_url() . '/custom-login/js/jquery.validate.min.js', false, false, false );\n}",
"public function _validate()\n {\n\t\t$data = array();\n\t\t$data['error_string'] = array();\n\t\t$data['inputerror'] = array();\n\t\t$data['status'] = TRUE;\n\n\t\tif($this->input->post('status') === 'SelecteerStatus')\n\t\t{\n $data['inputerror'][] = 'status';\n $data['error_string'][] = 'Status is verplicht!';\n $data['status'] = FALSE;\n\t\t}\n\t\t\n\t\tif($this->input->post('prioriteit') === 'SelecteerPrioriteit')\n\t\t{\n\t\t\t$data['inputerror'][] = 'prioriteit';\n\t\t\t$data['error_string'][] = 'Prioriteit is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n\n\t\tif(empty($this->input->post('Categorie')))\n\t\t{\n\t\t\t$data['inputerror'][] = 'categorie';\n\t\t\t$data['error_string'][] = 'Categorie is verplicht!';\n\t\t\t$data['status'] = FALSE;\n\t\t}\n if($this->input->post('werkman') === 'Selecteer')\n {\n $data['inputerror'][] = 'werkman';\n $data['error_string'][] = 'Werkman toewijzen is verplicht!';\n $data['status'] = FALSE;\n }\n\n\t\tif($data['status'] === FALSE)\n\t\t{\n\t\t\techo json_encode($data);\n\t\t\texit();\n\t\t}\n }",
"function validate()\n\t{\n\t}",
"protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"public function validate();",
"protected function Form_Validate() {\n // By default, we report that Custom Validations passed\n $blnToReturn = true;\n\n // Custom Validation Rules\n // TODO: Be sure to set $blnToReturn to false if any custom validation fails!\n\n $blnFocused = false;\n foreach ($this->GetErrorControls() as $objControl) {\n // Set Focus to the top-most invalid control\n if (!$blnFocused) {\n $objControl->Focus();\n $blnFocused = true;\n }\n\n // Blink on ALL invalid controls\n $objControl->Blink();\n }\n\n return $blnToReturn;\n }",
"public function validation()\n\t{\n\t\t//\n\t\t\t\n\t\t\t\treturn true;\n\t\t\t\n\t}",
"protected function performAjaxValidation($model)\n\t{\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='stylesheet-images-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"public function Validate() {return true;}",
"public function validation()\n {\n\n }",
"protected function preValidate() {}",
"function form_val_setrules(){\n $this->form_validation->set_error_delimiters('<p style=\"color:rgb(255, 115, 115);\" class=\"help-block\"><i class=\"glyphicon glyphicon-exclamation-sign\"></i> ','</p>');\n\n $this->form_validation->set_rules('return_date','Return Date','required');\n $this->form_validation->set_rules('reference','Reference','required'); \n }",
"function get_search_validate()\r\n {\r\n return $this->get_search_form()->validate();\r\n }",
"function ajax_validate_save_post()\n {\n }",
"public function validate()\n {\n $result = parent::validate();\n \n if ($result === true)\n $this->setErrorMessage('');\n else\n $this->setErrorMessage(Resources::getValue(Resources::SRK_FORM_ERRORGENERIC));\n \n return $result;\n }",
"public function validated();",
"protected function performAjaxValidation($model)\n{\nif(isset($_POST['ajax']) && $_POST['ajax']==='menu-items-form')\n{\necho CActiveForm::validate($model);\nYii::app()->end();\n}\n}",
"public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n return false;\n }\n\n\n return true;\n }",
"protected function validate()\n {\n }",
"public function performAjaxValidation($model,$class='category')\n\t{\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']===$class.'Form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"public function validation()\n {\n $validator = new Validation();\n\n $validator->add(\n 'userid',\n new Callback(\n [\n \"message\" => \"Такая услуга не существует\",\n \"callback\" => function ($image) {\n $user = Users::findFirstByUserid($image->getUserId());\n if ($user)\n return true;\n return false;\n }\n ]\n )\n );\n\n $validator->add(\n 'imagepath',\n new Callback(\n [\n \"message\" => \"Формат не поддерживается\",\n \"callback\" => function ($image) {\n $format = pathinfo($image->getImagePath(), PATHINFO_EXTENSION);\n\n if ($format == 'jpeg' || 'jpg')\n return true;\n elseif ($format == 'png')\n return true;\n elseif ($format == 'gif')\n return true;\n else {\n return false;\n }\n }\n ]\n )\n );\n return $this->validate($validator);\n }",
"function AddMandatoryJS() {\n\n\t\tif($this->conf['libraryToUse'] == 'jquery'){\n\t\t\t$jsValidation = '\n\t\t\t\tvar valid = new Validation(\\'#'.$this->OuterMarkerArray['###POWERMAIL_NAME###'].'\\', {immediate : true, onFormValidate : formCallback, focusOnError: true});\n\t\t\t';\n\n\t\t}else{\n\t\t\t$jsValidation = '\n\t\t\t\t\tvar valid = new Validation(\\'' . $this->OuterMarkerArray['###POWERMAIL_NAME###'] . '\\', {immediate : true, onFormValidate : formCallback});\n\t\t\t';\n\t\t}\n\n\t\t$js = '\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tfunction formCallback(result, form) {\n\t\t\t\t\twindow.status = \"valiation callback for form \\'\" + form.id + \"\\': result = \" + result;\n\t\t\t\t}\n\t\t\t\t' . $jsValidation . '\n\t\t\t</script>\n\t\t';\n\n\t\treturn $js;\n\t}",
"public function _rules() \n {\n\n\t$this->form_validation->set_rules('id_kalender', 'id_kalender', 'trim');\n\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n }",
"protected function performAjaxValidation($model)\n\t{\n\t\tif(isset($_POST['ajax']) && $_POST['ajax'] === 'classes-form') {\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"function validate() {\n\treturn true;\n}",
"public static function validate() {}",
"public function validation()\n\t{\n\t\t$tim=$this->form_validation;\n\t \t$data_option = array(\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"name\",\n\t \t\t\t\"label\"=>\"Name\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"firstname\",\n\t \t\t\t\"label\"=>\"Firstname\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"lastname\",\n\t \t\t\t\"label\"=>\"Lastname\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\tarray(\n \"field\" => \"email\", \n \"label\" => \"Email\", \n \"rules\" => \"required|valid_email\"\n ),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"sex\",\n\t \t\t\t\"label\"=>\"Sex\",\n\t \t\t\t\"rules\"=>\"required\"\n\t \t\t),\n\t \t\t\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"id_card\",\n\t \t\t\t\"label\"=>\"ID_Card\",\n\t \t\t\t\"rules\"=>\"exact_length[13]\"\n\t \t\t),\n\t \t\t\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"fb_id\",\n\t \t\t\t\"label\"=>\"facebookid\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"name_fb\",\n\t \t\t\t\"label\"=>\"facebookname\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"usernameIG\",\n\t \t\t\t\"label\"=>\"intagramname\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t\tarray(\n\t \t\t\t\"field\"=>\"token\",\n\t \t\t\t\"label\"=>\"access_token\",\n\t \t\t\t\"rules\"=>\"\"\n\t \t\t),\n\t \t);\n\t \t$tim->set_rules($data_option);\n\t \t$tim->set_message(\"required\",\"กรุณากรอกข้อมูล %s\");\n\t \t$tim->set_message(\"alpha_numeric\",\"กรุณากรอกข้อมูล %s ให้ถูกต้อง \");\n\t \t$tim->set_message(\"exact_length\",\"กรุณากรอกตัวเลข 13 หลัก\");\n\t \t$tim->set_message(\"valid_email\",\"กรุณากรอก %s ให้ถูกต้อง\");\n\t}",
"protected function setupValidation()\n {\n }",
"public function validate()\n\t{\n\t\t$this->vars['errors'] = $this->validation_errors();\n\t}",
"function form_backend_validation()\r\n {\r\n return true ;\r\n }",
"private function validate() {\n\t\n\t\t\treturn false;\n\t}",
"private function IndexValidacionFormulario() {\n\t\t\t$Val = new NeuralJQueryFormularioValidacion(true, true, false);\n\t\t\t$Val->Requerido('AVISO', 'Debe Ingresar el Número del Aviso');\n\t\t\t$Val->Numero('AVISO', 'El Aviso debe Ser Numérico');\n\t\t\t$Val->CantMaxCaracteres('AVISO', 10, 'Debe ingresar aviso con 10 Números');\n\t\t\t$Val->Requerido('PRIORIDAD', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('RAZON', 'Debe Seleccionar una Opción');\n\t\t\t$Val->Requerido('REGIONAL[]', 'Seleccione la Regional a Reportar');\n\t\t\t$Val->Requerido('NODO', 'Debe ingresar el Nodo al que pertenece la Matriz');\n\t\t\t$Val->Requerido('HORAFIN', 'Defina la fecha-hora que termina el Aviso');\n\t\t\t$Val->Requerido('MATRIZ', 'Debe informar el Número de la Matriz');\n\t\t\t$Val->ControlEnvio('peticionAjax(\"FormularioGuion\", \"Respuesta\");');\n\t\t\treturn $Val->Constructor('FormularioGuion');\n\t\t}",
"static function validation(){\r\n jresearchimport('helpers.charsets', 'jresearch.admin');\r\n jresearchimport('tables.activity', 'jresearch.admin');\r\n $extra = implode('', JResearchCharsetsHelper::getLatinWordSpecialChars());\r\n $doc = JFactory::getDocument();\r\n $token = JSession::getFormToken();\r\n JHTML::_('behavior.tooltip');\r\n JHTML::_('behavior.formvalidation');\r\n $message = JText::_('JRESEARCH_FORM_NOT_VALID');\r\n\r\n $doc->addScriptDeclaration(\"Joomla.submitbutton = function(task){\r\n if (task == ''){\r\n return false;\r\n }else{\r\n var isValid=true;\r\n if (task != 'cancel' && task != 'close'){\r\n var forms = $$('form.form-validate');\r\n for (var i=0;i<forms.length;i++)\r\n {\r\n if (!document.formvalidator.isValid(forms[i]))\r\n {\r\n isValid = false;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (isValid) {\r\n Joomla.submitform(task);\r\n return true;\r\n } else {\r\n alert(Joomla.JText._('COM_JRESEARCH_FORM_ERROR_UNACCEPTABLE','Some values are unacceptable'));\r\n return false;\r\n }\r\n }\r\n };\");\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'date\\', function(value) {\r\n regex=/^\\d{4}(-\\d{2}){2}$/;\r\n return regex.test(value); })\r\n });');\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'url\\', function(value) {\r\n regex=/^(ftp|http|https|ftps):\\/\\/([a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}|localhost|\\d{1,3}(\\.\\d{1,3}){3})(:\\d{2,5})?(([0-9]{1,5})?\\/.*)?$/i;\r\n return regex.test(value); })\r\n });');\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'year\\', function(value) {\r\n regex=/^([1-9]\\d{3}|0)$/i;\r\n return regex.test(value); })\r\n });');\r\n\r\n $doc->addScriptDeclaration('window.addEvent(\\'domready\\', function() {\r\n document.formvalidator.setHandler(\\'number\\', function(value) {\r\n regex=/^([\\+\\-]{0,1}\\d+\\.?\\d*)$/i;\r\n return regex.test(value); })\r\n });');\r\n \r\n $delimiter = JResearchActivity::$_keywordsDelimiter;\r\n $doc->addScriptDeclaration(\"window.addEvent('domready', function() {\r\n document.formvalidator.setHandler('keywords', function(value) {\r\n regex=/^[-_'\\w$extra\\s\\d]+(\".$delimiter.\"[-_'\\w$extra\\s\\d]+)*\".$delimiter.\"*$/i;\r\n return regex.test(value); })\r\n });\");\r\n\r\n $doc->addScriptDeclaration(\"window.addEvent('domready', function() {\r\n document.formvalidator.setHandler('issn', function(value) {\r\n regex=/^\\d{4}-?\\d{4}$/i;\r\n return regex.test(value); })\r\n });\");\r\n\r\n $doc->addScriptDeclaration(\"window.addEvent('domready', function() {\r\n document.formvalidator.setHandler('isbn', function(value) {\r\n regex=/^(\\d{10}|\\d{13}|\\d{9}x)$/i;\r\n return regex.test(value); })\r\n });\");\r\n }",
"private function __addMedicationSchedulerFormValidation() {\n\t\t$model = 'MedicationSchedulerForm';\n\t\t$validations = $this->$model->validate;\n\t\t$this->JQValidator->addValidation($model, $validations, 'medication_scheduler_form');\n\t}",
"function _prepare_validation()\n\t{\n\t\t$this->load->library('form_validation');\t\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t//Setting Validation Rule\t\n\t\t$this->form_validation->set_rules('samity_id','Code','trim|required|xss_clean|max_length[100]');\n\t\t$this->form_validation->set_rules('cbo_samity_day','Samity Day','trim|required|xss_clean');\n\t\t$this->form_validation->set_rules('txt_effective_date','Effective Date','trim|required|max_length[10]|is_date|xss_clean|callback_check_samity_effective_date');\t\n\t}",
"function validate() {\n // @todo Remove module_load_include() call when moving to Drupal core.\n module_load_include('inc', 'fapitng', '/includes/fapitng.validate');\n foreach ($this->validate_callbacks as $callback => $info) {\n if (!call_user_func_array($callback, array_merge(array($this->value), $info['arguments']))) {\n $this->errors[] = $info['message'];\n }\n }\n if ($this->errors) {\n $this->request['invalid_elements'][$this->id] = $this;\n }\n $this->validateInputElements($this->children);\n\n if (!empty($this->request['invalid_elements'])) {\n $this->request['rebuild'] = TRUE;\n return FALSE;\n }\n return TRUE;\n }",
"function validate() {\n\t\t// If it's not required, there's nothing to validate\n\t\tif ( !$this->get_attribute( 'required' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$field_id = $this->get_attribute( 'id' );\n\t\t$field_type = $this->get_attribute( 'type' );\n\t\t$field_label = $this->get_attribute( 'label' );\n\n\t\t$field_value = isset( $_POST[$field_id] ) ? stripslashes( $_POST[$field_id] ) : '';\n\n\t\tswitch ( $field_type ) {\n\t\tcase 'email' :\n\t\t\t// Make sure the email address is valid\n\t\t\tif ( !is_email( $field_value ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s requires a valid email address', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t// Just check for presence of any text\n\t\t\tif ( !strlen( trim( $field_value ) ) ) {\n\t\t\t\t$this->add_error( sprintf( __( '%s is required', 'jetpack' ), $field_label ) );\n\t\t\t}\n\t\t}\n\t}",
"public function settings_validate_options()\n {\n $settings_options = get_option($this->option_name);\n\n // did the CSS save option change?\n if ($settings_options['css_save_to'] !== $_POST[$this->option_name]['css_save_to']\n || $settings_options['css_format'] !== $_POST[$this->option_name]['css_format']) {\n // the save option has changed so we better resave the current stack\n $stack_id = apply_filters('oxy-stack-current-id', '');\n if (!empty($stack_id)) {\n $this->save_post_css($stack_id, $_POST[$this->option_name]);\n }\n }\n }",
"public function rules() {\n $input = \\Input::get();\n $rules['font_size'] = 'required|integer|between:12,24';\n $rules['font_weight'] = (isset($input['font_weight'])) ? 'integer|between:100,700' : '';\n $rules['font_color'] = (isset($input['font_color'])) ? ['regex:/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/'] : '';\n return $rules;\n }",
"abstract function validator();",
"function pbd_vc_init() { ?>\n\n\t<script type=\"text/javascript\">\n\tfunction isValidUSZip(sZip) {return /^\\d{5}(-\\d{4})?$/.test(sZip);}\n\t\n\t$('#locator_form').submit(function() {\n\t\tvar result = true;\n\t\t\n\t\tdocument.getElementById('distance_chzn').children[0].style.backgroundColor = '#eeeeee';\n\t\tdocument.getElementById('distance_chzn').children[0].style.color = '#9b9b99';\n\t\t\n\t\tdocument.getElementById('zipcode').style.backgroundColor = '#eeeeee';\n\t\tdocument.getElementById('zipcode').style.color = '#9b9b99';\n\t\t\n\t\tif(document.getElementById('distance').value == '')\n\t\t{\n\t\t\tdocument.getElementById('distance_chzn').children[0].style.backgroundColor = 'red';\n\t\t\tdocument.getElementById('distance_chzn').children[0].style.color = 'white';\n\t\t\tresult = false;\n\t\t}\n\t\t\n\t\tif(!isValidUSZip(document.getElementById('zipcode').value))\n\t\t{\n\t\t\tdocument.getElementById('zipcode').style.backgroundColor = 'red';\n\t\t\tdocument.getElementById('zipcode').style.color = 'white';\n\t\t\tresult = false;\n\t\t}\n\t\treturn result;});\n\t\n\t\n\t\tjQuery(document).ready(function($) {\n\t\t\n\t\t$('#locator_form').validate({\n\t\t\trules: {\n\t\t\t\tzipcode: {\n\n\t\t\t\trequired: true,\n\n\t\t\t\tminlength: 5\n\n\t\t\t\t},\n\n\t\t\t\tdistance: {\n\n\t\t\t\t\trequired:true\n\t\t\t\t\t\n\t\t\t\t\t\t/* {\n\t\t\t\t\t\t\tdepends: function () {\n\t\t\t\t\t\t\t\treturn $('.chzn-single span').css({\"background-color\":\"red\"}) \n \t\t\t\t}\n\t\t\t\t\t\t}*/\n\n\t\t\t\t} \n\n\t\t\t},\n\n\n\t\t\tmessages: {\n\n\t\t\tzipcode: \"Please enter a valid Zipcode.\",\n\n\t\t\tdistance: \"Please select a Distance.\"\n\n\t\t\t}\n\n\t\t\t});\n\n\n\t\t\t$('#nf').validate({\n\t\t\trules: {\n\t\t\t\tnamenf: {\n\t\t\t\trequired: true\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\temailnf: {\n\t\t\t\trequired: true,\n\t\t\t\temail: true\n\t\t\t\t},\n\n\t\t\t\tzipnf: {\n\t\t\t\trequired: true,\n\t\t\t\tminlength: 5\n\t\t\t\t}, \n\n\t\t\t\tdistancenf: {\n\t\t\t\trequired: true\n\t\t\t\t},\n\n\t\t\t\tchagree: {\n\t\t\t\trequired: true\n\t\t\t\t}\t\n\n\t\t\t},\n\n\t\t\tmessages: {\n\n\t\t\tnamenf: \"Please enter your name.\",\n\n\t\t\temailnf: \"Please enter a correct e-mail.\",\n\n\t\t\tzipnf: \"Please enter a valid Zipcode.\",\n\n\t\t\tdistancenf: \"Please select a Distance.\",\n\n\t\t\tchagree: \"You have to agree to the Terms and Conditions of Use.\"\n\n\t\t\t}\n\n\t\t\t});\n\n\t\t});\n\n\t</script>\n\n<?php }",
"public function form_post_validation() {\n\t\t$json['success'] = true;\n\n\t\t$success = $this->example_model->validate($this->input->post(),'insert');\n\n\t\tif ($success !== true) {\n\t\t\t$json['success'] = false;\n\t\t\t$json['errors'] = $success;\n\t\t} else {\n\t\t\t$json['link'] = 'https://github.com/dmyers2004/CI3-Ajax-Post---Model-Validation/archive/master.zip';\n\t\t\t$json['text'] = 'GitHub Download';\n\t\t}\n\n\t\t$this->output->json($json);\n\t}",
"function validation($data){\n //messages if there is a problem with the text.\n $errors = parent::validation($data);\n //extra check to make sure there is something in the htmlarea besides a <br />\n $questiontext= trim(strip_tags($data['questiontext']));\n if ($questiontext==''){\n $errors['questiontext'] = get_string('err_required', 'form');\n }\n return $errors;\n }",
"protected function performAjaxValidation($cursoDisponibleServidorPublico)\n\t{\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='curso-disponible-servidor-publico-form')\n\t\t{\n\t\t\techo CActiveForm::validate($cursoDisponibleServidorPublico);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"public function onValid($jsCode){\n\t\t$form=$this->getForm();\n\t\t$form->addValidationParam(\"onValid\", \"%function(){\".$jsCode.\"}%\");\n\t\treturn $form;\n\t}",
"protected function performAjaxValidation($model) {\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'qircomentario-form') {\n echo CActiveForm::validate($model);\n Yii::app()->end();\n }\n }",
"public function rules()\n {\n $data =[\n 'title'=>'required',\n 'description'=>'required',\n 'bg_type'=>'required',\n ];\n if ($this->request->get('bg_type') == 1)\n {\n $data['bg_color'] = 'required';\n }else\n {\n $data['bg_photo'] = 'required';\n }\n return $data;\n }",
"public function validator()\n {\n }",
"public function RenderJavascriptRules() {\n\n if (!$this->GetOption('JavascriptValidation')) {\n return '';\n }\n // adapt some validators for JS enviroment\n\t\t$ThoSep= $this->Msg('FormatNumber.SepThousand');\n\t\t$DecSep= $this->Msg('FormatNumber.SepDecimal');\n foreach($this->JsValidations as &$Rule) {\n $Rule= str_replace('Float', \"Float:$ThoSep/$DecSep\", $Rule);\n $Rule= str_replace('Decimal:', \"Decimal:$ThoSep/$DecSep/\", $Rule);\n }\n\n // pack them\n $JSON= json_encode($this->JsValidations);\n\n // convert doublequotes to quotes\n return str_replace('\"', \"'\", str_replace(\"'\", \"\", $JSON));\n }",
"public function init() {\n\t\tparent::init();\n\t\t\n\t\t// block prototype validation\n\t\tValidator::set_javascript_validation_handler('none');\n\t\t\n\t\t// load the jquery\n\t\t//Requirements::javascript(SAPPHIRE_DIR .'/thirdparty/jquery/jquery.js');\n\t\tRequirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.min.js');\n\t}",
"public function validate() { return TRUE; }",
"protected function performAjaxValidation($model)\n\t{\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='budget-format-form')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\t}",
"abstract public function validate();",
"abstract public function validate();",
"protected function performAjaxValidation($model) {\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'beneficiario-form') {\n echo CActiveForm::validate($model);\n Yii::app()->end();\n }\n }",
"public function validate()\n {\n if ($this->getOptions('required') == 1 && $this->getValue() == '') {\n $this->setLibelle('<div class=\"error_message\">Le champ est requis et ne doit pas être vide.</div>');\n return false;\n } else {\n return true;\n }\n }",
"public function validate() {\n }"
]
| [
"0.7211353",
"0.71286476",
"0.6620152",
"0.66036576",
"0.65881944",
"0.6429221",
"0.6412458",
"0.6315415",
"0.6278982",
"0.6228193",
"0.6207305",
"0.61968213",
"0.61565626",
"0.61141294",
"0.60707015",
"0.60031617",
"0.599123",
"0.5941088",
"0.5941088",
"0.5939904",
"0.59033716",
"0.5878821",
"0.5866708",
"0.58360004",
"0.58277804",
"0.57957816",
"0.5792902",
"0.57709724",
"0.5763258",
"0.57547927",
"0.57478845",
"0.57429475",
"0.5733786",
"0.5727688",
"0.5704392",
"0.5699444",
"0.5692702",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.5688975",
"0.56844014",
"0.5674958",
"0.56743777",
"0.5668259",
"0.5654091",
"0.56323045",
"0.56286997",
"0.5610957",
"0.5585681",
"0.558207",
"0.5570197",
"0.5566308",
"0.55584675",
"0.5550654",
"0.5536129",
"0.5529736",
"0.55215013",
"0.55159116",
"0.54960155",
"0.5490289",
"0.5481054",
"0.5481028",
"0.5478337",
"0.5468813",
"0.54650325",
"0.54631466",
"0.5459085",
"0.5450106",
"0.54455584",
"0.543981",
"0.54395854",
"0.54395753",
"0.54342896",
"0.54335475",
"0.5428489",
"0.54276985",
"0.5424915",
"0.5418699",
"0.54186094",
"0.54120964",
"0.54095834",
"0.5407287",
"0.5407077",
"0.5400147",
"0.5397934",
"0.5395753",
"0.53943735",
"0.5392323",
"0.5392323",
"0.53918755",
"0.5389301",
"0.53833073"
]
| 0.0 | -1 |
determines what pattern to use for the pattern match method. | public function determinePattern($className){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPattern() {}",
"public function getPattern();",
"public function getPattern();",
"abstract protected function getPattern(): string;",
"abstract protected function getPattern(): string;",
"abstract protected function getMethodPattern(): string;",
"public function get_pattern()\n {\n return $this->pattern;\n }",
"abstract function getQualifyingPattern();",
"public function getPattern()\n {\n return $this->options['pattern'];\n }",
"public function getPattern(): string;",
"public function getPattern(): string;",
"public function getPattern()\n {\n return $this->_pattern;\n }",
"public function setPattern($pattern) {}",
"public function getPattern() {\n\t\treturn $this->pattern;\n\t}",
"public function getPattern(): string\n {\n return $this->pattern;\n }",
"public function getPattern(): string\n {\n return $this->pattern;\n }",
"function getPattern($pattern) {\n return $this->patterns[$pattern];\n }",
"public function testPattern() {\r\n // Remove the following line when you implement this test.\r\n $p = '/(\\d+)\\s+(\\w+)/';\r\n $result = $this->reader->pattern($p);\r\n $this->assertEquals($result, $p);\r\n $p = $this->reader->pattern();\r\n $this->assertEquals($p, $result);\r\n \r\n $result = $this->reader->pattern(false); //disable pattern\r\n $this->assertFalse($result);\r\n }",
"public function getSearchPattern();",
"public function getSearchPattern();",
"public function matches(Pattern $pattern);",
"protected static function get_pattern() {\n return '/.*/';\n }",
"private function getPattern(){\n $pattern = strstr( substr($this->_requestUri,1) , '/', true) ;\n if( isset( $this->_config['pattern'] [$pattern] )){\n $this->_activePatern = $this->_config['pattern'][$pattern];\n\n $this->_cacheFolder = $pattern;\n\n $this->_requestUri = str_replace(\"/$pattern/\", \"/\", $this->_requestUri);\n }\n }",
"public function getPattern(): string\n {\n return $this->getConfig('pattern');\n }",
"public function getPattern(): ?string\n {\n return $this->pattern;\n }",
"protected function patterns() {\n throw new coding_exception('patterns() method needs to be overridden in each subclass of mod_dataform_field_patterns');\n }",
"private function getPattern ()\n {\n if ($this->pattern===null)\n {\n //first escape regex chars\n $pattern = preg_quote ($this->path,'/');\n\n //find variables in routes\n $matches = [];\n preg_match_all('/(\\\\\\\\\\{[a-zA-Z0-9_]+\\\\\\\\\\})+/', $pattern, $matches);\n\n if (isset($matches[0]) && count($matches[0]))\n {\n foreach ($matches[0] as $match)\n {\n $name = substr($match,2,-2);\n $input = new Input ($name,(isset($this->types[$name])?$this->types[$name]:0));\n //debug ($name,$this->path);\n $pattern = str_replace ($match,$input->getPattern(),$pattern);\n $this->inputs[] = $input;\n }\n }\n //debug ($matches, $this->path);\n $this->pattern = '/^'.$pattern.'$/';\n }\n return $this->pattern;\n }",
"protected static function analysis($pattern)\n {\n //$pattern = str_replace('.', '\\.', $pattern);\n $pattern = '/^' . str_replace('/', '[\\/]?', $pattern) . '$/i' ;\n $alternative_number_count = substr_count($pattern, '(?:num)');\n $number_count = substr_count($pattern, '(:num)');\n $alternative_any_count = substr_count($pattern, '(?:any)');\n $any_count = substr_count($pattern, '(:any)');\n\n $alternative_controller_count = substr_count($pattern, '(?:controller)');\n $alternative_action_count = substr_count($pattern, '(?:action)');\n $controller_count = substr_count($pattern, '(:controller)');\n $action_count = substr_count($pattern, '(:action)');\n\n $alternative_suffix_count = substr_count($pattern, '(?:suffix)');\n $suffix_count = substr_count($pattern, '(:suffix)');\n// echo $alternative_number_count . \"<br>\";\n// echo $number_count . \"<br>\";\n// echo $alternative_any_count . \"<br>\";\n// echo $any_count . \"<br>\";\n// echo $pattern . \"<br>\";\n\n if ($alternative_suffix_count)\n {\n $pattern = str_replace('.', '[\\.]?', $pattern);\n $pattern_array = explode('(?:suffix)', $pattern);\n $pattern = '';\n for($i = 0; $i < $alternative_suffix_count; $i++)\n {\n $pattern .= $pattern_array[$i] . \"(?'alter_suffix_\" . $i . \"'[\\\\w]*)\";\n }\n $pattern .= $pattern_array[$alternative_suffix_count];\n }\n\n if ($suffix_count)\n {\n $pattern = str_replace('.', '[\\.]', $pattern);\n $pattern_array = explode('(:suffix)', $pattern);\n $pattern = '';\n for($i = 0; $i < $suffix_count; $i++)\n {\n $pattern .= $pattern_array[$i] . \"(?'suffix_\" . $i . \"'[\\\\w]+)\";\n }\n $pattern .= $pattern_array[$suffix_count];\n }\n\n if ($alternative_number_count)\n {\n $pattern_array = explode('(?:num)', $pattern);\n $pattern = '';\n for($i = 0; $i < $alternative_number_count; $i ++)\n {\n $pattern .= $pattern_array[$i] . \"(?'alert_number_\" . $i . \"'[\\\\d]*)\";\n }\n $pattern .= $pattern_array[$alternative_number_count];\n }\n\n if ($number_count)\n {\n $pattern_array = explode('(:num)', $pattern);\n $pattern = '';\n for($i = 0; $i < $number_count; $i++)\n {\n $pattern .= $pattern_array[$i] . \"(?'number_\" . $i .\"'[\\\\d]+)\";\n }\n $pattern .= $pattern_array[$number_count];\n }\n\n if ($alternative_any_count)\n {\n $pattern_array = explode('(?:any)', $pattern);\n $pattern = '';\n for( $i = 0; $i < $alternative_any_count; $i++)\n {\n $pattern .= $pattern_array[$i] . \"(?'alter_any_\" . $i . \"'[\\\\w]*)\";;\n }\n $pattern .= $pattern_array[$alternative_any_count];\n }\n\n if ($any_count)\n {\n $pattern_array = explode('(:any)', $pattern);\n $pattern = '';\n for( $i = 0; $i < $any_count; $i++)\n {\n $pattern .= $pattern_array[$i] . \"(?'any_\" . $i . \"'[\\\\w]+)\";;\n }\n $pattern .= $pattern_array[$any_count];\n }\n\n return $pattern;\n }",
"public function setPattern($pattern)\n {\n $this->_pattern = $pattern;\n }",
"function current_route_pattern()\n {\n return RouteController::getCurrentRoute()['pattern'] ?? '';\n }",
"public function getBaseRoutePattern(): string;",
"public function getPattern()\n\t{\n\t\t$string = $this->getViewState('Pattern','');\n\n\t\t$pattern = null;\n\n\t\t//try the subpattern of \"date time\" presets\n\t\t$subpatterns = explode(' ',$string,2);\n\t\t$datetime = array();\n\t\tif(count($subpatterns)==2)\n\t\t{\n\t\t\t$datetime[] = $this->getPreset($subpatterns[0]);\n\t\t\t$datetime[] = $this->getPreset($subpatterns[1]);\n\t\t}\n\n\t\t//we have a good subpattern\n\t\tif(count($datetime) == 2\n\t\t\t&& strlen($datetime[0]) == 1\n\t\t\t&& strlen($datetime[1]) == 1)\n\t\t{\n\t\t\t$pattern = $datetime;\n\t\t}\n\t\telse //no subpattern, try the presets\n\t\t\t$pattern = $this->getPreset($string);\n\n\t\t//no presets found, use the string as the pattern\n\t\t//and let the DateFormat handle it.\n\t\tif($pattern===null)\n\t\t\t$pattern = $string;\n\t\tif (!is_array($pattern) && strlen($pattern) == 0)\n\t\t\t$pattern = null;\n\t\treturn $pattern;\n\t}",
"public function getPattern()\n {\n // file type\n $pattern = $this->getFileType() . ':';\n\n // schema (http, https)\n $pattern .= $this->uri->getScheme() . ':';\n\n // host\n $pattern .= $this->uri->getHost() . ':';\n\n $path = $this->uri->getPath() . '?' . $this->uri->getQuery();\n\n $pathNew = preg_replace(\"^[a-f0-9]{32}^\", \"<h>\", $path);\n $pathNew = preg_replace(\"^[a-z\\-\\_]{1,}^i\", \"<s>\", $pathNew);\n $pathNew = preg_replace(\"^[0-9]{1,}^\", \"<i>\", $pathNew);\n\n $pattern .= $pathNew;\n\n return $pattern;\n }",
"public function GetPattern () {\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->preparePatternAndBackReferenceIndexes();\n\t\treturn $this->pattern;\n\t}",
"private static function convertPattern($pattern) {\n\t\tif (preg_match('/^glob:(.+)$/', $pattern, $m)) {\n\t\t\t// TODO real glob support\n\t\t\treturn Files::regex($m[1]);\n\t\t} else if (preg_match('/^(?:re|regex):(.+)$/', $pattern, $m)) {\n\t\t\tif (preg_match('@^/.+/[imsxeADSUXJu]*$@', $m[1])) {\n\t\t\t\treturn $m[1];\n\t\t\t} else {\n\t\t\t\treturn '/' . addcslashes($m[1], '/') . '/i';\n\t\t\t}\n\t\t\treturn $m[1];\n\t\t} else {\n\t\t\treturn $pattern;\n\t\t}\n\t}",
"public function match($pattern, $path, $isCaseSensitive = false);",
"public function setPattern($pattern) {\n $this->pattern = $pattern;\n return $this;\n }",
"public function test_match_fromPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }",
"public function get_patterns()\n {\n }",
"public function SetPattern ($pattern) {\n\t\t$this->pattern = $pattern;\n\t\treturn $this;\n\t}",
"public function setPattern($pattern)\n {\n $this->pattern = $pattern;\n return $this;\n }",
"public function setPattern($pattern)\n {\n $this->pattern = $pattern;\n return $this;\n }",
"function route_pattern(): string\n{\n return RouteController::getCurrentRoute()['pattern'] ?? '';\n}",
"abstract public function getRouteMatch();",
"public function getPattern()\n {\n return \"/{(extends|extend|include|includes)(\\s*)\\\"(\\w.*?)\\\"(?:,(\\s*)(.*?))?}/is\";\n }",
"public function getPattern()\n {\n// if ($this->getOption('pattern')) {\n// return $this->getOption('pattern');\n// }\n\n $pattern = $this->formatter->getPattern();\n\n // set right order with respect to locale (e.g.: de_DE=dd.MM.yy; en_US=M/d/yy)\n // lookup various formats at http://userguide.icu-project.org/formatparse/datetime\n if (preg_match('/^([yMd]+).+([yMd]+).+([yMd]+)$/', $pattern)) {\n return preg_replace(array('/y+/', '/M+/', '/d+/'), array('{{ year }}', '{{ month }}', '{{ day }}'), $pattern);\n }\n\n // default fallback\n return '{{ year }}-{{ month }}-{{ day }}';\n }",
"abstract function getDataPattern();",
"static protected function _fnmatch($pattern, $str)\n\t{\n\t\t$arr = array(\n\t\t\t'\\*' => '.*', \n\t\t\t'\\?' => '.'\n\t\t\t);\n\t\treturn preg_match('#^' . strtr(preg_quote($pattern, '#'), $arr) . '$#i', $str);\n\t}",
"public function __construct( $pattern, $default = null )\n {\n $this->pattern = $pattern;\n $this->default = $default;\n }",
"private static function getPatternAndOptions( PPFrame $frame ) {\n\t\t$pattern = self::getLocalizedArgument( $frame, 'pattern', 1 );\n\t\tif ( $pattern === false ) {\n\t\t\t// no pattern specified\n\t\t\treturn '';\n\t\t}\n\n\t\t// test if pattern is delimited by slashes and extract the actual regex if so\n\t\t$options = [];\n\t\tif ( preg_match( '#^/(.*?(\\\\\\\\*))/([a-zA-Z]*)$#u', $pattern, $matches ) ) {\n\t\t\t// if the pattern ends with an odd number of backslashes then this wasn't a delimited pattern,\n\t\t\t// just unfortunately looks very close to one (as the ending delimiter was escaped)\n\t\t\tif ( strlen( $matches[2] ) % 2 === 0 ) {\n\t\t\t\t$pattern = $matches[1];\n\t\t\t\t$options = str_split( $matches[3] );\n\t\t\t}\n\t\t}\n\n\t\t// discard unsupported options\n\t\t$options = array_intersect( $options, [ 'm', 'i', 'U', 'x', 's' ] );\n\n\t\t// test for named options\n\t\tif ( self::getLocalizedArgument( $frame, 'multiline' ) ) {\n\t\t\t$options[] = 'm';\n\t\t}\n\n\t\tif ( self::getLocalizedArgument( $frame, 'caseless' ) ) {\n\t\t\t$options[] = 'i';\n\t\t}\n\n\t\tif ( self::getLocalizedArgument( $frame, 'ungreedy' ) ) {\n\t\t\t$options[] = 'U';\n\t\t}\n\n\t\tif ( self::getLocalizedArgument( $frame, 'extended' ) ) {\n\t\t\t$options[] = 'x';\n\t\t}\n\n\t\tif ( self::getLocalizedArgument( $frame, 'dotall' ) ) {\n\t\t\t$options[] = 's';\n\t\t}\n\n\t\t// add hardcoded options (currently only to treat subject and pattern as utf-8)\n\t\t$options[] = 'u';\n\n\t\t// remove duplicates\n\t\t$options = array_unique( $options );\n\n\t\t// Escape any unescaped slashes, as we use slash for our delimiter\n\t\t// Using \\xfe as a placeholder because it never appears in utf-8 strings, which is what wikitext is\n\t\t$replacements = [\n\t\t\t'\\\\\\\\' => \"\\xfe1\", // replace all escaped backslashes with a placeholder\n\t\t\t'\\\\/' => \"\\xfe2\", // replace all escaped slashes with a placeholder\n\t\t\t'/' => '\\\\/', // replace all unescaped slashes with escaped slashes\n\t\t\t\"\\xfe2\" => '\\\\/', // undo placeholder\n\t\t\t\"\\xfe1\" => '\\\\\\\\' // undo placeholder\n\t\t];\n\n\t\t$pattern = str_replace( array_keys( $replacements ), array_values( $replacements ), $pattern );\n\t\treturn '/' . $pattern . '/' . implode( $options );\n\t}",
"public function getPattern(): string\n {\n return '/^\\S*'.implode('', $this->getRegexOptions()).'\\S*$/';\n }",
"public function matchUrl($url) {\r\n // Wildcard or exact match\r\n if($this->pattern === '*' || $this->pattern === $url) {\r\n $this->setFixedNames();\r\n\r\n return TRUE;\r\n }\r\n\r\n $ids = array();\r\n $last_char = substr($this->pattern, -1);\r\n\r\n // Get splat\r\n if($last_char === '*') {\r\n $n = 0;\r\n $len = strlen($url);\r\n $count = substr_count($this->pattern, '/');\r\n\r\n for($i = 0; $i < $len; $i++) {\r\n if($url[$i] == '/') {\r\n $n++;\r\n }\r\n if($n == $count) {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n\r\n // Build the regex for matching\r\n $regex = str_replace(array(\r\n ')',\r\n '/*'\r\n ), array(\r\n ')?',\r\n '(/?|/.*?)'\r\n ), $this->pattern);\r\n\r\n $regex = preg_replace_callback('#@([\\w]+)(:\\{[^/\\(\\)]*?\\})?#', function($matches) use (&$ids) {\r\n $ids[$matches[1]] = NULL;\r\n if(isset($matches[3])) {\r\n return '(?P<' . $matches[1] . '>' . $matches[3] . ')';\r\n }\r\n\r\n return '(?P<' . $matches[1] . '>[^/\\?]+)';\r\n }, $regex);\r\n\r\n // Fix trailing slash\r\n if($last_char === '/') {\r\n $regex .= '?';\r\n } // Allow trailing slash\r\n else {\r\n $regex .= '/?';\r\n }\r\n\r\n // Attempt to match route and named parameters\r\n if(preg_match('#^' . $regex . '(?:\\?.*)?$#' . (($this->case_sensitive) ? '' : 'i'), $url, $matches)) {\r\n foreach($ids as $k => $v) {\r\n if(array_key_exists($k, $matches)) {\r\n $this->params[$k] = urldecode($matches[$k]);\r\n }\r\n }\r\n\r\n return TRUE;\r\n }\r\n\r\n return FALSE;\r\n }",
"public function setNamingPattern($pattern ='/([a-zA-Z1-9]+)(Function|Block)$/') {\n\t\t //\"/([a-zA-Z1-9]+)Function$/\";\n\t\t $this->_namingPattern = $pattern;\n\t}",
"function preg($pattern){\n return new Parser(['_call_preg', [$pattern]]);\n}",
"static public function is_pattern($pattern)\n\t{\n\t\treturn (strpos($pattern, '<') !== false) || (strpos($pattern, ':') !== false);\n\t}",
"public function getPatternForUri()\n {\n return '/' . preg_replace('/:[\\d\\w]+/i', '(' . $this->_paramPattern . ')', str_replace('/', '\\\\/', $this->_uri)) . '/i';\n }",
"public function getRule()\n {\n return 'regex:'.$this->getField()->getPattern();\n }",
"public function getPattern($pattern_key)\n {\n return $this->pattern[$pattern_key];\n }",
"public function getDatePattern() {\r\n\t\treturn $this->datePattern;\r\n\t}",
"public function getStringPattern()\n {\n return $this->stringPattern;\n }",
"public function getPattern() {\n if (!isset($this->pattern)) {\n if (empty($this->configuration['pattern'])) {\n $this->pattern = \\Drupal::service('plugin.manager.panels.pattern')->createInstance('default');\n }\n else {\n $this->pattern = \\Drupal::service('plugin.manager.panels.pattern')->createInstance($this->configuration['pattern']);\n }\n }\n return $this->pattern;\n }",
"public function getDefaultRegExp();",
"public function setPattern(?string $pattern): static\n {\n $this->pattern = $pattern;\n return $this;\n }",
"public function get_supported_modifiers() {\n return 'i';//any preg_matcher who intends to work with this question should support case insensitivity\n }",
"function match($pattern,&$matches = null){\n\t\t$out = preg_match($pattern,$this,$matches);\n\t\tif(is_array($matches)){\n\t\t\tforeach($matches as &$m){\n\t\t\t\t$m = new self($m);\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}",
"public static function match($pattern, $str, $isCaseSensitive = true) {\n \n $patArr = StringHelper::toCharArray($pattern);\n $strArr = StringHelper::toCharArray($str);\n $patIdxStart = 0;\n $patIdxEnd = count($patArr)-1;\n $strIdxStart = 0;\n $strIdxEnd = count($strArr)-1;\n \n $containsStar = false;\n for ($i = 0, $size=count($patArr); $i < $size; $i++) {\n if ($patArr[$i] == '*') {\n $containsStar = true;\n break;\n }\n }\n\n if (!$containsStar) {\n // No '*'s, so we make a shortcut\n if ($patIdxEnd != $strIdxEnd) {\n return false; // Pattern and string do not have the same size\n }\n for ($i = 0; $i <= $patIdxEnd; $i++) {\n $ch = $patArr[$i];\n if ($ch != '?') {\n if ($isCaseSensitive && $ch !== $strArr[$i]) {\n return false;// Character mismatch\n }\n if (!$isCaseSensitive && strtoupper($ch) !==\n strtoupper($strArr[$i])) {\n return false; // Character mismatch\n }\n }\n }\n return true; // String matches against pattern\n }\n\n if ($patIdxEnd == 0) {\n return true; // Pattern contains only '*', which matches anything\n }\n\n // Process characters before first star\n while(($ch = $patArr[$patIdxStart]) != '*' && $strIdxStart <= $strIdxEnd) {\n if ($ch != '?') {\n if ($isCaseSensitive && $ch !== $strArr[$strIdxStart]) {\n return false;// Character mismatch\n }\n if (!$isCaseSensitive && strtoupper($ch) !==\n strtoupper($strArr[$strIdxStart])) {\n return false;// Character mismatch\n }\n }\n $patIdxStart++;\n $strIdxStart++;\n }\n \n if ($strIdxStart > $strIdxEnd) {\n // All characters in the string are used. Check if only '*'s are\n // left in the pattern. If so, we succeeded. Otherwise failure.\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patArr[$i] != '*') {\n return false;\n }\n }\n return true;\n }\n\n // Process characters after last star\n while(($ch = $patArr[$patIdxEnd]) != '*' && $strIdxStart <= $strIdxEnd) {\n if ($ch != '?') {\n if ($isCaseSensitive && $ch !== $strArr[$strIdxEnd]) {\n return false;// Character mismatch\n }\n if (!$isCaseSensitive && strtoupper($ch) !==\n strtoupper($strArr[$strIdxEnd])) {\n return false;// Character mismatch\n }\n }\n $patIdxEnd--;\n $strIdxEnd--;\n }\n if ($strIdxStart > $strIdxEnd) {\n // All characters in the string are used. Check if only '*'s are\n // left in the pattern. If so, we succeeded. Otherwise failure.\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patArr[$i] != '*') {\n return false;\n }\n }\n return true;\n }\n\n // process pattern between stars. padIdxStart and patIdxEnd point\n // always to a '*'.\n while ($patIdxStart !== $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patIdxTmp = -1;\n for ($i = $patIdxStart+1; $i <= $patIdxEnd; $i++) {\n if ($patArr[$i] == '*') {\n $patIdxTmp = $i;\n break;\n }\n }\n if ($patIdxTmp === $patIdxStart + 1) {\n // Two stars next to each other, skip the first one.\n $patIdxStart++;\n continue;\n }\n // Find the pattern between padIdxStart & padIdxTmp in str between\n // strIdxStart & strIdxEnd\n $patLength = ($patIdxTmp - $patIdxStart - 1);\n $strLength = ($strIdxEnd - $strIdxStart + 1);\n $foundIdx = -1;\n \n //strLoop:\n for ($i = 0; $i <= $strLength - $patLength; $i++) {\n for ($j = 0; $j < $patLength; $j++) {\n $ch = $patArr[$patIdxStart+$j+1];\n if ($ch != '?') {\n if ($isCaseSensitive && $ch !== $strArr[$strIdxStart+$i+$j]) {\n continue 2; //continue to strLoop:\n }\n if (!$isCaseSensitive && strtoupper($ch) !==\n strtoupper($strArr[$strIdxStart+$i+$j])) {\n continue 2; //continue to strLoop:\n }\n }\n }\n // only reached if sub loop completed w/o invoking continue 2\n $foundIdx = $strIdxStart + $i;\n break;\n }\n\n if ($foundIdx == -1) {\n return false;\n }\n\n $patIdxStart = $patIdxTmp;\n $strIdxStart = $foundIdx + $patLength;\n }\n\n // All characters in the string are used. Check if only '*'s are left\n // in the pattern. If so, we succeeded. Otherwise failure.\n for ($i = $patIdxStart; $i <= $patIdxEnd; $i++) {\n if ($patArr[$i] != '*') {\n return false;\n }\n }\n return true;\n }",
"public function parseParameterPatterns()\n {\n return RouteMatch::parseParameterPatterns($this);\n }",
"private function _pmatch($pattern, $value) {\n return fnmatch($pattern, $value, FNM_NOESCAPE|FNM_PATHNAME );\n }",
"static private function parse(string $pattern): array\n\t{\n\t\t$catchall = false;\n\n\t\tif ($pattern[-1] == '*')\n\t\t{\n\t\t\t$catchall = true;\n\t\t\t$pattern = substr($pattern, 0, -1);\n\t\t}\n\n\t\t$pattern = strtr($pattern, self::EXTENDED_CHARACTER_CLASSES);\n\t\t$parts = preg_split('#(:\\w+|<(\\w+:)?([^>]+)>)#', $pattern, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n\t\t[ $interleaved, $params, $regex ] = self::parse_parts($parts);\n\n\t\tif ($catchall)\n\t\t{\n\t\t\t$regex .= '(.*)';\n\t\t\t$params[] = 'all';\n\t\t}\n\n\t\t$regex .= '$#';\n\n\t\treturn [ $interleaved, $params, $regex ];\n\t}",
"static public function is_pattern(string $pattern): bool\n\t{\n\t\treturn (strpos($pattern, '<') !== false) || (strpos($pattern, ':') !== false) || (strpos($pattern, '*') !== false);\n\t}",
"public function getMatcher();",
"Function get_pattern( $line )\n{\n $match = array();\n\n $match = array(\n array( 'pkg' => 'py2cairo', \n 'regex' => \"/py2cairo-([\\d\\.]+)/\" ),\n\n array( 'pkg' => 'Encode-JIS2K', \n 'regex' => \"/\\D*Encode-JIS2K-([\\d\\.]+)\\D*$/\" ),\n\n array( 'pkg' => 'IPC-Run3', \n 'regex' => \"/\\D*IPC-Run3-([\\d\\.]+)\\D*$/\" ),\n\n array( 'pkg' => 'Log-Log4perl', \n 'regex' => \"/\\D*Log-Log4perl-([\\d\\.]+)\\D*$/\" ),\n\n array( 'pkg' => 'Jinja2', \n 'regex' => \"/\\D*Jinja2-([\\d\\.]+)\\D*$/\" ),\n\n // Order matters here. jtreg must be before OpenJDK\n array( 'pkg' => 'jtreg', \n 'regex' => \"/jtreg(\\d[\\d\\.b-]+)$/\" ),\n\n array( 'pkg' => 'OpenJDK', \n 'regex' => \"/OpenJDK-([\\d\\.]+)-.*$/\" ),\n\n array( 'pkg' => 'junit4', \n 'regex' => \"/junit4_([\\d\\.]+).*$/\" ),\n );\n\n foreach( $match as $m )\n {\n $pkg = $m[ 'pkg' ];\n if ( preg_match( \"/$pkg/\", $line ) ) \n return $m[ 'regex' ];\n }\n\n return \"/\\D*(\\d.*\\d)\\D*$/\";\n}",
"public function test_match_fromInvalidPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertFalse(\n $route->match('GET', '/test'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }",
"public function getOriginalPattern()\n {\n return $this->definition->getPattern();\n }",
"protected function initFlagsByPatternOrReverse ($pattern) {\n\t\t$scheme = static::FLAG_SCHEME_NO;\n\t\tif (mb_strpos($pattern, '//') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_ANY;\n\t\t} else if (mb_strpos($pattern, 'http://') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_HTTP;\n\t\t} else if (mb_strpos($pattern, 'https://') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_HTTPS;\n\t\t}\n\t\t$this->flags |= $scheme;\n\t\t$host = 0;\n\t\tif (($scheme & static::FLAG_SCHEME_ANY) != 0) {\n\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_HOST) !== FALSE) {\n\t\t\t\t$host = static::FLAG_HOST_HOST;\n\t\t\t} else if (mb_strpos($pattern, static::PLACEHOLDER_DOMAIN) !== FALSE) {\n\t\t\t\t$host = static::FLAG_HOST_DOMAIN;\n\t\t\t} else {\n\t\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_TLD) !== FALSE)\n\t\t\t\t\t$host += static::FLAG_HOST_TLD;\n\t\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_SLD) !== FALSE)\n\t\t\t\t\t$host += static::FLAG_HOST_SLD;\n\t\t\t}\n\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_BASEPATH) !== FALSE)\n\t\t\t\t$host += static::FLAG_HOST_BASEPATH;\n\t\t}\n\t\tif ($host === 0)\n\t\t\t$host = static::FLAG_HOST_NO;\n\t\t$this->flags |= $host;\n\t\t$queryString = mb_strpos($pattern, '?') !== FALSE\n\t\t\t? static::FLAG_QUERY_INCL\n\t\t\t: static::FLAG_QUERY_NO;\n\t\t$this->flags |= $queryString;\n\t}",
"abstract protected function regexp(): string;",
"public function testRouteSetsPattern()\n {\n $route1 = new \\Slim\\Route('/foo/bar', function () {});\n $this->assertEquals('/foo/bar', $route1->getPattern());\n }",
"protected function getPattern()\n {\n $region = $this->resolveRegion();\n switch ($this->type) {\n case \"html\":\n $outputPattern = \"{{depend}}{{prefix}} {{/depend}}{{firstname}} {{depend}}{{middlename}} {{/depend}}\"\n . \"{{lastname}}{{depend}} {{suffix}}{{/depend}}\\n{{depend}}{{company}}\\n{{/depend}}{{street}}\\n\"\n . \"{{city}}, {{{$region}}}, {{postcode}}\\n{{country_id}}\\n{{depend}}T: {{telephone}}{{/depend}}\"\n . \"{{depend}}\\nF: {{fax}}{{/depend}}{{depend}}\\nVAT: {{vat_id}}{{/depend}}\";\n break;\n case \"oneline\":\n default:\n $outputPattern = \"{{depend}}{{prefix}} {{/depend}}{{firstname}} {{depend}}{{middlename}} {{/depend}}\"\n . \"{{lastname}}{{depend}} {{suffix}}{{/depend}}, {{street}}, \"\n . \"{{city}}, {{{$region}}} {{postcode}}, {{country_id}}\";\n break;\n }\n return $outputPattern;\n }",
"public function getPatternFlags()\n {\n return null;\n }",
"function define_pattern($s) {\n if(fmod($s,2) == 1) {\n return 'o';\n } else {\n return 'x';\n }\n }",
"public function setPattern($pattern)\n {\n $this->options['pattern'] = $pattern;\n\n return $this;\n }",
"public function getPatternFile()\n {\n return $this->patternFile;\n }",
"public function getRouteMatch();",
"public function match($url=null, $method=null)\n{\n foreach(RouteCollection::group($method) as $route)\n {\n $regex = $route->convertPattern();\n if(preg_match($regex, $url, $matches))\n {\n array_shift($matches);\n $this->matches = $matches;\n $this->route = $route;\n $route->register('matches', $matches);\n $route->register('regex', $regex);\n return $route->parameters();\n }\n }\n return false;\n}",
"public function match($request) {\n $requestArr = $this->explodeRequest($request);\n /*if (count($requestArr) < $this->countPatternArr) {\n return false;\n }*/\n for ($i = 0; $i < $this->countPatternArr; $i++) {\n if ($this->isParam($this->patternArr[$i])) {\n continue;\n }\n if (0 !== strcasecmp($this->patternArr[$i], $requestArr[$i])) {\n return false;\n }\n }\n return true;\n }",
"static function matchesRegularExpression($pattern)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::matchesRegularExpression', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"private function matchesPattern($pattern)\n {\n if (preg_match('/' . $pattern . '/u', $this->str)) {\n return true;\n } else {\n return false;\n }\n }",
"public function __construct( $pattern, $extension = NULL )\n {\n// Charcoal_ParamTrait::validateString( 1, $pattern );\n// Charcoal_ParamTrait::validateString( 2, $extension, TRUE );\n\n $this->pattern = $pattern;\n $this->extension = $extension;\n }",
"static public function getSupportedPatterns(): array\n {\n return static::$supported_patterns;\n }",
"public static function getPatternUrl()\n {\n return handles('antares::automation');\n }",
"public function isMatch($pat) {\r\n $result = preg_match($pat, $this->contents /*, $matches*/);\r\n //var_dump($pat); // debug patterns\r\n //if ($pat == NULL) debug_print_backtrace();\r\n //var_dump($matches); // debug patterns\r\n //var_dump($result); // debug patterns\r\n //if ($matches == NULL) debug_print_backtrace();\r\n //if ($result === FALSE) debug_print_backtrace();\r\n return $result;\r\n }",
"public function any($pattern, $action)\r\n {\r\n $this->match($this->methods, $pattern, $action);\r\n }",
"function wp_normalize_remote_block_pattern($pattern)\n {\n }",
"protected function getPattern(): string\n\t{\n\t\treturn $this->getDirectory() . $this->getGroup() . 'data_*_localized.json';\n\t}",
"private function extractRegex($pattern, $info)\n {\n $matches = array();\n preg_match($pattern, $info, $matches);\n return $matches[1];\n }",
"private function regexPattern($data)\n {\n $instruction = match ($data['instruction']) {\n 'show' => '=',\n 'not_show' => '!'\n };\n\n $data['pattern'] = str_replace('/', '\\/', $data['pattern']);\n\n $regStr = match ($data['rule']) {\n 'contains' => '(?'.$instruction.'.*'.$data['pattern'].'.*)',\n 'specific_page' => match($instruction) {\n '!' => '^(?!'.$data['pattern'].')',\n '=' => '(?='.$data['pattern'].')'\n },\n 'starting_with' => '^(?'.$instruction.$data['pattern'].')',\n 'ending_with' => '(?'.$instruction.$data['pattern'].'$)'\n };\n\n return $regStr;\n }",
"protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}",
"protected function preparePattern()\n {\n $patterns = [];\n foreach ($this->routes as $route => $config) {\n $this->routeData[$route] = $config;\n $prepared = preg_replace('/\\{([^:]+):([^}]+)\\}/', '{$1}', $config['route']);\n\n $params = [];\n if (preg_match('/\\{([^}]+)\\}/', $prepared, $params)) {\n array_shift($params);\n }\n\n $this->routeData[$route]['params'] = $params;\n $pattern = preg_replace('/\\{([^:]+):([^}]+)\\}/', '($2)', $config['route']);\n $patterns[] = \"(?P<{$route}>{$pattern})\";\n }\n\n $pattern = implode(' | ', $patterns);\n $this->pattern = \"~^(?: {$pattern} )$~x\";\n }",
"public function getPatternFlags()\n {\n return $this->getConfig('pattern_flags');\n }",
"function get_preg_expression($mode)\n{\n\tswitch ($mode)\n\t{\n\t\tcase 'url':\n\t\tcase 'url_inline':\n\t\t\t$inline = ($mode == 'url') ? ')' : '';\n\t\t\t$scheme = ($mode == 'url') ? '[a-z\\d+\\-.]' : '[a-z\\d+]'; // avoid automatic parsing of \"word\" in \"last word.http://...\"\n\t\t\t// generated with regex generation file in the develop folder\n\t\t\treturn \"[a-z]$scheme*:/{2}(?:(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})+|[0-9.]+|\\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\\])(?::\\d*)?(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\n\t\tcase 'www_url':\n\t\tcase 'www_url_inline':\n\t\t\t$inline = ($mode == 'www_url') ? ')' : '';\n\t\t\treturn \"www\\.(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})+(?::\\d*)?(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\n\t\tcase 'relative_url':\n\t\tcase 'relative_url_inline':\n\t\t\t$inline = ($mode == 'relative_url') ? ')' : '';\n\t\t\treturn \"(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*(?:/(?:[a-z0-9\\-._~!$&'($inline*+,;=:@|]+|%[\\dA-F]{2})*)*(?:\\?(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?(?:\\#(?:[a-z0-9\\-._~!$&'($inline*+,;=:@/?|]+|%[\\dA-F]{2})*)?\";\n\t\tbreak;\n\t}\n\n\treturn '';\n}"
]
| [
"0.7249676",
"0.71949965",
"0.71949965",
"0.70666516",
"0.70666516",
"0.70035756",
"0.6879538",
"0.68580055",
"0.6797862",
"0.6729665",
"0.6729665",
"0.66947037",
"0.66767013",
"0.6636134",
"0.6607104",
"0.6607104",
"0.6411594",
"0.6353183",
"0.6282285",
"0.6282285",
"0.6279473",
"0.6248549",
"0.6227514",
"0.6198759",
"0.6193357",
"0.61914545",
"0.61897606",
"0.60837495",
"0.6068963",
"0.60679126",
"0.606374",
"0.60336566",
"0.6016621",
"0.5923573",
"0.5905898",
"0.5888218",
"0.5879549",
"0.58513695",
"0.57865417",
"0.5757314",
"0.5746106",
"0.5746106",
"0.5732971",
"0.5700671",
"0.56920826",
"0.567928",
"0.56743556",
"0.56663746",
"0.565313",
"0.5628428",
"0.5621396",
"0.56151456",
"0.56091994",
"0.55763656",
"0.556913",
"0.55530214",
"0.5513432",
"0.55125344",
"0.5506531",
"0.55060095",
"0.5483802",
"0.5457104",
"0.5455935",
"0.5440767",
"0.54314214",
"0.542914",
"0.5414765",
"0.54115933",
"0.54020303",
"0.5401198",
"0.53975976",
"0.5381533",
"0.53610945",
"0.53502464",
"0.53458244",
"0.532713",
"0.532039",
"0.5296892",
"0.5294149",
"0.52790296",
"0.526386",
"0.52542675",
"0.52523327",
"0.5244627",
"0.52351755",
"0.52342546",
"0.5223372",
"0.52185595",
"0.5197193",
"0.5188967",
"0.5182313",
"0.51750576",
"0.51708764",
"0.51707006",
"0.51685375",
"0.5159381",
"0.51515",
"0.5133382",
"0.5128983",
"0.5117496"
]
| 0.679382 | 9 |
Lists all Client entities. | public function indexAction()
{
return $this->render('ClientBundle:TopMember:topmember.html.twig');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CMSBundle:Client')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getAllClients(){\n\t\t$sql = \"SELECT * FROM cliente;\";\n\t\treturn $this->Model->getData($sql);\n\t}",
"public function getClientsAction()\n {\n $this->throwIfClientNot('backend');\n $clientManager = $this->get(\n 'fos_oauth_server.client_manager.default'\n );\n\n $class = $clientManager->getClass();\n\n return $this->getDoctrine()->getRepository($class)->findAll();\n }",
"public function index()\n\t{\n\t\t$clientes = $this->clientesRepository->all();\n\n\t\treturn $this->sendResponse($clientes->toArray(), \"Clientes retrieved successfully\");\n\t}",
"public function index()\n {\n $em = $this->getDoctrine()->getManager();\n $clients = $em->getRepository('App:Clients')->selectAllClient();\n return $this->render('base.html.twig', [\n 'clients' => $clients\n ]);\n }",
"public function client_list()\n {\n return ClientList::latest()->paginate(10);\n }",
"public function index()\n {\n return Cliente::all();\n }",
"public function index()\n {\n $client = new Clients;\n return $client->allClients();\n }",
"public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM clientes';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}",
"public function index()\n {\n $clients = Client::all();\n\n return $this->showAll($clients);\n }",
"public function getAllClient() {\n $qb = $this ->createQueryBuilder('p')\n ->select('p')\n ->where('p.estEmploye = 0')\n ->orderBy('p.nom');\n return $qb->getQuery()->getResult();\n }",
"public function index()\n {\n $clientes = Cliente::all();\n return $this->showAll($clientes);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $clientes = $em->getRepository('AppBundle:Cliente')->findAll();\n\n return $this->render('cliente/index.html.twig', array(\n 'clientes' => $clientes,\n ));\n }",
"public function index()\n {\n // Get clients\n // Use Laravel’s pagination for showing Clients/Transactions list, 10 entries per page\n $clients = Client::paginate(10);\n return ClientResource::collection($clients);\n }",
"public static function all(){\n\t\t$bdd = new DBcnx();\n\t\t\treturn $bdd->allClient();\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function listClientAction()\n {\n \t$em = $this->getDoctrine()->getManager();\n $client = $em->getRepository('CoutureGestionBundle:Client')->findAll();\n $client = array_reverse($client);\n return $this->render('CoutureGestionBundle:Couture:listClient.html.twig', array(\n 'client' => $client\n ));\n }",
"public function index() {\n\n\t\techo json_encode($this->Database->clients_list());\n\t}",
"public function getAllClients() {\n // On récupère tout le contenu de la table clients\n $queryResult = $this->database->query('SELECT * FROM clients'); \n $allClientsData = $queryResult->fetchAll(PDO::FETCH_OBJ);\n return $allClientsData;\n }",
"function clientsListAction()\n\t{\n\t\t$searchParameters=$this->_request->getParams();\n\t\t\n\t\t$client_obj = new Ep_Quote_Client();\n\t\t$clients=$client_obj->getClients($searchParameters);\n\t\tif($clients!='NO')\n\t\t\t$this->_view->clients =$clients;\n\t\t\n\t\t$this->_view->client_creators=$client_obj->getClientCreatorUsers();\t\n\t\t\n\t\t$this->render('clients-list');\n\t}",
"public function getAllClient() {\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_client');\n\n\t\t$result = $this->db->get();\n\n\t\treturn $result->result();\n\t}",
"public function allClients()\n\t{\n\t\t$data['clients'] = $this->MainModel->selectAll('client_details', 'client_name');\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/sidebar');\n\t\t$this->load->view('template/all-clients', $data);\n\t\t$this->load->view('layout/footer');\n\t}",
"public function actionIndex()\n {\n $searchModel = new ClientSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n\t\t\t'modelsUser' => User::find()->all(),\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('uesperaBundle:ClienteCredito')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function listClients(){\n $mysql= $this->database->databaseConnect();\n $sql = 'SELECT * FROM client';\n $query = mysqli_query($mysql, $sql) or die(mysqli_connect_error());\n $this->database->databaseClose();\n\n while($row = mysqli_fetch_assoc($query)){\n $this->clients[] = $row;\n }\n\n return $this->clients;\n }",
"public function listaCliente() {\n\n return $clientes; // array de clientes\n }",
"public function index()\n {\n return ClientResource::collection(Client::orderBy('id', 'DESC')->paginate());\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return product_client::all();\n }",
"public function index()\n {\n $account = new AccountClient;\n return view('modules.organization.AccountClient.list', compact('account'));\n }",
"public function actionIndex()\n {\n $searchModel = new ClienteSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function clients() {\n\t\treturn $this->clients_model->getClients($this->compID);\n\t}",
"public function get_clientes()\n\t{\n\t\treturn $this->db->get(\"clientes\");\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $crmClientes = $em->getRepository('ERPAdminBundle:CrmCliente')->findAll();\n\n return $this->render('crmcliente/index.html.twig', array(\n 'crmClientes' => $crmClientes,\n ));\n }",
"public function index()\n {\n $client = Client::all();\n return view('clients.listCl', compact('client'));\n }",
"public function index()\n {\n $clients = Client::paginate();\n return response()->json($clients);\n }",
"public function actionIndex ()\n {\n $post = Yii::$app->request->post();\n $clientSearch = new ClientSearch();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => Client::find(),\n 'pagination' => [\n 'pageSize' => 10,\n ],\n ]);\n\n if ($clientSearch->load($post)) {\n $dataProvider = $clientSearch->search();\n }\n\n $clientTypes = ArrayFormatter::formatArray([\n Client::TYPE_CUSTOMER,\n Client::TYPE_PROVIDER,\n Client::TYPE_PARTNER,\n ]);\n $contactTypes = ArrayFormatter::formatArray(ContactType::getAllTypesAsArray());\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'clientSearch' => $clientSearch,\n 'client' => new Client(),\n 'clientTypes' => $clientTypes,\n 'contactTypes' => $contactTypes,\n ]);\n }",
"public function getAllEntities();",
"function Listar_Clientes()\n\t {\n\t\tlog_message('INFO','#TRAZA| CLIENTES | Listar_Clientes() >> ');\n\t\t$data['list'] = $this->Clientes->Listar_Clientes();\n return $data;\n\t }",
"public function tableList()\n {\n $list = (self::MODEL)::orderBy('clientes.created_at', 'DESC');\n $list = $this->handleRequest($list);\n\n return $this->listResponse(ClientTransformer::tableList($list));\n }",
"public function index()\n {\n $cm_clientes = CmCliente::with(\"contrato.cliente\", \"cmmac\", 'orden_trabajo', \"estado_cm\")->get();\n return $cm_clientes;\n }",
"public function indexAction()\n {\n // Verify that user is a super admin\n $auth = $this->get('core.auth.action_listener');\n $user = $auth::$user;\n if (($user->getPermissions() & 128) != 128) {\n throw new AccessDeniedHttpException(AuthListener::PermsMessage);\n }\n\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('UCrmCoreBundle:Client')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function clientList() {\n return $this->returnCommand(['CLIENT', 'LIST'], null, null, ResponseParser::PARSE_CLIENT_LIST);\n }",
"public function getAllCliente() {\n try {\n $sql = \"SELECT * FROM cliente\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $dados = $stm->fetchAll(PDO::FETCH_OBJ);\n return $dados;\n } catch (PDOException $erro) {\n echo \"<script>alert('Erro na linha: {$erro->getLine()}')</script>\";\n }\n }",
"public function clients()\n {\n return $this->morphedByMany(Client::class, 'model', 'authorizables')\n ->withPivot('user_id')\n ->withTimestamps();\n }",
"public function index()\n {\n $clients = Client::all();\n\n return response()->json(['data' => $clients], 200);\n }",
"public function index()\n {\n $data['clients'] = $this->client->getList();\n return view(\"Tenant::Client/index\", $data);\n }",
"public function actionIndex()\n {\n $searchModel = new ClientsLogosSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $categories = ClientsCategories::find()\n ->select(['id', 'name'])\n ->asArray()\n ->all();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'categories' => ArrayHelper::map($categories, 'id', 'name'),\n ]);\n }",
"public function index()\n {\n // get all clients \n $clients = Client::with(['deliveries.products'])->ordered(true)->get();\n\n // return clients as json\n return $clients->toJson();\n }",
"public function getClientList()\n {\n $clients = $this->find('all')\n ->select(['id', 'salutation', 'name'])\n ->where(['role' => 'client'])\n ->order(['name' => 'ASC']);\n $retval = [];\n foreach ($clients as $client) {\n $retval[$client->id] = $client->full_name;\n }\n\n return $retval;\n }",
"public function listClient()\n\t {\n\t\t$tab = array();\n\t\t\t$rqt = mysql_query(\"SELECT * FROM clients\");\n\t\t\twhile($data = mysql_fetch_assoc($rqt))\n\t\t\t\t$tab[] = $data;\n\t\t\treturn $tab;\n\t }",
"public function listarClientes(){\n $this->bd->getConeccion();\n $sql = \"SELECT * FROM CLIENTE\";\n $registros = $this->bd->executeQueryReturnData($sql); \n $this->bd->cerrarConeccion(); \n $clientes = array(); \n \n foreach ($registros as $cliente) {\n $cliente = new Cliente($cliente['id'],$cliente['dni'],$cliente['Nombre'],$cliente['Apellido'],$cliente['Correo'],$cliente['Telefono']);\n array_push($clientes, $cliente);\n }\n \n return $clientes; \n }",
"public function index()\n {\n return Entity::all();\n }",
"public function index()\n {\n $clients = Client::orderBy('id', 'desc')->paginate(15);\n return view('application.client.list', compact('clients'));\n }",
"public function index()\n {\n \t$clientes = Cliente::all();\n\t\treturn response()->json($clientes, 200);\n }",
"public function ListarClientes()\n{\n\tself::SetNames();\n\t$sql = \" select * from clientes \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"private function lista_clientes()\n {\n\n $lista_clientes = Cliente::where('status', 1)\n ->orderBy('nome')\n ->get();\n\n return $lista_clientes;\n }",
"public function getClientes()\n {\n return $this->clientes;\n }",
"public function getClientes()\n {\n return $this->clientes;\n }",
"public function index()\n {\n $clients = Client::orderBy('id', 'desc')->paginate(10);\n return view('clients.list',compact('clients'));\n }",
"public function clientList()\n {\n return $this->getParent()->channelGroupClientList($this->getId());\n }",
"public function index()\n {\n $clients = Client::orderBy('name', 'ASC')\n ->paginate(env('PAGINATION', 20));\n\n return view('client.index')->with(compact('clients'));\n }",
"function getClientList()\n\t{\n\t\t//Update Client List\n\t\t$this->Client_List = null;\n\t\t$assigned_clients_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Client');\n\t\tforeach($assigned_clients_rows as $assigned_client)\n\t\t\t$this->Client_List[] = new Client( $assigned_client['ClientProjectTask'] );\n\t\t\n\t\treturn $this->Client_List;\n\t}",
"public function get_all()\n {\n $conn = db();\n \n $clientes = [];\n \n $consulta = \"SELECT * FROM cliente\";\n try{\n \n $stmt = $conn->query($consulta);\n \n }catch(PDOException $ex){\n console_log($ex->getMessage());\n }\n\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $clientes[] = [\n 'id' => $row['id'],\n 'username' => $row['username'],\n 'passwd' => $row['passwd'],\n 'nombre' => $row['nombre'],\n 'apellidos' => $row['apellidos'],\n 'email' => $row['email'],\n 'domicilio' => $row['domicilio'],\n 'fechaCreacion' => $row['fechaCreacion'],\n 'fechaModificacion' => $row['fechaModificacion'],\n 'Cesta_id' => $row['Cesta_id']\n ];\n }\n return $clientes;\n \n }",
"public function clientList()\n\t{\n\t\treturn $this->client()->latest()\n\t\t\t->where('password_client', true)\n\t\t\t->where('revoked', false)->get()\n\t\t\t->makeVisible('secret');\n\t}",
"public function index()\n {\n $clientes = Clientes::all();\n return view('clientes', compact('clientes'));\n }",
"public function index()\n\t{\n\t\t$clientes = Cliente::orderBy('id', 'desc')->paginate(10);\n\n\t\treturn view('clientes.index', compact('clientes'));\n\t}",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => OrderClient::find(),\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'status' => SORT_ASC,\n ],\n ],\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public static function getAll()\n {\n $consulta = \"SELECT * FROM clientes\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }",
"public function getAll()\r\n {\r\n // Query the database and return an array of contacts\r\n return $this->getEntityManager()\r\n ->createQuery(\r\n 'SELECT c FROM AppBundle:Contact c ORDER BY c.firstName, c.lastName ASC'\r\n )\r\n ->getResult();\r\n }",
"public function indexClients()\n\t{\n\t\tif (!$this->commons->hasPermission('clients')) {\n\t\t\tNot_foundController::show('403');\n\t\t\texit();\n\t\t}\n\n\t\t/*Get User name and role*/\n\t\t$data = $this->commons->getUser();\n\t\t/**\n\t\t * Get all User data from DB using User model \n\t\t **/\n\t\t$data['result'] = $this->contactModel->getClients();\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER . 'language/' . $data['info']['language'] . '/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER . 'language/' . $data['info']['language'] . '/contact.php';\n\t\t$data['lang']['contact'] = $contact;\n\n\t\t/* Set confirmation message if page submitted before */\n\t\tif (isset($this->session->data['message'])) {\n\t\t\t$data['message'] = $this->session->data['message'];\n\t\t\tunset($this->session->data['message']);\n\t\t}\n\t\t/* Set page title */\n\t\t$data['page_title'] = $data['lang']['common']['text_clients'];\n\n\t\t/*Render User list view*/\n\t\t$this->view->render('contact/client_list.tpl', $data);\n\t}",
"public function index()\n {\n $clientes = Cliente::all();\n return view('clientes.index', compact(\"clientes\"));\n }",
"public function index()\n {\n $clients = Client::all();\n return view('clients.index',compact('clients'));\n }",
"public function index()\n {\n $clients = Client::get();\n return view('admin.client.index', compact('clients'));\n }",
"public function clients()\n {\n return $this->hasMany(Client::class);\n }",
"public function index()\n {\n $clients = cliente::All();\n return view('cliente.index',compact('clients'));\n }",
"public function listAction(UserInterface $user)\n {\n $repository = $this->getDoctrine()->getRepository(Client::class);\n $client = $repository->findBy(['user' => $user]);\n\n return $client;\n }",
"public function index()\n {\n\n $clients = Client::all();\n return view('Client.index', compact('clients'));\n }",
"public function index()\n {\n $clientes = clientes::all();\n return view('clientes.index', compact('clientes', $clientes));\n }",
"public function allclients(){\n $allclient= DB::table('client')->get();\n if($allclient->isEmpty()){\n $reply = Array();\n $reply['responsetype'] = \"fail\";\n $reply['message']=\"Failed to load clients\";\n \n return response()->json($reply);\n }\n\n return response()->json($allclient);\n }",
"public function index()\n {\n $user = Auth::user();\n $clients = Client::where('user_id', $user->id)->paginate(10);\n return response()->json([\n 'clients' => $clients\n ]);\n }",
"public function getClients()\n {\n try\n {\n return response()->json(['success' => true, 'data' => ClienteFacade::getAll()], 200);\n }\n catch (HttpException $httpException)\n {\n return response()->json(['success' => false, 'error_message' => $httpException->getMessage()], $httpException->getCode());\n }\n }",
"public function client_getAll(){\n $array = array();\n if( $stmt = $this->connection->prepare(\"SELECT * FROM clients;\") ){\n $stmt->execute();\n $stmt->bind_result($id, $type, $name, $company, $address, $email, $phone);\n \n $results = array();\n while( $stmt->fetch() ){\n $Client = new Client($id, $type, $name, $company, $address, $email, $phone);\n $results[] = $Client;\n } \n \n $stmt->close();\n return $results;\n }\n return null;\n }",
"public function index(): \\Illuminate\\Http\\JsonResponse\n {\n return response()->json(Client::all());\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HffBlogBundle:Comentarios')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function index()\n {\n $clientes = Cliente::all();\n return view('lista_cliente', compact('clientes'));\n }",
"public function view_all_clients() {\n $datos['query'] = $this->profesional_model->findAll();\n $this->load->view('profesionales/view_clientes', $datos);\n }",
"public function index()\n {\n $clients = Client::all();\n return view('clients/index')->with(['clients' => $clients]);\n }",
"public function index(Request $request)\n {\n if($request->wantsJson()) {\n return response()->json(['clients' => Client::all()]);\n }\n }",
"public function CarregaClientes() {\n\t\t$clientes = new Model_Wpr_Clientes_ClientesIntegracao ();\n\t\t\n\t\treturn $clientes->carregaClientes ();\n\t}",
"public static function traerTodosLosClientes()\n {\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n $consulta = $objetoAccesoDato->RetornarConsulta(\"SELECT * \n FROM usuarios AS u, clientes AS c \n WHERE u.id_usuario=c.id_usuario\");\n \n $consulta->execute();\n $consulta = $consulta->fetchAll(PDO::FETCH_ASSOC);\n return json_encode($consulta);\n }",
"public function index() {\n\t\t$clientes = cliente::all();\n\t\treturn view('cliente.cliente-lista', ['clientes' => $clientes]);\n\t}",
"public function index()\n\t{\n $clients = $this->client\n ->orderBy('title', 'asc')\n ->get();\n\n \t\treturn view('clients.index.index')->with('clients', $clients);\n\t}",
"public function indexAction()\n {\n // Récupération de la liste des clients.\n $repository = $this->getDoctrine()->getManager()->getRepository('KemistraMainBundle:Client');\n $clientsParticuliers = $repository->getListeParticuliers();\n $clientsProfessionnels = $repository->getListeProfessionels();\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:index.html.twig',\n array('clientsParticuliers' => $clientsParticuliers,\n 'clientsProfessionnels' => $clientsProfessionnels));\n }",
"public function index()\n {\n $clients = Client::with('cuote')->get();\n \n return view('clients.index', compact('clients'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('CrudforgeBundle:Users')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function lista() {\n $sql = \"SELECT * FROM cliente\";\n $qry = $this->db->query($sql); // query do pdo com acesso ao bd\n\n //return $qry->fetchAll(); // retorna todos os registros\n return $qry->fetchAll(\\PDO::FETCH_OBJ); // retorna todos os registros a nível de objeto\n }",
"function index() {\n\t\t$this->paginate = array(\n\t\t\t'conditions'=>array('user_id'=>$this->Auth->user('id')),\n\t\t\t'limit'=>'10',\n\t\t\t'order'=>'modified DESC'\n\t\t);\n\t\t$clients = $this->paginate();\n\t\t$this->set(compact('clients'));\n\t}",
"public function ctlBuscaClientes(){\n\n\t\t$respuesta = Datos::mdlClientes(\"clientes\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}",
"public function index()\n {\n $clientes = Cliente::paginate(15);\n return view('clientes.index', compact('clientes'));\n }",
"public function index()\n {\n $clients = Clients::all();\n\n return view('clients.index', compact('clients'));\n }"
]
| [
"0.7723367",
"0.70822036",
"0.707837",
"0.705902",
"0.7053973",
"0.7027018",
"0.7018856",
"0.70179707",
"0.69976074",
"0.69425803",
"0.69425166",
"0.68762743",
"0.67696005",
"0.6757923",
"0.67524594",
"0.6690152",
"0.6689022",
"0.66610366",
"0.66428113",
"0.66411287",
"0.66171545",
"0.6609005",
"0.6598287",
"0.65723807",
"0.65684193",
"0.6561369",
"0.65502167",
"0.65193206",
"0.6469987",
"0.6469722",
"0.64635783",
"0.64597577",
"0.64509165",
"0.6429723",
"0.6427541",
"0.63978994",
"0.63890934",
"0.6384273",
"0.63735783",
"0.6370045",
"0.63517904",
"0.63444036",
"0.6292515",
"0.62890583",
"0.6284659",
"0.6262113",
"0.62423074",
"0.6239049",
"0.6237001",
"0.62368387",
"0.6225998",
"0.62150484",
"0.6213989",
"0.6209636",
"0.6202017",
"0.6198536",
"0.6196292",
"0.6192603",
"0.6192603",
"0.6188919",
"0.61807626",
"0.61733043",
"0.6173155",
"0.6162667",
"0.61603934",
"0.6152829",
"0.6147749",
"0.6140732",
"0.61320144",
"0.61165845",
"0.6110786",
"0.6109612",
"0.6109012",
"0.6100358",
"0.6092986",
"0.6081109",
"0.60806537",
"0.6071435",
"0.6067466",
"0.60545796",
"0.6038013",
"0.6037859",
"0.6024778",
"0.6020499",
"0.60187906",
"0.60122013",
"0.5997678",
"0.59910625",
"0.59909165",
"0.5990287",
"0.59901255",
"0.59712195",
"0.59562886",
"0.5953551",
"0.5950491",
"0.59430933",
"0.59331715",
"0.5926659",
"0.5921358",
"0.5910926",
"0.5903649"
]
| 0.0 | -1 |
Private constructor to limit object instantiation to within the class | private function __construct() {
mysql_connect($this->dbHost,$this->dbUser,$this->dbPass) or die("Mysql Connection Failed: " . mysql_error());
mysql_select_db($this->dbName) or die("Database 'carpool_db' Selection failed: " . mysql_error());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }",
"final private function __construct() {}",
"final private function __construct() {}",
"private final function __construct() {}",
"final private function __construct() { }",
"final private function __construct() { }",
"final private function __construct() { }",
"private function __construct()\t// Private to prevent object being instantiated outside class\r\n {\r\n // Do nothing\r\n }",
"protected final function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct() {}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct () {}",
"final private function __construct() {\n\t\t\t}",
"final private function __construct()\n\t{\n\t}",
"final private function __construct(){\r\r\n\t}",
"private function __construct(){ }",
"private function __construct(){ }",
"private function __construct()\r\n {}",
"final private function __construct()\n {\n }",
"final private function __construct()\n {\n }",
"private function __construct()\t{}",
"final private function __construct()\n {\n }",
"function _construct(){ }",
"protected abstract function __construct();",
"private function __construct() {\r\n\t\r\n\t}",
"private function __construct() {}",
"private function __construct() {}"
]
| [
"0.84751713",
"0.8439514",
"0.8439514",
"0.82737803",
"0.8200065",
"0.8200065",
"0.8200065",
"0.81861174",
"0.8162909",
"0.8153471",
"0.8153471",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.8152859",
"0.81520766",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.80706024",
"0.8027365",
"0.8024215",
"0.7981445",
"0.7951161",
"0.7882318",
"0.7882318",
"0.7867331",
"0.78636026",
"0.78636026",
"0.78570503",
"0.78538215",
"0.78351915",
"0.781954",
"0.78068334",
"0.7798632",
"0.7798632"
]
| 0.0 | -1 |
Getter method for creating/returning the single instance of this class | public static function getInstance() {
if (!self::$singletonInstance)
{
self::$singletonInstance = new DBUtil();
}
return self::$singletonInstance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_instance() {\n\t\tif ( null === self::$single_instance ) {\n\t\t\tself::$single_instance = new self();\n\t\t}\n\n\t\treturn self::$single_instance;\n\t}",
"public static function get_instance() {\n\t\tif ( null === self::$single_instance ) {\n\t\t\tself::$single_instance = new self();\n\t\t}\n\n\t\treturn self::$single_instance;\n\t}",
"public static function get_instance() {\r\n\t\tif ( null === self::$single_instance ) {\r\n\t\t\tself::$single_instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$single_instance;\r\n\t}",
"public static function get()\n\t{\n\t\tif(null == self::$_instance)\n\t\t{\n\t\t\treturn new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public static function get() \n {\n if (!isset(self::$instance)) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function get()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }",
"public static function instance() {\n\t\treturn new self;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t\t\n\t}",
"public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }",
"public function getInstance()\n {\n return $this;\n }",
"public static function get() {\r\n\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$instance;\r\n\r\n\t}",
"public function getInstance() {\n\t\treturn $this->instance;\n\t}",
"public static function get() {\n\t\tif ( self::$instance === null )\n\t\t\tself::$instance = new self();\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }",
"public static function get_instance() {\r\n // # If the single instance hasn't been set, set it now.\r\n if ( null == self::$instance ) {\r\n self::$instance = new self;\r\n }\r\n\r\n return self::$instance;\r\n }",
"public static function get() {\n\t\tif ( self::$instance == null ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function get_instance()\n {\n\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function instance() {\n\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\n\t\t}",
"public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}",
"public static function getInstance() {\n return new self();\n }",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( self::$instance == null ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"abstract public function get_instance();",
"public function instance();",
"public static function get_instance() {\n\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$instance;\n\t\t}",
"public static function get_instance() {\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$instance;\n\t\t}",
"public static function instance()\n {\n\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function getInstance()\n {\n return new self();\n }",
"public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }",
"public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }",
"public static function getInstance() {\n \n if (self::$uniqueInstance === NULL) {\n $className = __CLASS__;\n self::$uniqueInstance = new $className;\n }\n return self::$uniqueInstance;\n \n }",
"function get() {\n\t\tif (!self::$instance) self::$instance = new self;\n\t\treturn self::$instance;\n\t}",
"public static function get_instance()\n {\n // If the single instance hasn't been set, set it now.\n if(null == self::$instance) {\n self::$instance = new self;\n }\n return self::$instance;\n }",
"public function getInstance(): self\n {\n return $this;\n }",
"public static function getInstance() {\n \n if (self::$uniqueInstance === NULL) {\n $className = __CLASS__;\n self::$uniqueInstance = new $className;\n }\n \n return self::$uniqueInstance;\n \n }",
"public static function getInstance() {\n \n if (self::$uniqueInstance === NULL) {\n $className = __CLASS__;\n self::$uniqueInstance = new $className;\n }\n \n return self::$uniqueInstance;\n \n }",
"public static function one()\n {\n return static::getInstance();\n }",
"public static function inst()\n {\n return static::get_one(__CLASS__);\n }",
"public static function get_instance() {\n\t\t# If the single instance hasn't been set, set it now.\n\t\tif (null == self::$instance) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public function create(){\r\n\treturn new $this->class();\r\n }",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) )\n\t\t\t\tself::$_instance = new self();\n\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t if ( !isset( self::$instance ) ) {\n\t $className = __CLASS__;\n\t self::$instance = new $className;\n\t }\n\t return self::$instance;\n\t }",
"public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public function getInstance(): object;",
"public static function get_instance() {\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function get_instance() {\n\t\t\t// Check if instance is already exists.\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function instance() {\n\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\n\t}",
"public static function instance() {\n if ( empty( self::$instance ) ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function get_instance() {\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance(){\n\t\t\tif( is_null( self::$instance ) ){\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function get_instance() {\n \t\tstatic $instance = null;\n \t\tif (is_null($instance)) {\n \t\t\t$instance = new self();\n \t\t}\n \t\treturn $instance;\n \t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function getInstance() {\n\t\tstatic $instance = null;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t}\n\n\t\treturn $instance;\n\t}",
"public static function getInstance()\n {\n if (self::$instance == null) {\n \n //make new istance of this class and save it to field for next usage\n $class = __class__;\n self::$instance = new $class();\n }\n\n return self::$instance;\n }",
"public static function getInstance(): self;",
"public static function instance () {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}",
"public static function getInstance() {\n\n static $instance;\n //If the class was already instantiated, just return it\n if (isset($instance))\n return $instance;\n\n $instance = new self;\n\n return $instance;\n }",
"public static function get_instance() {\n\n if ( ! self::$instance instanceof self ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }",
"public function getInstance(): mixed;",
"public static function instance () {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function getInstance()\n {\n if (!self::$__instance) {\n \n self::$__instance = new self;\n }\n \n return self::$__instance;\n }",
"public static function instance() {\n\t\tif ( !isset( self::$instance ) ) {\n\t\t\t$class_name = __CLASS__;\n\t\t\tself::$instance = new $class_name;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function getInstance(){\n\t\tif(is_null(self::$instance)){\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function instance(): self\n {\n return self::$instance ??= new self();\n }",
"public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t$class_name = __CLASS__;\n\t\t\tself::$instance = new $class_name;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function getInstance() {\n \n if (empty(self::$instance)) {\n \n self::$instance = new self();\n \n }\n \n return self::$instance;\n \n }",
"public static function instance() {\n\t\t\tif ( ! self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function getInstance() {\n\t\tself::init();\n\t\treturn parent::getInstance();\n\t}",
"public static function instance() {\n if(is_null( self::$_instance)){\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"static function getInstance () {\n\t\t\tif (self :: $_instance == null)\n\t\t\t\tself :: $_instance = new self ();\n\t\t\t\t\n\t\t\treturn self :: $_instance;\n\t\t}",
"public static function get_instance() {\n\n\t\treturn null === self::$instance ? new self() : self::$instance;\n\n\t}",
"public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}",
"public static function get_instance() {\n\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }"
]
| [
"0.77980083",
"0.77980083",
"0.7733116",
"0.76341015",
"0.7632652",
"0.76162595",
"0.7583834",
"0.7572871",
"0.75544614",
"0.75496936",
"0.75432426",
"0.75410503",
"0.75034493",
"0.7502158",
"0.74919796",
"0.74919796",
"0.7482811",
"0.7480773",
"0.74782836",
"0.7463974",
"0.7450676",
"0.74473935",
"0.7444744",
"0.7436912",
"0.7436622",
"0.74363226",
"0.7433283",
"0.7432277",
"0.7432277",
"0.7432277",
"0.7432277",
"0.74315464",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74300885",
"0.74189043",
"0.74189043",
"0.74149275",
"0.7412363",
"0.74118054",
"0.74118054",
"0.74045664",
"0.74042904",
"0.74031264",
"0.74018914",
"0.7398785",
"0.7398785",
"0.7397075",
"0.73952425",
"0.7393592",
"0.7389574",
"0.73854655",
"0.7378835",
"0.7378835",
"0.7378835",
"0.7378835",
"0.7378835",
"0.7378835",
"0.73736066",
"0.73649037",
"0.7356463",
"0.7353134",
"0.7353134",
"0.73510015",
"0.7348732",
"0.73427737",
"0.73427737",
"0.73427737",
"0.7342161",
"0.7340956",
"0.7339373",
"0.7339373",
"0.7334005",
"0.7333731",
"0.73337054",
"0.73330253",
"0.7330123",
"0.73244935",
"0.73221225",
"0.7321107",
"0.7320631",
"0.7311947",
"0.7306472",
"0.73036075",
"0.7296326",
"0.7294122",
"0.72913677",
"0.72876656",
"0.7286285",
"0.728611",
"0.7285703",
"0.7285593",
"0.7277985",
"0.72765815"
]
| 0.0 | -1 |
Remove the following lines when you implement this test. | public function testExtractTextArrayFromRootDomNode() {
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _tearDown( )\n {\n }",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown() {}",
"protected function tearDown ()\n {}",
"protected function tearDown()\n {\n Phlash::clear();\n }",
"protected function tearDown () {\n \n }",
"protected function tearDown() {\n\t\n }",
"protected function tearDown() {\n\t\n }",
"protected function tearDown() { }",
"protected function tearDown()\n {\n\t\t\n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"public function cleanHeaders()\n {\n /* @codeCoverageIgnoreStart() */\n @header_remove();\n /* @codeCoverageIgnoreEnd */\n }",
"protected function tearDown() {\r\n \r\n }",
"protected function tearDown() {\r\n \r\n }",
"protected function tearDown() {\r\n \r\n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() {\n \n }",
"protected function tearDown() \n { \n }",
"protected function tearDown()\n {\n \n }",
"protected function tearDown()\n {\n \n }",
"protected function tearDown()\n {\n \n }",
"protected function tearDownBase()\n {\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown()\r\n {\r\n \r\n }",
"public function notATestCase() {}",
"protected function tearDown()\r\n {\r\n \r\n }",
"protected function tearDown()\n {\n \n }",
"function tearDown() {\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }",
"protected function tearDown() {\n\n }"
]
| [
"0.66278493",
"0.65581053",
"0.65581053",
"0.65581053",
"0.65560454",
"0.65560454",
"0.65560454",
"0.65560454",
"0.65543747",
"0.65543747",
"0.65543747",
"0.65543747",
"0.65543747",
"0.65543747",
"0.65543747",
"0.6521765",
"0.6519987",
"0.65007824",
"0.64918673",
"0.64918673",
"0.64634895",
"0.6432117",
"0.641944",
"0.641944",
"0.641944",
"0.64061624",
"0.6405169",
"0.6405169",
"0.6405169",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.63971484",
"0.6393044",
"0.6390001",
"0.6390001",
"0.6390001",
"0.6384187",
"0.6381222",
"0.6381222",
"0.6381222",
"0.6378209",
"0.63763374",
"0.6375409",
"0.6367482",
"0.63597524",
"0.6354719",
"0.6354719",
"0.6354719",
"0.6354719",
"0.6354719",
"0.6354719",
"0.6354719",
"0.6354719"
]
| 0.0 | -1 |
WordPress Plugin Requirement Check. | public function wordpress_plugin_requires( $args = array( 'wpversion' => '3.3' ) ) {
global $wp_version, $plugin;
// First we check the minimum version of WordPress required.
if ( version_compare( $wp_version, $args['wpversion'], "<" ) ) {
// If the first requirement is not available then we check if the plugin was activated.
if ( function_exists( 'is_plugin_active' ) ) {
// Checks if plugin was activated on a single site setup.
if ( is_plugin_active( $plugin ) ) {
// Now we deactivate the plugin.
deactivate_plugins( $plugin, false, false );
}
}
else if ( function_exists( 'is_plugin_active_for_network' ) ) {
// Checks if plugin was activated on a single site setup.
if ( is_plugin_active_for_network( $plugin ) ) {
// Now we deactivate the plugin.
deactivate_plugins( $plugin, false, true );
}
}
wp_die( sprintf("'%s' ".__('requires WordPress %s or higher, and has been deactivated! Please upgrade WordPress and try again.<br /><br />Back to <a href="%s">WordPress Admin</a>.', 'wordpress_plugin_requirement'), $args['plugin_name'], $args['wpversion'], admin_url() );
} // end if wordpress version has met first plugin requirement.
// If easy digital downloads is required, we check to see if it is active.
if( in_array( 'edd', $args ) && function_exists( 'is_edd_activated' ) ) {
if( $this->is_edd_activated() ) {
wp_die( sprintf("'%s' ".__('requires <a href="%s" target="_blank">Easy Digital Downloads</a> to be activated in order to work. Please install and activate <a href="%s">Easy Digital Downloads</a> first.', 'wordpress_plugin_requirement'), $args['plugin_name'], 'https://easydigitaldownloads.com' admin_url('plugin-install.php?tab=search&type=term&s=easy+digital+downloads') );
}
}
// If jigoshop is required, we check to see if it is active.
if( in_array( 'jigoshop', $args ) && function_exists( 'is_jigoshop_activated' ) ) {
if( $this->is_jigoshop_activated() ) {
wp_die( sprintf("'%s' ".__('requires <a href="%s" target="_blank">Jigoshop</a> to be activated in order to work. Please install and activate <a href="%s">WooCommerce</a> first.', 'wordpress_plugin_requirement'), $args['plugin_name'], 'http://www.jigoshop.com/' admin_url('plugin-install.php?tab=search&type=term&s=Jigoshop') );
}
}
// If woocommerce is required, we check to see if it is active.
if( in_array( 'woocommerce', $args ) && function_exists( 'is_woocommerce_activated' ) ) {
if( $this->is_woocommerce_activated() ) {
wp_die( sprintf("'%s' ".__('requires <a href="%s" target="_blank">WooCommerce</a> to be activated in order to work. Please install and activate <a href="%s">WooCommerce</a> first.', 'wordpress_plugin_requirement'), $args['plugin_name'], 'http://www.woothemes.com/woocommerce/' admin_url('plugin-install.php?tab=search&type=term&s=WooCommerce') );
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check() {\n\t\tglobal $wp_version;\n\t\t$requirements_met = true;\n\n\t\tif ( version_compare( $wp_version, $this->install_requirements['WordPress Version'], '<' ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_wp_version_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( version_compare( PHP_VERSION, $this->install_requirements['PHP Version'], '<' ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_php_version_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( $this->install_requirements['Multibyte'] && ! $this->check_multibyte_support() ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_mbstring_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( $this->install_requirements['UTF-8'] && ! $this->check_utf8_support() ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_charset_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t}\n\n\t\tif ( ! $requirements_met && is_admin() ) {\n\t\t\t// Load text domain to ensure translated admin notices.\n\t\t\tload_plugin_textdomain( 'wp-typography', false, dirname( $this->local_plugin_path ) . '/translations/' );\n\t\t\t/* add_action( 'admin_init', array( $this, 'deactivate_plugin' ) ); */\n\t\t}\n\n\t\treturn $requirements_met;\n\t}",
"function joe_uah_plugins_check() {\n\n\t// Set constants for active third party plugins\n\tdefine( 'JOE_UAH_MINIORANGE_2_FACTOR', class_exists( 'Miniorange_Authentication' ) );\n\n}",
"public function check_requirements() {\r\n\r\n\t\t// Bail early if plugin meets requirements.\r\n\t\tif ( $this->meets_requirements() ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Add a dashboard notice.\r\n\t\tadd_action( 'all_admin_notices', array( $this, 'requirements_not_met_notice' ) );\r\n\r\n\t\t// Deactivate our plugin.\r\n\t\tadd_action( 'admin_init', array( $this, 'deactivate_me' ) );\r\n\r\n\t\t// Didn't meet the requirements.\r\n\t\treturn false;\r\n\t}",
"function plugin_satisfactionsmiley_check_prerequisites() {\n global $DB;\n\n $version = rtrim(GLPI_VERSION, '-dev');\n if (version_compare($version, '9.5', 'lt')) {\n //echo \"This plugin requires GLPI 9.5\";\n //return false;\n }\n\n if (!isset($_SESSION['glpi_plugins'])) {\n $_SESSION['glpi_plugins'] = [];\n }\n\n if (version_compare(GLPI_VERSION, '9.5-dev', '!=')\n && version_compare(GLPI_VERSION, '9.5', 'lt')\n || version_compare(GLPI_VERSION, '9.6', 'ge')) {\n if (method_exists('Plugin', 'messageIncompatible')) {\n echo Plugin::messageIncompatible('core', '9.5', '9.6');\n } else {\n echo __('Your GLPI version not compatible, require >= 9.5 and < 9.6', 'satisfactionsmiley');\n }\n return false;\n }\n return true;\n}",
"function rtasset_check_plugin_dependecy() {\n\n\tglobal $rtasset_plugin_check;\n\t$rtasset_plugin_check = array(\n\t\t'rtbiz' => array(\n\t\t\t'project_type' => 'all',\n\t\t\t'name' => esc_html__( 'WordPress for Business.', RT_ASSET_TEXT_DOMAIN ),\n\t\t\t'active' => class_exists( 'Rt_Biz' ),\n\t\t\t'filename' => 'index.php',\n\t\t),\n\t);\n\n\t$flag = true;\n\n\tif ( ! class_exists( 'Rt_Biz' ) || ! did_action( 'rt_biz_init' ) ) {\n\t\t$flag = false;\n\t}\n\n\tif ( ! $flag ) {\n\t\tadd_action( 'admin_enqueue_scripts', 'rtasset_plugin_check_enque_js' );\n\t\tadd_action( 'wp_ajax_rtasset_activate_plugin', 'rtasset_activate_plugin_ajax' );\n\t\tadd_action( 'admin_notices', 'rtasset_admin_notice_dependency_not_installed' );\n\t}\n\n\treturn $flag;\n}",
"public function check_requirements() {\n global $wp_version;\n\n $installed_php_version = phpversion();\n $installed_wp_version = $wp_version;\n $required_php_version = '5.2.4';\n $required_wp_version = '3.5.2';\n $installed_php_is_compatible = version_compare( $installed_php_version, $required_php_version, '>=' );\n $installed_wp_is_compatible = version_compare( $installed_wp_version, $required_wp_version, '>=' );\n\n $notices = array();\n $template = __( '<p>LaterPay: Your server <strong>does not</strong> meet the minimum requirement of %s version %s or higher. You are running %s version %s.</p>', 'laterpay' );\n\n // check PHP compatibility\n if ( ! $installed_php_is_compatible ) {\n $notices[] = sprintf( $template, 'PHP', $required_php_version, 'PHP', $installed_php_version );\n }\n\n // check WordPress compatibility\n if ( ! $installed_wp_is_compatible ) {\n $notices[] = sprintf( $template, 'Wordpress', $required_wp_version, 'Wordpress', $installed_wp_version );\n }\n\n // deactivate plugin, if requirements are not fulfilled\n if ( count( $notices ) > 0 ) {\n // suppress 'Plugin activated' notice\n unset( $_GET['activate'] );\n deactivate_plugins( $this->config->plugin_base_name );\n $notices[] = __( 'The LaterPay plugin could not be installed. Please fix the reported issues and try again.', 'laterpay' );\n }\n\n return $notices;\n }",
"function plugin_estimation_check_prerequisites() {\n\n //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.\n $version = preg_replace('/^((\\d+\\.?)+).*$/', '$1', GLPI_VERSION);\n if (version_compare($version, '9.2', '<')) {\n echo \"This plugin requires GLPI >= 9.2\";\n return false;\n }\n return true;\n}",
"private function meets_requirements() {\r\n\r\n\t\t// check PHP version\r\n\t\tif ( version_compare( phpversion(), self::REQUIRED_PHP_VERSION, '<' ) ) {\r\n\t\t\t$notice = wp_sprintf( 'BlockMeister requires PHP %s or higher to run.', self::REQUIRED_PHP_VERSION );\r\n\t\t\t$this->add_admin_error_notice_on_plugins_page( $notice );\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// check WP version\r\n\t\tif ( version_compare( $GLOBALS['wp_version'], self::REQUIRED_WP_VERSION, '<' ) ) {\r\n\t\t\t$notice = wp_sprintf( 'BlockMeister requires WordPress %s or later to run.', self::REQUIRED_WP_VERSION );\r\n\t\t\t$this->add_admin_error_notice_on_plugins_page( $notice );\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"public function check_wp_version_check_exists()\n {\n }",
"function base_requirements_met() {\n\t$wp_version = get_bloginfo( 'version' );\n\n\tif ( version_compare( PHP_VERSION, BASE_REQUIRED_PHP_VERSION, '<' ) ) {\n return false;\n\t}\n\tif ( version_compare( $wp_version, BASE_REQUIRED_WP_VERSION, '<' ) ) {\n return false;\n\t}\n\treturn true;\n}",
"function wp_version_check($extra_stats = array(), $force_check = \\false)\n {\n }",
"public function check_requirements() {\n\t\tif ( ! $this->meets_requirements() ) {\n\n\t\t\t// Add a dashboard notice\n\t\t\tadd_action( 'all_admin_notices', array( $this, 'requirements_not_met_notice' ) );\n\n\t\t\t// Deactivate our plugin\n\t\t\tdeactivate_plugins( $this->basename );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function is_wp_version_compatible($required)\n {\n }",
"public function check_required_plugins(){\n\n\t\tif ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) { ?>\n\n\t\t\t<div id=\"message\" class=\"error\">\n\t\t\t\t<p>BCIT WPD Restrict Purchase expects WooCommerce to be active. This plugin has been deactivated.</p>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\tdeactivate_plugins( '/bcit-wpd-restrict-purchase/bcit-wpd-restrict-purchase.php' );\n\t\t} // if plugin_active WooCommerce\n\n\t}",
"private function is_required_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t$requvired_plugin_list = array(\n\t\t\t'rest-api/plugin.php',\n\t\t\t'butterbean/butterbean.php',\n\t\t);\n\t\tforeach ( $requvired_plugin_list as $plugin ) {\n\t\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function requirements() {\n\t\t/**\n\t\t * If Genesis is not the parent theme, deactivate and show a notice.\n\t\t *\n\t\t * This was taken from https://github.com/copyblogger/genesis-connect-woocommerce/blob/develop/genesis-connect-woocommerce.php.\n\t\t */\n\t\tif ( 'genesis' !== get_option( 'template' ) ) {\n\t\t\tdeactivate_plugins( plugin_basename( __FILE__ ) );\n\t\t\tadd_action( 'admin_notices', function() {\n\t\t\t\t$notice = sprintf( __( 'Sorry, Mai Ads & Extra Content cannot be activated unless you have installed <a href=\"%s\">Genesis</a>', 'mai-ads-extra-content' ), 'http://my.studiopress.com/themes/genesis/' );\n\t\t\t\tprintf( '<div id=\"message\" class=\"error notice\"><p>%s</p></div>', wp_kses_post( $notice ) );\n\t\t\t});\n\t\t}\n\t}",
"public function requirements_met() {\n\n\t\tif ( ! $this->is_php_version_ready() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->is_wp_version_ready() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->is_wp_multisite_ready() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->plugin_compatibility() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// if ( ! $this->required_theme_version() ) {\n\t\t\t// return false;\n\t\t// }\n\n\t\treturn true;\n\t}",
"private static function check_requirements() {\n\t\tglobal $wp_version;\n\t\trequire_once( ABSPATH . '/wp-admin/includes/plugin.php' );\n\n\t\t$errors = array();\n\n\t\tif ( version_compare( PHP_VERSION, WC_POSTFINANCECHECKOUT_REQUIRED_PHP_VERSION, '<' ) ) {\n\t\t\t$errors[] = sprintf( __( \"PHP %1\\$s+ is required. (You're running version %2\\$s)\", 'woo-postfinancecheckout' ), WC_POSTFINANCECHECKOUT_REQUIRED_PHP_VERSION, PHP_VERSION );\n\t\t}\n\t\tif ( version_compare( $wp_version, WC_POSTFINANCECHECKOUT_REQUIRED_WP_VERSION, '<' ) ) {\n\t\t\t$errors[] = sprintf( __( \"Wordpress %1\\$s+ is required. (You're running version %2\\$s)\", 'woo-postfinancecheckout' ), WC_POSTFINANCECHECKOUT_REQUIRED_WP_VERSION, $wp_version );\n\n\t\t}\n\n\t\tif ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {\n\t\t\t/* translators: %s+: version */\n\t\t\t$errors[] = sprintf( __( 'Woocommerce %s+ has to be active.', 'woo-postfinancecheckout' ), WC_POSTFINANCECHECKOUT_REQUIRED_WC_VERSION );\n\t\t} else {\n\t\t\t$woocommerce_data = get_plugin_data( WP_PLUGIN_DIR . '/woocommerce/woocommerce.php', false, false );\n\n\t\t\tif ( version_compare( $woocommerce_data['Version'], WC_POSTFINANCECHECKOUT_REQUIRED_WC_VERSION, '<' ) ) {\n\t\t\t\t$errors[] = sprintf( __( \"Woocommerce %1\\$s+ is required. (You're running version %2\\$s)\", 'woo-postfinancecheckout' ), WC_POSTFINANCECHECKOUT_REQUIRED_WC_VERSION, $woocommerce_data['Version'] );\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t\\PostFinanceCheckout\\Sdk\\Http\\HttpClientFactory::getClient();\n\t\t} catch ( Exception $e ) {\n\t\t\t$errors[] = __( \"Install the PHP cUrl extension or ensure the 'stream_socket_client' function is available.\" );\n\t\t}\n\n\t\tif ( ! empty( $errors ) ) {\n\t\t\t$title = __( 'Could not activate plugin PostFinance Checkout.', 'woo-postfinancecheckout' );\n\t\t\t // phpcs:ignore\n\t\t\t $message = '<h1><strong>' . esc_html_e( $title ) . '</strong></h1><br/>' .\n\t\t\t\t\t'<h3>' . __( 'Please check the following requirements before activating:', 'woo-postfinancecheckout' ) . '</h3>' .\n\t\t\t\t\t'<ul><li>' .\n\t\t\t\t\timplode( '</li><li>', $errors ) .\n\t\t\t\t\t'</li></ul>';\n\t\t // phpcs:ignore\n\t\t\twp_die( esc_html_e( $message ), esc_html_e( $title ), array( 'back_link' => true ) );\n\t\t\treturn;\n\t\t}\n\t}",
"function plugin_requirements_checker()\n{\n static $requirements_checker = null;\n\n if (null === $requirements_checker) {\n require_once plugin_dir_path(__FILE__) . 'includes/RequirementsChecker.php';\n $requirements_conf = apply_filters(\n 'plugin_name_minimum_requirements',\n include_once(plugin_dir_path(__FILE__) . 'app/Config/requirementsConfig.php')\n );\n $requirements_checker = new RequirementsChecker($requirements_conf);\n }\n\n return $requirements_checker;\n}",
"function __requirements(){\n\nglobal $__settings, $error, $software;\n\n\t//If there are some shorfalls then pass it to $error and return false\n\tif(sversion_compare($__settings['ver'], '5.5.2.1', '<')){\n\t\t$error[] = 'You cannot upgrade to '.$software['ver'].' unless you have upgraded to 5.5.2.1';\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\n}",
"function requires_wordpress_version() {\r\n\tglobal $wp_version;\r\n\t$plugin = plugin_basename( __FILE__ );\r\n\t$plugin_data = get_plugin_data( __FILE__, false );\r\n\tif ( version_compare($wp_version, \"3.0\", \"<\" ) ) {\r\n\t\tif( is_plugin_active($plugin) ) {\r\n\t\t\tdeactivate_plugins( $plugin );\r\n\t\t\twp_die( \"'\".$plugin_data['Name'].\"' requires WordPress 3.0 or higher, and has been deactivated! Please upgrade WordPress and try again.<br /><br />Back to <a href='\".admin_url().\"'>WordPress admin</a>.\" );\r\n\t\t}\r\n\t}\n\t // if the ZF plugin is successfully loaded this constant is set to true\n if (defined('WP_ZEND_FRAMEWORK') && constant('WP_ZEND_FRAMEWORK')) {\n return true;\n }\n // you can also check if ZF is available on the system\n $paths = explode(PATH_SEPARATOR, get_include_path());\n foreach ($paths as $path) {\n if (file_exists(\"$path/Zend/Loader.php\")) {\n define('WP_ZEND_FRAMEWORK', true);\n return true;\n }\n }\n // nothing found, you may advice the user to install the ZF plugin\n define('WP_ZEND_FRAMEWORK', false);\r\n}",
"public function check_dependencies() {\n\n $dependencies = [];\n\n /**\n * Sample plugin dependency\n *\n * Depends on ACF plugin active\n */\n// if ( ! class_exists( 'acf' ) ) {\n// $dependencies[] = [\n// 'type' => 'error',\n// 'message' => $this->name . ' ' . __( 'requires ACF PRO plugin activated', 'goapostas' )\n// ];\n// }\n\n /**\n * Depends on ACF plugin active\n */\n if ( false === version_compare( PHP_VERSION, '7.0.0', '>=' ) ) {\n $dependencies[] = [\n 'type' => 'error',\n 'message' => $this->name . ' ' . __( 'requires PHP 7.0.0 or higher. Your PHP version is ' . PHP_VERSION, 'goapostas' )\n ];\n }\n\n if ( ! empty( $dependencies ) ) {\n $this->show_admin_notices( $dependencies );\n\n return false;\n }\n\n return true;\n }",
"function check_capabilities() {\n\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t\t// TODO: Error message\n\t\t}\n\n\t}",
"function IDL_install() {\n\tglobal $wp_version;\n\tif (version_compare($wp_version, \"2.6\", \"<\"))\n\t\tdie(__(\"This Plugin requires WordPress version 2.6 or higher\"));\n}",
"abstract function is_plugin_new_install();",
"function check_environment() {\n if (\n !is_plugin_active('woocommerce/woocommerce.php') and\n current_user_can('activate_plugins')\n ) {\n // Stop activation redirect and show error\n $this->deactivate_plugin();\n wp_die(\n 'Sorry, but this plugin requires the Woocommerce plugin to be installed and active. <br>\n <a href=\"' . admin_url('plugins.php') . '\">« Return to Plugins</a>'\n );\n }\n }",
"function plugin_requirements_checker() {\n\t\tstatic $requirements_checker = null;\n\n\t\tif ( null === $requirements_checker ) {\n\t\t\t$requirements_checker = $this->requirements_met();\n\t\t}\n\n\t\treturn $requirements_checker;\n\t}",
"public function checkRequirements()\n {\n }",
"function GTPress_preInit(){\r\n\tglobal $wp_version;\r\n\tif ( version_compare($wp_version, '3.1', '<') ) {\r\n\t\tdeactivate_plugins( basename(__FILE__) );\r\n\t\twp_die(\"Sorry, this plugin requires WordPress 3.1 or greater!<br>Please update your WordPress install before attempting to re-activate!\");\r\n\t}\r\n\tif ( is_plugin_active('./ozh-admin-drop-down-menu/wp_ozh_adminmenu.php') ) {\r\n\t\tdeactivate_plugins( basename(__FILE__) );\r\n\t\twp_die(\"Sorry, the plugin <a href=\\\"http://wordpress.org/extend/plugins/ozh-admin-drop-down-menu/\\\" alt=\\\"Ozh' Admin Drop Down Menu\\\">Ozh' Admin Drop Down Menu</a> is required!<br>Please install this plugin before attempting to re-activate!\");\r\n\t}\r\n\r\n}",
"function sl_requires_wordpress_version() {\n\tglobal $wp_version;\n\t$plugin = plugin_basename( __FILE__ );\n\t$plugin_data = get_plugin_data( __FILE__, false );\n \n\tif ( version_compare($wp_version, \"3.3\", \"<\" ) ) {\n\t\tif( is_plugin_active($plugin) ) {\n\t\t\tdeactivate_plugins( $plugin );\n\t\t\twp_die( \"'\".$plugin_data['Name'].\"' requires WordPress 3.3 or higher! Deactivating Plugin.<br /><br />Back to <a href='\".admin_url().\"'>WordPress admin</a>.\" );\n\t\t}\n\t}\n}",
"public static function check_dependencies() {\n\t\tif ( ! self::check_php() ) {\n\t\t\tadd_action( 'admin_notices', array( 'WP_Job_Manager_Dependency_Checker', 'add_php_notice' ) );\n\t\t\tadd_action( 'admin_init', array( __CLASS__, 'deactivate_self' ) );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! self::check_wp() ) {\n\t\t\tadd_action( 'admin_notices', array( 'WP_Job_Manager_Dependency_Checker', 'add_wp_notice' ) );\n\t\t\tadd_filter( 'plugin_action_links_' . JOB_MANAGER_PLUGIN_BASENAME, array( 'WP_Job_Manager_Dependency_Checker', 'wp_version_plugin_action_notice' ) );\n\t\t}\n\n\t\treturn true;\n\t}",
"function rtasset_admin_notice_dependency_not_installed() {\n\tif ( ! rtasset_is_plugin_installed( 'rtbiz' ) ) {\n\t\t$path = rtasset_get_path_for_plugin( 'rtbiz' );\n\t\t?>\n\t\t<div class=\"error rtasset-plugin-not-installed-error\">\n\t\t\t<p>\n\t\t\t\t<b><?php _e( 'rtBiz Assets:' ) ?></b> <?php _e( esc_attr( $path ) . ' plugin is not found on this site. Please install & activate it in order to use this plugin.', RT_ASSET_TEXT_DOMAIN ); ?>\n\t\t\t</p>\n\t\t</div>\n\t<?php\n\t} else {\n\t\tif ( rtasset_is_plugin_installed( 'rtbiz' ) && ! rtasset_is_plugin_active( 'rtbiz' ) ) {\n\t\t\t$path = rtasset_get_path_for_plugin( 'rtbiz' );\n\t\t\t$nonce = wp_create_nonce( 'rtasset_activate_plugin_' . $path );\n\t\t\t?>\n\t\t\t<div class=\"error rtasset-plugin-not-installed-error\">\n\t\t\t\t<p><b><?php _e( 'rtBiz Assets:' ) ?></b> <?php _e( 'Click' ) ?>\n\t\t\t\t\t<a href=\"#\" onclick=\"activate_rtasset_plugin('<?php echo esc_attr( $path ); ?>','rtasset_activate_plugin','<?php echo esc_attr( $nonce ); ?>')\">here</a> <?php _e( 'to activate rtBiz.', 'rtbiz' ) ?>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t}\n}",
"private function checkPlugin() {\n\n $check_version = !$this->input->getOption('without-plugin');\n\n if ($check_version) {\n $this->output->writeln(\n '<comment>' . __('Checking plugin version...') . '</comment>',\n OutputInterface::VERBOSITY_VERBOSE\n );\n\n $plugin = new Plugin();\n $plugin->checkPluginState('racks');\n\n if (!$plugin->getFromDBbyDir('racks')) {\n $message = __('Racks plugin is not part of GLPI plugin list. It has never been installed or has been cleaned.')\n . ' '\n . sprintf(\n __('You have to install Racks plugin files in version %s to be able to continue.'),\n self::RACKS_REQUIRED_VERSION\n );\n $this->output->writeln(\n [\n '<error>' . $message . '</error>',\n ],\n OutputInterface::VERBOSITY_QUIET\n );\n return false;\n }\n\n $is_version_ok = '1.8.0' === $plugin->fields['version'];\n if (!$is_version_ok) {\n $message = sprintf(\n __('You have to install Racks plugin files in version %s to be able to continue.'),\n self::RACKS_REQUIRED_VERSION\n );\n $this->output->writeln(\n '<error>' . $message . '</error>',\n OutputInterface::VERBOSITY_QUIET\n );\n return false;\n }\n\n $is_installable = in_array(\n $plugin->fields['state'],\n [\n Plugin::TOBECLEANED, // Can be in this state if check was done without the plugin dir\n Plugin::NOTINSTALLED, // Can be not installed if plugin has been cleaned in plugin list\n Plugin::NOTUPDATED, // Plugin 1.8.0 version has never been installed\n ]\n );\n if ($is_installable) {\n if ($this->input->getOption('update-plugin')) {\n $message = sprintf(\n __('Migrating plugin to %s version...'),\n self::RACKS_REQUIRED_VERSION\n );\n $this->output->writeln(\n '<info>' . $message . '</info>',\n OutputInterface::VERBOSITY_NORMAL\n );\n\n ob_start();\n $plugin->install($plugin->fields['id']);\n ob_end_clean();\n\n // Reload and check migration result\n $plugin->getFromDB($plugin->fields['id']);\n if (!in_array($plugin->fields['state'], [Plugin::TOBECONFIGURED, Plugin::NOTACTIVATED])) {\n $message = sprintf(\n __('Plugin migration to %s version failed.'),\n self::RACKS_REQUIRED_VERSION\n );\n $this->output->writeln(\n '<error>' . $message . '</error>',\n OutputInterface::VERBOSITY_QUIET\n );\n return false;\n }\n } else {\n $message = sprintf(\n __('Racks plugin data has to be updated to %s version. It can be done using the --update-plugin option.'),\n self::RACKS_REQUIRED_VERSION\n );\n $this->output->writeln(\n '<comment>' . $message . '</comment>',\n OutputInterface::VERBOSITY_QUIET\n );\n return false;\n }\n }\n\n $is_state_ok = in_array(\n $plugin->fields['state'],\n [\n Plugin::ACTIVATED, // Should not be possible as 1.8.0 is not compatible with 9.3\n Plugin::TOBECONFIGURED, // Should not be possible as check_config of plugin returns always true\n Plugin::NOTACTIVATED,\n ]\n );\n if (!$is_state_ok) {\n // Should not happens as installation should put plugin in awaited state\n throw new LogicException('Unexpected plugin state.');\n }\n }\n\n $rack_tables = [\n 'glpi_plugin_racks_itemspecifications',\n 'glpi_plugin_racks_others',\n 'glpi_plugin_racks_othermodels',\n 'glpi_plugin_racks_racks',\n 'glpi_plugin_racks_racks_items',\n 'glpi_plugin_racks_rackmodels',\n 'glpi_plugin_racks_racktypes',\n 'glpi_plugin_racks_rackstates',\n 'glpi_plugin_racks_roomlocations',\n ];\n $missing_tables = false;\n foreach ($rack_tables as $table) {\n if (!$this->db->tableExists($table)) {\n $this->output->writeln(\n '<error>' . sprintf(__('Racks plugin table \"%s\" is missing.'), $table) . '</error>',\n OutputInterface::VERBOSITY_QUIET\n );\n $missing_tables = true;\n }\n }\n if ($missing_tables) {\n $this->output->writeln(\n '<error>' . __('Migration cannot be done.') . '</error>',\n OutputInterface::VERBOSITY_QUIET\n );\n return false;\n }\n\n return true;\n }",
"function wp_get_active_and_valid_plugins()\n {\n }",
"function humcore_check_dependencies() {\n\n\tif ( ! in_array( 'curl', get_loaded_extensions() ) ) {\n\t\ttrigger_error( __( 'cURL is not installed on your server. In order to make this plugin work, you need to install cURL on your server.', 'humcore_domain' ), E_USER_ERROR );\n\t}\n\n}",
"private function check_requirements() {\n\n global $wp_version;\n\n $php_min_version = '5.2';\n $wp_min_version = '4.1';\n $php_current_version = phpversion();\n $errors = array();\n\n if ( version_compare( $php_min_version, $php_current_version, '>' ) ) {\n $errors[] = sprintf(\n __( 'Your PHP installation is too old. WordPress Popular Posts requires at least PHP version %1$s to function correctly. Please contact your hosting provider and ask them to upgrade PHP to %1$s or higher.', 'wordpress-popular-posts' ),\n $php_min_version\n );\n }\n\n if ( version_compare( $wp_min_version, $wp_version, '>' ) ) {\n $errors[] = sprintf(\n __( 'Your WordPress version is too old. WordPress Popular Posts requires at least WordPress version %1$s to function correctly. Please update your blog via Dashboard > Update.', 'wordpress-popular-posts' ),\n $wp_min_version\n );\n }\n\n return $errors;\n\n }",
"private function checkRequirements()\n {\n if (!function_exists('mime_content_type') && !function_exists('finfo_file') && version_compare(PHP_VERSION, '5.3.0') < 0){\n add_action('admin_notices', array($this, 'displayFunctionMissingNotice'));\n return TRUE;\n }\n return TRUE;\n }",
"public static function check()\n\t\t{\n\t\t\tif(!($v = get_option(\"ws_plugin__s2member_activated_version\")) || !version_compare($v, WS_PLUGIN__S2MEMBER_VERSION, \">=\"))\n\t\t\t\tc_ws_plugin__s2member_installation::activate(\"version\");\n\n\t\t\telse if(is_multisite() && is_main_site() && (!($mms_v = get_option(\"ws_plugin__s2member_activated_mms_version\")) || !version_compare($mms_v, WS_PLUGIN__S2MEMBER_VERSION, \">=\")))\n\t\t\t\tc_ws_plugin__s2member_installation::activate(\"mms_version\");\n\n\t\t\telse if(!($l = (int)get_option(\"ws_plugin__s2member_activated_levels\")) || $l !== $GLOBALS[\"WS_PLUGIN__\"][\"s2member\"][\"c\"][\"levels\"])\n\t\t\t\tc_ws_plugin__s2member_installation::activate(\"levels\");\n\t\t}",
"public function check() {\n\t\t$license_data = $this->find_license( $this->args );\n\n\t\t// Only report errors.\n\t\tif ( $license_data->status !== 'success' ) {\n\t\t\t$this->results[] = array(\n\t\t\t\t'severity' => $license_data->status,\n\t\t\t\t'message' => $license_data->message,\n\t\t\t);\n\t\t}\n\n\t\t// Check if GPLv2 compatible if no errors found with License Identifier so far.\n\t\tif ( $license_data->status !== 'warning' && ! $this->is_gpl2_or_later_compatible( $license_data ) ) {\n\t\t\t$this->results[] = array(\n\t\t\t\t'severity' => 'warning',\n\t\t\t\t'message' => sprintf(\n\t\t\t\t\t/* translators: %s: the license specified in readme.txt */\n\t\t\t\t\tesc_html__( 'The license specified, %s is not compatible with WordPress\\' license of GPL-2.0-or-later. All themes must meet this requirement!' ),\n\t\t\t\t\t$this->args\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t}",
"function plugin_itilcategorygroups_check_prerequisites() {\n if (version_compare(GLPI_VERSION,'0.85', 'lt')) {\n echo \"This plugin requires GLPI 0.85\";\n return false;\n }\n return true;\n}",
"private function initRequirePlugin(){\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Options Framework', // The plugin name\n\t\t 'slug' => 'options-framework', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WooCommerce', // The plugin name\n\t\t 'slug' => 'woocommerce', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Contact Form 7', // The plugin name\n\t\t 'slug' => 'contact-form-7', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t 'source'\t\t\t\t => get_stylesheet_directory_uri() . '/sub/plugins/contact-form-7.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WPBakery Visual Composer', // The plugin name\n\t\t 'slug' => 'js_composer', // The plugin slug (typically the folder name)\n\t\t 'required' => true,\n\t\t 'source' => get_stylesheet_directory_uri() . '/sub/plugins/js_composer.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Revolution Slider', // The plugin name\n 'slug' => 'revslider', // The plugin slug (typically the folder name)\n 'required' => true, // If false, the plugin is only 'recommended' instead of required\n 'source' => get_stylesheet_directory_uri() . '/sub/plugins/revslider.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Wishlist', // The plugin name\n 'slug' => 'yith-woocommerce-wishlist', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH Woocommerce Compare', // The plugin name\n 'slug' => 'yith-woocommerce-compare', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Zoom Magnifier', // The plugin name\n\t\t 'slug' => 'yith-woocommerce-zoom-magnifier', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'MailChimp', // The plugin name\n\t\t 'slug' => 'mailchimp-for-wp', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\t}",
"abstract function is_plugin();",
"public function addRequirementsChecking() {\n global $wp_version;\n\n $installed_php_version = phpversion();\n $installed_wp_version = $wp_version;\n $required_php_version = '5.2.4';\n $required_wp_version = '3.3';\n $installed_php_is_compatible = version_compare($installed_php_version, $required_php_version, '>=');\n $installed_wp_is_compatible = version_compare($installed_wp_version, $required_wp_version, '>=');\n\n $notices = array();\n $template = __('<p>LaterPay: Your server <strong>does not</strong> meet the minimum requirement of %s version %s or higher. You are running %s version %s.</p>', 'laterpay');\n if ( !$installed_php_is_compatible ) {\n $notices[] = sprintf($template, 'PHP', $required_php_version, 'PHP', $installed_php_version);\n }\n if ( !$installed_wp_is_compatible ) {\n $notices[] = sprintf($template, 'Wordpress', $required_wp_version, 'Wordpress', $installed_wp_version);\n }\n\n if ( count($notices) > 0 ) {\n $out = join('\\n', $notices);\n echo '<div class=\"error\">' . $out . '</div>';\n }\n }",
"function validate_plugin_accessibility(){\n\n $final_response=new stdClass();\n if( $GLOBALS['glbstg_plugenabled']==0 or $GLOBALS['glbstg_plugenabled']==\"0\" or $GLOBALS['glbstg_plugenabled']==\"\"){\n\n $final_response->response_notice=\"X5GON plugin is not enabled. Check with admin.\";\n }else{\n $final_response->response_notice=1;\n }\n\n return $final_response;\n }",
"function cj_authorship_check()\n{\n if (get_site_option(CJ_AUTHORSHIP_VERSION_OPTION) != \\CJ_Authorship\\CJ_Authorship_Handler::VERSION) {\n cj_authorship_install();\n }\n}",
"function is_wpmu_sitewide_plugin($file)\n {\n }",
"function sfc_publish_activation_check(){\r\n\tif (function_exists('sfc_version')) {\r\n\t\tif (version_compare(sfc_version(), '0.4', '>=')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tdeactivate_plugins(basename(__FILE__)); // Deactivate ourself\r\n\twp_die(\"The base SFC plugin must be activated before this plugin will run.\");\r\n}",
"public function check_version() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tif ( is_plugin_active( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) ) ) {\n\t\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice' ) );\n\t\t\t\tif ( isset( $_GET['activate'] ) ) {\n\t\t\t\t\tunset( $_GET['activate'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\tdeactivate_plugins( 'woocommerce-tm-custom-price-fields/tm-woo-custom-prices.php' );\n\t\t\tadd_action( 'admin_notices', array( $this, 'deprecated_notice' ) );\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\tadd_action( 'admin_notices', array( $this, 'disabled_notice_woocommerce_check' ) );\n\t\t}\n\n\t}",
"public function test_wp_version_check_attached()\n {\n }",
"private function is_wp_version_ready() {\n\t\tglobal $wp_version;\n\n\t\tif ( ! version_compare( $this->min_wp_version, $wp_version, '>=' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->add_error_notice(\n\t\t\t'WordPress ' . $this->min_wp_version . '+ is required',\n\t\t\t'You\\'re running version ' . $wp_version\n\t\t);\n\n\t\treturn false;\n\t}",
"function plugin_satisfactionsmiley_check_config() {\n return true;\n}",
"function wpd_load_3rd_plugins() {\n // Check to see if your plugin has already been loaded. This can be done in several\n\t// ways - here are a few examples:\n\t//\n\t// Check for a class:\n\t//\tif (!class_exists('MyPluginClass')) {\n\t//\n\t// Check for a function:\n\t//\tif (!function_exists('my_plugin_function_name')) {\n\t//\n\t// Check for a constant:\n\t//\tif (!defined('MY_PLUGIN_CONSTANT')) {\n\n\n /*if (!class_exists('PluginClassName')) {\n include_once(TEMPLATEPATH.'plugins/my-plugin/my-plugin.php');\n }*/\n \n}",
"function ayecode_show_update_plugin_requirement() {\n if ( !defined( 'WP_EASY_UPDATES_ACTIVE' ) ) {\n ?>\n <div class=\"notice notice-warning is-dismissible\">\n <p>\n <strong>\n <?php\n echo sprintf( __( 'The plugin %sWP Easy Updates%s is required to check for and update some installed plugins/themes, please install it now.', 'geodirectory' ), '<a href=\"https://wpeasyupdates.com/\" target=\"_blank\" title=\"WP Easy Updates\">', '</a>' );\n ?>\n </strong>\n </p>\n </div>\n <?php\n }\n }",
"public function checkRequirements()\n\t{\n\t\t$tests = array('result' => true);\n\t\t$tests['curl'] = array('name' => $this->l('PHP cURL extension must be enabled on your server'), 'result' => extension_loaded('curl'));\n\t\t$tests['mbstring'] = array('name' => $this->l('PHP Multibyte String extension must be enabled on your server'), 'result' => extension_loaded('mbstring'));\n\t\tif (Configuration::get('STRIPE_MODE'))\n\t\t\t$tests['ssl'] = array('name' => $this->l('SSL must be enabled on your store (before entering Live mode)'), 'result' => Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) && Tools::strtolower($_SERVER['HTTPS']) != 'off'));\n\t\t$tests['php52'] = array('name' => $this->l('Your server must run PHP 5.3.3 or greater'), 'result' => version_compare(PHP_VERSION, '5.3.3', '>='));\n\t\t$tests['configuration'] = array('name' => $this->l('You must sign-up for Stripe and configure your account settings in the module (publishable key, secret key...etc.)'), 'result' => $this->checkSettings());\n\n\t\tif (_PS_VERSION_ < 1.5)\n\t\t{\n\t\t\t$tests['backward'] = array('name' => $this->l('You are using the backward compatibility module'), 'result' => $this->backward, 'resolution' => $this->backward_error);\n\t\t\t$tmp = Module::getInstanceByName('mobile_theme');\n\t\t\tif ($tmp && isset($tmp->version) && !version_compare($tmp->version, '0.3.8', '>='))\n\t\t\t\t$tests['mobile_version'] = array('name' => $this->l('You are currently using the default mobile template, the minimum version required is v0.3.8').' (v'.$tmp->version.' '.$this->l('detected').' - <a target=\"_blank\" href=\"http://addons.prestashop.com/en/mobile-iphone/6165-prestashop-mobile-template.html\">'.$this->l('Please Upgrade').'</a>)', 'result' => version_compare($tmp->version, '0.3.8', '>='));\n\t\t}\n\n\t\tforeach ($tests as $k => $test)\n\t\t\tif ($k != 'result' && !$test['result'])\n\t\t\t\t$tests['result'] = false;\n\n\t\treturn $tests;\n\t}",
"public static function check_requirements() {\r\n\t\t\r\n\t\t// Check if permalinks are default (none). PW needs pretty permalinks of any sort\r\n\t\t\r\n\t\t$required = array();\r\n\t\t\r\n\t\tif ( get_option('permalink_structure') == '' ) {\r\n\t\t\t\r\n\t\t\t// Empty string - pretty permalinks are not enabled. This requirement fails\r\n\t\t\t\r\n\t\t\t$required[] = 'pretty_permalinks_are_required';\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $required;\r\n\t\t\r\n\t}",
"private static function check_wp() {\n\t\tglobal $wp_version;\n\n\t\treturn version_compare( $wp_version, self::MINIMUM_WP_VERSION, '>=' );\n\t}",
"static function plugins_loaded() {\n\n if ( !function_exists( 'is_plugin_active' ) ) {\n require_once ABSPATH . '/wp-admin/includes/plugin.php';\n }\n\n // check if MetaBox plugin is loaded\n if ( class_exists('RWMB_Loader')) {\n define( 'WPBUCKET_META_BOX', true );\n } else {\n define( 'WPBUCKET_META_BOX', false );\n }\n }",
"public function check( $wp = '3.5', $php = '5.3' ) {\n\n\t $compatibility_check = get_option( $this->options_prefix . 'compatibility_check' );\n\n\t if ( ! $compatibility_check || 1 != $compatibility_check ) {\n global $wp_version;\n\n if ( version_compare( PHP_VERSION, $php, '<' ) ) {\n $flag = 'PHP';\n } elseif ( version_compare( $wp_version, $wp, '<' ) ) {\n $flag = 'WordPress';\n } else {\n add_option( $this->options_prefix . 'compatibility_check', 1 );\n return;\n }\n\n $version = 'PHP' == $flag ? $php : $wp;\n\n $path = basename( dirname( __DIR__ ) ) . '/' . $this->plugin_name . '.php';\n\n deactivate_plugins( $path );\n\n wp_die(\n '<p><strong>Mihdan: No External Links</strong> ' .\n __('requires', $this->plugin_name) . ' ' .\n $flag . ' '. $version . ' ' .\n __('or greater', $this->plugin_name),\n __( 'Plugin Activation Error', $this->plugin_name ),\n array( 'response' => 200, 'back_link' => true )\n );\n }\n\n\t}",
"function plugin_depends($plugin_name)\n\t{\n\t\tif (!is_plugin_enabled($plugin_name))\n\t\t\tthrow new PluginException(sprintf(_echo('plugins:exception:missingplugin'), $plugin_name)); \n\t\t\t\n\t\treturn true;\n\t}",
"public function validate () {\n\t\treturn file_exists($this->pluginFile);\n\t}",
"public static function activation_check() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\twp_die( sprintf( esc_html__( 'WooCommerce TM Extra Product Options requires WordPress %s or later.', 'woocommerce-tm-extra-product-options' ), THEMECOMPLETE_EPO_WP_VERSION ) );\n\t\t}\n\n\t}",
"function park_register_required_plugins() {\n\n $plugins = array(\n\n // This is an example of how to include a plugin from an arbitrary external source in your theme.\n\n\n\n array(\n\n 'name' => esc_html('CocoBasic - Park WP'), // The plugin name.\n\n 'slug' => 'cocobasic-shortcode', // The plugin slug (typically the folder name).\n\n 'source' => 'http://demo.cocobasic.com/plugins/park-wp/cocobasic-shortcode.zip', // The plugin source.\n\n 'required' => true, // If false, the plugin is only 'recommended' instead of required. \n\n 'version' => '1.0',\n\n ),\n\n array(\n\n 'name' => esc_html('Contact Form 7'),\n\n 'slug' => 'contact-form-7',\n\n 'required' => true // If false, the plugin is only 'recommended' instead of required. \n\n )\n\n );\n\n\n\n /*\n\n * Array of configuration settings. Amend each line as needed.\n\n *\n\n * TGMPA will start providing localized text strings soon. If you already have translations of our standard\n\n * strings available, please help us make TGMPA even better by giving us access to these translations or by\n\n * sending in a pull-request with .po file(s) with the translations.\n\n *\n\n * Only uncomment the strings in the config array if you want to customize the strings.\n\n */\n\n $config = array(\n\n 'id' => 'park-wp', // Unique ID for hashing notices for multiple instances of TGMPA.\n\n 'default_path' => '', // Default absolute path to bundled plugins.\n\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\n\n 'has_notices' => true, // Show admin notices or not.\n\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\n\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\n\n 'message' => '', // Message to output right before the plugins table. \n\n );\n\n\n\n tgmpa($plugins, $config);\n\n }",
"public static function prerequisites( $wp_version = null ) {;\n\t\t\t$pass = TRUE;\n\t\t\t$pass = $pass && class_exists('TribeEvents');\n\t\t\t$pass = $pass && version_compare( is_null($wp_version) ? get_bloginfo('version') : $wp_version, self::MIN_WP_VERSION, '>=');\n\t\t\treturn $pass;\n\t\t}",
"function wpdc_check_active(){ \r\n\r\n // plugin is ok\r\n // do the actions and filters\r\n\t\t\tadd_action( 'admin_menu',\t'wpdc_my_add_plugin_admin_page'); // the function to show the plugin settings page\r\n }",
"public function check_minimum_requirements() {\n\t\t$meets_requirements = true;\n\t\t$errors = array();\n\n\t\tif ( ! GFCommon::has_akismet() ) {\n\t\t\t$meets_requirements = false;\n\t\t\t$errors[] = esc_html__( 'The Akismet plugin is either inactive or not installed.', 'gravityformsakismet' );\n\t\t}\n\n\t\tif ( ! $this->is_enabled_global() ) {\n\t\t\t$meets_requirements = false;\n\t\t\t$errors[] = esc_html__( 'To use this add-on, please visit the Forms -> Settings page to enable Akismet integration', 'gravityformsakismet' );\n\t\t}\n\n\t\treturn $meets_requirements\n\t\t\t? array( 'meets_requirements' => true )\n\t\t\t: array(\n\t\t\t\t'meets_requirements' => false,\n\t\t\t\t'errors' => $errors,\n\t\t\t);\n\t}",
"function is_allowed_to_install() {\n\t\t\treturn ( $this->is_premium() || ! $this->is_org_repo_compliant() );\n\t\t}",
"public function test_requirements()\n\t{\n\t\t// Look for ACF\n\t\tif ( ! class_exists('acf') && ! class_exists('Acf') ) { return false; }\n\t\treturn true;\n\t}",
"public function checkPHPVersion() {\r\n if ( version_compare(PHP_VERSION, self::MIN_PHP_VERSION, '<') ) {\r\n wp_die( sprintf( __('<p>PHP %s+ is required to use <b>%s</b> plugin. You have %s installed.</p>', 'instant-cryptocurrency-exchange'), self::MIN_PHP_VERSION, self::PLUGIN_NAME, PHP_VERSION ), 'Plugin Activation Error', ['response' => 200, 'back_link' => TRUE] );\r\n }\r\n }",
"function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}",
"function wp_check_site_meta_support_prefilter($check)\n {\n }",
"public function pluginCheck()\n {\n $installer = new NodeDependencyInstaller();\n\n $error = '';\n try {\n Helper::checkDirectoriesWriteable(['Audits', 'node_modules']);\n\n $installer->checkInternetAvailability();\n $installer->checkNpm();\n $installer->checkNpmDependencies();\n } catch (Exception $exception) {\n $error = $exception->getMessage();\n }\n\n return $this->renderTemplate('pluginCheck', [\n 'checkStartUrl' => (new Menu())->getUrlForAction('pluginCheckStart'),\n 'error' => $error\n ]);\n }",
"function wmp_notice() {\n global $current_screen;\n if ( $current_screen->parent_base == 'plugins' ) {\n echo '<div class=\"error\"><p>'.__( 'The <strong>WooCommerce Sales by Marketplace</strong> plugin requires the <a href=\"http://wordpress.org/plugins/woocommerce\" target=\"_blank\">WooCommerce</a> plugin to be activated in order to work. Please <a href=\"'.admin_url( 'plugin-install.php?tab=search&type=term&s=WooCommerce' ).'\" target=\"_blank\">install WooCommerce</a> or <a href=\"'.admin_url( 'plugins.php' ).'\">activate</a> first.' ).'</p></div>';\n }\n }",
"function required_theme_version(){\n\n\t\tif ( get_template_directory() !== get_stylesheet_directory() ) {\n\t\t\t$theme = wp_get_theme( 'xstore' );\n\t\t} else {\n\t\t\t$theme = wp_get_theme();\n\t\t}\n\n\t\tif ( $theme->name == ('XStore') && version_compare( $theme->version, ET_CORE_THEME_MIN_VERSION, '<' ) ) {\n\t\t\t$this->add_error_notice(\n\t\t\t\t__( 'XStore Core plugin requires the following theme: XStore '. ET_CORE_THEME_MIN_VERSION .' or higher.', 'xstore-core' ),\n\t\t\t\t''\n\t\t\t);\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function wp_not_installed()\n {\n }",
"function is_uninstallable_plugin($plugin)\n {\n }",
"function um_recaptcha_dependencies() {\r\n echo '<div class=\"error\"><p>' . sprintf( __( 'The <strong>%s</strong> extension requires the Ultimate Member plugin to be activated to work properly. You can download it <a href=\"https://wordpress.org/plugins/ultimate-member\">here</a>', 'um-recaptcha' ), um_recaptcha_extension ) . '</p></div>';\r\n }",
"function can_download_plugin() {\n\t\tif( SS_Envato_API()->user->is_staff() ) return true;\n\n\t\t$current_user = wp_get_current_user(); \n\n\t\t$tf_codes = get_user_tf_codes( $current_user->ID );\n\t\t$site_codes = get_on_site_licenses( $current_user->ID );\n\n\t \t$plugins_codes = explode(',', etheme_get_custom_field('tf_themes'));\n\t \t$for_themes = explode(',', etheme_get_custom_field('et_themes'));\n\n\t \t$intersection = array_intersect($tf_codes, $plugins_codes);\n\t \t$intersection2 = array_intersect($site_codes, $for_themes);\n\n\t \tif(count($intersection) > 0 || count($intersection2) > 0 || et_is_staff()) {\n\t \t\treturn true;\n\t \t}\n\n\t \treturn false;\n\n\t}",
"function um_recaptcha_dependencies() {\r\n echo '<div class=\"error\"><p>' . sprintf( __( 'The <strong>%s</strong> extension requires the Ultimate Member plugin to be activated to work properly. You can download it <a href=\"https://wordpress.org/plugins/ultimate-member\">here</a>', 'um-recaptcha' ), um_recaptcha_extension ) . '</p></div>';\r\n }",
"function cs_register_required_plugins() {\n\n\t/**\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' => __( 'Posts 2 Posts', 'social-coup' ),\n\t\t\t'slug' => 'posts-to-posts',\n\t\t\t'required' => true,\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Event Manager Theme Functionality', 'social-coup' ),\n\t\t\t'slug' => 'event-manager-theme-functionality',\n\t\t\t'required' => true,\n\t\t)\n\t);\n\n\t/** Theme text domain, used for internationalising strings */\n\t$theme_text_domain = 'social-coup';\n\n\t/**\n\t * Array of configuration settings. \n\t */\n\t$config = array(\n\t\t'domain' => $theme_text_domain, // Text domain - likely want to be the same as your theme. */\n\t\t/*'default_path' => '', // Default absolute path to pre-packaged plugins */\n\t\t/*'menu' => 'install-required-plugins', // Menu slug */\n\t\t'notices' => true, // Show admin notices or not */\n\t\t'strings' => array(\n\t\t\t'page_title' \t\t\t\t=> __( 'Install Required Plugins', $theme_text_domain ), // */\n\t\t\t'menu_title' \t\t\t\t=> __( 'Install Plugins', $theme_text_domain ), // */\n\t\t\t'instructions_install' \t\t\t\t=> __( 'The %1$s plugin is required for this theme. Click on the big blue button below to install and activate %1$s.', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t'instructions_install_recommended'\t=> __( 'The %1$s plugin is recommended for this theme. Click on the big blue button below to install and activate %1$s.', $theme_text_domain ), // %1$s = plugin name, %2$s = plugins page URL */\n\t\t\t'instructions_activate' \t\t\t\t=> __( 'The %1$s plugin is installed but currently inactive. Please go to the <a href=\"%2$s\">plugin administration page</a> page to activate it.', $theme_text_domain ), // %1$s = plugin name, %2$s = plugins page URL */\n\t\t\t'button' \t\t\t\t=> __( 'Install %s Now', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t'installing' \t\t\t\t=> __( 'Installing Plugin: %s', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t'oops' \t\t\t\t=> __( 'Something went wrong with the plugin API.', $theme_text_domain ), // */\n\t\t\t'notice_can_install_required' \t=> __( 'This theme requires the following plugins: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t'notice_can_install_recommended'\t\t=> __( 'This theme recommends the following plugins: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t'notice_cannot_install' \t\t\t\t=> __( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t'notice_can_activate_required' \t=> __( 'The following required plugins are currently inactive: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t'notice_can_activate_recommended'\t\t=> __( 'The following recommended plugins are currently inactive: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t'notice_cannot_activate' \t\t\t\t=> __( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t'return' \t\t\t\t=> __( 'Return to Required Plugins Installer', $theme_text_domain ), // */\n\t\t\t'plugin_activated' \t \t\t\t\t=> __( 'Plugin activated successfully.', $theme_text_domain ) // */\n\t\t)\n\t);\n\n\ttgmpa( $plugins, $config );\n\n}",
"static function has_required_plugins( $plugins = array('H', 'Timber') ) {\n $is_all_installed = true;\n\n // if any of the plugins doesn't exist, break the loop\n if( is_array( $plugins ) ) {\n foreach( $plugins as $p ) {\n $is_all_installed = class_exists( $p );\n if( !$is_all_installed ) { break; }\n }\n } else {\n $is_all_installed = class_exists( $plugins );\n }\n\n // show error message if all not installed AND it's admin page\n $is_admin_page = is_admin() && current_user_can('install_plugins');\n if( !$is_all_installed && $is_admin_page ) {\n add_action('admin_notices', function() {\n $text = sprintf(\n __('You need to activate WP Edje and Timber. <a href=\"%s\">Activate now »</a>.', 'my'),\n admin_url('plugins.php')\n );\n echo '<div class=\"notice notice-error\"><p>' . $text . '</p></div>';\n });\n }\n return $is_all_installed;\n }",
"function ninja_forms_three_addons_version_check(){\n// $items = wp_remote_retrieve_body( $items );\n $items = file_get_contents( dirname( __FILE__ ) . '/addons-feed.json' );\n $items = json_decode( $items, true );\n\n if( is_array( $items ) ) {\n foreach ($items as $item) {\n\n if (empty($item['plugin'])) continue;\n if (!file_exists(WP_PLUGIN_DIR . '/' . $item['plugin'])) continue;\n\n $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $item['plugin'], false, true);\n\n if (!$plugin_data['Version']) continue;\n if (version_compare($plugin_data['Version'], '3', '>=')) continue;\n\n /*\n * There are non-compatible add-ons installed.\n */\n\n return FALSE;\n }\n }\n\n return TRUE;\n}",
"function lambert_register_required_plugins() {\n /*\n * Array of plugin arrays. Required keys are name and slug.\n * If the source is NOT from the .org repo, then source is also required.\n */\n $plugins = array(\n\n array('name' => esc_html__('WPBakery Page Builder','lambert'),\n // The plugin name.\n 'slug' => 'js_composer',\n // The plugin slug (typically the folder name).\n 'source' => 'http://assets.cththemes.com/plugins/js_composer.zip',\n // The plugin source.\n 'required' => true,\n 'external_url' => esc_url(lambert_relative_protocol_url().'://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => '',\n 'class_to_check' => 'Vc_Manager'\n ), \n\n array(\n 'name' => esc_html__('WooCommerce','lambert'),\n // The plugin name.\n 'slug' => 'woocommerce',\n // The plugin slug (typically the folder name).\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/woocommerce/' ), \n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => '',\n 'class_to_check' => 'WooCommerce'\n ), \n\n array('name' => esc_html__('Redux Framework','lambert'),\n // The plugin name.\n 'slug' => 'redux-framework',\n // The plugin source.\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/redux-framework/' ),\n // If set, overrides default API URL and points to an external URL.\n 'function_to_check' => '',\n 'class_to_check' => 'ReduxFramework'\n ), \n\n array(\n 'name' => esc_html__('Contact Form 7','lambert'),\n // The plugin name.\n 'slug' => 'contact-form-7',\n // The plugin slug (typically the folder name).\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/contact-form-7/' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'wpcf7',\n 'class_to_check' => 'WPCF7'\n ), \n\n\n array(\n 'name' => esc_html__('CMB2','lambert'),\n // The plugin name.\n 'slug' => 'cmb2',\n // The plugin slug (typically the folder name).\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/support/plugin/cmb2'),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'cmb2_bootstrap',\n 'class_to_check' => 'CMB2_Base'\n ),\n \n\n array(\n 'name' => esc_html__('Lambert Add-ons','lambert' ),\n // The plugin name.\n 'slug' => 'lambert-add-ons',\n // The plugin slug (typically the folder name).\n 'source' => 'lambert-add-ons.zip',\n // The plugin source.\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n\n 'force_deactivation' => true,\n\n 'function_to_check' => '',\n 'class_to_check' => 'Lambert_Addons'\n ), \n\n array(\n 'name' => esc_html__('Loco Translate','lambert'),\n // The plugin name.\n 'slug' => 'loco-translate',\n // The plugin slug (typically the folder name).\n 'required' => false,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/loco-translate/'),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'loco_autoload',\n 'class_to_check' => 'Loco_Locale'\n ),\n\n \n array(\n 'name' => esc_html__('Envato Market','lambert' ),\n // The plugin name.\n 'slug' => 'envato-market',\n // The plugin slug (typically the folder name).\n 'source' => esc_url(lambert_relative_protocol_url().'://envato.github.io/wp-envato-market/dist/envato-market.zip' ),\n // The plugin source.\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url('//envato.github.io/wp-envato-market/' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'envato_market',\n 'class_to_check' => 'Envato_Market'\n ),\n\n array('name' => esc_html__('One Click Demo Import','lambert'),\n // The plugin name.\n 'slug' => 'one-click-demo-import',\n // The plugin slug (typically the folder name).\n 'required' => false,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/one-click-demo-import/'),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => '',\n 'class_to_check' => 'OCDI_Plugin'\n ),\n\n array('name' => esc_html__('Regenerate Thumbnails','lambert'),\n // The plugin name.\n 'slug' => 'regenerate-thumbnails',\n // The plugin slug (typically the folder name).\n 'required' => false,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/regenerate-thumbnails/' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'RegenerateThumbnails',\n 'class_to_check' => 'RegenerateThumbnails'\n ),\n\n \n\n\n );\n\n /*\n * Array of configuration settings. Amend each line as needed.\n *\n * TGMPA will start providing localized text strings soon. If you already have translations of our standard\n * strings available, please help us make TGMPA even better by giving us access to these translations or by\n * sending in a pull-request with .po file(s) with the translations.\n *\n * Only uncomment the strings in the config array if you want to customize the strings.\n */\n $config = array(\n 'id' => 'lambert', // Unique ID for hashing notices for multiple instances of TGMPA.\n 'default_path' => get_template_directory() . '/lib/plugins/', // Default absolute path to bundled plugins.\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\n 'has_notices' => true, // Show admin notices or not.\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\n 'message' => '', // Message to output right before the plugins table.\n\n \n );\n\n tgmpa( $plugins, $config );\n}",
"public static function theme_has_support()\n {\n }",
"public function requirements_notice() {\n\n\t\tif ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, $this->min_genesis_version, '>=' ) ) {\n\n\t\t\t$plugin = get_plugin_data( $this->plugin_dir_path . 'includes/class-genesis-simple-hooks.php' );\n\n\t\t\t$action = defined( 'PARENT_THEME_VERSION' ) ? __( 'upgrade to', 'plugin-boilerplate' ) : __( 'install and activate', 'plugin-boilerplate' );\n\n\t\t\t// Translators: String 1 is the name of the plugin, String 2 is the minimum required version of WordPress, String 3 is a url, String 4 is the minimum required version of Genesis, and String 5 is an expected action.\n\t\t\t$message = sprintf( __( '%1$s requires WordPress %2$s and <a href=\"%3$s\" target=\"_blank\">Genesis %4$s</a>, or greater. Please %5$s the latest version of Genesis to use this plugin.', 'plugin-boilerplate' ), $plugin['Name'], $this->min_wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $this->min_genesis_version, $action );\n\t\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- html in $message required for hyperlinks\n\t\t\techo '<div class=\"notice notice-warning\"><p>' . $message . '</p></div>';\n\n\t\t}\n\n\t}",
"public function check_capabilities() {\n\n add_action('admin_init', array( $this, 'init' ) );\n\n // Make sure user can edit theme options\n if ( ! current_user_can('edit_theme_options') ) {\n return;\n }\n\n // Add the menu item\n add_action('admin_menu', array( $this, 'create_menu' ) );\n\n // Load required asstes\n add_action('admin_enqueue_scripts', array( $this, 'load_assets' ) );\n\n }",
"function requires_wordpress_version() {\r\n\tglobal $wp_version;\r\n\t$plugin = plugin_basename( __FILE__ );\r\n\t$plugin_data = get_plugin_data( __FILE__, false );\r\n\r\n\tif ( version_compare($wp_version, \"2.7\", \"<\" ) ) {\r\n\t\tif( is_plugin_active($plugin) ) {\r\n\t\t\tdeactivate_plugins( $plugin );\r\n\t\t\twp_die( \"'\".$plugin_data['Name'].\"' requires WordPress 2.7 or higher, and has been deactivated! Please upgrade WordPress and try again.<br /><br />Back to <a href='\".admin_url().\"'>WordPress admin</a>.\" );\r\n\t\t}\r\n\t}\r\n}",
"function control_register_required_plugins() {\n\n\t$plugins = array(\n\n\t\tarray(\n\t\t\t'name' \t\t=> 'NerveTask',\n\t\t\t'slug' \t\t=> 'nervetask',\n\t\t\t'required' \t=> true,\n\t\t),\n\n\t);\n\n\t// Change this to your theme text domain, used for internationalising strings\n\t$theme_text_domain = 'control';\n\n\t/**\n\t * Array of configuration settings. Amend each line as needed.\n\t * If you want the default strings to be available under your own theme domain,\n\t * leave the strings uncommented.\n\t * Some of the strings are added into a sprintf, so see the comments at the\n\t * end of each line for what each argument will be.\n\t */\n\t$config = array(\n\t\t'domain' \t\t=> $theme_text_domain, \t// Text domain - likely want to be the same as your theme.\n\t\t'default_path' \t\t=> '', \t// Default absolute path to pre-packaged plugins\n\t\t'parent_menu_slug' \t=> 'themes.php', \t\t\t\t// Default parent menu slug\n\t\t'parent_url_slug' \t=> 'themes.php', \t\t\t\t// Default parent URL slug\n\t\t'menu' \t\t=> 'install-required-plugins', \t// Menu slug\n\t\t'has_notices' \t=> true, \t// Show admin notices or not\n\t\t'is_automatic' \t=> false,\t\t\t\t\t \t// Automatically activate plugins after installation or not\n\t\t'message' \t\t\t=> '',\t\t\t\t\t\t\t// Message to output right before the plugins table\n\t\t'strings' \t\t=> array(\n\t\t\t'page_title' \t\t\t=> __( 'Install Required Plugins', $theme_text_domain ),\n\t\t\t'menu_title' \t\t\t=> __( 'Install Plugins', $theme_text_domain ),\n\t\t\t'installing' \t\t\t=> __( 'Installing Plugin: %s', $theme_text_domain ), // %1$s = plugin name\n\t\t\t'oops' \t\t\t=> __( 'Something went wrong with the plugin API.', $theme_text_domain ),\n\t\t\t'notice_can_install_required' \t\t\t=> _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_install_recommended'\t\t\t=> _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_install' \t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_required' \t\t\t=> _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_recommended'\t\t\t=> _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_activate' \t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)\n\t\t\t'notice_ask_to_update' \t\t\t\t\t\t=> _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_update' \t\t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)\n\t\t\t'install_link' \t\t\t\t\t \t\t\t=> _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),\n\t\t\t'activate_link' \t\t\t\t \t\t\t=> _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),\n\t\t\t'return' \t\t\t=> __( 'Return to Required Plugins Installer', $theme_text_domain ),\n\t\t\t'plugin_activated' \t\t\t=> __( 'Plugin activated successfully.', $theme_text_domain ),\n\t\t\t'complete' \t\t\t\t\t\t\t\t\t=> __( 'All plugins installed and activated successfully. %s', $theme_text_domain ), // %1$s = dashboard link\n\t\t\t'nag_type'\t\t\t\t\t\t\t\t\t=> 'updated' // Determines admin notice type - can only be 'updated' or 'error'\n\t\t)\n\t);\n\n\ttgmpa( $plugins, $config );\n\n}",
"private function scan_allowed() {\n\t\treturn $this->as3cf->is_plugin_enabled();\n\t}",
"public static function is_needed() {\n\t\treturn is_admin() || wp_doing_cron();\n\t}",
"function _init_plugin() {\n\t\tglobal $db, $apcms;\n\t\t\n\t\treturn true;\n\t}",
"function chocorocco_mailchimp_tgmpa_required_plugins($list=array()) {\n\t\tif (in_array('mailchimp-for-wp', chocorocco_storage_get('required_plugins')))\n\t\t\t$list[] = array(\n\t\t\t\t'name' \t\t=> esc_html__('MailChimp for WP', 'chocorocco'),\n\t\t\t\t'slug' \t\t=> 'mailchimp-for-wp',\n\t\t\t\t'required' \t=> false\n\t\t\t);\n\t\treturn $list;\n\t}",
"function howes_register_required_plugins(){\n\t\n\t/**\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'Revolution Slider', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'revslider', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/revslider.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '5.4.7.4', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'WPBakery Visual Composer', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'js_composer', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/js_composer.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '5.4.7', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'CF Post Formats', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'cf-post-formats', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/cf-post-formats.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'Envato Market', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'envato-market', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/envato-market.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Breadcrumb NavXT',\n\t\t\t'slug' => 'breadcrumb-navxt',\n\t\t\t'required' => true,\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Contact Form 7',\n\t\t\t'slug' => 'contact-form-7',\n\t\t\t'required' => true,\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Max Mega Menu',\n\t\t\t'slug' => 'megamenu',\n\t\t\t'required' => false,\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Easy Pricing Tables Lite by Fatcat Apps',\n\t\t\t'slug' => 'easy-pricing-tables',\n\t\t\t'required' => false,\n\t\t),\n\t);\n\n\t// Change this to your theme text domain, used for internationalising strings\n\t//$theme_text_domain = 'howes';\n\n\t/**\n\t * Array of configuration settings. Amend each line as needed.\n\t * If you want the default strings to be available under your own theme domain,\n\t * leave the strings uncommented.\n\t * Some of the strings are added into a sprintf, so see the comments at the\n\t * end of each line for what each argument will be.\n\t */\n\t$config = array(\n\t\t'domain' \t\t=> 'howes', \t// Text domain - likely want to be the same as your theme.\n\t\t'default_path' \t\t=> '', \t// Default absolute path to pre-packaged plugins\n\t\t//'parent_menu_slug' \t=> 'themes.php', \t\t\t\t// Default parent menu slug\n\t\t//'parent_url_slug' \t=> 'themes.php', \t\t\t\t// Default parent URL slug\n\t\t'menu' \t\t=> 'install-required-plugins', \t// Menu slug\n\t\t'has_notices' \t=> true, \t// Show admin notices or not\n\t\t'is_automatic' \t=> true,\t\t\t\t\t \t// Automatically activate plugins after installation or not\n\t\t'message' \t\t\t=> '',\t\t\t\t\t\t\t// Message to output right before the plugins table\n\t\t'strings' \t\t=> array(\n\t\t\t'page_title' \t\t\t=> __( 'Install Required Plugins', 'howes' ),\n\t\t\t'menu_title' \t\t\t=> __( 'Install Plugins', 'howes' ),\n\t\t\t'installing' \t\t\t=> __( 'Installing Plugin: %s', 'howes' ), // %1$s = plugin name\n\t\t\t'oops' \t\t\t=> __( 'Something went wrong with the plugin API.', 'howes' ),\n\t\t\t'notice_can_install_required' \t\t\t=> _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_install_recommended'\t\t\t=> _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_install' \t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_required' \t\t\t=> _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_recommended'\t\t\t=> _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_activate' \t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)\n\t\t\t'notice_ask_to_update' \t\t\t\t\t\t=> _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_update' \t\t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)\n\t\t\t'install_link' \t\t\t\t\t \t\t\t=> _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),\n\t\t\t'activate_link' \t\t\t\t \t\t\t=> _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),\n\t\t\t'return' \t\t\t=> __( 'Return to Required Plugins Installer', 'howes' ),\n\t\t\t'plugin_activated' \t\t\t=> __( 'Plugin activated successfully.', 'howes' ),\n\t\t\t'complete' \t\t\t\t\t\t\t\t\t=> __( 'All plugins installed and activated successfully. %s', 'howes' ), // %1$s = dashboard link\n\t\t)\n\t);\n\ttgmpa( $plugins, $config );\n}",
"function my_theme_register_required_plugins() {\n\n\t/**\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\t\t/** This is an example of how to include a plugin pre-packaged with a theme */\n\t\tarray(\n\t\t\t'name' => 'ScrollToTop',\n\t\t\t'slug' => 'dynamic-to-top',\n\t\t\t'required' => false\n\t\t),\n\t\t\n\t\t/** This is an example of how to include a plugin from the WordPress Plugin Repository */\n\t\tarray(\n\t\t\t'name' => 'OptionTree',\n\t\t\t'slug' => 'option-tree',\n\t\t\t'required' => true\n\t\t)\n\t);\n\n\t/** Change this to your theme text domain, used for internationalising strings */\n\t// $theme_text_domain = 'skeleton';\n\n\t/**\n\t * Array of configuration settings. Uncomment and amend each line as needed.\n\t * If you want the default strings to be available under your own theme domain,\n\t * uncomment the strings and domain.\n\t * Some of the strings are added into a sprintf, so see the comments at the\n\t * end of each line for what each argument will be.\n\t */\n\t$config = array(\n\t\t/*'domain' => $theme_text_domain, // Text domain - likely want to be the same as your theme. */\n\t\t/*'default_path' => '', // Default absolute path to pre-packaged plugins */\n\t\t/*'menu' => 'install-required-plugins', // Menu slug */\n\t\t/*'notices' => true, // Show admin notices or not */\n\t\t'strings' => array(\n\t\t\t/*'page_title' \t\t\t\t=> __( 'Install Required Plugins', $theme_text_domain ), // */\n\t\t\t/*'menu_title' \t\t\t\t=> __( 'Install Plugins', $theme_text_domain ), // */\n\t\t\t/*'instructions_install' \t\t\t\t=> __( 'The %1$s plugin is required for this theme. Click on the big blue button below to install and activate %1$s.', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t/*'instructions_install_recommended'\t=> __( 'The %1$s plugin is recommended for this theme. Click on the big blue button below to install and activate %1$s.', $theme_text_domain ), // %1$s = plugin name, %2$s = plugins page URL */\n\t\t\t/*'instructions_activate' \t\t\t\t=> __( 'The %1$s plugin is installed but currently inactive. Please go to the <a href=\"%2$s\">plugin administration page</a> page to activate it.', $theme_text_domain ), // %1$s = plugin name, %2$s = plugins page URL */\n\t\t\t'button' \t\t\t\t=> __( 'Install %s Now', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t/*'installing' \t\t\t\t=> __( 'Installing Plugin: %s', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t/*'oops' \t\t\t\t=> __( 'Something went wrong with the plugin API.', $theme_text_domain ), // */\n\t\t\t/*'notice_can_install_required' \t=> __( 'This theme requires the following plugins: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t/*'notice_can_install_recommended'\t\t=> __( 'This theme recommends the following plugins: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t/*'notice_cannot_install' \t\t\t\t=> __( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t/*'notice_can_activate_required' \t=> __( 'The following required plugins are currently inactive: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t/*'notice_can_activate_recommended'\t\t=> __( 'The following recommended plugins are currently inactive: %1$s.', $theme_text_domain ), // %1$s = plugin names */\n\t\t\t/*'notice_cannot_activate' \t\t\t\t=> __( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', $theme_text_domain ), // %1$s = plugin name */\n\t\t\t/*'return' \t\t\t\t=> __( 'Return to Required Plugins Installer', $theme_text_domain ), // */\n\t\t\t/*'plugin_activated' \t \t\t\t\t=> __( 'Plugin activated successfully.', $theme_text_domain ) // */\n\t\t)\n\t);\n\n\ttgmpa( $plugins, $config );\n\n}",
"function acf_or_die() {\n\n\t\tif ( !class_exists('acf') ) {\t\t\t\n\t\t\t$this->kill_plugin();\n\t\t} else if ( !acf_get_setting('pro') == 1 && ( !class_exists('acf_plugin_repeater') && !class_exists('acf_plugin_flexible_content') ) ) {\n\t\t\t$this->kill_plugin();\n\t\t} else {\n\t\t\t$this->settings['this_acf_version'] = acf()->settings['version'];\n\t\t\tif ( version_compare( $this->settings['this_acf_version'], $this->settings['min_acf_pro_version'], '<' ) ) {\n\t\t\t\t$this->kill_plugin();\n\t\t\t}\n\t\t}\n\t}",
"function boiler_dependencies() {\n if( ! function_exists('acf_add_options_page') )\n echo '<div class=\"error\"><p> Warning: The theme needs ACF Plugin installed and activated to function </p></div>';\n}",
"function cbc_register_required_plugins() {\n\t/*\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\n\t\tarray(\n\t\t\t'name' => 'Meta Box',\n\t\t\t'slug' => 'meta-box',\n\t\t\t'required' => true,\n\t\t),\n\n\t);\n\n\t/*\n\t * Array of configuration settings. Amend each line as needed.\n\t *\n\t * TGMPA will start providing localized text strings soon. If you already have translations of our standard\n\t * strings available, please help us make TGMPA even better by giving us access to these translations or by\n\t * sending in a pull-request with .po file(s) with the translations.\n\t *\n\t * Only uncomment the strings in the config array if you want to customize the strings.\n\t */\n\t$config = array(\n\t\t'id' => 'cbc', // Unique ID for hashing notices for multiple instances of TGMPA.\n\t\t'default_path' => '', // Default absolute path to bundled plugins.\n\t\t'menu' => 'tgmpa-install-plugins', // Menu slug.\n\t\t'parent_slug' => 'themes.php', // Parent menu slug.\n\t\t'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.\n\t\t'has_notices' => true, // Show admin notices or not.\n\t\t'dismissable' => true, // If false, a user cannot dismiss the nag message.\n\t\t'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n\t\t'is_automatic' => false, // Automatically activate plugins after installation or not.\n\t\t'message' => '', // Message to output right before the plugins table.\n\n\t);\n\n\ttgmpa( $plugins, $config );\n}",
"function my_theme_register_required_plugins() {\r\n\r\n /**\r\n * Array of plugin arrays. Required keys are name and slug.\r\n * If the source is NOT from the .org repo, then source is also required.\r\n */\r\n $plugins = array(\r\n\r\n \r\n\r\n // This is an example of how to include a plugin from the WordPress Plugin Repository.\r\n array(\r\n 'name' => 'Redux Framework',\r\n 'slug' => 'redux-framework',\r\n 'required' => true,\r\n\t\t\t'force_activation' => false, \r\n 'force_deactivation' => false, \r\n ),\r\n array(\r\n 'name' => 'Visual Composer',\r\n 'slug' => 'js_composer',\r\n\t\t\t'source' => 'http://webredox.net/plugins/js_composer.zip',\r\n 'required' => true,\r\n ),\t\t\r\n\t\t\r\n\t\tarray(\r\n 'name' => 'Contact Form 7',\r\n 'slug' => 'contact-form-7',\r\n 'required' => true,\r\n ),\r\n\t\tarray(\r\n 'name' => 'Revolution Slider', \r\n 'slug' => 'revslider',\r\n 'source' => 'http://webredox.net/plugins/revslider.zip',\r\n 'required' => false, \r\n ),\t\r\n\t\tarray(\r\n 'name' => 'Redux Developer Mode Disabler',\r\n 'slug' => 'redux-developer-mode-disabler',\r\n 'required' => true,\r\n ),\t\t\r\n \t\t\r\n\r\n );\r\n\r\n /**\r\n * Array of configuration settings. Amend each line as needed.\r\n * If you want the default strings to be available under your own theme domain,\r\n * leave the strings uncommented.\r\n * Some of the strings are added into a sprintf, so see the comments at the\r\n * end of each line for what each argument will be.\r\n */\r\n $config = array(\r\n 'default_path' => '', // Default absolute path to pre-packaged plugins.\r\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\r\n 'has_notices' => true, // Show admin notices or not.\r\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\r\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\r\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\r\n 'message' => '', // Message to output right before the plugins table.\r\n \r\n );\r\n\r\n tgmpa( $plugins, $config );\r\n\r\n}",
"function woocomm_add_fee_check_woocomm_is_loaded()\n\t{\n\t\tif( class_exists( 'WooCommerce' ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\twc_add_fees_load_plugin_version();\n\t}",
"function plugin_is_active() {\n\t\treturn class_exists( 'Marketpress' );\n\t}",
"function my_theme_register_required_plugins() {\n $plugins = array(\n\n array(\n 'name' => 'JSON API',\n 'slug' => 'json-api',\n 'required' => true,\n ),\n\n array(\n 'name' => 'XML Sitemap',\n 'slug' => 'xml-sitemap',\n 'required' => true,\n ),\n\n );\n\n /**\n * Array of configuration settings. Amend each line as needed.\n * If you want the default strings to be available under your own theme domain,\n * leave the strings uncommented.\n * Some of the strings are added into a sprintf, so see the comments at the\n * end of each line for what each argument will be.\n */\n $config = array(\n 'id' => 'tgmpa',\t\t\t\t\t// Unique ID for hashing notices for multiple instances of TGMPA.\n 'default_path' => '',\t\t\t\t\t\t// Default absolute path to pre-packaged plugins.\n 'menu' => 'tgmpa-install-plugins',\t// Menu slug.\n 'has_notices' => true, // Show admin notices or not.\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\n 'dismiss_msg' => '',\t\t\t\t\t\t// If 'dismissable' is false, this message will be output at top of nag.\n 'is_automatic' => true,\t\t\t\t\t\t// Automatically activate plugins after installation or not.\n 'message' => '',\t\t\t\t\t\t// Message to output right before the plugins table.\n 'strings' => array(\n 'page_title' => __( 'Install Required Plugins', 'tgmpa' ),\n 'menu_title' => __( 'Install Plugins', 'tgmpa' ),\n 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ), // %s = plugin name.\n 'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ),\n 'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'tgmpa' ), // %1$s = plugin name(s).\n 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'tgmpa' ), // %1$s = plugin name(s).\n 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'tgmpa' ),\n 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'tgmpa' ),\n 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ),\n 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ),\n 'complete' => __( 'All plugins installed and activated successfully. %s', 'tgmpa' ), // %s = dashboard link.\n 'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.\n )\n );\n\n tgmpa( $plugins, $config );\n\n}"
]
| [
"0.8043087",
"0.75335014",
"0.7532508",
"0.74805266",
"0.7476624",
"0.74485064",
"0.73717934",
"0.73011225",
"0.72933906",
"0.72396684",
"0.7178887",
"0.7163206",
"0.7065173",
"0.7057183",
"0.7055174",
"0.703937",
"0.70355535",
"0.7022463",
"0.6999613",
"0.69299287",
"0.69104344",
"0.69038826",
"0.6892454",
"0.68745726",
"0.6868858",
"0.6862464",
"0.68375725",
"0.6819636",
"0.6814875",
"0.67791265",
"0.67548394",
"0.67479146",
"0.6743408",
"0.6709561",
"0.6695576",
"0.6693882",
"0.6684647",
"0.66816264",
"0.6680674",
"0.6679558",
"0.66530466",
"0.66449076",
"0.6644311",
"0.66383195",
"0.66245824",
"0.66157764",
"0.66097134",
"0.65965176",
"0.6594301",
"0.6571338",
"0.6554403",
"0.65530384",
"0.6552825",
"0.6541213",
"0.6528041",
"0.6523713",
"0.6521114",
"0.65192175",
"0.65169406",
"0.65148944",
"0.6495349",
"0.6494128",
"0.6493805",
"0.6486599",
"0.6476012",
"0.64759886",
"0.6470641",
"0.64416987",
"0.6439199",
"0.6432357",
"0.64316833",
"0.64275277",
"0.64192754",
"0.64159334",
"0.6405167",
"0.6400485",
"0.6400049",
"0.6393842",
"0.6379913",
"0.6360592",
"0.6345017",
"0.6324984",
"0.63241076",
"0.63145334",
"0.6309857",
"0.6300898",
"0.6297301",
"0.628727",
"0.62712836",
"0.6259948",
"0.6252158",
"0.625001",
"0.62332547",
"0.6229355",
"0.6228617",
"0.6226743",
"0.62236285",
"0.62164074",
"0.6214651",
"0.62037885"
]
| 0.7365859 | 7 |
end if wordpress_plugin_requires //////////////////////////////////////////////////////////////////////// The functions below are for detecting various other popular plugins. // //////////////////////////////////////////////////////////////////////// Query whether WooCommerce is activated. | public function is_woocommerce_activated(){
$active_plugins = (array) get_option('active_plugins', array());
if(is_multisite()){
$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
}
return in_array('woocommerce/woocommerce.php', $active_plugins) || array_key_exists('woocommerce/woocommerce.php', $active_plugins);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_woocommerce_activated() {\n\t\treturn class_exists( 'woocommerce' );\n\t}",
"function is_woocommerce_activated() {\n return class_exists( 'woocommerce' ) ? true : false;\n}",
"function wcwspay_is_woocommerce_active() {\n if ( in_array( \"woocommerce/woocommerce.php\", apply_filters( \"active_plugins\", get_option( \"active_plugins\" ) ) ) ) {\n return true;\n }\n return false;\n}",
"public static function Woocommerce_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins );\n }",
"static function is_woocommerce_active() {\n\t\treturn class_exists( 'Woocommerce' );\n\t}",
"function pacz_woocommerce_enabled() {\n\tif ( class_exists( 'woocommerce' ) ) { return true; }\n\treturn false;\n}",
"function woocommerce_enabled()\n{\n\tif(class_exists('Woocommerce'))\n\t\treturn true;\n\telse\n\t\treturn false;\n}",
"function mkdf_re_is_woocommerce_installed() {\n\t\treturn function_exists('is_woocommerce');\n\t}",
"function carousel_slider_is_woocommerce_active() {\n\n\t\tif ( in_array( 'woocommerce/woocommerce.php', get_option( 'active_plugins' ) ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( defined( 'WC_VERSION' ) || defined( 'WOOCOMMERCE_VERSION' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public static function themecomplete_woocommerce_check_only() {\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\n\t\tif ( is_multisite() ) {\n\t\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\n\t\t}\n\n\t\treturn in_array( 'woocommerce/woocommerce.php', $active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', $active_plugins );\n\t}",
"public function is_woocommerce_active() {\n\t\t\treturn in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );\n\t\t}",
"function fiorello_mikado_is_woocommerce_installed() {\n\t\treturn function_exists( 'is_woocommerce' );\n\t}",
"public function is_woocommerce_active()\n {\n return in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')), true);\n }",
"public function check_required_plugins(){\n\n\t\tif ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) { ?>\n\n\t\t\t<div id=\"message\" class=\"error\">\n\t\t\t\t<p>BCIT WPD Restrict Purchase expects WooCommerce to be active. This plugin has been deactivated.</p>\n\t\t\t</div>\n\n\t\t\t<?php\n\t\t\tdeactivate_plugins( '/bcit-wpd-restrict-purchase/bcit-wpd-restrict-purchase.php' );\n\t\t} // if plugin_active WooCommerce\n\n\t}",
"public static function isWoocommerceIntegration() {\n\t\t\treturn class_exists( 'WooCommerce' );\n\t\t}",
"function check_environment() {\n if (\n !is_plugin_active('woocommerce/woocommerce.php') and\n current_user_can('activate_plugins')\n ) {\n // Stop activation redirect and show error\n $this->deactivate_plugin();\n wp_die(\n 'Sorry, but this plugin requires the Woocommerce plugin to be installed and active. <br>\n <a href=\"' . admin_url('plugins.php') . '\">« Return to Plugins</a>'\n );\n }\n }",
"private function is_required_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t$requvired_plugin_list = array(\n\t\t\t'rest-api/plugin.php',\n\t\t\t'butterbean/butterbean.php',\n\t\t);\n\t\tforeach ( $requvired_plugin_list as $plugin ) {\n\t\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public function using_woocommerce() {\n if ( $this->using_ecommerce() === false )\n return false;\n\n return in_array( 'woocommerce', $this->ecommerce_providers );\n }",
"private function should_load() {\n\t\treturn class_exists( 'WooCommerce', false );\n\t}",
"function wp_get_active_and_valid_plugins()\n {\n }",
"function mixtape_qodef_is_woocommerce_page() {\n\t\tif (function_exists('is_woocommerce') && is_woocommerce()) {\n\t\t\treturn is_woocommerce();\n\t\t} elseif (function_exists('is_cart') && is_cart()) {\n\t\t\treturn is_cart();\n\t\t} elseif (function_exists('is_checkout') && is_checkout()) {\n\t\t\treturn is_checkout();\n\t\t} elseif (function_exists('is_account_page') && is_account_page()) {\n\t\t\treturn is_account_page();\n\t\t}\n\t}",
"function plugin_is_active() {\n\t\treturn function_exists( 'jigoshop_init' ) || class_exists( 'JigoshopInit' );\n\t}",
"public static function woocommerce_check() {\n\n\t\tif (get_option( 'woocommerce_db_version' ) === FALSE && class_exists('WC_Install')){\n\t\t\tWC_Install::update_db_version();\n\t\t}\n\n\t\tif ( self::themecomplete_woocommerce_check() && ! version_compare( get_option( 'woocommerce_db_version' ), THEMECOMPLETE_EPO_WC_VERSION, '<' ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}",
"function plugin_is_active() {\n\t\treturn class_exists( 'Marketpress' );\n\t}",
"function ava_is_shop_callback( $control ) {\n /*\n * Query whether WooCommerce is activated. If not, return early.\n *\n * @see https://docs.woocommerce.com/document/query-whether-woocommerce-is-activated/\n */\n if ( ! ava_is_woocommerce_activated() ) {\n return;\n }\n\n return is_shop() || is_product_category() ;\n}",
"function wprt_is_woocommerce_shop() {\n\tif ( ! class_exists( 'woocommerce' ) ) {\n\t\treturn false;\n\t} elseif ( is_shop() ) {\n\t\treturn true;\n\t}\n}",
"function stage_is_shop_active()\n{\n return (bool) defined('WC_ABSPATH');\n}",
"function mixtape_qodef_is_woocommerce_shop() {\n\t\treturn function_exists('is_shop') && (is_shop() || is_product());\n\t}",
"function mixtape_qodef_load_woo_assets() {\n\t\treturn mixtape_qodef_is_woocommerce_installed() && (mixtape_qodef_is_woocommerce_page() ||\n\t\t\tmixtape_qodef_has_woocommerce_shortcode() || mixtape_qodef_has_woocommerce_widgets());\n\t}",
"public function isGlobaleCommerceInstalled()\n {\n return $this->_isExtensionInstalled('Iparcel_GlobaleCommerce');\n }",
"static function has_required_plugins( $plugins = array('H', 'Timber') ) {\n $is_all_installed = true;\n\n // if any of the plugins doesn't exist, break the loop\n if( is_array( $plugins ) ) {\n foreach( $plugins as $p ) {\n $is_all_installed = class_exists( $p );\n if( !$is_all_installed ) { break; }\n }\n } else {\n $is_all_installed = class_exists( $plugins );\n }\n\n // show error message if all not installed AND it's admin page\n $is_admin_page = is_admin() && current_user_can('install_plugins');\n if( !$is_all_installed && $is_admin_page ) {\n add_action('admin_notices', function() {\n $text = sprintf(\n __('You need to activate WP Edje and Timber. <a href=\"%s\">Activate now »</a>.', 'my'),\n admin_url('plugins.php')\n );\n echo '<div class=\"notice notice-error\"><p>' . $text . '</p></div>';\n });\n }\n return $is_all_installed;\n }",
"function mkdf_re_mkdf_woocommerce_integration_installed() {\n return defined( 'MIKADO_WOOCOMMERCE_CHECKOUT_INTEGRATION' );\n }",
"function fa_is_wptouch_installed(){\n\t$installed = class_exists('WPtouchPlugin') || class_exists('WPtouchPro');\n\treturn $installed;\n}",
"final public function activate() {\n\t\n\t\t//Check PHP Version and deactivate & die if it doesn't meet minimum requirements.\n\t\tif ( version_compare(PHP_VERSION, '7.2.0', '<=') ) {\n\t\t\tdeactivate_plugins( plugin_basename( WRP_PLUGIN_FILE ) );\n\t\t\twp_die( 'This plugin requires <b>PHP Version 7.2 and up</b>. <a href=\"' . admin_url('plugins.php') . '\">Go Back</a>' );\n }\n \n //Check if WooCommerce is activated. Otherwise, do not activate the plugin.\n if( !is_plugin_active('woocommerce/woocommerce.php') ) {\n deactivate_plugins( plugin_basename( WRP_PLUGIN_FILE ) );\n\t\t\twp_die( 'This plugin requires <b>WooCommerce<b>. <a href=\"' . admin_url('plugins.php') . '\">Go Back</a>' );\n }\n\t\t\n //Do activate Stuff now...\n \n\t}",
"function woocomm_add_fee_check_woocomm_is_loaded()\n\t{\n\t\tif( class_exists( 'WooCommerce' ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\twc_add_fees_load_plugin_version();\n\t}",
"public function is_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\t$plugins = get_plugins();\n\n\t\treturn ! empty( $plugins[ self::PLUGIN_SLUG ] );\n\t}",
"public static function check_activated_plugin() {\n\t\t$set = [];\n\t\t$plugins = get_option( 'active_plugins', [] );\n\n\t\tforeach ( self::get_conflicting_plugins() as $plugin => $type ) {\n\t\t\tif ( ! isset( $set[ $type ] ) && in_array( $plugin, $plugins, true ) ) {\n\t\t\t\t$set[ $type ] = true;\n\t\t\t\tself::set_notification( $type );\n\t\t\t}\n\t\t}\n\n\t\tif ( in_array( 'wpml-string-translation/plugin.php', $plugins, true ) ) {\n\t\t\tGlobalHelper::remove_notification( 'convert_wpml_settings' );\n\t\t}\n\t}",
"function acf_is_plugin_active()\n{\n}",
"function is_installed()\n{\n return has_account() && has_meta();\n}",
"public function is_jigoshop_activated(){\n\t\t\t$active_plugins = (array) get_option('active_plugins', array());\n\n\t\t\tif(is_multisite()){\n\t\t\t\t$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));\n\t\t\t}\n\n\t\t\treturn in_array('jigoshop/jigoshop.php', $active_plugins) || array_key_exists('jigoshop/jigoshop.php', $active_plugins);\n\t\t}",
"public static function themecomplete_woocommerce_check() {\n\t\treturn ! self::tc_needs_wc_db_update() && self::themecomplete_woocommerce_check_only();\n\t}",
"function mixtape_qodef_has_woocommerce_shortcode() {\n\t\t$woocommerce_shortcodes = array(\n\t\t\t'woocommerce_order_tracking',\n\t\t\t'add_to_cart',\n\t\t\t'product',\n\t\t\t'products',\n\t\t\t'product_categories',\n\t\t\t'product_category',\n\t\t\t'recent_products',\n\t\t\t'featured_products',\n\t\t\t'woocommerce_messages',\n\t\t\t'woocommerce_cart',\n\t\t\t'woocommerce_checkout',\n\t\t\t'woocommerce_my_account',\n\t\t\t'woocommerce_edit_address',\n\t\t\t'woocommerce_change_password',\n\t\t\t'woocommerce_view_order',\n\t\t\t'woocommerce_pay',\n\t\t\t'woocommerce_thankyou'\n\t\t);\n\n\t\tforeach($woocommerce_shortcodes as $woocommerce_shortcode) {\n\t\t\t$has_shortcode = mixtape_qodef_has_shortcode($woocommerce_shortcode);\n\n\t\t\tif($has_shortcode) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function get_plugin_status( $install_string = '' ) {\n\n\t// Get the array of active plugins.\n\t$currently_active = get_option( 'active_plugins' );\n\n\t// check the array for being active, with fallback\n\treturn in_array( $install_string, $currently_active ) ? true : false;\n}",
"function mixtape_qodef_has_woocommerce_widgets() {\n\t\t$widgets_array = array(\n\t\t\t'qodef_woocommerce_dropdown_cart',\n\t\t\t'woocommerce_widget_cart',\n\t\t\t'woocommerce_layered_nav',\n\t\t\t'woocommerce_layered_nav_filters',\n\t\t\t'woocommerce_price_filter',\n\t\t\t'woocommerce_product_categories',\n\t\t\t'woocommerce_product_search',\n\t\t\t'woocommerce_product_tag_cloud',\n\t\t\t'woocommerce_products',\n\t\t\t'woocommerce_recent_reviews',\n\t\t\t'woocommerce_recently_viewed_products',\n\t\t\t'woocommerce_top_rated_products'\n\t\t);\n\n\t\tforeach($widgets_array as $widget) {\n\t\t\t$active_widget = is_active_widget(false, false, $widget);\n\n\t\t\tif($active_widget) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function is_really_wc_page() {\n if ( function_exists( \"is_woocommerce\" ) && is_woocommerce() ) {\n return true;\n }\n $woocommerce_keys = array(\n \"woocommerce_shop_page_id\",\n \"woocommerce_terms_page_id\",\n \"woocommerce_cart_page_id\",\n \"woocommerce_checkout_page_id\",\n \"woocommerce_pay_page_id\",\n \"woocommerce_thanks_page_id\",\n \"woocommerce_myaccount_page_id\",\n \"woocommerce_edit_address_page_id\",\n \"woocommerce_view_order_page_id\",\n \"woocommerce_change_password_page_id\",\n \"woocommerce_logout_page_id\",\n \"woocommerce_lost_password_page_id\"\n );\n foreach ( $woocommerce_keys as $wc_page_id ) {\n if ( get_the_ID() == get_option( $wc_page_id, 0 ) ) {\n return true;\n }\n }\n\n return false;\n}",
"private function is_promotion_plugins_installed() {\n\t\treturn array_reduce( $this->promotion_plugins, function ( $should_show_notice, $plugin_name ) {\n\t\t\tif ( $should_show_notice ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn in_array( $plugin_name, $this->get_plugins(), true );\n\t\t}, false );\n\t}",
"public static function activation_check() {\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\tdeactivate_plugins( plugin_basename( THEMECOMPLETE_EPO_PLUGIN_FILE ) );\n\t\t\twp_die( sprintf( esc_html__( 'WooCommerce TM Extra Product Options requires WordPress %s or later.', 'woocommerce-tm-extra-product-options' ), THEMECOMPLETE_EPO_WP_VERSION ) );\n\t\t}\n\n\t}",
"function wprt_is_woocommerce_page() {\n if ( function_exists ( \"is_woocommerce\" ) && is_woocommerce() )\n\t\treturn true;\n\n $woocommerce_keys = array (\n \t\"woocommerce_shop_page_id\" ,\n \"woocommerce_terms_page_id\" ,\n \"woocommerce_cart_page_id\" ,\n \"woocommerce_checkout_page_id\" ,\n \"woocommerce_pay_page_id\" ,\n \"woocommerce_thanks_page_id\" ,\n \"woocommerce_myaccount_page_id\" ,\n \"woocommerce_edit_address_page_id\" ,\n \"woocommerce_view_order_page_id\" ,\n \"woocommerce_change_password_page_id\" ,\n \"woocommerce_logout_page_id\" ,\n \"woocommerce_lost_password_page_id\" );\n\n foreach ( $woocommerce_keys as $wc_page_id ) {\n\t\tif ( get_the_ID () == get_option ( $wc_page_id , 0 ) ) {\n\t\t\treturn true ;\n\t\t}\n }\n \n return false;\n}",
"private function is_elementor_dev_installed() {\n\t\treturn in_array( static::PLUGIN_NAME, $this->get_plugins(), true );\n\t}",
"protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }",
"function requires_wordpress_version() {\r\n\tglobal $wp_version;\r\n\t$plugin = plugin_basename( __FILE__ );\r\n\t$plugin_data = get_plugin_data( __FILE__, false );\r\n\tif ( version_compare($wp_version, \"3.0\", \"<\" ) ) {\r\n\t\tif( is_plugin_active($plugin) ) {\r\n\t\t\tdeactivate_plugins( $plugin );\r\n\t\t\twp_die( \"'\".$plugin_data['Name'].\"' requires WordPress 3.0 or higher, and has been deactivated! Please upgrade WordPress and try again.<br /><br />Back to <a href='\".admin_url().\"'>WordPress admin</a>.\" );\r\n\t\t}\r\n\t}\n\t // if the ZF plugin is successfully loaded this constant is set to true\n if (defined('WP_ZEND_FRAMEWORK') && constant('WP_ZEND_FRAMEWORK')) {\n return true;\n }\n // you can also check if ZF is available on the system\n $paths = explode(PATH_SEPARATOR, get_include_path());\n foreach ($paths as $path) {\n if (file_exists(\"$path/Zend/Loader.php\")) {\n define('WP_ZEND_FRAMEWORK', true);\n return true;\n }\n }\n // nothing found, you may advice the user to install the ZF plugin\n define('WP_ZEND_FRAMEWORK', false);\r\n}",
"function is_yith_wishlist_premium() {\n\t\treturn ! defined( 'YITH_WCWL_FREE_INIT' ) && file_exists( WP_PLUGIN_DIR . '/yith-woocommerce-wishlist-premium/init.php' );\n\t}",
"function ppom_pro_is_installed() {\n\t\n\t$return = false;\n\t \n if( class_exists('PPOM_PRO') ) \n $return = true;\n return $return;\n}",
"function inkpro_additional_theme_support() {\r\n\r\n\t/**\r\n\t * Enable WooCommerce support\r\n\t */\r\n\tadd_theme_support( 'woocommerce' );\r\n}",
"public static function Elementor_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'elementor/elementor.php', self::$active_plugins ) || array_key_exists( 'elementor/elementor.php', self::$active_plugins );\n }",
"function frame_shop()\n{\n if (function_exists(\"is_woocommerce\") && is_woocommerce())\n return true;\n\n $woocommerce_keys = array ( \"woocommerce_shop_page_id\" ,\n \"woocommerce_terms_page_id\" ,\n \"woocommerce_cart_page_id\" ,\n \"woocommerce_checkout_page_id\" ,\n \"woocommerce_pay_page_id\" ,\n \"woocommerce_thanks_page_id\" ,\n \"woocommerce_myaccount_page_id\" ,\n \"woocommerce_edit_address_page_id\" ,\n \"woocommerce_view_order_page_id\" ,\n \"woocommerce_change_password_page_id\" ,\n \"woocommerce_logout_page_id\" ,\n \"woocommerce_lost_password_page_id\" ) ;\n\n foreach ( $woocommerce_keys as $wc_page_id ) {\n if ( get_the_ID () == get_option ( $wc_page_id , 0 ) ) {\n return true ;\n }\n }\n\n return false;\n}",
"function fiorello_mikado_is_wp_gutenberg_installed() {\n\t\treturn class_exists( 'WP_Block_Type' );\n\t}",
"function GTPress_preInit(){\r\n\tglobal $wp_version;\r\n\tif ( version_compare($wp_version, '3.1', '<') ) {\r\n\t\tdeactivate_plugins( basename(__FILE__) );\r\n\t\twp_die(\"Sorry, this plugin requires WordPress 3.1 or greater!<br>Please update your WordPress install before attempting to re-activate!\");\r\n\t}\r\n\tif ( is_plugin_active('./ozh-admin-drop-down-menu/wp_ozh_adminmenu.php') ) {\r\n\t\tdeactivate_plugins( basename(__FILE__) );\r\n\t\twp_die(\"Sorry, the plugin <a href=\\\"http://wordpress.org/extend/plugins/ozh-admin-drop-down-menu/\\\" alt=\\\"Ozh' Admin Drop Down Menu\\\">Ozh' Admin Drop Down Menu</a> is required!<br>Please install this plugin before attempting to re-activate!\");\r\n\t}\r\n\r\n}",
"public static function isWoocommercePage()\n {\n return ( self::hasWoocommerce() && ( is_woocommerce() || is_checkout() || is_cart() || is_account_page() ) );\n }",
"function uds_pricing_is_active()\n{\n\tif(function_exists('uds_active_shortcodes')) {\n\t\t$active_shortcodes = uds_active_shortcodes();\n\t\tif( ! in_array('uds-pricing-table', $active_shortcodes)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n}",
"function wss_wc_not_installed() {\n\techo '<div class=\"notice notice-error is-dismissible\">';\n\t\techo '<p>' . __( '<b>WARNING!</b> <i>WooCommerce Support System</i> requires <b><a href=\"https://it.wordpress.org/plugins/woocommerce/\" target=\"_blank\">WooCommerce</a></b> to be activated.', 'wc-support-system' ) . '</p>';\n\techo '</div>';\n}",
"function wpdc_check_active(){ \r\n\r\n // plugin is ok\r\n // do the actions and filters\r\n\t\t\tadd_action( 'admin_menu',\t'wpdc_my_add_plugin_admin_page'); // the function to show the plugin settings page\r\n }",
"public static function has_woocommerce_support( $theme ) {\n\t\t$themes = array( $theme );\n\t\tif ( $theme->get( 'Template' ) ) {\n\t\t\t$parent_theme = wp_get_theme( $theme->get( 'Template' ) );\n\t\t\t$themes[] = $parent_theme;\n\t\t}\n\n\t\tforeach ( $themes as $theme ) {\n\t\t\t$directory = new \\RecursiveDirectoryIterator( $theme->theme_root . '/' . $theme->stylesheet );\n\t\t\t$iterator = new \\RecursiveIteratorIterator( $directory );\n\t\t\t$files = new \\RegexIterator( $iterator, '/^.+\\.php$/i', \\RecursiveRegexIterator::GET_MATCH );\n\n\t\t\tforeach ( $files as $file ) {\n\t\t\t\t$content = file_get_contents( $file[0] );\n\t\t\t\tif ( preg_match( '/add_theme_support\\(([^(]*)(\\'|\\\")woocommerce(\\'|\\\")([^(]*)/si', $content, $matches ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private function flow_woocommerce_version_check($version = '3.0.0') {\r\n if (class_exists('WooCommerce')) {\r\n global $woocommerce;\r\n if (version_compare($woocommerce->version, $version, \">=\")) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n return false;\r\n }",
"function is_wpcli() {\n\treturn defined('WP_CLI') && WP_CLI;\n}",
"function check_capabilities() {\n\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t\t// TODO: Error message\n\t\t}\n\n\t}",
"public static function Wpml_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'sitepress-multilingual-cms/sitepress.php', self::$active_plugins ) || array_key_exists( 'sitepress-multilingual-cms/sitepress.php', self::$active_plugins );\n }",
"function wcwspay_admin_notice_missing_woocommerce() {\n global $current_screen;\n if( $current_screen->parent_base === \"plugins\" ) {\n ?>\n <div class=\"notice notice-error\">\n <p><?php _e( \"Please install and activate <a href='http://www.woothemes.com/woocommerce/' target='_blank'>WooCommerce</a> before activating the Neuralab WooCommerce WSPay Payment Gateway!\", \"wcwspay\" ); ?></p>\n </div>\n <?php\n }\n}",
"public function stop_plugin() {\n\n\t\tif ( apply_filters( 'wc_epo_stop_plugin', false ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif ( ! self::themecomplete_woocommerce_check() ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif ( ! self::compatible_version() ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif ( self::old_version() ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif ( ! self::woocommerce_check() ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}",
"function fiorello_mikado_is_wpml_installed() {\n\t\treturn defined( 'ICL_SITEPRESS_VERSION' );\n\t}",
"function jetpack_is_product() {\n\treturn ( function_exists( 'is_product' ) ) ? is_product() : false;\n}",
"public static function is_wpml_active() {\n \n include_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n \n $wpml_active = is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' );\n \n $string_translation_active = is_plugin_active( 'wpml-string-translation/plugin.php' );\n \n return $wpml_active && $string_translation_active;\n \n }",
"public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}",
"function heateor_ss_is_plugin_active($pluginFile){\r\n\treturn in_array($pluginFile, apply_filters('active_plugins', get_option('active_plugins')));\r\n}",
"public static function isInstalled (\n\t)\t\t\t// <bool> TRUE if successfully installed, FALSE if not.\n\t\n\t// $plugin->isInstalled();\n\t{\n\t\t// Make sure the newly installed tables exist\n\t\t$pass1 = DatabaseAdmin::columnsExist(\"explore_area\", array(\"type\", \"explore_id\"));\n\t\t$pass2 = DatabaseAdmin::columnsExist(\"explore_creatures\", array(\"explore_zone\", \"rarity\"));\n\t\t\n\t\treturn ($pass1 and $pass2);\n\t}",
"function mme_check_active() {\n\tif ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {\n // Put your plugin code here\n\t\tadd_menu_page( 'Email Cart Details', 'Email Cart Details', 'administrator', 'emailcartdetails', 'mme_display_form', plugin_dir_url(__FILE__).'images/Email-icon.png','20.5');\n\n\t} else {\n\t\tdeactivate_plugins( plugin_basename( __FILE__ ) );\n\t\techo '<style>div#message.updated{ display: none; }</style>';\n\t\t$error_no_woocommerce = 'Sorry, WooCommerce does not found, Please activate woocommerce plugin';\n\t\tmme_error_notice($error_no_woocommerce);\n\t}\n\n}",
"public function is_subscriptions_active() {\n\n\t\t$active_plugins = (array) get_option( 'active_plugins', array() );\n\n\t\tif ( is_multisite() ) {\n\t\t\t$active_plugins = array_merge( $active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );\n\t\t}\n\n\t\treturn in_array( 'woocommerce-subscriptions/woocommerce-subscriptions.php', $active_plugins ) || array_key_exists( 'woocommerce-subscriptions/woocommerce-subscriptions.php', $active_plugins );\n\t}",
"private static function check_wp() {\n\t\tglobal $wp_version;\n\n\t\treturn version_compare( $wp_version, self::MINIMUM_WP_VERSION, '>=' );\n\t}",
"function is_wp_version_compatible($required)\n {\n }",
"public function user_can_install_and_activate( WP_User $user ) {\n\t\treturn $user->has_cap( 'install_plugins' ) && $user->has_cap( 'activate_plugins' ) && $user->has_cap( 'activate_plugin', self::PLUGIN_SLUG );\n\t}",
"static function wpl_toolskit_ot_active() {\n\t\t//if ( is_plugin_active( 'option-tree/ot-loader.php' ) ) {\n\t\t\treturn true;\n\t\t//}\n\t}",
"public function is_edd_activated(){\n\t\t\t$active_plugins = (array) get_option('active_plugins', array());\n\n\t\t\tif(is_multisite()){\n\t\t\t\t$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));\n\t\t\t}\n\n\t\t\treturn in_array('easy-digital-downloads/easy-digital-downloads.php', $active_plugins) || array_key_exists('easy-digital-downloads/easy-digital-downloads.php', $active_plugins);\n\t\t}",
"static function plugins_loaded() {\n\n if ( !function_exists( 'is_plugin_active' ) ) {\n require_once ABSPATH . '/wp-admin/includes/plugin.php';\n }\n\n // check if MetaBox plugin is loaded\n if ( class_exists('RWMB_Loader')) {\n define( 'WPBUCKET_META_BOX', true );\n } else {\n define( 'WPBUCKET_META_BOX', false );\n }\n }",
"function wp_get_active_and_valid_themes()\n {\n }",
"public function isActive()\n {\n If ($this->theme_active == 1)\n {\n //plugin is active\n return true;\n\n } else {\n \n //plugin is not active\n return false;\n }\n\n }",
"function joe_uah_plugins_check() {\n\n\t// Set constants for active third party plugins\n\tdefine( 'JOE_UAH_MINIORANGE_2_FACTOR', class_exists( 'Miniorange_Authentication' ) );\n\n}",
"function rtasset_check_plugin_dependecy() {\n\n\tglobal $rtasset_plugin_check;\n\t$rtasset_plugin_check = array(\n\t\t'rtbiz' => array(\n\t\t\t'project_type' => 'all',\n\t\t\t'name' => esc_html__( 'WordPress for Business.', RT_ASSET_TEXT_DOMAIN ),\n\t\t\t'active' => class_exists( 'Rt_Biz' ),\n\t\t\t'filename' => 'index.php',\n\t\t),\n\t);\n\n\t$flag = true;\n\n\tif ( ! class_exists( 'Rt_Biz' ) || ! did_action( 'rt_biz_init' ) ) {\n\t\t$flag = false;\n\t}\n\n\tif ( ! $flag ) {\n\t\tadd_action( 'admin_enqueue_scripts', 'rtasset_plugin_check_enque_js' );\n\t\tadd_action( 'wp_ajax_rtasset_activate_plugin', 'rtasset_activate_plugin_ajax' );\n\t\tadd_action( 'admin_notices', 'rtasset_admin_notice_dependency_not_installed' );\n\t}\n\n\treturn $flag;\n}",
"function wmp_notice() {\n global $current_screen;\n if ( $current_screen->parent_base == 'plugins' ) {\n echo '<div class=\"error\"><p>'.__( 'The <strong>WooCommerce Sales by Marketplace</strong> plugin requires the <a href=\"http://wordpress.org/plugins/woocommerce\" target=\"_blank\">WooCommerce</a> plugin to be activated in order to work. Please <a href=\"'.admin_url( 'plugin-install.php?tab=search&type=term&s=WooCommerce' ).'\" target=\"_blank\">install WooCommerce</a> or <a href=\"'.admin_url( 'plugins.php' ).'\">activate</a> first.' ).'</p></div>';\n }\n }",
"function wpd_load_3rd_plugins() {\n // Check to see if your plugin has already been loaded. This can be done in several\n\t// ways - here are a few examples:\n\t//\n\t// Check for a class:\n\t//\tif (!class_exists('MyPluginClass')) {\n\t//\n\t// Check for a function:\n\t//\tif (!function_exists('my_plugin_function_name')) {\n\t//\n\t// Check for a constant:\n\t//\tif (!defined('MY_PLUGIN_CONSTANT')) {\n\n\n /*if (!class_exists('PluginClassName')) {\n include_once(TEMPLATEPATH.'plugins/my-plugin/my-plugin.php');\n }*/\n \n}",
"function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}",
"function thunderbear_woocommerce_support() {\n add_theme_support( 'woocommerce' );\n}",
"function wp_not_installed()\n {\n }",
"function _wprp_supports_theme_upgrade() {\n\n\tinclude_once ( ABSPATH . 'wp-admin/includes/admin.php' );\n\n\treturn class_exists( 'Theme_Upgrader' );\n\n}",
"function fiorello_mikado_is_gutenberg_installed() {\n\t\treturn function_exists( 'is_gutenberg_page' ) && is_gutenberg_page();\n\t}",
"function check() {\n\t\tglobal $wp_version;\n\t\t$requirements_met = true;\n\n\t\tif ( version_compare( $wp_version, $this->install_requirements['WordPress Version'], '<' ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_wp_version_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( version_compare( PHP_VERSION, $this->install_requirements['PHP Version'], '<' ) ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_php_version_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( $this->install_requirements['Multibyte'] && ! $this->check_multibyte_support() ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_mbstring_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t} elseif ( $this->install_requirements['UTF-8'] && ! $this->check_utf8_support() ) {\n\t\t\tif ( is_admin() ) {\n\t\t\t\tadd_action( 'admin_notices', array( $this, 'admin_notices_charset_incompatible' ) );\n\t\t\t}\n\t\t\t$requirements_met = false;\n\t\t}\n\n\t\tif ( ! $requirements_met && is_admin() ) {\n\t\t\t// Load text domain to ensure translated admin notices.\n\t\t\tload_plugin_textdomain( 'wp-typography', false, dirname( $this->local_plugin_path ) . '/translations/' );\n\t\t\t/* add_action( 'admin_init', array( $this, 'deactivate_plugin' ) ); */\n\t\t}\n\n\t\treturn $requirements_met;\n\t}",
"public function is_wordless2_ready() {\n\t\tif ( $this->theme_is_upgradable() )\n\t\t\tWP_CLI::error('Nope');\n\t\telse\n\t\t\tWP_CLI::success('Yep!');\n\t}",
"private static function is_installed( $plugin ) {\n\t\tif ( ! function_exists( 'get_plugins' ) ) {\n\t\t\trequire_once ABSPATH . 'wp-admin/includes/plugin.php';\n\t\t}\n\n\t\t$all_plugins = get_plugins();\n\n\t\treturn isset( $all_plugins[ $plugin ] );\n\t}",
"function GP_authorize_gateway_init() {\n // it means WooCommerce is not installed on the site\n // so do nothing\n if ( ! class_exists( 'WC_Payment_Gateway' ) ) return;\n\n // If we made it this far, then include our Gateway Class\n include_once( 'authorizenet.php' );\n\n // Now that we have successfully included our class,\n // Lets add it too WooCommerce\n add_filter( 'woocommerce_payment_gateways', 'GP_authorize_gateway' );\n function GP_authorize_gateway( $methods ) {\n $methods[] = 'GP_authorize_gateway';\n return $methods;\n }\n}",
"function requires_wordpress_version() {\r\n\tglobal $wp_version;\r\n\t$plugin = plugin_basename( __FILE__ );\r\n\t$plugin_data = get_plugin_data( __FILE__, false );\r\n\r\n\tif ( version_compare($wp_version, \"2.7\", \"<\" ) ) {\r\n\t\tif( is_plugin_active($plugin) ) {\r\n\t\t\tdeactivate_plugins( $plugin );\r\n\t\t\twp_die( \"'\".$plugin_data['Name'].\"' requires WordPress 2.7 or higher, and has been deactivated! Please upgrade WordPress and try again.<br /><br />Back to <a href='\".admin_url().\"'>WordPress admin</a>.\" );\r\n\t\t}\r\n\t}\r\n}",
"private function is_wp_version_ready() {\n\t\tglobal $wp_version;\n\n\t\tif ( ! version_compare( $this->min_wp_version, $wp_version, '>=' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->add_error_notice(\n\t\t\t'WordPress ' . $this->min_wp_version . '+ is required',\n\t\t\t'You\\'re running version ' . $wp_version\n\t\t);\n\n\t\treturn false;\n\t}"
]
| [
"0.8089199",
"0.8004243",
"0.78541064",
"0.78349674",
"0.7824288",
"0.7710195",
"0.77081776",
"0.7673448",
"0.7661962",
"0.76611155",
"0.7636752",
"0.76107806",
"0.754041",
"0.74764895",
"0.7313533",
"0.7308448",
"0.72869617",
"0.7080213",
"0.70030165",
"0.6937037",
"0.69345754",
"0.687628",
"0.6875527",
"0.6855569",
"0.6846017",
"0.68435377",
"0.6806265",
"0.6801364",
"0.6799809",
"0.6682687",
"0.6635495",
"0.6622233",
"0.65948606",
"0.6572546",
"0.6533134",
"0.65329766",
"0.65312606",
"0.6527229",
"0.65260196",
"0.6516418",
"0.6487057",
"0.6485575",
"0.64739335",
"0.6469734",
"0.6468533",
"0.6468308",
"0.64208645",
"0.64052576",
"0.640001",
"0.6399801",
"0.62991387",
"0.6279486",
"0.6237996",
"0.6232132",
"0.62225974",
"0.6221244",
"0.6210731",
"0.61995846",
"0.6189021",
"0.61754",
"0.61696035",
"0.6140067",
"0.6080844",
"0.60777926",
"0.6072764",
"0.6060865",
"0.60596734",
"0.6048275",
"0.60224754",
"0.60144293",
"0.60124946",
"0.60100603",
"0.6002109",
"0.5999094",
"0.5978422",
"0.59761655",
"0.59681565",
"0.595774",
"0.59559715",
"0.5945731",
"0.59418505",
"0.5941734",
"0.59392715",
"0.59164983",
"0.5914878",
"0.59104675",
"0.59096783",
"0.5908791",
"0.58842874",
"0.5880785",
"0.5870783",
"0.5869766",
"0.58662707",
"0.5860945",
"0.5854322",
"0.5850547",
"0.584601",
"0.58357584",
"0.58331686",
"0.58325034"
]
| 0.79172015 | 2 |
Query whether Jigoshop is activated. | public function is_jigoshop_activated(){
$active_plugins = (array) get_option('active_plugins', array());
if(is_multisite()){
$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
}
return in_array('jigoshop/jigoshop.php', $active_plugins) || array_key_exists('jigoshop/jigoshop.php', $active_plugins);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function plugin_is_active() {\n\t\treturn function_exists( 'jigoshop_init' ) || class_exists( 'JigoshopInit' );\n\t}",
"public function using_jigoshop() {\n if ( $this->using_ecommerce() === false )\n return false;\n\n return in_array( 'jigoshop', $this->ecommerce_providers );\n }",
"public function IsActive ();",
"public function is_active();",
"public function isActive() \n {\t\n \t// if PIWIK tracking is activated return TRUE\n \tif (Mage::getStoreConfig('piwik/piwik/active')) {\n \t\treturn true;\n \t}\n \t// return FALSE otherwise\n \treturn false;\n }",
"public function isSelected()\n {\n /* @var $session Dhl_Intraship_Model_Session */\n $session = Mage::getSingleton('intraship/session');\n return (\n true === $session->hasData('is_gogreen') &&\n 1 === (int) $session->getData('is_gogreen')\n );\n }",
"protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }",
"public function isActive() {\r\n return $this->getModelPlugin()->isActive($this->getPluginKey());\r\n }",
"public function is_active(): bool;",
"public static function isFeatureActive()\n {\n }",
"static function wpl_toolskit_ot_active() {\n\t\t//if ( is_plugin_active( 'option-tree/ot-loader.php' ) ) {\n\t\t\treturn true;\n\t\t//}\n\t}",
"function getIsActive() ;",
"function isActive(){\n\t\treturn $this->getSessionID() == $this->getUser()->getShift() && $this->getStatus() == '1' ? true : false;\n\t}",
"function is_active()\n {\n }",
"public function activated($name)\n {\n return is_array($this->memory->get(\"extensions.active.{$name}\"));\n }",
"public function IsActive()\n {\n return true;\n }",
"function is_themosis_active() {\n return class_exists( 'Themosis' ) ? true : false;\n}",
"public function isActivated() {}",
"public function isActive()\n {\n return (bool)$this->getValue(self::KEY_ACTIVE);\n }",
"function isActive() ;",
"public function IsOpen()\n {\n $this->CallJqUiMethod(\"isOpen\");\n }",
"function available()\n {\n $db =& JFactory::getDBO();\n $query = 'select count(*) from #__extensions as a where a.element = ' . $db->Quote('com_community') . ' AND a.enabled=1';\n\t\t$db->setQuery($query);\n\t\t$count = (int)$db->loadResult();\n if ($count > 0)\n return true;\n\n return false;\n }",
"function is_active()\n {\n return $this->userData[$this->user_active];\n }",
"public function isEnabled()\n {\n\t\tif($this->actif == 1) return true;\n \telse return false;\n }",
"function plugin_is_active($name, $version = null, $compOperator = '>=')\n{\n $plugin = get_db()->getTable('Plugin')->findByDirectoryName($name);\n if (!$plugin) {\n return false;\n }\n if (!$plugin->isActive()) {\n return false;\n }\n if ($version) {\n return version_compare($plugin->getDbVersion(), $version, $compOperator);\n } else {\n return true;\n }\n}",
"public function getActive() {\n\t\tif (isset($this->_data['active']) && $this->_data['active']) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"function isPluginActive($a_pname)\n\t{\n\t\tglobal $ilPluginAdmin;\n\t\tif ($ilPluginAdmin->isActive(IL_COMP_MODULE, \"SurveyQuestionPool\", \"svyq\", $a_pname))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function isInstalled()\n\t{\n\t\t$db = JFactory::getDBO();\n\t\t$q = sprintf(\"SELECT * FROM jos_components WHERE parent = 0 AND `option` LIKE 'com_%s' LIMIT 1\",str_replace('_','',$this->name));\n\t\t$db->execute($q);\n\t\treturn ($object = $db->loadObject()) ? $object->id : false;\n\t}",
"public static function wpabstats_browser_active_check()\n {\n $getChartArticleIsActive = get_option('_wpabstats_browser_widget');\n $isActive = \"\";\n\n if( $getChartArticleIsActive === \"on\" ) $isActive = 'checked=\"checked\"';\n\n return $isActive;\n }",
"function getIsAvailable() ;",
"public function isThereAnActivatedServiceContent(){\n $cmd =Yii::app()->db->createCommand();\n $cmd->select('COUNT(*)')\n ->from('website_services')\n ->where(\"status='active'\");\n $result = $cmd->queryScalar();\n \n if($result > 0){\n return true;\n }else{\n return false;\n }\n \n }",
"public function isActive()\n {\n If ($this->theme_active == 1)\n {\n //plugin is active\n return true;\n\n } else {\n \n //plugin is not active\n return false;\n }\n\n }",
"function getIsOn(){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT isOn FROM bot_on_off LIMIT 1');\n\t\t$statement->execute();\n\t\treturn $statement->fetch()['isOn'] == true;\n\t}",
"function active()\r\n {\r\n return true;\r\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfigFlag('training_layred/catalog/enabled');\n }",
"private function has_at_least_one_active_experiment() {\n\t\tforeach ( Plugin::$instance->experiments->get_features() as $feature_name => $feature ) {\n\t\t\tif ( Experiments_Manager::STATE_ACTIVE === $feature['state'] ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public static function isEnabled() {\n global $DB;\n $iterator = $DB->request([\n 'SELECT' => ['state'],\n 'FROM' => 'glpi_crontasks',\n 'WHERE' => [\n 'name' => 'telemetry',\n 'state' => 1\n ]\n\n ]);\n return count($iterator) > 0;\n }",
"public function isActive()\n\t{\n\t\treturn $this->isOpened();\n\t}",
"public function isActive() {\n $isActive = Mage::getStoreConfig('santander/general/active');\n if($isActive) {\n return true;\n } else {\n return false;\n }\n }",
"public function isActive() {\n $isActive = Mage::getStoreConfig('santander/general/active');\n if($isActive) {\n return true;\n } else {\n return false;\n }\n }",
"public function queryLogActive() {\n\t\treturn isset($this->loggers['query']);\n\t}",
"public function getIsActive()\r\n {\r\n return ($this->isActive=='1');\r\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE)\n && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE);\n }",
"public function hasOp() {\n return $this->_has(1);\n }",
"public function isActive()\n\t{\n\t\treturn ($GLOBALS['TL_CONFIG']['enableSearch'] && $this->Input->get('act') == 'index');\n\t}",
"public static function isFeaturePublished(){\n return JeproshopSettingModelSetting::getValue('virtual_product_feature_active');\n }",
"function idealEnabled() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$sql = 'SELECT COUNT(id) FROM #__osmembership_plugins WHERE name=\"os_ideal\" AND published=1';\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$total = $db->loadResult() ;\r\n\t\tif ($total) {\r\n\t\t\trequire_once JPATH_ROOT.'/components/com_osmembership/plugins/ideal/ideal.class.php';\r\n\t\t\treturn true ;\r\n\t\t} else {\r\n\t\t\treturn false ;\r\n\t\t}\r\n\t}",
"public function isTagalysActive()\n\t{\n\t\t//$status = $this->scopeConfig->getValue('tgs_search/default/status', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\t\t$status = $this->scopeConfig->getValue('tagalys_tglssearch/general/enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n\t\tif ($status)\n\t\t{\n\n\t\t\t//$service = $this->tglssearchClientConnector;\n\t\t\t$service = $this->tglssearchClientConnector;\n\t\t $tagalys = $service->isRequestSuccess();\n\t\t if($tagalys)\n\t\t\t{\n\t\t\t\t//print_r('if');die;\n\t\t \treturn $service;\n\t\t }\n\t\t\telse\n\t\t\t{\n\t\t\t\t//print_r('else');die;\n\t\t \treturn false;\n\t\t }\n\n\t\t} else\n\t\t{\n\t\t\t//print_r('false');die;\n\t\t\treturn false;\n\t\t}\n\t\t//print_r('nthg');die;\n\t}",
"public function enabled()\n {\n return extension_loaded('ibm_db2');\n }",
"public function isActive()\n {\n return $this->getActive();\n }",
"public function isScanActive()\n {\n return $this->lastScan == 'active';\n }",
"public function isActive()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->esta_activo;\n\t}",
"public function getIsActive();",
"public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }",
"function isPackageActive( $pPackageGuid ) {\n\t\treturn( $this->getPackageConfigValue( $pPackageGuid, 'active' ) == 'y' );\n\t}",
"public function isActive (){\n if($this->is_active == 1) {\n return true;\n }else{\n return false;\n }\n }",
"public function isActive();",
"public function isActive();",
"public function isActive();",
"public function isActive();",
"public function getIsActive(): bool;",
"public function getIsActive(): bool;",
"public function getIsActive(): bool;",
"public function hasActivateCode(){\n return $this->_has(3);\n }",
"function erp_is_imap_active() {\n $options = get_option( 'erp_settings_erp-crm_email_connect_imap', [] );\n\n $imap_status = (boolean) isset( $options['imap_status'] ) ? $options['imap_status'] : 0;\n $enable_imap = ( isset( $options['enable_imap'] ) && $options['enable_imap'] == 'yes' ) ? true : false;\n\n if ( $enable_imap && $imap_status ) {\n return true;\n }\n\n return false;\n}",
"public function getIsActive() {}",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"public function isActive()\n\t\t{\n\t\t\treturn $this->_state === 1;\n\t\t}",
"public function getIsVisible(){\n\t\tif(is_array($this->productos))\n\t\t{\t\t\n\t\t\tforeach($this->lookhasproducto as $lookhasproducto){\n\t\t\t\tif($lookhasproducto->producto->getCantidad(null, $lookhasproducto->color_id) > 0 && \n $lookhasproducto->producto->estado == 0)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"protected function isGridelementsInstalled()\n {\n $geLoaded = t3lib_extMgm::isLoaded('gridelements');\n $this->results['isGridelementsInstalled'] = $geLoaded;\n return $geLoaded;\n }",
"public function getIsActive()\n {\n if (array_key_exists(\"isActive\", $this->_propDict)) {\n return $this->_propDict[\"isActive\"];\n } else {\n return null;\n }\n }",
"public function isActive(): bool;",
"public function isActive(): bool;",
"public function userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function hasProduct(){\n return $this->_has(1);\n }",
"public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}",
"function stage_is_feature_active($feature)\n{\n return stage_string_to_bool(stage_get_fallback('features' . '.' . $feature . '.' . 'activate'));\n}",
"public function isActive()\n {\n return ($this->slug == \"actief\");\n }",
"public function can_activate(): bool;",
"public function getGcloudPluginStatusAction()\n {\n $result = array(\"result\" => \"0\");\n\n $mdlAcme = $this->getModel();\n\n // Check if the required plugin is installed\n if ((string)$mdlAcme->isPluginInstalled('google-cloud-sdk') == \"1\") {\n $result['result'] = \"1\";\n }\n\n return $result;\n }",
"private function isOpcModuleActive()\n {\n // fallback for mobile-enabled theme\n if (Configuration::get('OPC_MOBILE_FALLBACK') && $this->context->getMobileDevice())\n return false;\n\n // fallback for paypal express checkout\n if (isset($this->context->cookie->express_checkout) && Configuration::get('OPC_PAYPAL_EXPRESS_FALLBACK'))\n return false;\n\n if ($this->opcModuleActive > -1)\n return $this->opcModuleActive;\n\n $opc_mod_script = _PS_MODULE_DIR_ . 'onepagecheckout/onepagecheckout.php';\n if (file_exists($opc_mod_script)) {\n require_once($opc_mod_script);\n $opc_mod = new OnePageCheckout();\n $this->opcModuleActive = (Tools::getValue('opc-debug') == 1900)?true:((Tools::getValue('opc-debug') == 1901)?false:$opc_mod->active);\n } else {\n $this->opcModuleActive = 0;\n }\n return $this->opcModuleActive;\n }",
"public function isApple() : bool\n {\n return $this->title == self::APPLE;\n }",
"public function isStoreActive() {\r\n\t\treturn $this->_storeManager->getStore()->isActive();\r\n\t}",
"private static function backendSearchActive()\n {\n //Backend search active\n $backendSearchActive = apply_Filters('AlgoliaIndex/BackendSearchActive', true);\n\n //Query algolia for search result\n if ($backendSearchActive || is_post_type_archive()) {\n return true;\n }\n\n return false;\n }",
"public static function isInstallationInProgress()\n {\n $sql = 'SELECT `value` FROM ' . _DB_PREFIX_ . 'configuration\n WHERE `name` = \\'LENGOW_INSTALLATION_IN_PROGRESS\\'';\n $value = Db::getInstance()->getRow($sql);\n return $value ? (bool)$value['value'] : false;\n }",
"function active()\n\t{\n\t\treturn true;\n\t}",
"public function isAvailable()\n\t{\n\t\ttry {\n\t\t\t$output = $this->execute('x = 3;');\n\t\t} catch (ExternalRuntimeException $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function isMonitoring() {\n\t\tif (!session_loggedin() || !$this->ArtifactType->isPermitted()) {\n\t\t\treturn false;\n\t\t}\n\t\t$MonitorElementObject = new MonitorElement('artifact');\n\t\treturn $MonitorElementObject->isMonitoredByUserId($this->getID(), user_getid());\n\t}",
"public function isActive() {\n $row = $this->getInnerRow();\n return (int)$row['active'] === 1;\n }",
"public function getIsRunning();",
"public function isActive()\r\n\t{\r\n\t\treturn $this->filter((int) Mage::getStoreConfig('ec/config/active'));\r\n\t}",
"public function hasActivateCode(){\n return $this->_has(10);\n }",
"public function hasActivateCode(){\n return $this->_has(10);\n }",
"public function isModuleActived($name) {\n\t\t$result = Yii::app()->db->createCommand(\"SELECT * FROM {$this->_moduleTableName} WHERE enabled=1 AND name= :name\")->queryRow(true, array(\n\t\t\t':name' => trim(strtolower($name)))\n\t\t);\n\n\t\tif($result === false)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}",
"public function isActive() {\n return (bool) $this->getValue('active');\n }",
"public function isEnabled(){\n return $this->activo;\n }"
]
| [
"0.68858886",
"0.6450874",
"0.6271204",
"0.62306666",
"0.6175893",
"0.6173632",
"0.6150675",
"0.61139417",
"0.608017",
"0.60013694",
"0.5952681",
"0.59048736",
"0.5895107",
"0.58459646",
"0.5805845",
"0.5765689",
"0.5755417",
"0.57391846",
"0.5717812",
"0.57032526",
"0.56993914",
"0.56959385",
"0.5694383",
"0.5676765",
"0.56736857",
"0.5668658",
"0.5630982",
"0.56011546",
"0.55990875",
"0.5584302",
"0.5577372",
"0.557638",
"0.55612284",
"0.5557296",
"0.55548686",
"0.5553739",
"0.55352366",
"0.5532022",
"0.5530038",
"0.5530038",
"0.5517006",
"0.5509141",
"0.55070597",
"0.55010194",
"0.54939294",
"0.548327",
"0.5469297",
"0.5462503",
"0.54578155",
"0.54534715",
"0.5452087",
"0.5447328",
"0.54429644",
"0.5441992",
"0.5440232",
"0.54395294",
"0.5438363",
"0.5438363",
"0.5438363",
"0.5438363",
"0.543685",
"0.543685",
"0.543685",
"0.5435473",
"0.542982",
"0.54226416",
"0.5422293",
"0.54196566",
"0.54196006",
"0.5415646",
"0.540947",
"0.5404976",
"0.5404976",
"0.5403176",
"0.5402264",
"0.5402264",
"0.5402264",
"0.5402264",
"0.5402264",
"0.53961873",
"0.53857005",
"0.5385224",
"0.53844553",
"0.53822774",
"0.5380858",
"0.5372765",
"0.53696126",
"0.5368822",
"0.5368632",
"0.5366438",
"0.5365902",
"0.5361079",
"0.5360229",
"0.53556174",
"0.5349195",
"0.53490055",
"0.53490055",
"0.53489953",
"0.534728",
"0.53438973"
]
| 0.72238916 | 0 |
Query whether Easy Digital Downloads is activated. | public function is_edd_activated(){
$active_plugins = (array) get_option('active_plugins', array());
if(is_multisite()){
$active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array()));
}
return in_array('easy-digital-downloads/easy-digital-downloads.php', $active_plugins) || array_key_exists('easy-digital-downloads/easy-digital-downloads.php', $active_plugins);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_allowed_download() {\n return $this->_manage_products == 'allow_download';\n }",
"public function isDownloadable()\n {\n return ((int)$this->downloadable === 1);\n }",
"public function hasDownloads()\n\t{\n\t\t// Cache downloads if not yet done\n\t\t$this->getDownloads();\n\n\t\treturn !empty($this->arrDownloads);\n\t}",
"public function isAutoDownloadEnabled() {\n return $this->settings['features']['autoDownload'];\n }",
"protected function checkDownloadsPossible() {}",
"public function isDownloadRunning()\n\t{\n\t\treturn($this->isPackageTaskRunning('downloadPoolPackages', 'startDownloadToPool'));\n\t}",
"function getIsAvailable() ;",
"public function isAddAsDownload() {\r\n\t\treturn $this->getAddAsDownload();\r\n\t}",
"public function onlyDownloadable() {\n $cart = ShoppingCart::get();\n\n foreach($cart->getItems() as $item) {\n if(!$item->FindStockItem() InstanceOf DownloadableProduct) {\n return false;\n }\n }\n\n return true;\n }",
"function is_digital($id){\n if($this->db->get_where('product',array('product_id'=>$id))->row()->download == 'ok'){\n return true;\n } else {\n return false;\n }\n }",
"public function getIsAvailable() {}",
"public function getIsAvailable();",
"public function getDownloadable()\n {\n return $this->downloadable;\n }",
"public function isDemoDumpAvailable()\n {\n $result = self::checkFileAccess(Registry::get('config.dir.install') . App::DB_DEMO);\n\n if (!$result) {\n $app = App::instance();\n $app->setNotification('E', $app->t('error'), $app->t('demo_dump_is_not_available'), true);\n }\n\n return $result;\n }",
"private function _is_download()\n {\n if(isset($_REQUEST['csvdownload']) && $_REQUEST['csvdownload'])\n return(true);\n else\n return(false);\n }",
"public function isAvailable() {\n $path = $this->path();\n return file_exists($path);\n }",
"function available()\n {\n $db =& JFactory::getDBO();\n $query = 'select count(*) from #__extensions as a where a.element = ' . $db->Quote('com_community') . ' AND a.enabled=1';\n\t\t$db->setQuery($query);\n\t\t$count = (int)$db->loadResult();\n if ($count > 0)\n return true;\n\n return false;\n }",
"public function isArtifactScanEnabled()\n {\n return $this->scanArtifactFiles;\n }",
"public function getEnabled()\n {\n return array_filter($this->storage, function($val)\n {\n return $val['status'] === ProviderInterface::STATUS_INSTALLED;\n });\n }",
"public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }",
"public function is_chooser_available() {\n\n\t\t// If custom app is not enabled, return false.\n\t\tif ( ! $this->get_plugin_setting( 'customAppEnable' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get site URL.\n\t\t$site_url = parse_url( get_site_url() );\n\n\t\t// Get origin from site URL.\n\t\t$origin = $site_url['scheme'] . '://' . $site_url['host'];\n\n\t\t// Get app key.\n\t\t$app_key = $this->get_app_key();\n\n\t\t// Prepare chooser URL.\n\t\t$chooser_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'origin' => $origin,\n\t\t\t\t'app_key' => $app_key,\n\t\t\t),\n\t\t\t'https://www.dropbox.com/chooser'\n\t\t);\n\n\t\t// Make a request to the chooser URL.\n\t\t$chooser_request = wp_remote_get( $chooser_url );\n\n\t\treturn ! is_wp_error( $chooser_request ) && 200 === $chooser_request['response']['code'];\n\n\t}",
"public function isAvailable(){\n\t\treturn is_dir($this->path);\n\t}",
"public function hasBytesDownloadRate()\n {\n return $this->bytes_download_rate !== null;\n }",
"public static function check_download() {\n\n\t\t// Check the user's capabilities before proceeding\n\t\t$this->check_capabilities();\n\n\t\t$api_params = array(\n\t\t\t'edd_action' => 'check_download',\n\t\t\t'item_name' => urlencode( $_POST['download'] ),\n\t\t);\n\n\t\t// Send our details to the remote server\n\t\t$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );\n\n\t\t// There was no error, we can proceed\n\t\tif ( ! is_wp_error( $request ) ) {\n\n\t\t\t$request = maybe_unserialize( json_decode( wp_remote_retrieve_body( $request ) ) );\n\n\t\t\tif ( 'free' == $request->download ) {\n\t\t\t\t// This is a free download.\n\t\t\t\t$response = 0;\n\t\t\t} else if ( 'chargeable' == $request->download ) {\n\t\t\t\t// This is a chargeable download.\n\t\t\t\t// We'll probably need to ask for a license.\n\t\t\t\t$response = 1;\n\t\t\t} else {\n\t\t\t\t// File does not exist\n\t\t\t\t$response = 'invalid';\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// Server was unreacheable\n\t\t\t$response = 'Server error';\n\n\t\t}\n\n\t\tdie( json_encode( $response ) );\n\n\t}",
"public function isAvailable(): bool;",
"public function hasDownloadPaused()\n {\n return $this->download_paused !== null;\n }",
"public function hasNumDownloading()\n {\n return $this->num_downloading !== null;\n }",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"public function isAvailable() {}",
"function isAvailable() ;",
"function isAvailable() ;",
"protected function isInstalledAndEnabled()\n {\n return $this->isPluginAvailable($this->identifier)\n && Settings::get('octoshop_products_enabled', true);\n }",
"public function is_installed() { \n\n $sql = \"DESCRIBE `localplay_mpd`\";\n $db_results = Dba::query($sql);\n\n return Dba::num_rows($db_results);\n\n\t}",
"public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}",
"public function hasBytesDownloaded()\n {\n return $this->bytes_downloaded !== null;\n }",
"public static function gdAvailable()\n {\n return extension_loaded('gd');\n }",
"public function isEnabled()\n {\n return Mage::getStoreConfig('refersion/refersion_settings/refersion_active');\n }",
"public function is_available() {\n\t\treturn $this->secret_api_key && $this->publishable_api_key;\n\t}",
"function edd_downloads_has_user_purchased( $user_id, $downloads, $variable_price_id = null, $verify_purchase = false ) {\t\n\t$users_purchases = edd_get_users_purchases( $user_id );\t\n\t$return = false;\t\n\tif ( ! is_array( $downloads ) ) {\t\n\t\t$downloads = array( $downloads );\t\n\t}\t\n\t$now\t \t\t= strtotime(date('Y-m-d H:i:s'));\t\n\tif ( $users_purchases ) {\t\n\t\tforeach ( $users_purchases as $purchase ) {\t\n\t\t\t$purchased_files = edd_get_payment_meta_downloads( $purchase->ID );\t\n\t\t\t\t\n\t\t\t$licenses = edd_software_licensing()->get_licenses_of_purchase( $purchase->ID );\t\n\t\t\t$licenses_products = array();\t\n\t\t\tif( is_array( $licenses ) ){\t\n\t\t\t\tforeach($licenses as $license){\t\n\t\t\t\t\t$download_id \t= get_post_meta($license->ID, '_edd_sl_download_id', true);\t\n\t\t\t\t\t$status \t\t= get_post_meta($license->ID, '_edd_sl_status', true);\t\n\t\t\t\t\t$expire \t\t= get_post_meta($license->ID, '_edd_sl_expiration', true);\t\n\t\t\t\t\t$licenses_products[$download_id] \t\t\t= array();\t\n\t\t\t\t\t$licenses_products[$download_id]['status'] \t= $status;\t\n\t\t\t\t\t$licenses_products[$download_id]['expire'] \t= $expire;\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t}else{\t\n\t\t\t\treturn false;\t\n\t\t\t}\t\n\t\t\tif ( is_array( $purchased_files ) ) {\t\n\t\t\t\tforeach ( $purchased_files as $download ) {\t\n\t\t\t\t\tif ( in_array( $download['id'], $downloads ) ) {\t\n\t\t\t\t\t\t//check to see if the license is active\t\n\t\t\t\t\t\t//echo $licenses_products[$download['id']]['expire'] . \">\" . $now . \"==========\";\t\n\t\t\t\t\t\tif(isset($licenses_products[$download['id']]['expire']) && $now > $licenses_products[$download['id']]['expire']){// || $licenses_products[$download['id']]['status'] == 'inactive'\t\n\t\t\t\t\t\t\tif($verify_purchase){\n\t\t\t\t\t\t\t\treturn \"purchased_expired\";\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t$variable_prices = edd_has_variable_prices( $download['id'] );\t\n\t\t\t\t\t\tif ( $variable_prices && ! is_null( $variable_price_id ) && $variable_price_id !== false ) {\t\n\t\t\t\t\t\t\tif ( isset( $download['options']['price_id'] ) && $variable_price_id == $download['options']['price_id'] ) {\t\n\t\t\t\t\t\t\t\treturn true;\t\n\t\t\t\t\t\t\t} else {\t\n\t\t\t\t\t\t\t\treturn false;\t\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t} else {\t\n\t\t\t\t\t\t\treturn true;\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t}\t\n\t\t}\t\n\t}\t\n\treturn false;\t\n}",
"public function getAvailable() : bool\n {\n return $this->available;\n }",
"public function isDeactivatedPermanently()\n {\n if ($this->isDeactivatedSometime() === false)\n return false;\n \n return !$this->isDeactivatedTemporarily();\n }",
"public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function getStatusInstallments(){\n\n if (!Mage::getStoreConfig(self::XPATH_CONFIG_ACTIVE)) {\n return false;\n }\n\n return true;\n }",
"function idealEnabled() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$sql = 'SELECT COUNT(id) FROM #__osmembership_plugins WHERE name=\"os_ideal\" AND published=1';\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$total = $db->loadResult() ;\r\n\t\tif ($total) {\r\n\t\t\trequire_once JPATH_ROOT.'/components/com_osmembership/plugins/ideal/ideal.class.php';\r\n\t\t\treturn true ;\r\n\t\t} else {\r\n\t\t\treturn false ;\r\n\t\t}\r\n\t}",
"public function check_activation_status () {\n $licenses_link = get_option( $this->token . '-url', '' );\n //echo \"<pre>\"; print_r( $this ); echo \"</pre>\"; die();\n $products = $this->get_detected_products();\n //echo \"<pre>\"; print_r( $products ); echo \"</pre>\"; die();\n $messages = array();\n if ( 0 < count( $products ) ) {\n foreach ( $products as $k => $v ) {\n if ( isset( $v['product_status'] ) && 'inactive' == $v['product_status'] ) {\n if( !empty( $licenses_link ) ) {\n $message = sprintf( __( '%s License is not active. To get started, activate it <a href=\"%s\">here</a>.', $this->domain ), $v['product_name'], $licenses_link );\n } else {\n $message = sprintf( __( '%s License is not active.', $this->domain ), $v['product_name'] );\n }\n if( !empty( $v[ 'errors_callback' ] ) && is_callable( $v[ 'errors_callback' ] ) ) {\n call_user_func_array( $v[ 'errors_callback' ], array( $message, 'warning' ) );\n } else {\n $messages[] = $message;\n }\n }\n }\n }\n if( !empty( $messages ) ) {\n $this->messages = $messages;\n }\n\n /**\n * We also ping UD server once per 24h\n * for getting any specific information.\n */\n $this->maybe_ping_ud();\n }",
"function can_download_plugin() {\n\t\tif( SS_Envato_API()->user->is_staff() ) return true;\n\n\t\t$current_user = wp_get_current_user(); \n\n\t\t$tf_codes = get_user_tf_codes( $current_user->ID );\n\t\t$site_codes = get_on_site_licenses( $current_user->ID );\n\n\t \t$plugins_codes = explode(',', etheme_get_custom_field('tf_themes'));\n\t \t$for_themes = explode(',', etheme_get_custom_field('et_themes'));\n\n\t \t$intersection = array_intersect($tf_codes, $plugins_codes);\n\t \t$intersection2 = array_intersect($site_codes, $for_themes);\n\n\t \tif(count($intersection) > 0 || count($intersection2) > 0 || et_is_staff()) {\n\t \t\treturn true;\n\t \t}\n\n\t \treturn false;\n\n\t}",
"public function dbIsInstalled();",
"public function isAvailable($url) \n\t{\n\t\t$this->api->parseUrl($url);\n\t\treturn $this->api->call(['command' => 'check'])->response()['RRPCode'] == 210 ? true : false;\n\t}",
"public function isAnonDownloadSoftware($softwareid)\n\t\t{\n\n\t\t\tif ($this->hasData($softwareid) == false)\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$data = $this->getSoftwareData($softwareid);\n\n\t\t\tif (isset($data['allowanondownloads']) == false)\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (is_bool($data['allowanondownloads']) == false)\n\t\t\t{\n\n\t\t\t\tthrow new \\Error();\n\t\t\t}\n\n\t\t\treturn $data['allowanondownloads'];\n\t\t}",
"public function GetDownloadInfo()\n {\n if (trim($this->url) === '') {\n $this->logger->log('URL is empty');\n\n return false;\n }\n\n $mediathek = $this->findSupportingMediathek();\n if ($mediathek === null) {\n $this->logger->log('Failed to find mediathek for ' . $this->url);\n\n return false;\n }\n\n return $this->toDownloadInfo($mediathek->getDownloadInfo(\n $this->url,\n $this->username,\n $this->password\n ));\n }",
"public static function isAvailable()\n\t{\n\t\treturn true;\n\t}",
"function userCanDownloadFile($sessionID, $fileID ){\r\n\t\t$query = \"SELECT `ContactID` FROM `attachments` WHERE ID='$fileID'\";\r\n\t\t$result = mysql_query($query);\r\n\t\t$result = mysql_fetch_array($result);\r\n\t\t$contactID = $result['ContactID'];\r\n\t\treturn $this->userCanViewContact( $sessionID, $contactID );\r\n\t}",
"public function isPubliclyAvailable() {\n $id = $this->getID();\n $the_post = $this->find('first', array(\n 'conditions' => array(\n 'Post.id' => $id,\n ),\n 'fields' => array(\n 'Post.enabled',\n 'Post.published',\n ),\n 'recursive' => -1,\n 'callbacks' => false,\n ));\n\n $invalid_post = empty($the_post);\n\n// Don't try to process any more logic unless we know the Post even exists.\n if ($invalid_post) {\n return false;\n }\n\n $disabled_post = $the_post['Post']['enabled'] === false;\n $unpublished_post = new DateTime($the_post['Post']['published']) > new DateTime();\n\n if ($disabled_post || $unpublished_post) {\n return false;\n }\n else {\n return true;\n }\n }",
"protected function isInstalled(){\n\t\t$dsn = Configuration::get('dsn', '');\n\t\t//echo \"dsn = \" . $dsn . \"--\";\n\t\tif ($dsn == ''){\n\t\t\t$alreadyInstalled = false;\n\t\t}\n\t\telse{\n\t\t\t$alreadyInstalled = true;\n\t\t}\n\t\treturn $alreadyInstalled;\n\t}",
"public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }",
"public static function isAvailable()\n {\n return Image::isAvailable('gd');\n }",
"public function hasDlcsList()\n {\n return $this->dlcs !== null;\n }",
"public function isAvailable()\n\t{\n\t\ttry {\n\t\t\t$output = $this->execute('x = 3;');\n\t\t} catch (ExternalRuntimeException $e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function checkIfDbalExtensionIsInstalled() {}",
"public function GetDownloadInfo()\n {\n if (strlen(trim($this->url)) === 0) {\n $this->logger->log('URL is empty');\n return false;\n }\n\n $mediathek = $this->findSupportingMediathek();\n if ($mediathek === null) {\n $this->logger->log('Failed to find mediathek for ' . $this->url);\n return false;\n }\n\n return $this->toDownloadInfo($mediathek->getDownloadInfo(\n $this->url,\n $this->username,\n $this->password\n ));\n }",
"protected function isAvailable()\n {\n if (null === $this->isAvailable) {\n $this->isAvailable = Pi::service('module')->isActive('relation');\n }\n\n return $this->isAvailable;\n }",
"public function checkproductavailablility($prodUniqid='',$uid='') {\r\n\t if( $prodUniqid != '' && $uid != '' ) {\r\n\t /**** Download check *****/\r\n\r\n\t $prodDetails = $this->CI->DatabaseModel->access_database('ts_products','select','',array('prod_uniqid'=>$prodUniqid));\r\n\r\n\t $userDetail = $this->CI->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$uid));\r\n\r\n if(!empty($prodDetails)) {\r\n\r\n $donwload_insert_array = array(\r\n 'download_uid' => $uid,\r\n 'download_planid' => $userDetail[0]['user_plans']\r\n );\r\n $downCheck = $this->CI->DatabaseModel->access_database('ts_downloadtbl','select','',$donwload_insert_array);\r\n\r\n if( !empty($downCheck) ) {\r\n $donwload_insert_array = array(\r\n 'download_uid' => $uid,\r\n 'download_planid' => $userDetail[0]['user_plans'],\r\n 'download_pid' => $prodDetails[0]['prod_id']\r\n );\r\n $userPreviousDownload = $this->CI->DatabaseModel->access_database('ts_downloadtbl','select','',$donwload_insert_array);\r\n\r\n if( empty($userPreviousDownload) ) {\r\n if( $prodDetails[0]['prod_free'] == '0') {\r\n $userPlan = $userDetail[0]['user_plans'];\r\n $pos = strpos($prodDetails[0]['prod_plan'] , $userPlan);\r\n\r\n if( $pos === false ){\r\n return '0';\r\n }\r\n $planDetails = $this->CI->DatabaseModel->access_database('ts_plans','select','',array('plan_product'=>$userPlan));\r\n\r\n if( strtolower(trim($planDetails[0]['plan_product'])) != 'all' ) {\r\n if( $planDetails[0]['plan_product'] <= count($downCheck) ) {\r\n return '2'; // Upgrade plan message\r\n }\r\n }\r\n }\r\n // Save download record\r\n $this->CI->DatabaseModel->access_database('ts_downloadtbl','insert',$donwload_insert_array,'');\r\n }\r\n }\r\n\r\n // Check whether this product comes in current Plan\r\n $userPlan = $userDetail[0]['user_plans'];\r\n if( $prodDetails[0]['prod_free'] == '1') {\r\n return '1'; // Get download FREE Product\r\n }\r\n else if( strpos($prodDetails[0]['prod_plan'].',',$userPlan.',') !== FALSE ) {\r\n return '1'; // Get download\r\n }\r\n else {\r\n // PRODUCT PURCHASE SINGLE COST\r\n\r\n $prod_purchase = array(\r\n 'purrec_prodid' => $prodDetails[0]['prod_id'],\r\n 'purrec_uid' => $uid\r\n );\r\n $purchaseCheck = $this->CI->DatabaseModel->access_database('ts_purchaserecord','select','',$prod_purchase);\r\n\r\n if( !empty($purchaseCheck) ) {\r\n return '1'; // Get download\r\n }\r\n else {\r\n return '2'; // Upgrade plan message\r\n }\r\n }\r\n }\r\n else {\r\n return '0';\r\n }\r\n\r\n /**** Download check *****/\r\n\t }\r\n\t else {\r\n\t return '0'; // to homepage\r\n\t }\r\n\t}",
"public function hasInstall();",
"function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}",
"public function is_available() {\n if ($this->enabled == \"yes\") {\n if (!is_ssl() && !$this->testmode) {\n return false;\n }\n // Required fields check\n if (!$this->secret_key || !$this->publishable_key) {\n return false;\n }\n return true;\n }\n return false;\n }",
"public function can_use_unstable_channels( $downloads ){\n\n\t\t$can = true;\n\t\tforeach( $downloads as $download ){\n\t\t\t$available_version = $download['version'];\n\t\t\t$installed_version = WP_Installer()->plugin_is_installed( $download['name'], $download['slug'] );\n\t\t\tif( $installed_version !== false && version_compare( $available_version, $installed_version, '>' ) ){\n\t\t\t\t$can = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $can;\n\t}",
"public function isDeactivated()\n {\n return $this->getDeactivated() == 'true';\n }",
"public static function isAvailable ()\n\t{\n\t\tif (!function_exists('curl_version')){\n\t\t\treturn false;\n\t\t}\n\n\t\t$versionInfo = curl_version();\n\t\t$versionTab = explode('.', $versionInfo['version']);\n\n\t\tif ($versionTab[0] < 7 || ($versionTab[0] == 7 && $versionTab[1] < 10) || ($versionTab[0] == 7 && $versionTab[1] == 10 && $versionTab[2] < 5)){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function isInstalled()\n {\n return $this->resource->getProperty('installed');\n }",
"public function isFeatured()\n {\n $isFeatured = FeaturedCompany::where([\n ['company_id', '=', $this->id],\n ['end_date', '>=', \\Carbon\\Carbon::now()],\n ])->get();\n if(!$isFeatured->isEmpty())\n {\n return true;\n };\n return false;\n }",
"public function isAvailable(): bool\n {\n return true;\n }",
"public function canBeDeactivated()\n {\n return $this->getIsActive();\n }",
"public function isDataDumpAvailable()\n {\n $result = self::checkFileAccess(Registry::get('config.dir.install') . App::DB_DATA);\n\n if (!$result) {\n $app = App::instance();\n $app->setNotification('E', $app->t('error'), $app->t('data_dump_is_not_available'), true);\n }\n\n return $result;\n }",
"protected function isVisible()\n {\n return parent::isVisible()\n && $this->getProduct()\n && $this->getAttachments();\n }",
"public function isAlreadyDownloaded(): bool\n {\n return file_exists($this->getFilePath());\n }",
"public function is_elex_dpd_enabled() {\n\t\treturn class_exists( 'Elex_dp_dynamic_pricing_plugin' );\n\t}",
"public function is_available() {\n\t\tif ( 'yes' === $this->enabled ) {\n\t\t\tif ( ! $this->testmode && is_checkout() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif ( ! $this->secret_key || ! $this->publishable_key ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function isInstalled() {\n return (bool)defined('ADDONS_CATALOG_SUPPORT_TICKETS_STATUS');\n }",
"public function installed() {\n\t\t//return $query->num_rows;\n \n\t\tif ( is_null($this->installed) ) {\n\t\t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"extension WHERE `type` = 'module' AND `code` = 'product_option_image_pro'\");\n\t\t\t$this->installed = $query->num_rows;\n\t\t}\n // not working in mijoshop\n //$query = $this->db->query('SHOW TABLES LIKE \"' . DB_PREFIX . 'poip_option_image\"');\n return $this->installed;\n }",
"public static function isEnabled()\n\t{\n\t\treturn Main\\ModuleManager::isModuleInstalled('recyclebin');\n\t}",
"abstract public function isAvailable() ;",
"public function isAvailable()\n {\n if ($this->archived) {\n return false;\n }\n\n $result = self::$db->fetchOne('select count(*) AS valid\n from jukebox.playlists\n inner join jukebox.playlist_availability on playlists.playlistid = playlist_availability.playlistid\n inner join jukebox.playlist_timeslot\n on playlist_availability.playlist_availability_id = playlist_timeslot.playlist_availability_id\n where playlists.playlistid = $1\n and playlist_availability.effective_from <= NOW()\n and (playlist_availability.effective_to is null or playlist_availability.effective_to >= NOW())\n and (\n day=EXTRACT(DOW FROM NOW())\n or (EXTRACT(DOW FROM NOW())=0 and day=7)\n )\n and start_time <= \"time\"(NOW())\n and end_time >= \"time\"(NOW())', [$this->getID()]);\n\n return $result['valid'] > 0;\n }",
"public static function is_available()\n {\n }",
"function isAvailable()\n {\n }",
"public function is_available($package) {\n return $this->is_enabled();\n }"
]
| [
"0.6756252",
"0.6728547",
"0.6452824",
"0.64130855",
"0.6371583",
"0.63233256",
"0.61859",
"0.6164307",
"0.6154089",
"0.60969454",
"0.608827",
"0.60789347",
"0.6031823",
"0.5982702",
"0.59387773",
"0.59274393",
"0.5912295",
"0.58973855",
"0.5818333",
"0.5806709",
"0.5786719",
"0.572762",
"0.5700102",
"0.5686686",
"0.5679239",
"0.5672867",
"0.56580406",
"0.562687",
"0.562687",
"0.562687",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.562647",
"0.5597707",
"0.5597707",
"0.5577656",
"0.55716765",
"0.55608886",
"0.5558509",
"0.5557608",
"0.55506",
"0.55475587",
"0.55349684",
"0.553011",
"0.5521802",
"0.5519608",
"0.5510947",
"0.5510823",
"0.550186",
"0.5494251",
"0.5488945",
"0.54859287",
"0.54645824",
"0.5462855",
"0.5459239",
"0.54585993",
"0.5457417",
"0.54557914",
"0.545251",
"0.54433835",
"0.5440542",
"0.5427458",
"0.5425504",
"0.5419813",
"0.5415932",
"0.5411921",
"0.5410331",
"0.5409034",
"0.5408876",
"0.5407635",
"0.53977823",
"0.5391629",
"0.538953",
"0.53890675",
"0.5387053",
"0.5386114",
"0.5372144",
"0.5371397",
"0.5368105",
"0.53631455",
"0.5360113",
"0.5359299",
"0.53471816",
"0.53406173",
"0.53244567",
"0.53205866",
"0.5319734",
"0.5317672",
"0.5310922"
]
| 0.67948794 | 0 |
Lists all Email models. | public function actionIndex()
{
$searchModel = new EmailSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllEmails() {\n return getALL('SELECT * FROM mail');\n}",
"public function emails()\n {\n return $this->hasMany(Email::class);\n }",
"public function findAll()\n {\n return $this->em\n ->getRepository('App:Mail')\n ->findAll()\n ;\n }",
"public function actionIndex()\n {\n $request = Yii::app()->request;\n $email = new TransactionalEmail('search');\n $email->unsetAttributes();\n\n $email->attributes = (array)$request->getQuery($email->modelName, array());\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('transactional_emails', 'View transactional emails'),\n 'pageHeading' => Yii::t('transactional_emails', 'View transactional emails'),\n 'pageBreadcrumbs' => array(\n Yii::t('transactional_emails', 'Transactional emails') => $this->createUrl('transactional_emails/index'),\n Yii::t('app', 'View all')\n )\n ));\n\n $this->render('list', compact('email'));\n }",
"public function emails()\n\t{\n\t\treturn $this->oneToMany(__NAMESPACE__ . '\\\\Mailinglist\\\\Email', 'mid');\n\t}",
"public function index()\n {\n return view(\"emails\", [\"emails\" => $this->email->get()->sortByDesc(\"created_at\")]);\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $emails = $em->getRepository('Workshop5Bundle:Email')->findAll();\n\n return $this->render('email/index.html.twig', array(\n 'emails' => $emails,\n ));\n }",
"public function indexAction()\n {\n try {\n $email = new Email();\n $grupo = new EmailGrupo();\n\n $this->view->emails = $email->lista(\n $this->_session->empresa->id_empresa,\n $this->_getParam('pagina', 0),\n $this->_getParam('grupo', null)\n );\n\n $this->view->grupos = $grupo->lista(\n $this->_session->empresa->id_empresa\n );\n } catch (Exception $e) {\n $mensagem = array('error' => $e->getMessage());\n $this->_helper->flashMessenger($mensagem);\n }\n }",
"public function getAllEmails() {\n $this->db->cache = false;\n if (!$this->db->from($this->table)->select('email')->all()) {\n return [];\n }\n return $this->db->from($this->table)->select('email')->all();\n }",
"public function indexAction()\n {\n return new ViewModel(array(\n 'records' => $this->emailsService->getCurrentEmails(),\n ));\n }",
"function index()\n {\n if (!$this->session->userdata('admin_logged')){ redirect('admin/login');} \n $data['email'] = $this->Email_model->get_all_email();\n \n $data['_view'] = 'email/index';\n $this->load->view('layouts/main',$data);\n }",
"public function emails()\n {\n return $this->hasMany(PartenaireEmail::class);\n }",
"public function emails()\n {\n return $this->hasManyThrough(Contact::class, Profile::class)\n ->select([DB::raw('IFNULL(prefix, \"Email\") AS type'), 'value AS url', 'is_primary'])\n ->where('type', 'email');\n }",
"public function getEmails(){\r\n \r\n $dbConfig = array(\r\n \"DB_DNS\" => 'mysql:host=localhost;port=3306;dbname=PHPadvClassSpring2015',\r\n \"DB_USER\" => 'root', \r\n \"DB_PASSWORD\" => '');\r\n $pdo = new DB($dbConfig);\r\n $db = $pdo->getDB();\r\n $stmt = $db->prepare(\"SELECT * FROM emailtype where active = 1\");\r\n if ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n echo '<h3>Types of E-mails</h3>';\r\n foreach ($results as $value) {\r\n echo '<p>- <strong>', $value['emailtype'], '</strong></p>';\r\n }\r\n } else {\r\n echo '<p>No data found!</p>';\r\n } \r\n \r\n }",
"public function getAllMails()\n {\n $user = Auth::user();\n $emails = DB::table('users')->select('id','email')->get();\n return response()->json($emails);\n }",
"public function actionIndex()\r\n {\r\n\r\n /*var_dump(\\Yii::$app->user->identity->mail);\r\n exit;*/\r\n $dataProvider = new ActiveDataProvider([\r\n 'query' => Order::find()->where(['email'=>\\Yii::$app->user->identity->mail])->orderBy([\r\n 'date_create' => SORT_DESC,\r\n 'id' => SORT_DESC,\r\n ]),\r\n 'pagination' => [\r\n 'forcePageParam' => false,\r\n 'pageSizeParam' => false,\r\n 'pageSize' => 10,\r\n ],\r\n 'sort'=> false\r\n ]);\r\n //var_dump(Order::find()->where(['email'=>\\Yii::$app->user->identity->mail])->asArray()->all()); exit;\r\n return $this->render('index', [\r\n 'dataProvider' => $dataProvider,\r\n //'model' => Order::find()->asArray()->all()\r\n ]);\r\n }",
"public function index() {\n\t\t$this->{$this->modelClass}->recursive = 0;\n\n\t\t$this->set('attachments', $this->{$this->modelClass}->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'foreign_key' => $this->modelId,\n\t\t\t\t'group' => $this->modelClass,\n\t\t\t\t'model' => $this->model\n\t\t\t)\n\t\t)));\n\t\t$this->set('limit', $this->_getLimit());\n\t}",
"function get_all_mail()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('mail')->result_array();\n }",
"function getEmails() {\n\treturn db_query(\"SELECT email FROM Emails\");\n}",
"public function getEmails()\n\t{\n \\Phalcon\\DI::getDefault()->get('logger')->log(\"Emails: \" . print_r($this->emails, true));\n\t\treturn $this->emails;\n\t}",
"public function actionIndex()\n {\n\n \t$model = new MailTemplate();\n \t$dataProvider = new ActiveDataProvider([\n 'query' => MailTemplate::find()\n ]);\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'model' => $model,\n ]);\n }",
"public function getAllEmail()\n {\n $query = $this->db->select('first_name, last_name, email')\n ->get('user');\n return $query->result_object();\n }",
"public function getOrderEmailList(){\n // Set method and action\n $method = 'email';\n $action = 'getOrderEmailList';\n\n // Set data\n $data = array('params' => true);\n\n // Send request and retrieve response\n $result = Dispatcher::send($method, $action, $data);\n\n return $result;\n }",
"function listEmails(){\n \n $conn = $this->connect();\n $ret = '';\n \n $sql = 'select email from ' . $this->dbtable;\n\t\t\t$query = mysql_query( $sql, $conn );\n \n\t\t\twhile( $row = mysql_fetch_assoc( $query ) ){\n\t\t\t\t$ret .= $row['email'] . \";\\n\";\n\t\t\t}\n \n mysql_close( $conn );\n \n\t\t\treturn $ret;\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entities = $em->getRepository('LooninsIncidentBundle:GdpMails')->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function getEmails()\n {\n $response = $this->get('user/emails');\n\n return $response['emails'];\n }",
"public function getAllEmails() {\n $users = $this->getDoctrine()->getRepository(User::class)->findAll();\n $emails = [];\n foreach($users as $email) {\n if(\"admin@email.com\" != $email->getEmail())\n array_push($emails, $email->getEmail());\n }\n\n return $emails;\n }",
"public function fetchEmails(): void\n {\n $this->fetchedEmails = [];\n\n try {\n $response = $this->mailhog->request('GET', '/api/v1/messages');\n $this->fetchedEmails = json_decode($response->getBody(), false);\n } catch (Exception $e) {\n $this->fail('Exception: ' . $e->getMessage());\n }\n $this->sortEmails($this->fetchedEmails);\n\n // by default, work on all emails\n $this->setCurrentInbox($this->fetchedEmails);\n }",
"public function listadeTodosEmailDao(){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoEmail.php\");\r\n \r\n $obj = Connection::getInstance();\r\n $listaEmail = array();\r\n \r\n $string = \"Select nome,email,comentario,data from email order by data\";\r\n $resultado = mysql_query($string) or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n\t$i=0; \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n\r\n\t $email = new objetoEmail(); \r\n $email->enviarEmail($registro['email'],$registro['nome'],$registro['comentario'],$registro['data']); \r\n\t $listaEmail[$i] = $email;\r\n \r\n $i++;\r\n }\r\n\t\t\r\n\t\tmysql_free_result($resultado);\r\n $obj->freebanco();\r\n return $listaEmail;\r\n }",
"public function getContactAllEmail()\n\t{\n\t\t$emails = 'nothing';\n\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$url = $this->url . \"/Contacts/filter\";\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name\",\n\t\t\t);\n\n\t\t\t$response = self::call($url, $this->token, 'GET',$filter_arguments);\n\n\t\t\t$email_records = $response->records;\n\n\t\t\tforeach($email_records as $record)\n\t\t\t{\n\t\t\t\t$emails[] = $record->portal_name;\n\t\t\t}\n\t\t}\n\n\t\treturn $emails;\n\t}",
"public function listaFaturamentoEmails()\n {\n return view('faturamento.listarEmailsFaturamento');\n }",
"public function index()\n {\n $mail = Mails::get();\n\n return view('admin.mails.index', compact('mail'));\n }",
"public function getEmails()\n {\n return $this->emails;\n }",
"public function getEmails()\n {\n return $this->emails;\n }",
"public function index()\n {\n return $this->model->all();\n }",
"public function emails()\n {\n return $this->emails;\n }",
"public function GetAll()\n {\n return $this->model->all();\n }",
"public function emailAddresses()\n {\n return $this->hasMany(OfficeEmailAddress::class);\n }",
"public function emailAddresses()\n {\n return $this->hasMany(OfficeEmailAddress::class);\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function GetEmailAddresses()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetAllMembersAndEmails();\n }",
"public function index(){\n Auth::checkAdminLogin();\n\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Email');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = 'Email Index';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Emails';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Email Index';\n\n\t\t###### PAGINATION ######\n //sanitise or set keywords to false\n if(isset($_GET['keywords']) && !empty($_GET['keywords'])){\n $_GET['keywords'] = FormInput::checkKeywords($_GET['keywords']);\n }else{\n $_GET['keywords'] = false;\n }\n\n $totalItems = $this->_model->countAllData($_GET['keywords']);\n $pages = new Pagination(20,'keywords='.$_GET['keywords'].'&page', $totalItems[0]['total']);\n $this->_view->getAllData = $this->_model->getAllData($pages->get_limit(), $_GET['keywords']);\n\n\t\t// Create the pagination nav menu\n\t\t$this->_view->page_links = $pages->page_links();\n\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('emails/index', 'layout', 'backoffice');\n\t}",
"public function findAll() {\n\t\treturn dibi::dataSource(\"SELECT * FROM [view_message]\");\n\t}",
"public function getAllIBCEmails() {\n\t\t$dao = $this->getDao(new IBCEmailGen());\n $whereClauseGroup = new WhereClauseGroup(\n\t\t\tarray(\n\t\t\t\tnew WhereClause('module','=', IBCEmailGen::$MODULE_NAME)\n\t\t\t)\n );\n $responses = $dao->getAllWhere($whereClauseGroup);\n return $responses;\n\t}",
"public function actionIndex()\n {\n $this->layout = 'profile-layout';\n \n $session = Yii::$app->session;\n\n $student = Student::findOne($session->get('id'));\n \n $emails = null;\n \n if($student!==null){\n \n $emails = Email::find()->where(['receiver_email' => $student->email_address])->all();\n \n }\n\n return $this->render('index',[\n 'emails' => $emails,\n ]);\n }",
"public function index(){\n return $this->model->all();\n }",
"public function retrieveAllMails()\n {\n $mails = new Collection();\n for($i = 1; $i <= $this->countAllMails(); $i++)\n {\n $mails->add($this->retrieveMail($i));\n }\n return $mails;\n }",
"public function index()\n {\n $emails = EmailTracker::all();\n return view('email_tracker',compact('emails'));\n }",
"public function all()\n {\n return Model::all();\n }",
"public function all()\n {\n return Model::all();\n }",
"public function getAll()\r\n {\r\n return $this->contactManager->fetchAll(true, null, null);\r\n }",
"public function scopeGetAllMails()\n {\n\n $gname = Input::get( 'gname' );\n\n $mails = Tolist::findMany( array(\n 'to_id' => Auth::user()->id . '_' . $gname\n ), array(\n 'email'\n ) )->all( 'email' );\n\n return Helper::cleanGroups( $mails, '|' );\n\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"public function all()\n {\n return $this->model->all();\n }",
"function getMailList() {\n return getAll(\"SELECT id,`email` FROM `member` WHERE id != ?\"\n , [getLogin()['mid']]);\n}",
"public function index()\n {\n if (\\Auth::user()->type != \\App\\User::ADMINISTRATOR) {\n abort(403);\n }\n $emailboxes = Emailbox::with('sites')->get();\n return view('emailbox.list', ['emailboxes' => $emailboxes]);\n }",
"public function getMails(): Collection\n {\n\n return $this->mails;\n\n }",
"public function index()\n {\n\n $group = EmailGroup::paginate(20);\n return view('admin.email-marketing.Group.index')->with(['items' => $group]);\n }",
"public function all()\n\t{\n\t\treturn $this->model->all();\n\t}",
"public function index()\n {\n return $this->model->getAll();\n }",
"public function listAll(){\n\n\t\t\t$result = array();\n\t\t\t$people = array();\n\n\t\t\t$structure = General::listStructure(EMAILGATEWAYS, '/email.[\\\\w-]+.php/', false, 'ASC', EMAILGATEWAYS);\n\n\t\t\tif(is_array($structure['filelist']) && !empty($structure['filelist'])){\n\t\t\t\tforeach($structure['filelist'] as $f){\n\t\t\t\t\t$f = str_replace(array('email.', '.php'), '', $f);\n\t\t\t\t\t$result[$f] = $this->about($f);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$extensions = Symphony::ExtensionManager()->listInstalledHandles();\n\n\t\t\tif(is_array($extensions) && !empty($extensions)){\n\t\t\t\tforeach($extensions as $e){\n\n\t\t\t\t\tif(!is_dir(EXTENSIONS . \"/$e/email-gateways\")) continue;\n\n\t\t\t\t\t$tmp = General::listStructure(EXTENSIONS . \"/$e/email-gateways\", '/email.[\\\\w-]+.php/', false, 'ASC', EXTENSIONS . \"/$e/email-gateways\");\n\n\t\t\t\t\tif(is_array($tmp['filelist']) && !empty($tmp['filelist'])){\n\t\t\t\t\t\tforeach($tmp['filelist'] as $f){\n\t\t\t\t\t\t\t$f = preg_replace(array('/^email./i', '/.php$/i'), '', $f);\n\t\t\t\t\t\t\t$result[$f] = $this->about($f);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tksort($result);\n\t\t\treturn $result;\n\t\t}",
"public function index() {\n $emails = Tbl_emails::all(); //with('tbl_emailcategory')->get()\n $total = count($emails);\n if ($total > 0) {\n $formstable = '<table id=\"example1\" class=\"table\">';\n $formstable .= '<thead>';\n $formstable .= '<tr>';\n $formstable .= '<th>Mail</th>';\n// $formstable .= '<th>Category</th>';\n $formstable .= '<th>Action</th>';\n $formstable .= '</tr>';\n $formstable .= '</thead>';\n $formstable .= '<tbody>';\n foreach ($emails as $temp) {\n $formstable .= '<tr>';\n $formstable .= '<td>' . $temp->mail . '</td>';\n// $formstable .= '<td>' . $temp->tbl_emailcategory->category . '</td>';\n $formstable .= '<td>';\n $formstable .= '<a href=\"' . url('admin/emails/' . $temp->mail_id . '/edit') . '\" class=\"btn badge badge-secondary py-1 px-2 mr-2\">Edit</a></li>\n <a href=\"\" class=\"btn badge badge-secondary py-1 px-2 mr-2\">Delete</a>';\n //' . url('admin/emails/delete/' . $temp->mail_id) . '\n $formstable .= '</td>';\n $formstable .= '</tr>';\n }\n $formstable .= '</tbody>';\n $formstable .= '</table>';\n } else {\n $formstable = 'No records available';\n }\n\n $data['total'] = $total;\n $data['table'] = $formstable;\n\n return view('admin.emails.index')->with(\"data\", $data);\n }",
"public function emailadressen() {\r\n\t\t$objDBMaillijstEmailAdres = new clsDBMaillijstEmailAdres();\r\n\t\tforeach($objDBMaillijstEmailAdres->selectAll($this->getm_iBedrijfID(), $this->getm_iMaillijstID()) as $rs){\r\n\t\t\tarray_push($this->m_colEmailAdressen,new clsEmailAdres($rs['BedrijfID'],$rs['EmailAdresID'])); // voeg object MaillijstEmailAdres toe aan emailadressen collection\r\n\t\t};\r\n\t \treturn $this->m_colEmailAdressen;\r\n\t}",
"public function showAllByEmail(Request $request)\n {\n $this->validate($request, ['email' => 'required|email']);\n\n $recipient = Recipient::where('email', $request->input('email'))->first();\n if ($recipient === null) {\n return response()->json(['error' => 'Recipient not found!'], 400);\n } else {\n $vouchers = VoucherPool::where(\n 'recipient_id',\n $recipient->id\n )->with(\n 'specialoffer'\n )->get();\n\n return response()->json(\n ['data' => ['recipient' => $recipient, 'vouchers' => $vouchers]]\n );\n }\n }",
"public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }",
"public function getModels();",
"public function getModels();",
"public function index()\n {\n return Model::all();\n }",
"public function index()\n {\n $mailers = Mailer::orderBy('send_date', 'desc')->get();\n\n return view('mailers.index', compact('mailers'));\n }",
"public function getAllEnquiries()\r\n\t\t{\r\n\t\t\tContact::SetQuery($name, $email, $subject, $message);\r\n\t\t}",
"public function getAllVoicemail()\n {\n return $this->_getAndParse($this->_serverPath['voicemail'], null);\n }",
"public function index()\n {\n\t\t$e2s = EmailToSMS::find(1);\n return view('gammu-e2s::email2sms',['e2s'=>$e2s]);\n }",
"public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }",
"function getAll() {\r\n\t\t$cond = new Criteria();\r\n\t\t$alls = NewsletterUserPeer::doSelect($cond);\r\n\t\treturn $alls;\r\n }",
"public function index()\n {\n $emailfrom=EmailAcounts::all();\n return view('Compose',compact('emailfrom'));\n }",
"public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }",
"public function index(EmailRequestList $request)\n {\n return response()->json(['success' => true, 'messages' => [__('pages.email.send.success')], 'data' => ['email' => $this->emailService->index($request->paginate, 200)]], 200);\n }",
"public function actionList()\r\n {\r\n $this->_userAutehntication();\r\n switch($_GET['model'])\r\n {\r\n case 'posts': \r\n $models = Post::model()->findAll();\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>list</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($models)) {\r\n $this->_sendResponse(200, sprintf('No Post found for model <b>%s</b>', $_GET['model']) );\r\n } else {\r\n $rows = array();\r\n foreach($models as $model)\r\n $rows[] = $model->attributes;\r\n\r\n $this->_sendResponse(200, CJSON::encode($rows));\r\n }\r\n }",
"public static function getAll()\n {\n $db = new DatabaseManager();\n $connection = $db->getDbh();\n\n $sql = 'SELECT * FROM messages';\n $statement = $connection->prepare($sql);\n $statement->setFetchMode(\\PDO::FETCH_CLASS, __CLASS__);\n $statement->execute();\n\n $objects = $statement->fetchAll();\n return $objects;\n }",
"public function findAll()\n {\n return $this->model->all();\n }",
"public function index()\n {\n // Busco todos los mails\n $mails = Mail::all();\n \n // Retorno vista\n return view('panel.mails.index', compact('mails'));\n }",
"public function index()\n {\n $this->data['model'] = MailTracking::orderBy('Mtr_CreatedOn', 'desc')->paginate(10);\n\n return parent::index();\n }",
"public function all()\n {\n return $this->getModel()->all();\n }",
"public function index()\n\n {\n $contacts = Contact::paginate(10);\n return view('admin.all_messege.index',compact('contacts'));\n }",
"public function indexEmail()\n {\n if (!Sentinel::hasAccess('communication')) {\n Flash::warning(\"Permission Denied\");\n return redirect('/');\n }\n $data = Email::where('branch_id', session('branch_id'))->get();\n return view('communication.email', compact('data'));\n }",
"private function emailList()\n {\n return array(\n 'temp@yahoo.com',\n 'something@outlook.com',\n 'anything@yahoo.com',\n );\n }",
"public function getAll()\n {\n return $this->model->orderBy('id', 'DESC')->get();\n }"
]
| [
"0.68866825",
"0.6865553",
"0.6796659",
"0.67715317",
"0.6690034",
"0.6682161",
"0.6607999",
"0.65811944",
"0.65793234",
"0.63902086",
"0.6342409",
"0.63021195",
"0.6278748",
"0.6234125",
"0.62221783",
"0.6138468",
"0.61341375",
"0.61251754",
"0.61060524",
"0.6060922",
"0.6034446",
"0.60118634",
"0.6000459",
"0.5987427",
"0.59835804",
"0.5981723",
"0.5966725",
"0.5960733",
"0.5947993",
"0.5921989",
"0.59119594",
"0.59114474",
"0.58954585",
"0.5892884",
"0.5889775",
"0.58731765",
"0.58731765",
"0.5845539",
"0.5828002",
"0.58206475",
"0.5812773",
"0.5812773",
"0.5800062",
"0.5800062",
"0.5800062",
"0.57934123",
"0.57932377",
"0.57909775",
"0.5783903",
"0.5783292",
"0.5781658",
"0.5780505",
"0.57783747",
"0.57754135",
"0.57754135",
"0.57445973",
"0.5743349",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.5741427",
"0.57338756",
"0.57318926",
"0.5731306",
"0.57277876",
"0.5723864",
"0.5721705",
"0.5716282",
"0.5711344",
"0.56933063",
"0.56888455",
"0.5684321",
"0.5684092",
"0.5684092",
"0.5677214",
"0.56645745",
"0.5660637",
"0.56587887",
"0.5658324",
"0.56503993",
"0.56374466",
"0.56324816",
"0.56281817",
"0.561774",
"0.5610106",
"0.5608207",
"0.56054616",
"0.55872285",
"0.55825096",
"0.55760497",
"0.55699426",
"0.55690974",
"0.556783",
"0.5565802"
]
| 0.72133 | 0 |
Finds the Email model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = Email::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findByEmail($email)\n {\n return $this->model->where('email', $email)->first();\n }",
"public function findEmail($id)\n {\n if(is_object($id)){\n $emailId = $id->getId();\n }else{\n $emailId = $id;\n }\n $this->logger->debug(\">>>>Finding Email\" . $emailId);\n $email = $this->emailRepository->find($emailId);\n if (! $email) {\n $this->logger->error(\"Email Service - Find Email - \" . \"Email Id\" . $emailId . \"Not Found\");\n throw new ValidationException([\n 'email Not Found.'\n ], 'email Not Found.', 'email_not_found');\n }\n return $email;\n }",
"function findByEmail()\n {\n Configure::write('debug', '0');\n $this->layout = false;\n \n if ($this->RequestHandler->isAjax() && $this->request->data['Manager']['email']) {\n\n $conditions = array('email' => $this->request->data['Manager']['email'],'is_deleted'=>0) ;\n $managers = $this->Manager->User->find('first', array( 'contain' => array(),'conditions'=>$conditions));\n\n $assignmodel = $this->request->data['Manager']['model'];\n $modelID = $this->request->data['Manager']['model_id'];\n\n $this->set(compact('managers'));\n $this->set('assignmodel', $assignmodel);\n $this->set('modelID', $modelID);\n } else {\n exit();\n }\n\n }",
"public static function findUserbyEmail($email)\r\n {\r\n\t\t $tableName = preg_replace('/.*\\\\\\\\/', '', get_called_class());\r\n\t\t $sql = 'SELECT * FROM ' . $tableName . ' WHERE email = ?';\r\n \r\n //grab the only record for find one and return as an object\r\n $recordsSet = self::getResults($sql, self::$modelName, $email);\r\n \r\n if (is_null($recordsSet)) {\r\n return FALSE;\r\n } else {\r\n return $recordsSet[0];\r\n }\r\n }",
"public function find($id) {\n return $this->allEmail->find($id);\n }",
"public function getByEmail(string $email)\n {\n return $this->model->where('email', $email)->first();\n }",
"public abstract function find($primary_key, $model);",
"public function findEmailByKey($key)\r\n {\r\n $column = 'email';\r\n\r\n return $this->db->select($column)\r\n ->from(self::getTableName())\r\n ->whereEquals('key', $key)\r\n ->query($column);\r\n }",
"public function find_by_email($email)\n\t{\n\t\treturn $this->where('email', $email)->find();\n\t}",
"public function findByAddress($email)\n {\n if($validation = $this->validation(['email' => $email]))\n return $validation;\n\n $q = $this->createModel();\n $q = $q->where('email','=',$email);\n return $q->first();\n }",
"public function findByEmail($email){\n try {\n $connection = Connection::getConnection();\n $sql = \"select * from \\\"user\\\" where email = :email\";\n $stmt = $connection->prepare($sql);\n $stmt->bindValue(\":email\", $email);\n $result = $stmt->execute();\n $result = $stmt->fetchAll();\n if ($result) {\n $result = $result[0];\n return new UserModel(\n $result['id'],\n $result['name'],\n $result['gender'],\n $result['email'],\n $result['status'],\n $result['type'],\n $result['photo']\n );\n } else {\n return null;\n }\n } catch (\\Exception $ex) {\n throw $ex;\n } finally {\n $connection = null;\n } \n }",
"public function retrieveOneAction() {\n $requestData = $this->get('json.service')->decode($this->getRequest()->get('json_data'));\n\n $id = $requestData['id'];\n $email = $this->get('email.service')->retrieveOne($id);\n\n if ($email) {\n return $this->get('json.service')->sucessResponse($email);\n }\n\n return $this->get('json.service')->errorResponse(new ResponseEmailRetrieveFailure());\n }",
"function people_findByEmail($find_email) {\n $response = $this->execute(array('method' => 'flickr.people.findByEmail', 'find_email' => $find_email));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}",
"protected function findModel($email, $periodstart, $periodend) {\n if (($model = Dw::findOne(['email' => $email, 'periodstart' => $periodstart, 'periodend' => $periodend])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function findByEmail($email = null) {\n\t\treturn $this->find('first', array(\n\t\t\t'contain' => array(),\n\t\t\t'conditions' => array(\n\t\t\t\t$this->alias . '.email' => $email,\n\t\t\t)\n\t\t));\n\t}",
"public function findUser($email = null)\n {\n if(!$email){\n\n throw new Exception(__METHOD__ .\": Parameter {$email} should have email address.\");\n }\n\n $param = ['email' => esc($email), 'table' => 'Users'];\n\n $this->query->get($param['table'], \"email ='{$param['email']}'\");\n\n return $this->query->first();\n }",
"public function findByEmail($email);",
"public function findByEmail($email);",
"public function findByEmail($email);",
"public function findByEmail($email);",
"public function findUserByEmail($email);",
"public function findUserByEmail($email);",
"public function findUserByEmail($email);",
"public function findByEmail($email, $not_id = null)\n\t{\n\n\n\n\n\t\tif(!$not_id) {\n \t$this->db->select()\n ->from($this->getSource())\n ->where(\"email = ?\");\n $this->db->execute([$email]);\n } else {\n \t$this->db->select()\n ->from($this->getSource())\n ->where(\"email = ?\")\n ->andWhere(\"id <> ?\");\n $this->db->execute([$email, $not_id]);\n }\n\t \n\t return $this->db->fetchInto($this);\n\t}",
"public static function idByEmail($email=NULL)\n {\n if($email!=NULL)\n {\n try \n {\n $count = User::where('email', $email)->count();\n if($count > 0)\n {\n $user = User::where('email', $email)->orderBy('name', 'asc')->first();\n return $user->id;\n }\n else\n {\n return null;\n }\n } \n catch (ModelNotFoundException $e) \n {\n Log::error(\"The user with email ` $email ` does not exist: \". $e->getMessage());\n //TODO: send email?\n return null;\n }\n }\n else\n {\n return null;\n }\n }",
"protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"public function loadUserByEmail($email)\n { \n $user = $this->_em->getRepository('Entity\\User\\User')->findOneBy(array('email' => $email));\n\n if($user != null)\n return $user;\n\n throw new UsernameNotFoundException(\"Compte introuvable\");\n }",
"public static function findByEmail($email)\n {\n return static::find()->where(['email' => $email])->one();\n }",
"public static function findByEmailOrUsername (string $emailOrUsername): ?object\n {\n /**\n * Whitespace entfernen.\n */\n $emailOrUsername = trim($emailOrUsername);\n\n /**\n * Datenbankverbindung herstellen.\n */\n $database = new Database();\n\n /**\n * Tabellennamen berechnen.\n */\n $tablename = self::getTablenameFromClassname();\n\n /**\n * Query ausführen.\n *\n * Wir setzen hier LIMIT 1, weil wir nur eine*n User*in gleichzeitig einloggen können und daher nur eine*n\n * User*in zurückbekommen wollen aus der Datenbank. Nachdem sowohl email als auch username UNIQUE sind, gibt es\n * nur dann die Möglichkeit, dass wir mehr als ein Ergebnis erhalten, wenn jemand eine Fremde E-Mail Adresse als\n * Username verwendet hat.\n */\n $results = $database->query(\"SELECT * FROM $tablename WHERE email = ? OR username = ? LIMIT 1\", [\n 's:email' => $emailOrUsername,\n 's:username' => $emailOrUsername\n ]);\n\n /**\n * Im AbstractModel haben wir diese Funktionalität aus der all()-Methode herausgezogen und in eine eigene\n * Methode verpackt, damit wir in allen anderen Methoden, die zukünftig irgendwelche Daten aus der Datenbank\n * abfragen, den selben Code verwenden können und nicht Code duplizieren müssen.\n */\n $result = self::handleUniqueResult($results);\n\n /**\n * Ergebnis zurückgeben.\n */\n return $result;\n }",
"public static function findByEmail($email){\n\t\t$sql = 'SELECT * FROM users WHERE email = :email';\n\t\t$db = static::getDB();\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bindParam(':email', $email, PDO::PARAM_STR);\n\t\t//$stmt->setFetchMode(PDO::FETCH_CLASS, 'App\\Models\\User');\n\t\t$stmt->setFetchMode(PDO::FETCH_CLASS, get_called_class());\n\t\t$stmt->execute();\n\t\t//PDO::fetch() returns false if no record is found\n\t\treturn $stmt->fetch();\n\t}",
"public function findByEmail($email)\n {\n return self::model()->findByAttributes(array('email' => $email));\n }",
"public function findByEmail($email)\n {\n return self::model()->findByAttributes(array('email' => $email));\n }",
"public function findByEmail(string $email)\n {\n return $this->findOne(['email' => $email]);\n }",
"function getByEmail($email){\n\t\t}",
"public function findById() {\n // TODO: Implement findById() method.\n }",
"public function getUserByEmail($email)\n {\n return $this->model->where('email', $email)->first();\n }",
"function loadByEmail( $email )\n {\n \t// calling constructSearchCondition ensures that quotes are added to the email address\n \t$condition = $this->constructSearchCondition( \"person_email\", \"=\", $email );\n\n\t// will return whether this row manager was successfully loaded according to the condition\n\treturn $this->loadByCondition( $condition );\n }",
"public static function findByEmail($email){\n\n $sql=\"SELECT * FROM user WHERE email=:email\";\n $stmt=static::getDB()->prepare($sql);\n $stmt->bindValue(\":email\",$email,PDO::PARAM_STR);\n // FETCH_CLASS sẽ thực thi xong rồi mới chạy __constructer\n $stmt->setFetchMode(PDO::FETCH_OBJ);\n $stmt->execute();\n $count=$stmt->rowCount();\n // if($count !=1){\n // echo 'User with that email does not exist';\n // return false;\n // }\n return $stmt->fetch(); \n }",
"function getByEmail($email);",
"public function fetchOneForEmail($email) {\n\t\treturn $this->fetchOneWhere([$this->columnPrefix.'email = ?'=>$email]);\n\t}",
"public static function LoadByEmail($email)\r\n\t\t{\r\n\t\t\t$db = Core::GetDBInstance();\r\n\t\t\t\r\n\t\t\t$clientid = $db->GetOne(\"SELECT id FROM clients WHERE email=?\", array($email));\r\n\t\t\tif (!$clientid)\r\n\t\t\t\tthrow new Exception(sprintf(_(\"Client with email=%s not found in database\"), $email));\r\n\t\t\t\t\r\n\t\t\treturn self::Load($clientid);\r\n\t\t}",
"public function findOneByEmail($email)\n {\n $data = $this->connection\n ->selectDB('boomstone')\n ->selectCollection($this->getCollectionName())\n ->findOne(array('email' => $email));\n\n if (null === $data) {\n return null;\n }\n return $this->hydrate($data);\n }",
"public function findByEmail($email) {\n\t\t$query = $this->createQuery();\n\t\treturn $query->matching($query->equals('email', $email))\n\t\t->execute()->getFirst();\n\t}",
"public static function getByEmail ($email) {\n // Retrieve account resources.\n $accounts = Json::save('account', null);\n\n // If account resource is not avaiable, internal server error.\n if ($list == 1)\n return 1;\n\n // Iterate through list and return it.\n foreach ($accounts as $account) {\n if ($account['email'] == $email)\n return $account;\n }\n\n // Account not found.\n return 2;\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public function getByEmail($email) {\n\n\t\t// get database\n\t\t$db = $this->app->database;\n\n\t\t// search email\n\t\tif ($id = $db->queryResult('SELECT id FROM #__users WHERE email = '.$db->Quote($email))) {\n\t\t\treturn $this->get($id);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getFirstByEmail($email)\n {\n if (!$user = $this->findFirstByEmail($email)) {\n throw new EntityNotFoundException($email, 'email');\n }\n\n return $user;\n }",
"function find_by_email($h, $email ){\n \n $sql = \"SELECT * FROM \" . TABLE_USERS . \" WHERE user_email=%s LIMIT 1\";\n $query = $h->db->prepare($sql, $email);\n \n\treturn $parents = $h->db->get_results($query);; \n }",
"public static function findUserByEmail($email)\n {\n return static::find()->where(['email' => $email])->one();\n }",
"public static function findByEmail($email)\n {\n return self::find()->andWhere([ 'email' => $email ])->one();\n }",
"Public Function getIdUsingEmail($Email)\n\t{\n\t\t$Result = $this->_db->fetchRow('SELECT * FROM bevomedia_user WHERE email = ?', $Email);\n\t\tif(!$Result || !sizeOf($Result))\n\t\t\treturn false;\n\t\treturn $Result->id;\n\t}",
"static public function fetchUsingEmail($email) {\n $obj = new self();\n return $obj->findByEmail($email);\n }",
"public function findUserByEmail($email) {\r\n // rufe die Funktion query('SQL Statement') in der Klasse Database auf\r\n $this->db->query('SELECT * FROM users WHERE email = :email');\r\n $this->db->bind(':email', $email);\r\n \r\n //es sollte nur eine uebereinstiende Mail geben, also single() methode nuzzen\r\n $row = $this->db->singleResult();\r\n\r\n // Check row, if > 0 an email is found\r\n if($this->db->numRows() > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"protected function findModel($id)\n {\n if (($model = SourceMessage::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Module::t('The requested page does not exist.'));\n }\n }",
"public function getFirstByEmail($email)\n {\n if (!$user = $this->findFirstByEmail($email)) {\n throw new Exceptions\\EntityNotFoundException($email, 'email');\n }\n\n return $user;\n }",
"public function getById($id)\n {\n $email = $this->repo->getById($id);\n return $email;\n }",
"protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}",
"public function fetchUserByEmail($email);",
"public function lookupEmail( $emailAddress )\n {\n $user = \\R::findOne('user', 'email = ?', [ $emailAddress ]);\n \n if( is_null($user) )\n {\n return false;\n }\n \n return $user;\n }",
"public static function findByEmail($email)\n {\n return self::whereUserEmail($email)->first();\n }",
"protected function findModel($id)\n {\n if (($model = Alerts::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function getEmployeeByEmail($email) {\n $rowset = $this->tableGateway->select(array('email' => $email));\n $row = $rowset->current();\n if (!$row)\n throw new \\Admin\\Exception(\"email: $email does not exist!\");\n return $row;\n }",
"public function findUserByEmail($email){\n $this->db->query('SELECT * FROM users WHERE us_email = :email');\n // Bind values\n $this->db->bind(':email', $email);\n $row = $this->db->single();\n // Check row returned\n if($this->db->rowCount() > 0) {\n return $row;\n } else {\n return false;\n }\n }",
"protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }",
"public function findUserByEmail($email) {\n /** @var User $user */\n $user = $this->findOneBy([\"email\" => $email]);\n return $user;\n }",
"public function findUserByEmail($email)\n {\n return User::where('email', $email)->first();\n }",
"public static function getByEmail($email) {\n $c = new Criteria();\n $c->add(self::EMAIL, $email);\n return self::doSelectOne($c);\n }",
"public function getByEmail($email)\n {\n $user = $this->userModel->where('email', $email)->first();\n return $user;\n }",
"public function findUserByEmail($email)\n {\n return $this->findOneBy(array('email' => $email));\n }",
"public function findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }",
"public function findByEmail($email)\n {\n return $this->product->email($email)->first();\n }",
"protected function findModel($id) {\n if (($model = Message::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(\\Yii::t('app', 'The requested page does not exist.'));\n }\n }",
"public function find($model, $id);",
"protected function findModel($id)\n {\n if (($model = SourceMessage::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function getByEmailAddress(string $emailAddress): ?User;",
"public static function getByEmail($email) {\n $r= self::getPeer()->doSelect(new Criteria(array('email', $email, EQUAL)));\n return $r ? $r[0] : NULL;\n }",
"protected function findModel($id) {\n\t\tif (($model = Notification::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id) {\n\t\tif(($model = Alert::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}",
"public function showByEmail($email){\n\t\t$users = User::where('status', 1)\n\t\t\t\t\t\t->where('email', $email)->get();\n\t\tif($users->count() == 0){\n\t\t\treturn $this->errorResponse( 'User does not exist', 404);\n\t\t}\n\t\treturn response($users->first());\n\t}",
"protected function findModel($id) {\n if (($model = Message::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function getApiKey(string $email):string\n {\n $user=User::with('company')\n ->where('email', $email)\n ->first();\n\n if (!$user) {\n throw new ModelNotFoundException();\n }\n return $user->company->api_key;\n }",
"public function findUserByEmail($email)\n {\n return $this->userRepo->where(['email_company' => $email])->first();\n }",
"public function loadByEmail($email){ \n\t\n\t\tif(empty($email)){\n\t\t\tdie('no email supplied');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $this->loadWhere(\"email = '\".$email.\"'\");\n\t\t\n\t}",
"public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }",
"public function sGetUserMailById()\n {\n return $this->db->fetchOne(\n 'SELECT email FROM s_user WHERE id = ?',\n [$this->session->offsetGet('sUserId')]\n ) ?: null;\n }",
"public function getByEmail($email) {\n\t\t\n\t\t$row = $this->findByEmail($email);\n\t\t\n\t\tif($row === false) {\n\t\t\tthrow new \\Exception('Unable to find user record by email: ' . $email);\n\t\t}\n\t\t\n\t\treturn UserEntity($row);\n\t\t\n\t}",
"public function find($key)\n\t{\n\t\t$user = model('user')->find_user($key);\n\n\t\treturn $user ? UserModel::newWithAttributes(Arr::toArray($user)) : null;\n\t}",
"public function getModelForEmail($email)\n {\n $emailTemplates = $this->getEmailTemplates();\n\n foreach ($emailTemplates as $emailTemplate) {\n $emailRule = new Email($emailTemplate);\n\n if ($emailRule->check($email)) {\n return $this->bannedEmailsRepository->findByEmail($emailTemplate);\n }\n }\n\n return null;\n }",
"public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }",
"public function findUserByEmail($email){\r\n $this->db->query('SELECT * FROM user_request WHERE email = :email');\r\n // Bind value\r\n $this->db->bind(':email', $email);\r\n\r\n $row = $this->db->single();\r\n\r\n // Check row\r\n if($this->db->rowCount() > 0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"protected function findModel($id)\n {\n if (($model = Message::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }",
"public function findOne(array $criteria) {\n $object = null;\n\n if(count($criteria) > 0) {\n\n /** @var UserEmail $object */\n $object = $this->findOneBy(\n $criteria\n );\n }\n\n return $object;\n }",
"protected function findModel($id)\n {\n if (($model = IssueAssign::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public static function findByEmail($email)\n {\n return static::findOne(['email' => $email]);\n }",
"public static function findByEmail($email)\n {\n return static::findOne(['email' => $email]);\n }",
"public static function findByEmail($email)\n {\n return static::findOne(['email' => $email]);\n }",
"public static function findByEmail($email)\n {\n return static::findOne(['email' => $email]);\n }"
]
| [
"0.6527904",
"0.6510788",
"0.6398881",
"0.6373641",
"0.6363581",
"0.6304064",
"0.6202437",
"0.6189282",
"0.61869645",
"0.61401826",
"0.6020931",
"0.6009259",
"0.5971566",
"0.5970691",
"0.5947556",
"0.59145874",
"0.5909728",
"0.5906946",
"0.5900369",
"0.5900369",
"0.5900369",
"0.5900369",
"0.5887851",
"0.5887851",
"0.5887851",
"0.584761",
"0.5843847",
"0.58339417",
"0.580171",
"0.57972383",
"0.57853645",
"0.578161",
"0.57795465",
"0.57795465",
"0.5776694",
"0.5767034",
"0.57663685",
"0.575108",
"0.57509255",
"0.57255656",
"0.5719157",
"0.5716935",
"0.5708649",
"0.57055175",
"0.56994474",
"0.5698335",
"0.5697598",
"0.5686871",
"0.5678865",
"0.5662226",
"0.5651327",
"0.56394875",
"0.5638586",
"0.5632109",
"0.56163025",
"0.5604604",
"0.5595146",
"0.55876875",
"0.5573966",
"0.5572848",
"0.5567116",
"0.5566384",
"0.55627763",
"0.5562179",
"0.5562154",
"0.5550393",
"0.55477536",
"0.55429614",
"0.554292",
"0.55400556",
"0.55375844",
"0.55316705",
"0.5520008",
"0.5514892",
"0.5514063",
"0.55068624",
"0.54992616",
"0.54944086",
"0.5491551",
"0.5483655",
"0.5481752",
"0.5481337",
"0.5478475",
"0.54766697",
"0.5473961",
"0.54729533",
"0.5468429",
"0.54564375",
"0.54545826",
"0.54541844",
"0.54501516",
"0.54480994",
"0.54474825",
"0.54443854",
"0.5442706",
"0.54399663",
"0.5439178",
"0.5439178",
"0.5439178",
"0.5439178"
]
| 0.6959013 | 0 |
Constructor method for RespPlateAuth | public function __construct(array $listAuthorizations = array(), $mssg = null)
{
$this
->setListAuthorizations($listAuthorizations)
->setMssg($mssg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct()\n{\n\tglobal $pclib;\n\t\n\tparent::__construct();\n\n\t$this->app = $pclib->app;\n\n\t$this->passwordAlgo = $this->app->config['pclib.auth']['algo'];\n\t$this->secret = $this->app->config['pclib.auth']['secret'];\n}",
"public function __construct()\n {\n parent::__construct();\n\n /* setup base parameters for authentication */\n $this->baseParams = [\n 'ts' => date('Y-m-d H:i:s'), //timestamp\n 'apikey' => config('marvel.public_key'), //public key\n 'hash' => md5(date('Y-m-d H:i:s').config('marvel.private_key').config('marvel.public_key')), //md5 combination of ts, private key and public key\n ];\n }",
"function __construct(){\n\n\t\tparent::__construct(); //Llamada al constructor de la clase padre\n\n\t\t$this->id = \"\";\n\t\t$this->password = \"\";\n\n\t}",
"function __construct() {\n\n\n\n\t\t\t// Check to see all authentication providers are registered in the database\n\t\t\t$this->CheckAndRegisterProviders();\n\n\t\t}",
"public function __construct() {\n parent::__construct(\"Error during authentification either the username, password or captcha is not valid.\", 302, null);\n }",
"public function __construct()\n {\n # code...\n //$this->auth = $auth;\n // $this->$id = $id;\n }",
"public function __construct()\n {\n parent::__construct();\n\n /** @var Config $oConfig */\n $oConfig = Factory::service('Config');\n\n $this->authMfaMode = $oConfig->item('authTwoFactorMode');\n $aConfig = $oConfig->item('authTwoFactor');\n $this->authMfaConfig = $aConfig[$this->authMfaMode];\n }",
"public function __construct($_loginId = NULL,$_password = NULL,$_licenseKey = NULL,$_accountNumber = NULL)\n {\n parent::__construct(array('loginId'=>$_loginId,'password'=>$_password,'licenseKey'=>$_licenseKey,'accountNumber'=>$_accountNumber),false);\n }",
"public function __construct($password);",
"public function __construct(){\n\t\t\t$this->authentication();\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t$this->_username = \"lenykoskey\";\n\t\t\t$this->_apiKey = \"abbfa09e621a6ece272a254e3fcd910657ff46e88f82db205499603d06dda908\";\n\n\t\t}",
"public function __construct()\n {\n parent::__construct();\n $this->authentication = getAuthentication();\n }",
"public function __construct()\n {\n $this->uid = null;\n $this->fields = array('username' => '',\n 'password' => '',\n 'emailAddr' => '',\n 'isActive' => false);\n }",
"public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n }",
"public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n }",
"public function __construct()\n {\n $decryptor = Mage::helper('core');\n\n $this->AccountSid = Mage::helper('twilio')->getAccountSID();\n $this->AuthToken = Mage::helper('twilio')->getAuthToken();\n $this->twilioNumber = Mage::helper('twilio')->getTwilioNumber();\n $this->smsNotificationNumber = Mage::helper('twilio')->getSMSNotificationNumber();\n\n parent::__construct($this->AccountSid, $this->AuthToken);\n }",
"function __construct()\n {\n parent::__construct();\n\n// if(!authCheck($this->post('auth'))){\n// returnFailedResponse();\n// exit();\n// }\n\n $this->check_auth_client = $this->tasks->check_auth_client();\n\n }",
"function __construct($access,$user,$pass) {\n\t$this->AccessLicenseNumber = $access;\n\t$this->UserID = $user;\n\t$this->Password = $pass;\t\n\t$this->credentials = 1;\n }",
"public function __construct( $auth_string = '' ) \n {\n $client = new Client( $auth_string );\n $this->request = new Request( $client );\n }",
"function __construct() {\r\n $this->setPasscode(filter_input(INPUT_POST, 'passcode'));\r\n }",
"public function __construct()\n {\n $this->authentication = new Authentication(\n getenv('AUTH_DOMAIN'),\n getenv('AUTH_CLIENT_ID'),\n getenv('AUTH_CLIENT_SECRET'),\n getenv('AUTH_AUDIENCE')\n );\n }",
"public function __construct()\r\n\t\t{\r\n\t\t\t$this->api_id = self::API_ID;\r\n\t\t\t$this->api_secret = self::API_SECRET;\r\n\t\t}",
"public function __construct ()\n {\n //$authObject = new Authenticate();\n // $authObject->checkIPExists();\n \n// $authObject->setRequiredType($this->getRequiredType());\n// if ($authObject->isValidUser() != 1) {\n \n// $_SESSION[\"ErrorMessage\"] .= $authObject->getMessage() . \"<br>\";\n \n// header(\"Location:\" . $_SESSION[\"DOMAIN_PATH\"] . \"/index.php?msg=\" . \n// $authObject->getMessage() . \"\");\n// }\n }",
"public function __construct() {\n parent::__construct(\n self::USER_PHP_USERNAME, self::USER_PHP_CREDENTIALS_FILENAME);\n }",
"public function __construct()\n {\n $this->makeSignature();\n\n parent::__construct();\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$data['title'] = 'My Rownds';\n\t\t$data['email'] = app::session('email');\n\t\t$data['allow_public'] = app::session('allow_public');\n\t\t$data['private_key'] = app::session('private_ley');\n\t\t$data['user_id'] = app::session('id');\n\t\t$this->load->vars($data);\n\t}",
"public function __construct()\n {\n // Init security library object\n $this->securityLibObj = new SecurityLib();\n\n }",
"public function __construct() {\n // Secret key set\n \\Stripe::setApiKey(SEC_KEY);\n }",
"protected function _construct()\n {\n $this->_init(\n \\Bayonet\\BayonetAntiFraud\\Model\\BayonetFingerprint::class,\n \\Bayonet\\BayonetAntiFraud\\Model\\ResourceModel\\BayonetFingerprint::class\n );\n }",
"function __construct(){\r\n\r\n\t\t\t$this->setHttpHeaders();\r\n\t\t\t$this->setUserIp();\r\n\t\t\t$this->setUserAgent();\r\n\r\n\t\t}",
"public function __construct()\n {\t\n @include(SHIN_Core::isConfigExists('auth.php'));\n\t\t\n $this->_config_mapper($auth);\n\t\t\n\t\tif($auth['keeping_logic'] == 'db')\n\t\t{\n\t\t\t// db style\n\t\t\tSHIN_Core::loadModel(array('sys_session_model', 'session_model'));\n\t\t\t$this->sessionModel = SHIN_Core::$_models['session_model']->get_instance();\n\t\t\t$this->sessionModel->init($this->sh_Options['sess_expiration']/60, $this->sh_Options['sess_time_to_update']/60);\n\t\t}\n\t\t\n\t\tConsole::logSpeed('SHIN_Auth begin work, Time taken to get to line: '.__FILE__.'::'.__LINE__);\n\t\tConsole::logMemory($this, 'SHIN_Auth. Size of class: ');\t\t \n }",
"public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }",
"public function __construct()\n {\n // To ignore the Notice instead of Isset on missing POST vars\n error_reporting(E_ALL & ~E_NOTICE);\n $_SESSION['auth_service'] = $_POST['auth_type'];\n\n if ($_SESSION['auth_service'] == \"jwt\") {\n $this->authService = new JWTService();\n } else {\n $this->authService = new CodeGrantService();\n }\n }",
"function __construct($requireSignIn = false) {\n\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->client_id = Tool::config('client_id');\n $this->client_secret = Tool::config('client_secret');\n $this->redirect_uri = Tool::config('redirect_uri');\n $this->authorize_url = Tool::config('app_type', 'com') === 'com'\n ? Constants::AUTHORITY_URL.Constants::AUTHORIZE_ENDPOINT\n : Constants::AUTHORITY_URL_21V.Constants::AUTHORIZE_ENDPOINT_21V;\n $this->access_token_url = Tool::config('app_type', 'com') === 'com'\n ? Constants::AUTHORITY_URL.Constants::TOKEN_ENDPOINT\n : Constants::AUTHORITY_URL_21V.Constants::TOKEN_ENDPOINT_21V;\n $this->scopes = Constants::SCOPES;\n }",
"public function __construct($email, $password) {\n\n$this->email = $email;\n$this->password = $password;\n}",
"public function __construct() {\t\t\n\t\t$this->apikey='uYXMOYkzh1bJwKLk8SFb00EiYydmLDvoqskEOtqlk4hSE9NAM9RRV08C';\n\t\t$this->apisec='9FsUJswhQX13nGdahA6YDgkfZdYd05/SPObJKD12GAP5LKq1smT0FAVuMc26PH0fvuYPVlPVECBYXvu8Aqy92Q==';\n\t\t$this->url = 'https://api.kraken.com';\n }",
"public function __construct($registant,$otp)\n {\n $this->registant = $registant;\n $this->otp = $otp;\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('RaporModel');\n\t\t$this->check_login();\n\t}",
"public function __construct()\n {\n $this->api_id = Config::get('biddingos.ym.api_id');\n $this->api_token = md5(Config::get('biddingos.ym.api_token'));\n $this->refresh_time = Config::get('biddingos.ym.refresh_time');\n parent::__construct();\n }",
"public function __construct(Guard $auth)\n\t{\n\t\t$this->auth = $auth;\n\t\t//$this->cek_login();\n\t}",
"public function __construct(){\n parent::__construct();\n\t \t\t\n \t $check_auth_client = $this->Promo_code_model->check_auth_client();//check auth\n\t if($check_auth_client != true){\n\t\tdie($this->output->get_output());\n\t }\t\n }",
"protected final function __construct() {}",
"public function __construct() {\n $this->api = \\Slim\\Slim::getInstance();\n\n $this->CSUser = CSUser::getInstance();\n $this->CSAuth = CSAuth::getInstance();\n\n //Login route\n\t\t$this->api->post('/login', array($this, 'login')); \n\n\t\t//Logout rout\n\t\t$this->api->delete('/login', array($this, 'logout'));\n }",
"public function __construct($otp)\n {\n $this->otp = $otp;\n }",
"private function __construct() \n {\n \n\t\t$this->_storage = new Tg_Auth_Storage_Session();\n\t\t$this->_adapter = new Tg_Auth_Adapter_User();\n\t\t$this->_auth = Zend_Auth::getInstance();\n $this->_auth->setStorage($this->_storage);\n }",
"public function __construct()\n {\n // auth here\n }",
"public function __construct()\n {\n $Auth = new auth(true);\n $this->userData = $Auth->CheckToken();\n // var_dump($Auth);\n }",
"function __construct() { \r\n\t\t\t\t$this->id;\r\n\t\t\t\t$this->cpf;\r\n\t\t\t\t$this->email;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}",
"public function __construct()\n\n\t{\n\n\t\t$this->CI =& get_instance();\n\n\t\t\n\n\t\tdefine('AUTH_REG_SUCCESS', 0);\n\n\t\tdefine('AUTH_REG_USERNAME_IN_USE', 1);\n\n\t\tdefine('AUTH_REG_DATABASE_ERROR', 2);\n\n\t}",
"public function __construct()\n {\n $this->setApiKey();\n $this->setRequestOptions();\n }",
"public function __construct()\n {\n parent::__construct();\n\n // call password_crypt class \n $this->load->library('user_account');\n $this->load->model('Credentials_model');\n }",
"public function __construct() {\n $this->secretKey = $GLOBALS['config']['secret_key'];\n $this->accessKey = $GLOBALS['config']['access_key'];\n $this->sellerId = $GLOBALS['config']['seller_id'];\n $this->signatureMethod = $GLOBALS['config']['signature_method'];\n $this->signatureVersion = $GLOBALS['config']['signature_version'];\n $this->marketplaceId = $GLOBALS['config']['marketplace_id'];\n $this->version = $GLOBALS['config']['version'];\n }",
"function __construct() {\n parent::__construct();\n $this->id = $this->getUserID(Session::get('user'));\n $this->FirstName = $this->getUserFirstName($this->id);\n $this->email = $_SESSION['user'];\n }",
"public function __construct()\n {\n // validate compatibiliry with the system\n $this->_validate_compatibility();\n\n // load config file\n $this->config->load('auth');\n\n // load language file for messages\n $this->lang->load('auth', 'english');\n\n // load authentication model\n $this->load->model('auth_model');\n\n // load required libraries\n $this->load->library(['session', 'user_agent', 'encryption']);\n\n // load required helpers\n $this->load->helper(['cookie', 'string', 'auth']);\n\n // log message to debugger\n log_message('debug', 'Authentication library initialized.');\n }",
"public function __construct() {\r\n\t\tif(!$this->isLoggedIn()) {\r\n\t\t\theader('location: ' . URL . 'authentication/index');\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t $this->loadModel($this->modelToLoad);\r\n\t $this->model->setAuth($_SESSION['ID'], $_SESSION['PASSWORD']);\r\n\t\t\r\n\t\tparent::__construct();\r\n\t}",
"public function __construct() {\n\n\t\t# Make twig extend\n\t\tTwig::init();\n\n\t\t# Get path\n\t\t$path = Request::getPath();\n\n\t\t# Check if available\n\t\tif(!empty(Sky::$config[\"authenticate\"][\"use\"]) && !Auth::isLoggedIn())\n\t\t\tforeach($this->authPages as $page)\n\t\t\t\tif(preg_match(\"/$page/\", $path))\n\t\t\t\t\tRequest::setAddress('/login');\n\n\t}",
"public function __construct()\n {\n if (8 == func_num_args()) {\n $this->signatureMethodUniqueId = func_get_arg(0);\n $this->firstName = func_get_arg(1);\n $this->middleName = func_get_arg(2);\n $this->lastName = func_get_arg(3);\n $this->fullName = func_get_arg(4);\n $this->dateOfBirth = func_get_arg(5);\n $this->signatureMethod = func_get_arg(6);\n $this->signedTime = func_get_arg(7);\n }\n }",
"function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t// Load MongoDB library instead of native db driver if required\n\n\t\t$this->config->item('use_mongodb', 'ion_auth') ? $this->load->library('mongo_db') : $this->load->database();\n\t\t$this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth'));\n\t\t$this->lang->load('auth');\n \n\t\t// $this->load->helper('language');\n\t}",
"public function __construct() {\r\n\t\t$this->endpoints = array(\r\n\t\t\t'sendPasswordResetRequest' => array(\r\n\t\t\t\t'required_role' => self::PUBLIC_ACCESS,\r\n\t\t\t\t'params' => array(\r\n\t\t\t\t\t'forgotten_password_email' => array('required', 'valid-email')\r\n\t\t\t\t)\r\n\t\t\t),\r\n\t\t\t'checkPasswordResetHash' => array(\r\n\t\t\t\t'required_role' => self::PUBLIC_ACCESS,\r\n\t\t\t\t'params' => array(\r\n\t\t\t\t\t'user_id' => 'required',\r\n\t\t\t\t\t'hash' => 'required'\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t#request params\r\n\t\t$this->params = $this->checkRequest();\r\n\t}",
"function __construct()\n {\n parent::__construct();\n $this->auth();\n $this->load->model('Credit_card_emi');\n }",
"private function __construct()\n {\n $localhost=true;\n //$this->mApiKey='ABQIAAAAjvAdx3uLvexI2G5bkYepahQwp-bsalx-QHFJ3KX5HEBgBZfTQBQPhQ5PgqIYfvMrIIcYqeBzemnG7w';\n\t\t$this->mApiKey='ABQIAAAAjvAdx3uLvexI2G5bkYepahQGDwfolOEAvUGmNN27MQhUpy2Y5RRUEzl5y_D0iijy_5MdB5A1wd7qXw';\n if(!$localhost)\n {\n $this->mApiKey='ABQIAAAAjvAdx3uLvexI2G5bkYepahQcPyf2dOLSRs_M3CZpYgJ3TGWiohQJqe8T6pV9a5fEsB3cWr-w6wk7sQ';\n }\n }",
"function __construct() {\r\n parent::__construct(false, $name = 'CSH Login');\t\r\n }",
"public function __construct()\n {\n parent::__construct();\n\n $app = App::getInstance();\n $auth = new Auth($app->getDb());\n\n if (!$auth->logged() || !$auth->authorized(Session::get('auth'))) {\n $this->redirectTo(\"HTTP/1.0 401 Unauthorized\", \"unauthorized\");\n }\n\n $this->hasToken();\n }",
"public function __construct()\r\r\n\t{\r\r\n\t\t$this->import('BackendUser', 'User');\r\r\n\t\tparent::__construct();\r\r\n\r\r\n\t\t$this->User->authenticate();\r\r\n\t}",
"public function __construct()\n {\n $this->salt = base_convert(sha1(uniqid(mt_rand(), true)), 16, 36);\n $this->enabled = false;\n $this->locked = false;\n $this->expired = false;\n $this->roles = new ArrayCollection();\n $this->credentialsExpired = false;\n $this->confirmationToken = base64_encode(utf8_encode(openssl_random_pseudo_bytes(10)));\n $this->createdAt = new \\DateTime();\n }",
"public function __construct()\n {\n\n // For Authenticating with Login Credentials\n\n //$this->username = config('whmcs.username');\n //$this->password = config('whmcs.password');\n\n // For Authenticating with API Credentials\n\n $this->api_identifier = config('whmcs.api_identifier');\n $this->api_secret = config('whmcs.api_secret');\n\n $this->api_access_key = config('whmcs.api_access_key');\n\n $this->response_type = strtolower(config('whmcs.response_type'));\n\n $this->client = new Client([\n 'base_uri' => config('whmcs.url'),\n 'timeout' => config('whmcs.timeout'),\n 'headers' => ['Accept' => 'application/json']\n ]);\n }",
"public function __construct() {\r\n $this->firstname=NULL;\r\n $this->lastname=NULL;\r\n $this->email=NULL;\r\n $this->password=NULL;\r\n $this->authenticated=FALSE;\r\n $this->club_id=NULL;\r\n }",
"function __construct() {\r\n $this->config->token = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"token\", '');\r\n $this->config->api = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"api\", '');\r\n $this->config->sender = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"sender\", '');\r\n\t}",
"public function __construct()\n {\n $this->protocol = api_get_setting('sso_authentication_protocol');\n // There can be multiple domains, so make sure to take only the first\n // This might be later extended with a decision process\n $domains = explode(',', api_get_setting('sso_authentication_domain'));\n $this->domain = trim($domains[0]);\n $this->auth_uri = api_get_setting('sso_authentication_auth_uri');\n $this->deauth_uri = api_get_setting('sso_authentication_unauth_uri');\n //cut the string to avoid recursive URL construction in case of failure\n $this->referer = $this->protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'],0,strpos($_SERVER['REQUEST_URI'],'sso'));\n $this->deauth_url = $this->protocol.$this->domain.$this->deauth_uri;\n $this->master_url = $this->protocol.$this->domain.$this->auth_uri;\n $this->referrer_uri = base64_encode($_SERVER['REQUEST_URI']);\n $this->target = api_get_path(WEB_PATH);\n }",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"protected function __construct() {}",
"function __construct() {\n parent::__construct();\n $this->load->database();\n\t\t$this->load->library(array('ion_auth','form_validation'));\n\t\t$this->load->helper(array('url','language'));\n\n\t\t$this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth'));\n\n\t\t$this->lang->load('auth');\n }",
"protected function __construct () {}",
"public function __construct()\n {\n $this->checkrequest();\n $this->initialize();\n }",
"protected function __construct() {\n\t\t\n\t}",
"protected function __construct() {\n\t\t\n\t}",
"final private function __construct() {\n\t\t\t}",
"function __construct()\n\t{\n\t\t// Construct the parent class\n\t\tparent::__construct();\n\t\t$this->data['token'] = $this->input->get_request_header('token');\n\t\tvalidateAuth($this->data['token']);\n\t\t$this->load->model(['user_model','Products_model']);\n\t\t$this->load->helper(['my_helper', 'string']);\n\t\t$_POST = json_decode(file_get_contents(\"php://input\"), true);\n\t}",
"public function __construct() {\n global $apiConfig;\n if (! empty($apiConfig['developer_key'])) {\n $this->developerKey = $apiConfig['developer_key'];\n }\n if (! empty($apiConfig['oauth2_client_id'])) {\n $this->clientId = $apiConfig['oauth2_client_id'];\n }\n if (! empty($apiConfig['oauth2_client_secret'])) {\n $this->clientSecret = $apiConfig['oauth2_client_secret'];\n }\n if (! empty($apiConfig['oauth2_redirect_uri'])) {\n $this->redirectUri = $apiConfig['oauth2_redirect_uri'];\n }\n if (! empty($apiConfig['oauth2_access_type'])) {\n $this->accessType = $apiConfig['oauth2_access_type'];\n }\n if (! empty($apiConfig['oauth2_approval_prompt'])) {\n $this->approvalPrompt = $apiConfig['oauth2_approval_prompt'];\n }\n }",
"function __construct()\n\t{\n\t\t// $this->cust_code = $cust_code;\n\t\t// $this->fecha_interaccion = $fecha_interaccion;\n\t\t// $this->tipo_interaccion = $tipo_interaccion;\n\t\t// $this->time_stamp = $time_stamp;\n }",
"protected function __construct() {\n\n\t}",
"final private function __construct() {}",
"final private function __construct() {}",
"protected function __construct()\r\n\t\t{\r\n\t\t}",
"final private function __construct() { }",
"final private function __construct() { }"
]
| [
"0.73686886",
"0.72146994",
"0.7068594",
"0.68780184",
"0.68637633",
"0.68517005",
"0.6832106",
"0.68052787",
"0.68045217",
"0.67822725",
"0.67735595",
"0.6747091",
"0.674471",
"0.6733947",
"0.6733947",
"0.6729743",
"0.67295516",
"0.6721406",
"0.67184865",
"0.6712769",
"0.67106456",
"0.67037964",
"0.6696855",
"0.6672868",
"0.6670307",
"0.6664966",
"0.6664787",
"0.6648214",
"0.66436046",
"0.6638982",
"0.66322166",
"0.66172105",
"0.6614845",
"0.66000324",
"0.65903074",
"0.658533",
"0.65732986",
"0.6572597",
"0.6559872",
"0.65554106",
"0.6551731",
"0.6551038",
"0.65471554",
"0.6538238",
"0.6535116",
"0.65333825",
"0.65314054",
"0.6525061",
"0.65233886",
"0.6511549",
"0.6509207",
"0.6501774",
"0.65001357",
"0.6499249",
"0.6497982",
"0.6493075",
"0.6492049",
"0.64904505",
"0.6484786",
"0.6483503",
"0.64774567",
"0.6476556",
"0.64735943",
"0.64723676",
"0.6467116",
"0.6466165",
"0.64616597",
"0.6461432",
"0.6458681",
"0.6458282",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64440066",
"0.64421374",
"0.6439509",
"0.64344436",
"0.64326143",
"0.64326143",
"0.64274704",
"0.642678",
"0.6419914",
"0.6415688",
"0.64109015",
"0.64070565",
"0.64070565",
"0.6406607",
"0.6405583",
"0.6405583"
]
| 0.0 | -1 |
Get listAuthorizations value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getListAuthorizations()
{
return isset($this->listAuthorizations) ? $this->listAuthorizations : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAuthorizations(): array;",
"public static function validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $respPlateAuthListAuthorizationsItem) {\n // validation for constraint: itemType\n if (!$respPlateAuthListAuthorizationsItem instanceof \\bunge\\StructType\\RespPlateAuthDetail) {\n $invalidValues[] = is_object($respPlateAuthListAuthorizationsItem) ? get_class($respPlateAuthListAuthorizationsItem) : sprintf('%s(%s)', gettype($respPlateAuthListAuthorizationsItem), var_export($respPlateAuthListAuthorizationsItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The listAuthorizations property can only contain items of type \\bunge\\StructType\\RespPlateAuthDetail, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }",
"public function authorList()\n\t{\n\t\t$authors = ee('Member')->getAuthors(ee('Request')->get('search'));\n\n\t\tif (AJAX_REQUEST)\n\t\t{\n\t\t\treturn ee('View/Helpers')->normalizedChoices($authors);\n\t\t}\n\n\t\treturn $authors;\n\t}",
"function retrieve_promoter_guest_list_authorizations(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_promoter_guest_list_authorizations($this->promoter->up_id);\n\t\t\n\t}",
"public function forAuthorizableTypes()\n {\n return $this->forAuthorizableTypes;\n }",
"public function getAuthors()\n {\n return $this->getValue('authors');\n }",
"public function get_authenty()\r\n {\r\n //right column defines how to treat each role for guessing the owner of the resource\r\n $roles=array(\r\n 'custodian' => 'owner',\r\n 'resourceProvider' => 'distributor',\r\n 'owner' => 'owner',\r\n 'user' => 'distributor',\r\n 'distributor' => 'distributor',\r\n 'originator' => 'owner',\r\n 'pointOfContact' => 'owner',\r\n 'principalInvestigator' => 'owner',\r\n 'processor' => 'owner',\r\n 'pubisher' => 'owner',\r\n 'author' => 'owner' \r\n );\r\n \r\n \r\n $countries=array();\r\n\r\n //check the ident_contact\r\n $contacts=$this->get_key_value('ident_contacts');\r\n \r\n if ($contacts)\r\n {\r\n foreach($contacts as $contact)\r\n {\r\n $role=NULL;\r\n if (array_key_exists($contact['role'],$roles)){\r\n $role=$roles[$contact['role']];\r\n }\r\n \r\n if ($role=='owner' && isset($contact['org_name'])) {\r\n return $contact['org_name'];\r\n }\r\n }\r\n }\r\n \r\n $meta_contacts=$this->get_key_value('metadata_contacts');\r\n \r\n if ($meta_contacts)\r\n {\r\n foreach($meta_contacts as $contact)\r\n {\r\n if (array_key_exists($contact['role'],$roles)){\r\n $role=$roles[$contact['role']];\r\n }\r\n \r\n if ($role=='owner' && isset($contact['org_name'])) {\r\n return $contact['org_name'];\r\n }\r\n }\r\n }\r\n \r\n return NULL;\r\n }",
"public function hasAuthorizer() {\n return $this->_has(2);\n }",
"protected function getAuthors() {\r\n\t\treturn $this->authors;\r\n\t}",
"public function getAuthors() {\n\t\treturn self::$authors;\n\t}",
"public function getAllowedOrganizations()\n {\n\n if (! $this->_hasVar('__allowedOrgs')) {\n $this->refreshAllowedOrganizations();\n }\n // \\MUtil_Echo::track($this->_getVar('__allowedOrgs'));\n\n return $this->_getVar('__allowedOrgs');\n }",
"public function getAuthors() {\n return self::$authors;\n }",
"public function getAuthors()\n {\n return self::$authors;\n }",
"public function setListAuthorizations(array $listAuthorizations = array())\n {\n // validation for constraint: array\n if ('' !== ($listAuthorizationsArrayErrorMessage = self::validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations($listAuthorizations))) {\n throw new \\InvalidArgumentException($listAuthorizationsArrayErrorMessage, __LINE__);\n }\n if (is_null($listAuthorizations) || (is_array($listAuthorizations) && empty($listAuthorizations))) {\n unset($this->listAuthorizations);\n } else {\n $this->listAuthorizations = $listAuthorizations;\n }\n return $this;\n }",
"public function getAuthors()\n\t{\n\t\treturn $this->authors;\n\t}",
"public function getAuthors()\n {\n return $this->authors;\n }",
"public function hasAuthorized() {\n return $this->_has(1);\n }",
"public function hasSpecificAuthorization() {\n return $this->_has(10);\n }",
"public function allAuthorizationsValid()\n {\n if (count($this->authorizations) > 0) {\n foreach ($this->authorizations as $auth) {\n if ($auth->status != 'valid') {\n return false;\n }\n }\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"function getList() {\n return $this->listRole;\n }",
"public function getAuthors()\n {\n return static::$authors;\n }",
"public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }",
"public static function getAuthList()\n\t{\n\t\treturn !empty(MHTTPD::$config['Auth']) ? MHTTPD::$config['Auth'] : false;\n\t}",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }",
"public static function authorizable()\n {\n return true;\n }",
"protected function get_iauthority()\n {\n }",
"protected function get_iauthority()\n {\n }",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }",
"public function hasAuthorIzation(array $data = array()) {\n if(empty($data))\n return false;\n $authorization = $this->em->getRepository(\"OradtStoreBundle:AccountBizAuthorization\")->findOneBy($data);\n if(empty($authorization))\n return false;\n return true;\n }",
"function get_companies_list() {\n return get_view_data('org_list');\n}",
"public function isAuthorized() {\n\t\treturn true;\n\t}",
"public function getAuthors()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('authors', $this->data))\n\t\t\t\treturn array();\n\t\t\t\n\t\t\t$ret = array();\n\t\t\tforeach($this->data['authors'] as $author)\n\t\t\t{\n\t\t\t\t$ret[] = new Thrush_API_OpenLibrary_Author($author);\n\t\t\t}\n\t\t\t\n\t\t\treturn $ret;\n\t\t}",
"public function get_authors();",
"private function updateAuthorizations()\n {\n $this->authorizations = [];\n foreach ($this->authorizationURLs as $authURL) {\n if (filter_var($authURL, FILTER_VALIDATE_URL)) {\n $auth = new LEAuthorization($this->connector, $this->log, $authURL);\n if ($auth != false) {\n $this->authorizations[] = $auth;\n }\n }\n }\n }",
"private function actionGetAuthors() {\n\t\t$authors = array();\n\t\t$obj = new stdClass();\n\n\t\t$users = get_users( 'exclude=[1]&who=authors' );\n\n\t\tforeach ( $users as $user ) {\n\t\t\t$authors[] = array( 'id' => $user->ID, 'name' => $user->display_name );\n\t\t}\n\n\t\t$obj->success = true;\n\t\t$obj->errorMessage = null;\n\t\t$obj->authors = $authors;\n\n\t\t$this->sendJSON( $obj );\n\t}",
"private function get_authorized_users() {\n\t\t$authorized_users = get_option( 'livechat_authorized_users' );\n\t\tif ( ! $authorized_users ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn array_values(\n\t\t\tarray_filter( explode( ',', $authorized_users ) )\n\t\t);\n\t}",
"public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public function Authorization() {\n\t\t\n\t\treturn $this->service->RedirectToAuthorization();\n\t}",
"public function getAccessionsList(){\n return $this->_get(2);\n }",
"public function getAccessionsList(){\n return $this->_get(2);\n }",
"public function authorize()\n {\n return session('company');\n }",
"function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }",
"public function authorize() {\n\t\treturn $this->user()->hasPermission('edit.roles');\n\t}",
"function getAuthority() {\n\t\treturn $this->getData('approvingAuthority');\n\t}",
"public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }",
"public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }",
"public function getOrganisationList()\n {\n return $this->getResponse('/v1/organizations/list');\n }",
"public function getRespondentOrganizations()\n {\n\n if (! $this->_hasVar('__allowedRespOrgs')) {\n $availableOrganizations = $this->util->getDbLookup()->getOrganizationsWithRespondents();\n $allowedOrganizations = $this->getAllowedOrganizations();\n\n $this->_setVar('__allowedRespOrgs', array_intersect($availableOrganizations, $allowedOrganizations));\n }\n // \\MUtil_Echo::track($this->_getVar('__allowedOrgs'));\n\n return $this->_getVar('__allowedRespOrgs');\n }",
"private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }",
"public function isAuthorized() {\n\t\t\n\t}",
"public function getJurisdictionalAuthorization()\n {\n return $this->jurisdictionalAuthorization;\n }",
"public function authorize()\n {\n return $this->_instance->authorize();\n }",
"public function getOrganizations(): ?int {\n $val = $this->getBackingStore()->get('organizations');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'organizations'\");\n }",
"public function authorize()\n {\n return $this->user('office')->isActive();\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"public function getAuthors(): AuthorCollection;",
"public function hasAuthorization(): bool;",
"public function getAuthorcompany() {}",
"public function getContacts()\n {\n if (array_key_exists(\"contacts\", $this->_propDict)) {\n return $this->_propDict[\"contacts\"];\n } else {\n return null;\n }\n }",
"public function getEnableOnBehalfRequestorsToAddAccess()\n {\n if (array_key_exists(\"enableOnBehalfRequestorsToAddAccess\", $this->_propDict)) {\n return $this->_propDict[\"enableOnBehalfRequestorsToAddAccess\"];\n } else {\n return null;\n }\n }",
"public function index()\n {\n return OrganizerResource::collection(\n Auth::user()->organizers\n );\n }",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n $model = $this->resource()::$model;\n\n return $this->authorizeIfPolicyExists('viewAny', $model);\n }",
"public function authorize()\n {\n return $this->json();\n }",
"public function getIsAdminPermissionsAttribute($value){\n return ($value) ? json_decode($value) : null;\n }",
"public function isAuthorized() {}",
"public function authorization(): bool|string\n {\n return $_SERVER['HTTP_AUTHORIZATION'] ?? false;\n }",
"public function getOwners()\n {\n if (array_key_exists(\"owners\", $this->_propDict)) {\n return $this->_propDict[\"owners\"];\n } else {\n return null;\n }\n }",
"function getauthorized() {\r\n\r\n $db = JFactory::getDBO();\r\n $query = \"SELECT id,email,api,transaction_key,mode FROM #__em_authorized_settings\r\n WHERE id = 1\";\r\n $db->setQuery($query);\r\n $result = $db->loadObject();\r\n\r\n return $result;\r\n }",
"public function authorize()\n {\n return auth('customer')->check();\n }",
"public function getAuthorizationURL() {\n\t\treturn $this->selectedEndpoint['authorization_url'];\n\t}",
"public function authorize()\n {\n return $this->user()->can('list', Card::class);\n }",
"function getAuth() {\n parent::getAuth(); // load company!\n $au = $this->getAuthUser();\n if (!$au) {\n $this->jerr(\"Not authenticated\", array('authFailure' => true));\n }\n if ($au->company()->comptype != 'OWNER') {\n $this->jerr(\"Permission Denied\" );\n }\n $this->authUser = $au;\n return true;\n }",
"public function getAuthorisation(Payment $payment);",
"public function hasListValue(){\n return $this->_has(6);\n }",
"public function getAuthors();",
"public function _getAllowedValueList()\n {\n return self::$valueList;\n }",
"protected function get_authority()\n {\n }",
"protected function get_authority()\n {\n }",
"public function getAuthorizationURL()\n {\n return $this->get('AuthorizationURL');\n }",
"public function getCustomizations(): ?EducationSynchronizationCustomizations {\n $val = $this->getBackingStore()->get('customizations');\n if (is_null($val) || $val instanceof EducationSynchronizationCustomizations) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'customizations'\");\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function getAuthor() {\n $contributors = $this->product->getContributors();\n foreach ($contributors as $contributor) {\n if($contributor->getRole() == PONIpar\\ProductSubitem\\Contributor::ROLE_AUTHOR) {\n\n $value = $contributor->getValue();\n\n if(key_exists('PersonName',$value)) {\n return $value['PersonName'];\n }\n elseif(key_exists('PersonNameInverted',$value)) {\n $inverted = $value['PersonNameInverted'];\n $author = implode(' ',array_reverse(explode(', ',$inverted)));\n }\n\n // if the first author string is too long (might be a collections of authors), skip to the next\n if(strlen($author) < 100) return $author;\n else continue;\n\n }\n }\n // if we reach this that means we haven't found an author\n return null;\n }",
"public function getAuthor()\n {\n return $this->author = get_userdata($this->get()->post_author);\n }",
"public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}",
"public function authorize()\n {\n return true; // TODO : edit it with roles\n }",
"public function getCustomerResultPermissions(): array;",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n return $this->user()->isAdmin();\n }",
"public function authorize()\n {\n return PrivateCategory::where([\n ['owner_id', '=', Auth::user()->id],\n ['id', '=', $this->category_id],\n ])->exists();\n }",
"public function authorizable(): bool\n {\n return false;\n }",
"public function organizers()\n {\n return $this->members()->wherePivot('role', '=', Member::ROLE_ORGANIZER)->get();\n }",
"public function authorize()\n {\n return Auth::user()->hasAnyRole(['kuchar', 'manager']);\n }",
"public function getAuthorizationID()\n {\n return $this->_authorizationID;\n }",
"private function canList()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function authorize()\n {\n $order = $this->route('order');\n if($order){\n \t$order_repository = app()->make(orderRepository::class);\n\t return $order_repository->accesibleOrders(Auth::user())->findOneBy($order->id);\n\n }\n return false;\n\n }",
"public function testGettingRoles()\n {\n $this->assertEquals(['baz'], $this->principal->getRoles());\n }",
"public function getAuthority()\n {\n }",
"public function getAuthority()\n {\n }"
]
| [
"0.66624427",
"0.5703299",
"0.55814767",
"0.5469377",
"0.54133505",
"0.540837",
"0.53632885",
"0.52999806",
"0.5298147",
"0.52748513",
"0.5246963",
"0.5234719",
"0.5218052",
"0.52155644",
"0.52107996",
"0.5173124",
"0.5169621",
"0.5145678",
"0.5128908",
"0.5079068",
"0.5066499",
"0.5065379",
"0.5025246",
"0.5013511",
"0.50124156",
"0.5006274",
"0.49882418",
"0.49882418",
"0.49829176",
"0.49390268",
"0.49318045",
"0.4907613",
"0.48917785",
"0.48817635",
"0.4881174",
"0.48765975",
"0.48727357",
"0.48651823",
"0.48622304",
"0.48551247",
"0.48551247",
"0.4852395",
"0.48360217",
"0.4822474",
"0.48099995",
"0.48074114",
"0.47999898",
"0.4798444",
"0.47881642",
"0.47848946",
"0.4778769",
"0.47721586",
"0.47656846",
"0.47554824",
"0.4741577",
"0.47372752",
"0.47180393",
"0.47145",
"0.47103304",
"0.46968928",
"0.46960378",
"0.4686986",
"0.46840918",
"0.46790218",
"0.46788418",
"0.4676146",
"0.46715027",
"0.46618134",
"0.4651702",
"0.4651384",
"0.46496385",
"0.4649444",
"0.46477896",
"0.46458513",
"0.46419212",
"0.4641633",
"0.46363452",
"0.46327996",
"0.4631566",
"0.46308035",
"0.4628798",
"0.46222818",
"0.4621833",
"0.4621825",
"0.4620503",
"0.4619732",
"0.46173096",
"0.461628",
"0.461548",
"0.46102023",
"0.46048564",
"0.46043423",
"0.46000075",
"0.45957738",
"0.4581513",
"0.45811787",
"0.45788392",
"0.4569522",
"0.45649874",
"0.45649874"
]
| 0.774214 | 0 |
This method is responsible for validating the values passed to the setListAuthorizations method This method is willingly generated in order to preserve the oneline inline validation within the setListAuthorizations method | public static function validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations(array $values = array())
{
$message = '';
$invalidValues = [];
foreach ($values as $respPlateAuthListAuthorizationsItem) {
// validation for constraint: itemType
if (!$respPlateAuthListAuthorizationsItem instanceof \bunge\StructType\RespPlateAuthDetail) {
$invalidValues[] = is_object($respPlateAuthListAuthorizationsItem) ? get_class($respPlateAuthListAuthorizationsItem) : sprintf('%s(%s)', gettype($respPlateAuthListAuthorizationsItem), var_export($respPlateAuthListAuthorizationsItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The listAuthorizations property can only contain items of type \bunge\StructType\RespPlateAuthDetail, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
}
unset($invalidValues);
return $message;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setListAuthorizations(array $listAuthorizations = array())\n {\n // validation for constraint: array\n if ('' !== ($listAuthorizationsArrayErrorMessage = self::validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations($listAuthorizations))) {\n throw new \\InvalidArgumentException($listAuthorizationsArrayErrorMessage, __LINE__);\n }\n if (is_null($listAuthorizations) || (is_array($listAuthorizations) && empty($listAuthorizations))) {\n unset($this->listAuthorizations);\n } else {\n $this->listAuthorizations = $listAuthorizations;\n }\n return $this;\n }",
"public function allAuthorizationsValid()\n {\n if (count($this->authorizations) > 0) {\n foreach ($this->authorizations as $auth) {\n if ($auth->status != 'valid') {\n return false;\n }\n }\n return true;\n }\n return false;\n }",
"public function getListAuthorizations()\n {\n return isset($this->listAuthorizations) ? $this->listAuthorizations : null;\n }",
"private function updateAuthorizations()\n {\n $this->authorizations = [];\n foreach ($this->authorizationURLs as $authURL) {\n if (filter_var($authURL, FILTER_VALIDATE_URL)) {\n $auth = new LEAuthorization($this->connector, $this->log, $authURL);\n if ($auth != false) {\n $this->authorizations[] = $auth;\n }\n }\n }\n }",
"public static function authorizable()\n {\n return true;\n }",
"function checkAuthors () {\n\t\tif ( count ( $this->authors) == 0 ) return ;\n\t\n\t\tif ( isset($this->existing_q) ) {\n\t\t\t$this->wd->loadItem ( $this->existing_q ) ;\n\t\t\t$i = $this->wd->getItem ( $this->existing_q ) ;\n\t\t\t$c1 = $i->getClaims ( $this->props['author'] ) ;\n\t\t\t$c2 = $i->getClaims ( $this->props['short author'] ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c1 ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c2 ) ;\n\t\t\t\n\t\t\t// Special case: Single author, one author already in item...\n\t\t\tif ( count($this->authors) == 1 && count($c1)+count($c2) == 1 ) {\n\t\t\t\t$this->authors[1]->hadthat = true ;\n\t\t\t}\n\t\t}\n\t}",
"public function authorList()\n\t{\n\t\t$authors = ee('Member')->getAuthors(ee('Request')->get('search'));\n\n\t\tif (AJAX_REQUEST)\n\t\t{\n\t\t\treturn ee('View/Helpers')->normalizedChoices($authors);\n\t\t}\n\n\t\treturn $authors;\n\t}",
"public function getAuthorizations(): array;",
"public function beforeValidateElement()\n {\n // it to be an integer because authorId is an attribute and not like custom relation fields\n if (is_array($this->model->authorId) && count($this->model->authorId)) {\n $this->model->authorId = $this->model->authorId[0];\n }\n }",
"protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}",
"protected function checkAuthorizathor(): void\n {\n if (!$this->authorizatorClient->authorizathor()) {\n throw AuthorizathorException::notAllowed();\n }\n }",
"public function rules () : array\n\t{\n\t\treturn [\n\t\t\t'authors' => 'array',\n\t\t\t'authors.*' => 'int|min:1|exists:users,id',\n\t\t\t'order' => 'string|in:ASC,DESC',\n\t\t];\n\t}",
"function makeEditableAuthorList($authors) {\t\t\n\t\treturn \"\n\t\t\t<div id='authorlist' class='authorlist'>\n\t\t\t\t\".$this->makeAuthorList($authors).\"\t\t\t\n\t\t\t</div>\n\t\t\n\t\t\";\n\t}",
"function makeAuthorList($authors) {\n\t\t$alist = \"\n\t\t\t\t<input type='hidden' name='authors' id='authors' value=\\\"\".implode(\",\",$authors).\"\\\" />\n\t\t\t\t<ul class='memberlist_s'>\\n\";\n\t\t$udata = $this->getUserData($authors, array('FirstName','ProfilePicture'));\n\t\tforeach ($udata as $user_id => $u) {\t\t\t\n\t\t\t$alist .= '\n\t\t\t\t<li>\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t<img src=\"'.$u['ProfilePicture']['SmallThumb'].'\" style=\"width:30px;\" />\n\t\t\t\t\t</td><td>\n\t\t\t\t\t<div style=\"padding:2px;\">'.$u['FirstName'].'</div>\n\t\t\t\t\t<div style=\"padding:2px;\"><a href=\"#\" style=\"background:url(/images/famfamfam_mini/action_stop.gif) no-repeat left;padding:2px 2px 2px 18px;\" onclick=\"removeAuthor('.$user_id.'); return false;\">Fjern</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t</li> ';\n\t\t}\n\t\t$alist .= '\n\t\t\t\t</ul>\n\t\t\t\t';\n\t\treturn $alist;\n\t}",
"public function __construct(array $listAuthorizations = array(), $mssg = null)\n {\n $this\n ->setListAuthorizations($listAuthorizations)\n ->setMssg($mssg);\n }",
"public function hasEditorACL(){\r\n\t\t$validACLEditPages = array(\r\n\t\t\t'training_title_option_all' => 'training_title_option_all',\r\n\t\t\t'training-category' => 'acl_editor_training_category',\r\n\t\t\t'training-assign-title' => 'acl_editor_training_category',\r\n\t\t\t'people-qual' => 'acl_editor_people_qualifications',\r\n\t\t\t'people-responsibility' => 'acl_editor_people_responsibility',\r\n\t\t\t'people-types' => 'acl_editor_people_trainer',\r\n\t\t\t'people-title' => 'acl_editor_people_titles',\r\n\t\t\t'people-skills' => 'acl_editor_people_trainer_skills',\r\n\t\t\t'people-languages' => 'acl_editor_people_languages',\r\n\t\t\t'people-affiliations' => 'acl_editor_people_affiliations',\r\n\t\t\t'people-suffix' => 'acl_editor_people_suffix',\r\n\t\t\t'people-active' => 'acl_editor_people_active_trainer',\r\n\t\t\t'training-organizer' => 'acl_editor_training_organizer',\r\n\t\t\t'training-topic' => 'acl_editor_training_topic',\r\n\t\t\t'training-level' => 'acl_editor_training_level',\r\n\t\t\t'training-pepfar' => 'acl_editor_pepfar_category',\r\n\t\t\t'training-refreshercourse' => 'acl_editor_refresher_course',\r\n\t\t\t'training-funding' => 'acl_editor_funding',\r\n\t\t\t'training-recommend' => 'acl_editor_recommended_topic',\r\n\t\t\t'training-gotcurriculum' => 'acl_editor_nationalcurriculum',\r\n\t\t\t'training-method' => 'acl_editor_method',\r\n\t\t\t'training-viewing-location' => 'acl_admin_training',\r\n\t\t\t'training-budget-code' => 'acl_admin_training',\r\n\t\t\t'facilities-types' => 'acl_editor_facility_types',\r\n\t\t\t'facilities-sponsors' => 'acl_editor_facility_sponsors',\r\n\t\t\t'preservice-classes' => 'acl_editor_ps_classes',\r\n\t\t\t'preservice-cadres' => 'acl_editor_ps_cadres',\r\n\t\t\t'preservice-degrees' => 'acl_editor_ps_degrees',\r\n\t\t\t'preservice-funding' => 'acl_editor_ps_funding',\r\n\t\t\t'preservice-institutiontypes' => 'acl_editor_ps_institutions',\r\n\t\t\t'preservice-languages' => 'acl_editor_ps_languages',\r\n\t\t\t'preservice-nationalities' => 'acl_editor_ps_nationalities',\r\n\t\t\t'preservice-joindropreasons' => 'acl_editor_ps_joindropreasons',\r\n\t\t\t'preservice-sponsors' => 'acl_editor_ps_sponsors',\r\n\t\t\t'preservice-tutortypes' => 'acl_editor_ps_tutortypes',\r\n\t\t\t'preservice-coursetypes' => 'acl_editor_ps_coursetypes',\r\n\t\t\t'preservice-religion' => 'acl_editor_ps_religions',\r\n\t\t\t'preservice-prior-education' => 'acl_editor_ps_classes',\r\n\t\t\t'users-add' => 'add_edit_users',\r\n\t\t\t'training-settings' => 'acl_admin_training',\r\n\t\t\t'people-settings' => 'acl_admin_people',\r\n\t\t\t'facilities-settings' => 'acl_admin_facilities',\r\n\t\t\t'people-new' => 'facility_and_person_approver',\r\n\t\t\t'facilities-new-facilities' => 'facility_and_person_approver',\r\n\t\t\t'employee-category' => 'employees_module',\r\n\t\t\t'employee-role' => 'employees_module',\r\n\t\t\t'employee-transition' => 'employees_module',\r\n\t\t\t'employee-relationship' => 'employees_module',\r\n\t\t\t'employee-referral' => 'employees_module',\r\n\t\t\t'employee-training-provided' => 'employees_module',\r\n\t\t 'employee-dsdmodel' => 'acl_editor_employee_dsdmodel',//TA:#416\r\n\t\t 'employee-dsdteam' => 'acl_editor_employee_dsdteam',//TA:#416\r\n\t\t\t'tutorspecialty' => 'acl_editor_tutor_specialty', //TA: added 7/22/2014\r\n\t\t\t'tutorcontract' => 'acl_editor_tutor_contract', //TA: added 7/24/2014\r\n\t\t\t'commodityname' => 'acl_editor_commodityname', //TA:17: added 9/19/2014\r\n\t\t\t'commoditytype' => 'acl_editor_commoditytype', //TA:17:12: added 10/03/2014\r\n\t\t);\r\n\r\n\r\n\t\treturn $this->hasACL($validACLEditPages[$this->getRequest()->action]);\r\n\t}",
"public function validateAclRulesAction()\n {\n $this->view->invalid = array();\n\n // Get the access control list containing roles and resources.\n $acl = new Ramp_Acl();\n\n // Get the Access Control List containing defined roles and \n // resources.\n $authInfo = new Application_Model_DbTable_Auths();\n $accessRules = $authInfo->getAccessRules();\n\n // Check the access rules to validate whether each role and \n // resource exist in the access control list.\n foreach ( $accessRules as $ruleNumber => $rule )\n {\n foreach ( $rule as $role => $resource )\n {\n if ( ! $acl->hasRole($role) )\n {\n $this->view->invalid[$ruleNumber]['role'] = $role;\n }\n if ( ! $acl->has($resource) )\n {\n $this->view->invalid[$ruleNumber]['resource'] = $resource;\n }\n }\n }\n }",
"function validate() {\n $errors = parent::validate();\n // Verify that search fields are set up.\n $style_options = $this->get_option('style_options');\n if (!isset($style_options['search_fields'])) {\n $errors[] = t('Display \"@display\" needs a selected search fields to work properly. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title));\n }\n else {\n // Verify that the search fields used actually exist.\n //$fields = array_keys($this->view->get_items('field'));\n $fields = array_keys($this->handlers['field']);\n foreach ($style_options['search_fields'] as $field_alias => $enabled) {\n if ($enabled && !in_array($field_alias, $fields)) {\n $errors[] = t('Display \"@display\" uses field %field as search field, but the field is no longer present. See the settings for the Entity Reference list format.', array('@display' => $this->display->display_title, '%field' => $field_alias));\n }\n }\n }\n return $errors;\n }",
"public static function validateListContractsForArrayConstraintsFromSetListContracts(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $insertPlateAuthorizationListContractsItem) {\n // validation for constraint: itemType\n if (!$insertPlateAuthorizationListContractsItem instanceof \\bunge\\StructType\\RespPlateAuthContract) {\n $invalidValues[] = is_object($insertPlateAuthorizationListContractsItem) ? get_class($insertPlateAuthorizationListContractsItem) : sprintf('%s(%s)', gettype($insertPlateAuthorizationListContractsItem), var_export($insertPlateAuthorizationListContractsItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The listContracts property can only contain items of type \\bunge\\StructType\\RespPlateAuthContract, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }",
"public function authors_is_required()\n {\n $entry = Entry::factory()->raw();\n $category = Category::factory()->create();\n\n Sanctum::actingAs(User::factory()->create());\n\n $this->jsonApi()->withData([\n 'type' => 'entries',\n 'attributes' => $entry,\n 'relationships' => [\n 'categories' => [\n 'data' => [\n 'id' => $category->getRouteKey(),\n 'type' => 'categories'\n ]\n ]\n ]\n ])->post(route('api.v1.entries.create'))\n ->assertStatus(Response::HTTP_UNPROCESSABLE_ENTITY) //422\n ->assertJsonFragment(['source' => ['pointer' => '/data']]);\n\n $this->assertDatabaseMissing('entries', $entry);\n }",
"public function authorize()\n {\n // to do update verification and rules on the rights to create a company\n return true;\n }",
"public function authorizable(): bool\n {\n return false;\n }",
"public function __construct()\n {\n $this->validateArray = [\n 'title' => 'required|unique:books',\n 'year' => 'required|integer',\n 'author' => 'exists:authors,id'\n ];\n }",
"public function rules()\n {\n return [\n\t\t\t[['title', 'text', 'year', 'author_id'], 'required']\n ];\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function validateAuthorId($key, $value, $params, $rule)\n\t{\n\t\tif (ee()->session->userdata('member_id'))\n\t\t{\n\t\t\tif ($this->author_id != ee()->session->userdata('member_id') && ee()->session->userdata('can_edit_other_entries') != 'y')\n\t\t\t{\n\t\t\t\treturn 'not_authorized';\n\t\t\t}\n\n\t\t\tif ( ! $this->isNew() && $this->getBackup('author_id') != $this->author_id &&\n\t\t\t\t(ee()->session->userdata('can_edit_other_entries') != 'y' OR ee()->session->userdata('can_assign_post_authors') != 'y'))\n\t\t\t{\n\t\t\t\treturn 'not_authorized';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! $this->isNew() && $this->getBackup('author_id') != $this->author_id &&\n\t\t\t\t($this->Author->MemberGroup->can_edit_other_entries != 'y' OR $this->Author->MemberGroup->can_assign_post_authors != 'y'))\n\t\t\t{\n\t\t\t\treturn 'not_authorized';\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"protected function preValidate() {}",
"protected function validation(){\t\t\n\t\t$this->validate(\"InclusionIn\", array(\n\t\t\t\"field\" => \"mandoc\",\n\t\t\t\"domain\" => array('S', 'N'),\n\t\t\t\"required\" => true\n\t\t));\n\t\tif($this->validationHasFailed()==true){\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function authors(array $data, array $attributes=array()){\r\n //Add research areas\r\n $authOptions = array();\r\n\r\n $authOptions[] = JHTML::_('select.option', '-1', JText::_('JRESEARCH_AUTHORS'));\r\n\r\n foreach($data as $author){\r\n $authOptions[] = JHTML::_('select.option', $author['mid'], $author['member_name']);\r\n }\r\n\r\n return self::htmllist($authOptions, $attributes);\r\n }",
"public function forAuthorizableTypes()\n {\n return $this->forAuthorizableTypes;\n }",
"private function validate() {\n $this->valid = (1 === count($this->marriages));\n }",
"public function rebuildAuthorizations()\n {\n $roleRepository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Role');\n\n // Clear\n $this->entityManager->createQuery('DELETE Edweld\\AclBundle\\Entity\\Authorization')->execute();\n $this->entityManager->clear('Edweld\\AclBundle\\Entity\\Authorization');\n\n // Regenerate\n foreach ($roleRepository->findAll() as $role) {\n /** @var Role $role */\n $role->createAuthorizations($this);\n }\n $this->entityManager->flush();\n $this->entityManager->clear();\n }",
"private function validate() {\n\t\tif (!$this->user->hasPermission('modify', 'module/bottomlistcategory')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\t\t\n\t\tif (!$this->error) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\t\n\t}",
"protected function validateInput()\r\n {\r\n self::setValidSortTypes();\r\n\r\n if (empty($this->offset)) {\r\n $this->offset = 0;\r\n }\r\n\r\n // Missing values\r\n $check_missing = ['type', 'offset', 'limit', 'sort_type', 'sort_order'];\r\n missing_values_to_exception($this, 'CHV\\ListingException', $check_missing, 100);\r\n\r\n // Validate type\r\n if (!in_array($this->type, self::$valid_types)) {\r\n throw new ListingException('Invalid $type \"' . $this->type . '\"', 110);\r\n }\r\n\r\n if ($this->offset < 0 || $this->limit < 0) {\r\n throw new ListingException('Limit integrity violation', 121);\r\n }\r\n\r\n // Validate sort type\r\n if (!in_array($this->sort_type, self::$valid_sort_types)) {\r\n throw new ListingException('Invalid $sort_type \"' . $this->sort_type . '\"', 130);\r\n }\r\n\r\n // Validate sort order\r\n if (!preg_match('/^(asc|desc)$/', $this->sort_order)) {\r\n throw new ListingException('Invalid $sort_order \"' . $this->sort_order . '\"', 140);\r\n }\r\n }",
"protected function _aclValidation()\n {\n if(!$this->_aclResource && !$this->_aclPrivilege) {\n return;\n }\n \n if(!$this->_acl->isUserAllowed(\n $this->_aclResource, \n $this->_aclPrivilege\n )) {\n $fullResource = array(\n $this->_request->getModuleName(),\n $this->_request->getControllerName(),\n $this->_request->getActionName(),\n );\n \n throw new SG_Controller_Action_NotAuthorized_Exception(\n 'User not allowed to access \"' \n . implode(':', $fullResource) \n . '\" (ACL: '\n . $this->_aclResource\n . ' > '\n . $this->_aclPrivilege\n . ').'\n );\n }\n }",
"protected function beforeValidate()\n\t{\n if($this->getIsNewRecord()) {\n $this->setAuthorId(Yii::app()->user->getId());\n }\n\t\treturn true;\n\t}",
"public function check()\n\t{\n // @TODO: Finish validation checks\n $this->assertNotEmpty($this->item_list_element, 'COM_CAJOBBOARD_ORGANIZATION_TYPE_ERR_TYPE_OF_ORGANIZATION');\n $this->assertNotEmpty($this->url, 'COM_CAJOBBOARD_ORGANIZATION_TYPE_ERR_ URL');\n\n\t\tparent::check();\n\n return $this;\n }",
"public function validate($data)\n {\n if ($this->checkMenuItemIsRemoved($data)) {\n return;\n }\n\n $this->assertContainsRequiredParameters($data);\n $this->assertIdentifierIsNotUsed($data['id']);\n\n foreach ($data as $param => $value) {\n $this->validateMenuItemParameter($param, $value);\n }\n $this->_ids[] = $data['id'];\n }",
"function SetupListOptions() {\n\t\tglobal $Security, $scholarship_package;\n\n\t\t// \"edit\"\n\t\t$this->ListOptions->Add(\"edit\");\n\t\t$item =& $this->ListOptions->Items[\"edit\"];\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->CanEdit();\n\t\t$item->OnLeft = FALSE;\n\n\t\t// \"detail_scholarship_payment\"\n\t\t$this->ListOptions->Add(\"detail_scholarship_payment\");\n\t\t$item =& $this->ListOptions->Items[\"detail_scholarship_payment\"];\n\t\t$item->CssStyle = \"white-space: nowrap;\";\n\t\t$item->Visible = $Security->AllowList('scholarship_payment');\n\t\t$item->OnLeft = FALSE;\n\n\t\t// Call ListOptions_Load event\n\t\t$this->ListOptions_Load();\n\t\tif ($scholarship_package->Export <> \"\" ||\n\t\t\t$scholarship_package->CurrentAction == \"gridadd\" ||\n\t\t\t$scholarship_package->CurrentAction == \"gridedit\")\n\t\t\t$this->ListOptions->HideAllOptions();\n\t}",
"function validate() {\n\t\timport('lib.pkp.classes.navigationMenu.NavigationMenuItem');\n\t\tif ($this->getData('menuItemType') && $this->getData('menuItemType') != \"\") {\n\t\t\tif ($this->getData('menuItemType') == NMI_TYPE_CUSTOM) {\n\t\t\t\tif (!preg_match('/^[a-zA-Z0-9\\/._-]+$/', $this->getData('path'))) {\n\t\t\t\t\t$this->addError('path', __('manager.navigationMenus.form.pathRegEx'));\n\t\t\t\t}\n\n\t\t\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\n\t\t\t\t$navigationMenuItem = $navigationMenuItemDao->getByPath($this->_contextId, $this->getData('path'));\n\t\t\t\tif (isset($navigationMenuItem) && $navigationMenuItem->getId() != $this->navigationMenuItemId) {\n\t\t\t\t\t$this->addError('path', __('manager.navigationMenus.form.duplicatePath'));\n\t\t\t\t}\n\t\t\t} elseif ($this->getData('menuItemType') == NMI_TYPE_REMOTE_URL) {\n\t\t\t\tif(!filter_var($this->getData('url'), FILTER_VALIDATE_URL)) {\n\t\t\t\t\t$this->addError('url', __('manager.navigationMenus.form.customUrlError'));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$this->addError('path', __('manager.navigationMenus.form.typeMissing'));\n\t\t}\n\n\t\treturn parent::validate();\n\t}",
"function ValidateAdmin()\n\t{\n\t}",
"public function rules()\n {\n return [\n 'publisher_name' => 'required',\n 'publisher_url' => 'required'\n ];\n }",
"public function testAuthor()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's author is correct\n $feedAuthor = $feed->getAuthor();\n $this->assertEquals($feedAuthor, $feed->author);\n $this->assertEquals(1, count($feedAuthor));\n $this->assertTrue($feedAuthor[0] instanceof Zend_Gdata_App_Extension_Author);\n $this->verifyProperty2($feedAuthor[0], \"name\", \"text\", \"GData Ops Demo\");\n $this->verifyProperty2($feedAuthor[0], \"email\", \"text\", \"gdata.ops.demo@gmail.com\");\n\n // Assert that each entry has valid author data\n foreach ($feed as $entry) {\n $entryAuthor = $entry->getAuthor();\n $this->assertEquals(1, count($entryAuthor));\n $this->verifyProperty2($entryAuthor[0], \"name\", \"text\", \"GData Ops Demo\");\n $this->verifyProperty2($entryAuthor[0], \"email\", \"text\", \"gdata.ops.demo@gmail.com\");\n $this->verifyProperty($entryAuthor[0], \"uri\", null);\n }\n }",
"public function listCaseTestValidateForInput()\n {\n return [\n ['name', '', 'The name field is required.'],\n ['identity_number', '', 'The identity number field is required.'],\n ['dob', '', 'The dob does not match the format Y-m-d.'],\n ['address', '', 'The address must be a string.'],\n ['avatar', '','The avatar must be an image'],\n ['avatar', '','The avatar must be a file of type: png, jpg, jpeg'],\n ];\n }",
"public function merge_validater_allow_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_allow_arr[$k] = (bool)$v;\n }\n }",
"public function authors_list()\n\t{\n\t\t$this->admin_header();\n\t\t\n\t\t//fetch the total number of categories\n\t\t$config['total_num_author'] = $this->Admin_model->fetch_all_rows('authors');\n\t\t\n\t\t//fetch the total number of tags\n\t\t$data['total_num_tags'] = $this->Admin_model->fetch_all_rows('tags');\n\t\t\n\t\t//$config['total_rows'] = $this->Admin_model->fetch_all_rows('food');\n\t\t \n\t\t$config['base_url'] = site_url(\"Admin/authors/\");\n\t\t$config['per_page'] = 10;\n\t\t$config['uri_segment'] = '3';\n\t\t$config['num_links'] = round($config['total_num_author'] / $config['per_page']);\n\t\t\n\t\t$config['full_tag_open'] = '<ul class=\"pagination\">';\n\t\t$config['full_tag_close'] = '</ul>';\n\t\t\n\t\t$config['first_link'] = FALSE;\n\t\t\n\t\t$config['last_link'] = FALSE;\n\t\t\n\t\t$config['next_link'] = FALSE;\n\t\t\n\t\t$config['prev_link'] = FALSE;\n\t\t\n\t\t$config['cur_tag_open'] = '<li class=\"active\"><a href=\"#\">';\n\t\t$config['cur_tag_close'] = '</li>';\n\t\t\n\t\t$config['num_tag_open'] = '<li>';\n\t\t$config['num_tag_close'] = '</li>';\n\t\t\n\t\t$this->pagination->initialize($config);\n\t\t\n\t\t$page_number = $this->uri->segment(3);\n\t\t$data['authors'] = $this->Admin_model->fetch_author($config['per_page'], $page_number);\n\t\t\n\t\t$data['total_num_pages'] = ceil($config['total_num_author'] / $config['per_page']);\n\t\t$data['total_num_rows'] = $config['total_num_author'];\n\t\t\n\t\t$url_segments = $this->uri->total_segments();\n\t\t$data['page_num'] = ($url_segments !== 3) ? 1 : $this->uri->segment(3);\n\t\t\n\t\t$this->add_author_template('authors_list', $data);\n\t}",
"protected function doTestAuthoringInfo() {\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n $values = [];\n\n // Post different authoring information for each translation.\n foreach ($this->langcodes as $index => $langcode) {\n $user = $this->drupalCreateUser();\n $values[$langcode] = [\n 'uid' => $user->id(),\n 'created' => REQUEST_TIME - mt_rand(0, 1000),\n ];\n $edit = [\n 'content_translation[uid]' => $user->getAccountName(),\n 'content_translation[created]' => $this->container->get('date.formatter')->format($values[$langcode]['created'], 'custom', 'Y-m-d H:i:s O'),\n ];\n $url = $entity->toUrl('edit-form', ['language' => ConfigurableLanguage::load($langcode)]);\n $this->drupalGet($url);\n $this->submitForm($edit, $this->getFormSubmitAction($entity, $langcode));\n }\n\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n foreach ($this->langcodes as $langcode) {\n $metadata = $this->manager->getTranslationMetadata($entity->getTranslation($langcode));\n $this->assertEquals($values[$langcode]['uid'], $metadata->getAuthor()->id(), 'Translation author correctly stored.');\n $this->assertEquals($values[$langcode]['created'], $metadata->getCreatedTime(), 'Translation date correctly stored.');\n }\n\n // Try to post non valid values and check that they are rejected.\n $langcode = 'en';\n $edit = [\n // User names have by default length 8.\n 'content_translation[uid]' => $this->randomMachineName(12),\n 'content_translation[created]' => '19/11/1978',\n ];\n $this->drupalGet($entity->toUrl('edit-form'));\n $this->submitForm($edit, $this->getFormSubmitAction($entity, $langcode));\n $this->assertSession()->statusMessageExists('error');\n $metadata = $this->manager->getTranslationMetadata($entity->getTranslation($langcode));\n $this->assertEquals($values[$langcode]['uid'], $metadata->getAuthor()->id(), 'Translation author correctly kept.');\n $this->assertEquals($values[$langcode]['created'], $metadata->getCreatedTime(), 'Translation date correctly kept.');\n }",
"public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }",
"public function wxr_authors_list()\n {\n $db = Typecho_Db::get();\n $dbPrefix = $db->getPrefix();\n\n $user_table = $dbPrefix . 'users';\n $authors = $db->fetchAll($db->query(\"select uid,name,mail from {$user_table} where activated != 0\"));\n $html = '';\n foreach ( $authors as $author ) {\n $html .= \"\\t<wp:author>\";\n $html .= '<wp:author_id>' . $author['uid'] . '</wp:author_id>';\n $html .= '<wp:author_login>' . $author['name'] . '</wp:author_login>';\n $html .= '<wp:author_email>' . $author['mail'] . '</wp:author_email>';\n $html .= '<wp:author_display_name>' . $this->wxr_cdata($author['name']) . '</wp:author_display_name>';\n $html .= '<wp:author_first_name>' . $this->wxr_cdata('') . '</wp:author_first_name>';\n $html .= '<wp:author_last_name>' . $this->wxr_cdata('') . '</wp:author_last_name>';\n $html .= \"</wp:author>\\n\";\n }\n return $html;\n }",
"public function editTermsValidator(array $data) {\n return Validator::make($data, [\n 'name' => 'required|in:features,colors,themes,tags',\n 'value' => 'required|max:255',\n ]);\n }",
"public function testCopyleftWhenAuthorshipOptionEnabled()\n {\n $this->service->assignCopyleft($this->author, $this->resource, new Authorship(1));\n\n // use black box approach by testing transformation result\n $doc = new Document();\n $this->resource->build()->transform($doc);\n\n $body = $doc->getEntity('resource')->property('body')->getValue();\n\n $this->assertEquals(\n 1,\n preg_match('~' . $this->author->getFullName() . ', ' . self::AGENCY_NAME . '?\\.$~', strip_tags($body)),\n 'Author doesn\\'t exists in article copyleft'\n );\n }",
"public function addValidators() {\n\t\t$this->getElement('username')->addValidators(array(array('isUnique', true, array('options' => array('table' => 'Users', 'field' => 'username', 'match' => 'id', 'key' => $this->_account['id']), 'messages' => array('notUnique' => 'User name is used.')))));\n\t\t$this->getElement('screenname')->addValidators(array(array('isUnique', true, array('options' => array('table' => 'Users', 'field' => 'screenname', 'match' => 'id', 'key' => $this->_account['id']), 'messages' => array('notUnique' => 'Screen name is used.')))));\n\t\t$this->getElement('authenticatepassword')->addValidators(array(array('Password', true, array('options' => array('id' => $this->_user->id)))));\n\t}",
"function create_author_list( $role ) {\n\n // list editors first\n $args = array(\n 'role' => $role,\n 'orderby' => 'display_name'\n );\n\n // Create the WP_User_Query object\n $wp_user_query = new WP_User_Query($args);\n\n $author_ids = $wp_user_query->get_results();\n\n foreach($author_ids as $author) :\n\n $curauth = get_userdata($author->ID);\n\n if($curauth->user_login !== 'admin') : // if name == admin don't display\n $user_link = get_author_posts_url($curauth->ID);\n $avatar = 'default'; ?>\n\n\n <div class=\"author\" title=\"<?php echo $curauth->display_name; ?>\">\n <a href=\"\n <?php echo get_author_posts_url( get_the_author_meta( 'ID', $curauth->ID ) ); ?>\n \">\n <?php\n // avatar goes here\n $avatar = get_field('author_photo', 'user_' . $curauth->ID );\n echo '<img src=\"';\n echo $avatar['url'];\n echo '\" />';\n ?>\n <p class=\"name\"><?php echo $curauth->display_name; ?></p>\n <p><?php the_author_meta( 'shortbio', $curauth->ID ); ?></p>\n </a>\n </div>\n\n\n <?php endif;\n endforeach;\n\n}",
"public function authorize()\n {\n $canAdd = Voyager::can('add_membercontacts');\n $canUpdate = Voyager::can('edit_membercontacts');\n if($canAdd && $canUpdate)\n {\n return true;\n }\n else\n {\n // fix this with redirection\n return false;\n }\n }",
"function cap_byline_array_set_terms( $post_id ) {\n global $post;\n // Dont run this on the state-year-report post type\n if ( !is_singular('state-year-report') ) {\n // Get the ACF Byline Array\n $field_data = get_field('byline_array');\n $persons = array();\n // Check to see if this post has any authors if it does not, proceed with auto selection\n // we do this check becuase we don't want to continue to autoselect if they've removed the autoselect author in one off cases.\n // Also we're presuming to autoselect as a function only if no authors are present.\n if ( empty($field_data) ) {\n // Get the author information\n if(is_object($post) && isset($post->post_author)) {\n $author_slug = get_the_author_meta( 'user_login', $post->post_author );\n if(term_exists($author_slug, 'person')) {\n $author_data = get_term_by( 'slug', $author_slug, 'person' );\n $author_id = $author_data->term_id;\n } else {\n $author_data = \"\";\n $author_id = null;\n }\n\n // Check for an author byline override. Basically this is a intern function.\n $default_byline_override = get_user_meta( $post->post_author, '_default_byline', true );\n if(term_exists($default_byline_override, 'person')) {\n $default_byline = get_term_by( 'id', $default_byline_override, 'person' );\n $default_byline_id = $default_byline->term_id;\n } else {\n $default_byline = \"\";\n $default_byline_id = null;\n }\n\n // If a override is present use that first\n if ( !empty($default_byline_override) && false === get_field( 'disable_auto_author_select','options' ) ) {\n $persons[] = $default_byline_id;\n // If a person exists with the slug of the author then auto add it.\n } elseif ( term_exists( $author_slug, 'person' ) && false === get_field( 'disable_auto_author_select','options' ) ) {\n $persons[] = $author_id;\n }\n }\n\n }\n\n // Go through the persons from the field add them to the persons array.\n if(isset($field_data) && is_array($field_data) && count($field_data) > 0) {\n foreach ($field_data as $data) {\n $persons[] = $data;\n }\n }\n\n // Go back and update the field with the new data\n update_field('field_53f38cd042a42', $persons);\n // Set this posts person terms to the persons array\n wp_set_post_terms( $post_id, $persons, 'person', false );\n }\n}",
"protected function _validate() {\n\t}",
"public function authorsProvider()\n {\n return [[[]]];\n }",
"public function setValidators(array $amValidators)\n {\n sfForm::setValidators(\n array( \n 'grantee_unique_id'\t\t\t=> new sfValidatorString(\n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => true, 'trim' => true),\n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => $amValidators['grantee_unique_id']['required'])\n \t\t ),\n\t\t\t\t'transfer_date'\t\t\t\t=> new sfValidatorString( \n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)),\n\t\t\t\t//'transfer_cost'\t\t\t\t=> new sfValidatorString(array('required' => false, 'trim' => true)),\n 'catalog_id' => new sfValidatorString( \n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)),\n 'payment_id' => new sfValidatorString( \n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)),\n\t\t\t\t'receipt_number'\t\t\t=> new sfValidatorString( \n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)),\n\t\t\t\t'grantee_identity_id'\t\t=> new sfValidatorString( \n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true)),\n\t\t\t\t'grantee_identity_number'\t=> new sfValidatorString( \n\t\t\t\t\t\t\t\t\t\t\t\tarray('required' => false, 'trim' => true))\n )\n );\n }",
"function _wp_register_meta_args_allowed_list($args, $default_args)\n {\n }",
"function retrieve_promoter_guest_list_authorizations(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_promoter_guest_list_authorizations($this->promoter->up_id);\n\t\t\n\t}",
"public function authorizeAction()\n {\n $this->view->title .= ' - Grant Access';\n\n $id = $this->_getParam('roleId');\n if (empty($id)) throw new InvalidArgumentException('Missing parameter roleId.');\n\n // find current role\n $roleResource = new Application_Model_Mapper_Roles();\n /* @var $role Application_Model_Role */\n $role = current($roleResource->find($id));\n\n $Acl = new Application_Model_Mapper_Acl();\n\n $form = $this->_getForm('aclAdd');\n $form->setAction($form->getAction());\n\n $request = $this->getRequest();\n if ($request->isPost() && $form->isValid($request->getPost())) {\n $values = $form->getValues();\n $i = 0;\n $Acl->cleanByRoleAndResource($values['roleId'], $values['resourceId']);\n foreach ($values['action'] as $action) {\n $data = $values;\n $data['action'] = $action;\n\n $aclItem = $Acl->fetchRowByRoleAndResource($data['roleId'], $data['resourceId'], $action);\n $aclItem->setData($data);\n $aclItem->save();\n }\n $this->_helper->flashMessenger(\"Update $i rule(s) for role \\\"{$role->name}\\\"!\");\n //clean acl cache\n $i = $this->_cleanAclCacheByRole($role);\n $this->_helper->flashMessenger(\"clean $i acl cache for {$role->name}.\");\n }\n\n //get all registered resources\n $Resources = new Application_Model_Mapper_Resources();\n $rowset = $Resources->fetchAll();\n\n $allResources = array();\n foreach ($rowset as $resource) {\n $allResources[$resource->id] = $resource->name;\n }\n\n $form->setDefault('roleId', $role->id);\n //find resources by role\n $rowset = $role->getResources();\n $resources = array();\n foreach ($rowset as $resource) {\n $resources[$resource->id] = $resource;\n }\n //$aResources = array_diff_key($allResources, $resources);\n $rowset = $role->getAcl();\n $acl = array();\n foreach ($rowset as $item) {\n $acl[$item->resourceId][] = $item;\n }\n\n $form->getElement('resourceId')->setMultiOptions($allResources);\n\n $this->view->resources = $resources;\n $this->view->acl = $acl;\n $this->view->form = $form;\n\n $this->view->role = $role;\n }",
"public function setAncestralInvariants(AssertionList $ancestralInvariants)\n {\n $this->ancestralInvariants = $ancestralInvariants;\n }",
"function create_promoter_guest_list_authorization(){\n\t\t\n\t\t$this->CI->load->library('form_validation');\n\t\t\n\t\t$this->CI->form_validation->set_rules('venue', \t\t\t\t'', 'required');\n\t\t$this->CI->form_validation->set_rules('type', \t\t\t\t'', 'required');\n\t\t$this->CI->form_validation->set_rules('auto_approve', \t\t'', 'required');\n\t\t$this->CI->form_validation->set_rules('auto_promote', \t\t'', 'required');\n\t\t$this->CI->form_validation->set_rules('gl_name', \t\t\t'', 'required');\n\t\t$this->CI->form_validation->set_rules('weekday', \t\t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('gl_description', \t'', 'trim|required');\n\t\t\n\t\t\n\t\t\n\t\t$this->CI->form_validation->set_rules('min_age', \t\t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('regular_cover', \t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('gl_cover', \t\t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('door_opens', \t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('door_closes', \t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('auto_promote', \t\t'', 'trim|required');\n\t\t$this->CI->form_validation->set_rules('additional_info_1', \t'', 'trim');\n\t\t$this->CI->form_validation->set_rules('additional_info_2', \t'', 'trim');\n\t\t$this->CI->form_validation->set_rules('additional_info_3', \t'', 'trim');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//guest_list_auto_approve\n\t\t\n\t\tif($this->CI->form_validation->run() == false){\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'Please fill out all fields.');\n\t\t}\n\t\t\n\t\t//Force all guest lists to have images\n\t\t//IMAGE Handling\n\t\tif($manage_image = $this->CI->session->flashdata('manage_image')){\t\t\t\n\t\t\t$manage_image = json_decode($manage_image);\n\t\t\t\n\t\t\tif(!isset($manage_image->image_data) || !$manage_image->image_data){\n\t\t\t\t//This user has NOT uploaded an image\n\t\t\t\t\n\t\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t\t'message' => 'You must upload an image.');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t$team_venue_id \t\t= strip_tags($this->CI->input->post('venue'));\n\t\t$auto_approve \t\t= strip_tags($this->CI->input->post('auto_approve'));\n\t\t$gl_name \t\t\t= strip_tags($this->CI->input->post('gl_name'));\n\t\t$gl_description \t= strip_tags($this->CI->input->post('gl_description'));\n\t\t\n\t\t\n\t\t$type \t\t\t\t= strip_tags($this->CI->input->post('type'));\n\t\t$weekday \t\t\t= strip_tags($this->CI->input->post('weekday'));\n\t\t$date \t\t\t\t= strip_tags($this->CI->input->post('date'));\n\t\t\n\t\t\n\t\t$auto_promote \t\t= strip_tags($this->CI->input->post('auto_promote'));\n\t\t\n\t\t\n\t\t$gl_cover\t\t\t= strip_tags($this->CI->input->post('gl_cover'));\n\t\t$regular_cover\t\t= strip_tags($this->CI->input->post('regular_cover'));\n\t\t$door_opens\t\t\t= strip_tags($this->CI->input->post('door_opens'));\n\t\t$door_closes\t\t= strip_tags($this->CI->input->post('door_closes'));\n\t\t$min_age\t\t\t= strip_tags($this->CI->input->post('min_age'));\n\t\t$additional_info_1\t= strip_tags($this->CI->input->post('additional_info_1'));\n\t\t$additional_info_2\t= strip_tags($this->CI->input->post('additional_info_2'));\n\t\t$additional_info_3\t= strip_tags($this->CI->input->post('additional_info_3'));\n\t\t$image_data\t\t\t= $this->CI->input->post('image_data');\n\t\t\n\t\t$weekday_int = $weekday;\n\t\tswitch($weekday){\n\t\t\tcase 0:\n\t\t\t\t$weekday = 'mondays';\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$weekday = 'tuesdays';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$weekday = 'wednesdays';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$weekday = 'thursdays';\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$weekday = 'fridays';\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$weekday = 'saturdays';\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$weekday = 'sundays';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'Invalid weekday');\t\n\t\t}\n\t\t\n\t\t//make sure gl_name is > 5 characters && < 30 && no special characters\n\t\t$gl_name = trim(preg_replace('/\\s\\s+/', ' ', $gl_name));\n\t\t\n\t\t\n\t\tif($type == 'event'){\n\t\t\tif(!$date){\n\t\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t\t'message' => 'Please provide a date');\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif(preg_match('~[^a-z0-9 ]~i', $gl_name))\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'List name must contain only alphanumeric characters');\t\n\t\t\t\t\t\t\n\t\tif(strlen($gl_name) < 5)\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'List name must be more than 5 characters');\n\t\t\n\t\tif(strlen($gl_name) > 30)\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'List name must not exceed 30 characters');\n\n\t\tif(strlen($gl_description) > 2000)\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'List description must not exceed 2000 characters');\n\t\t\t\n\t\tif(strlen($gl_description) < 10)\n\t\t\treturn array('success' => false,\n\t\t\t\t\t\t\t'message' => 'List description must be greater than 10 characters');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif($image_data == 'false'){\n\t\t\treturn array('success' => false, \n\t\t\t\t\t\t\t'message' => 'Please provide an image for your guest list');\n\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t$this->CI->load->library('library_image_upload', '', 'image_upload');\n\t\t\n\t\t//make image live\t\t\t\n\t\t$new_image_name = $this->CI->image_upload->make_image_live('guest_lists', $image_data['image']);\n\t\t\n\t\t//crop image\n\t\t$image_obj \t\t\t= new stdClass;\n\t\t$image_obj->image \t= $new_image_name;\n\t\t$this->CI->image_upload->image_crop($image_obj, 'guest_lists', true, $image_data, true);\n\t\t$new_image_name \t= $this->CI->image_upload->image_data['image'];\n\t\t$image_data['image']\t\t= $new_image_name;\n\t\t\n\t\t\n\t\tif($auto_promote == 'true'){\n\t\t\t//create auto-promote cron record\n\t\t\t$this->CI->db->insert('cron_jobs',\n\t\t\tarray(\n\t\t\t\t'cj_min'\t\t\t=> 0,\n\t\t\t\t'cj_hour'\t\t\t=> 12,\n\t\t\t\t'cj_day_of_month' \t=> '*',\n\t\t\t\t'cj_month'\t\t\t=> '*',\n\t\t\t\t'cj_day_of_week'\t=> $weekday_int,\n\t\t\t\t'cj_type'\t\t\t=> 'auto_promote',\n\t\t\t\t'cj_once'\t\t\t=> 0\n\t\t\t));\n\t\t\t$cj_id = $this->CI->db->insert_id();\n\t\t}else{\n\t\t\t$cj_id = NULL;\n\t\t}\t\t\n\t\t\n\t\t\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->create_promoter_guest_list_authorization($this->promoter->up_id, \n\t\t\t\t$team_venue_id, \n\t\t\t\t$weekday, \n\t\t\t\t$gl_name, \n\t\t\t\t$gl_description, \n\t\t\t\t$auto_approve, \n\t\t\t\t$gl_cover,\n\t\t\t\t$regular_cover, \n\t\t\t\t$door_opens, \n\t\t\t\t$door_closes, \n\t\t\t\t$min_age, \n\t\t\t\t$additional_info_1, \n\t\t\t\t$additional_info_2, \n\t\t\t\t$additional_info_3, \n\t\t\t\t$auto_promote,\n\t\t\t\t$image_data, \n\t\t\t\tfalse,\n\t\t\t\t$cj_id,\n\t\t\t\t\n\t\t\t\t$type, $date);\n\t\t\t\t\n\t\tif($auto_promote == 'true'){\n\t\t\t$this->CI->load->helper('run_gearman_job');\n\t\t\trun_gearman_job('gearman_update_crontab', array());\n\t\t}\n\t\t\n\t}",
"public function authorize()//AQUI QUE VALIDA USUÀRIO\r\n {\r\n return true;\r\n }",
"public function initializeControllerArgumentsBaseValidators() {}",
"public static function get_authors_parameters() {\n return new external_function_parameters(array(\n 'id' => new external_value(PARAM_INT, 'Glossary entry ID'),\n 'from' => new external_value(PARAM_INT, 'Start returning records from here', VALUE_DEFAULT, 0),\n 'limit' => new external_value(PARAM_INT, 'Number of records to return', VALUE_DEFAULT, 20),\n 'options' => new external_single_structure(array(\n 'includenotapproved' => new external_value(PARAM_BOOL, 'When false, includes self even if all of their entries' .\n ' require approval. When true, also includes authors only having entries pending approval.', VALUE_DEFAULT, 0)\n ), 'An array of options', VALUE_DEFAULT, array())\n ));\n }",
"function ensureAuthorsInDatabase($authors)\r\n {\r\n $CI = &get_instance();\r\n if (!is_array($authors))\r\n return null;\r\n \r\n $tempresult = array();\r\n foreach ($authors as $author)\r\n {\r\n $current = $this->getByExactName($author->firstname, $author->von, $author->surname, $author->jr);\r\n if ($current == null)\r\n $current = $this->add($author);\r\n \r\n $tempresult[] = $current;\r\n }\r\n //silently drop duplicate authors from list\r\n $authorids = array();\r\n $authors = array();\r\n foreach ($tempresult as $a)\r\n {\r\n if (!in_array($a->author_id,$authorids))\r\n {\r\n $authorids[] = $a->author_id;\r\n $authors[] = $a;\r\n }\r\n else\r\n {\r\n appendMessage(__(\"Dropped duplicate author\").\"<br/>\");\r\n }\r\n }\r\n\r\n return $authors;\r\n }",
"protected function prepareValidations() {}",
"public function authorize()\n {\n return true; // All can use SortInput\n }",
"protected function _construct() \n {\n\t$this->_objectId = 'author_id';\n\t$this->_blockGroup = 'Brituy_SimpleBlog';\n\t$this->_controller = 'adminhtml_author';\n\tparent::_construct();\n\t\n\t$this->buttonList->update('save primary', 'label', __('Save Author'));\n\t$this->buttonList->add(\n\t\t'saveandcontinue',[\n\t\t\t'label' => __('Save and Continue Edit'),\n\t\t\t'class' => 'save',\n\t\t\t'data_attribute' => [\n\t\t\t\t'mage-init' => [\n\t\t\t\t\t'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],\n\t\t\t\t],\n\t\t\t],\n\t\t],\n\t-100);\n\n\t$this->buttonList->update('delete', 'label', __('Delete'));\n }",
"public function testRequireAuthor()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }",
"function culturefeed_entry_ui_edit_collaboration_data_form_validate(array $form, array &$form_state) {\n\n if (isset($form_state['values']['collaboration'])) {\n\n $collaboration = $form_state['values']['collaboration'];\n foreach ($collaboration as $tag => $info) {\n\n $field = \"collaboration][\" . $tag . \"][image][\";\n if (!empty($info['image']['upload']) && $info['image']['copyright'] != 1) {\n form_set_error($field . \"copyright\", t('Please agree to the general conditions of UiTdatabank and declare that you have the necessary rights or permissions to distribute the image through UiTdatabank.'));\n }\n if (!empty($info['image']['upload']) && empty($info['image']['copyright_text'])) {\n form_set_error($field . \"copyright_text\", t('Copyright field is required.'));\n }\n\n }\n\n }\n\n}",
"public function beforeValidate($options = array()) {\n\t\t$this->validate = array_merge($this->validate, array(\n\t\t\t'block_id' => array(\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t'rule' => array('numeric'),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t\t'allowEmpty' => false,\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'on' => 'update', // Limit validation to 'create' or 'update' operations\n\t\t\t\t),\n\t\t\t),\n\t\t\t'key' => array(\n\t\t\t\t'notBlank' => array(\n\t\t\t\t\t'rule' => array('notBlank'),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t\t'allowEmpty' => false,\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'on' => 'update', // Limit validation to 'create' or 'update' operations\n\t\t\t\t),\n\t\t\t),\n\t\t\t'language_id' => array(\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t'rule' => array('numeric'),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t\t'required' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'click_count' => array(\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t'rule' => array('numeric'),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t\t'allowEmpty' => true,\n\t\t\t\t),\n\t\t\t),\n\n\t\t\t//status to set in PublishableBehavior.\n\n\t\t\t'url' => array(\n\t\t\t\t'notBlank' => array(\n\t\t\t\t\t'rule' => array('notBlank'),\n\t\t\t\t\t'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('links', 'URL')),\n\t\t\t\t\t'allowEmpty' => false,\n\t\t\t\t\t'required' => true,\n\t\t\t\t),\n\t\t\t\t'url' => array(\n\t\t\t\t\t'rule' => array('url'),\n\t\t\t\t\t'message' => sprintf(\n\t\t\t\t\t\t__d('net_commons', 'Unauthorized pattern for %s. Please input the data in %s format.'),\n\t\t\t\t\t\t__d('links', 'URL'),\n\t\t\t\t\t\t__d('links', 'URL')\n\t\t\t\t\t),\n\t\t\t\t\t'allowEmpty' => false,\n\t\t\t\t\t'required' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t\t'title' => array(\n\t\t\t\t'notBlank' => array(\n\t\t\t\t\t'rule' => array('notBlank'),\n\t\t\t\t\t'message' => sprintf(__d('net_commons', 'Please input %s.'), __d('links', 'Title')),\n\t\t\t\t\t'allowEmpty' => false,\n\t\t\t\t\t'required' => true,\n\t\t\t\t),\n\t\t\t),\n\t\t));\n\n\t\tif ($this->data['Link']['url'] === 'http://') {\n\t\t\t$this->data['Link']['url'] = '';\n\t\t}\n\n\t\tif (isset($this->data['LinkOrder'])) {\n\t\t\t$this->LinkOrder->set($this->data['LinkOrder']);\n\t\t\tif (! $this->LinkOrder->validates()) {\n\t\t\t\t$this->validationErrors = array_merge(\n\t\t\t\t\t$this->validationErrors, $this->LinkOrder->validationErrors\n\t\t\t\t);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::beforeValidate($options);\n\t}",
"public function rules()\n {\n return [\n [['admin_id', 'identity'], 'required'],\n [['admin_id'], 'integer'],\n ];\n }",
"public function testSetCollectionApproval()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function authorize() {\n\t\treturn $this->user()->hasPermission('edit.roles');\n\t}",
"public function get_authors();",
"public static function validateAccessCode()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 50),\n );\n }",
"protected function beforeValidate()\n {\n $this->actions = !empty($this->actions) ? implode(',', $this->actions) : '';\n return parent::beforeValidate();\n }",
"protected function award_validation()\n {\n if (is_superadmin_loggedin()) {\n $this->form_validation->set_rules('branch_id', translate('branch'), 'required');\n }\n $this->form_validation->set_rules('role_id', translate('role'), 'trim|required');\n $this->form_validation->set_rules('user_id', translate('winner'), 'trim|required');\n $this->form_validation->set_rules('award_name', translate('award_name'), 'trim|required');\n $this->form_validation->set_rules('gift_item', translate('gift_item'), 'trim|required');\n $this->form_validation->set_rules('award_reason', translate('award_reason'), 'trim|required');\n $this->form_validation->set_rules('given_date', translate('given_date'), 'trim|required');\n $roleID = $this->input->post('role_id');\n if ($roleID == 7) {\n $this->form_validation->set_rules('class_id', translate('class'), 'trim|required');\n }\n }",
"public function rules()\n\t{\n\t\treturn [\n\t\t\t'title' => 'required',\n\t\t\t'author_id' => 'required',\n\t\t\t'topic_id' => 'required',\n\t\t];\n\t}",
"private function isValid(){\n\n\t\tif (!$this->inputValidation->validateRequiredFields('Du måste i fylla både namn och kommentar.')){ return false; }\t\n\t\tif (!$this->inputValidation->regexValidation('/^[A-Za-zåäöÅÄÖ\\s]{2,64}$/', 'author', 'Namnet innehåller otillåtna tecken. (A-Ö, a-ö, 2-64 tecken)')){ return false; }\n\n\t\treturn true;\t\t\n\t}",
"public function authorize()\n {\n return true; // TODO : edit it with roles\n }",
"protected function configureValidations()\n {\n }",
"function SetupListOptions() {\r\n\t\tglobal $Security, $Language;\r\n\r\n\t\t// \"edit\"\r\n\t\t$item = &$this->ListOptions->Add(\"edit\");\r\n\t\t$item->CssStyle = \"white-space: nowrap;\";\r\n\t\t$item->Visible = $Security->CanEdit();\r\n\t\t$item->OnLeft = TRUE;\r\n\r\n\t\t// Call ListOptions_Load event\r\n\t\t$this->ListOptions_Load();\r\n\t}",
"public function validateCustomerEdit()\n {\n $customer = $this->_objectManager->create(\n \\Magento\\Customer\\Model\\Customer::class\n )->load(\n $this->_request->getParam('id')\n );\n if ($customer->getId() && !in_array($customer->getWebsiteId(), $this->_role->getRelevantWebsiteIds())) {\n $this->_forward();\n }\n }",
"public function authorize()\n {\n return $this->user()->can('create', MarEntry::class);\n }",
"public function validateEnableContent() {\n\t\tif (empty($this->objects)) {\n\t\t\t$this->readObjects();\n\t\t\tif (empty($this->objects)) {\n\t\t\t\tthrow new UserInputException('objectIDs');\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->queue = current($this->objects);\n\t\tif (!$this->queue->canEdit()) {\n\t\t\tthrow new PermissionDeniedException();\n\t\t}\n\t}",
"protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }",
"public function __construct() {\n\n\t\t//Call the parent constructor\n\t\tparent::__construct(); \n\t\t\n\t\t$this->validate = array_merge(\n\t\t\t\t\t$this->validate\n\t\t\t\t);\t\t\n\n\t}",
"public function rules()\n {\n return [\n\t\t\t'organization_id' => 'required_if:is_post,true|integer|exists:organizations,id',\n\t\t\t'facility_id' => 'required_if:is_post,true|integer|exists:facilities,id',\n\t\t\t'creator_id' => 'required_if:is_post,true|integer|exists:creators,id',\n\t\t\t'title' => 'required_if:is_post,true|string|min:2',\n\t\t\t'description' => 'required_if:is_post,true|string|min:2',\n\t\t];\n }",
"public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }",
"public function authorize() {\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( is_tax() || is_category() || is_tag() ) {\n\t\t\t$term_id = get_queried_object()->term_id;\n\n\t\t\tif ( empty ( $term_id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$user = new User();\n\t\t\t$access_type = get_term_meta( $term_id, 'subway_membership_access_type', true );\n\t\t\t$allowed_user_roles = get_term_meta( $term_id, 'subway_membership_access_type_roles', true );\n\t\t\t$current_user_role = $user->get_role( get_current_user_id() );\n\n\t\t\tif ( 'private' === $access_type ) {\n\t\t\t\t// If no user role is found.\n\t\t\t\tif ( ! array_intersect( $allowed_user_roles, $current_user_role ) ) {\n\t\t\t\t\t$options = new Options();\n\t\t\t\t\t$login_page_url = $options->get_redirect_url();\n\t\t\t\t\twp_safe_redirect( $login_page_url, 302 );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function testGetAllBooksFromAuthor()\n {\n $author_actions = new AuthorsActions();\n\n $response = $author_actions->handleGetBooksFromAuthorAction(['name' => 'terry_pratchett'], []);\n\n self::assertEquals(RestResponse::STATUS_OK, $response->getCode());\n self::assertEquals(3, count($response->getData()));\n }",
"public function beforeValidate($options = array()) {\n\t\t$this->validate = ValidateMerge::merge(array(\n\t\t\t'room_id' => array(\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t'rule' => array('numeric'),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'public_type' => array(\n\t\t\t\t'numeric' => array(\n\t\t\t\t\t'rule' => array('numeric'),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t),\n\t\t\t\t'inList' => array(\n\t\t\t\t\t'rule' => array('inList', array(\n\t\t\t\t\t\tself::TYPE_PRIVATE,\n\t\t\t\t\t\tself::TYPE_PUBLIC,\n\t\t\t\t\t\tself::TYPE_LIMITED\n\t\t\t\t\t)),\n\t\t\t\t\t'message' => __d('net_commons', 'Invalid request.'),\n\t\t\t\t)\n\t\t\t),\n\t\t), $this->validate);\n\n\t\treturn parent::beforeValidate($options);\n\t}",
"protected function beforeValidate()\n\t{\n\t\tif (!empty($this->description))\n\t\t{\n\t\t\t$purifier = new CHtmlPurifier();\n\t\t\t$purifier->options = array(\n\t\t\t\t'HTML.Allowed' => 'p,a[href],b,i,font,ol,ul,li',\n\t\t\t);\n\t\t\t$purifier->purify($this->description);\n\t\t\t$this->description\t=stripcslashes($this->description);\n\t\t}\n\t\tif (!empty($this->title))\n\t\t{\n\t\t\t$this->title\t\t=stripcslashes($this->title);\n\t\t}\n\t\tif (!empty($this->title_lt))\n\t\t{\n\t\t\t$this->title_lt\t\t=stripcslashes($this->title_lt);\n\t\t}\n\t\treturn parent::beforeValidate();\n\t}",
"public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }",
"protected function buildValidationCallback() {\n }",
"abstract protected function setValidationCustomAttributes(): array;",
"public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'style_identifier', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'text_effect', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'underline', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }"
]
| [
"0.60470885",
"0.60040224",
"0.59412426",
"0.56145465",
"0.5605123",
"0.5581648",
"0.54744023",
"0.54591846",
"0.53694564",
"0.5362308",
"0.53580755",
"0.5290141",
"0.5290015",
"0.5235145",
"0.520285",
"0.5093342",
"0.50917745",
"0.5090179",
"0.5083488",
"0.5048691",
"0.50349563",
"0.5013655",
"0.49704728",
"0.49391127",
"0.4926545",
"0.4922709",
"0.49200076",
"0.491435",
"0.49059162",
"0.48749366",
"0.48580366",
"0.48345023",
"0.48213816",
"0.48204437",
"0.4812232",
"0.48060983",
"0.477809",
"0.47740933",
"0.47564456",
"0.4751878",
"0.47514343",
"0.47343612",
"0.4726955",
"0.47218972",
"0.47195196",
"0.47106314",
"0.4700021",
"0.46977726",
"0.46748227",
"0.46747246",
"0.46680418",
"0.46650457",
"0.46585336",
"0.46567836",
"0.46417922",
"0.46370512",
"0.4635652",
"0.4623432",
"0.46158397",
"0.46148902",
"0.46132258",
"0.46120825",
"0.458568",
"0.4585602",
"0.45840433",
"0.45800263",
"0.4578948",
"0.4575266",
"0.4573579",
"0.45727438",
"0.45670447",
"0.45622805",
"0.45569056",
"0.4555775",
"0.4554878",
"0.45533428",
"0.4552781",
"0.45502806",
"0.45498088",
"0.4547827",
"0.45465338",
"0.45423493",
"0.45402884",
"0.45309097",
"0.45305854",
"0.452921",
"0.45195487",
"0.45170853",
"0.45119038",
"0.4502289",
"0.4500615",
"0.44963148",
"0.44936877",
"0.44901845",
"0.4489954",
"0.44873542",
"0.44869894",
"0.4486058",
"0.44840762",
"0.44836012"
]
| 0.7109493 | 0 |
Set listAuthorizations value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setListAuthorizations(array $listAuthorizations = array())
{
// validation for constraint: array
if ('' !== ($listAuthorizationsArrayErrorMessage = self::validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations($listAuthorizations))) {
throw new \InvalidArgumentException($listAuthorizationsArrayErrorMessage, __LINE__);
}
if (is_null($listAuthorizations) || (is_array($listAuthorizations) && empty($listAuthorizations))) {
unset($this->listAuthorizations);
} else {
$this->listAuthorizations = $listAuthorizations;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getListAuthorizations()\n {\n return isset($this->listAuthorizations) ? $this->listAuthorizations : null;\n }",
"public static function validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $respPlateAuthListAuthorizationsItem) {\n // validation for constraint: itemType\n if (!$respPlateAuthListAuthorizationsItem instanceof \\bunge\\StructType\\RespPlateAuthDetail) {\n $invalidValues[] = is_object($respPlateAuthListAuthorizationsItem) ? get_class($respPlateAuthListAuthorizationsItem) : sprintf('%s(%s)', gettype($respPlateAuthListAuthorizationsItem), var_export($respPlateAuthListAuthorizationsItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The listAuthorizations property can only contain items of type \\bunge\\StructType\\RespPlateAuthDetail, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }",
"private function updateAuthorizations()\n {\n $this->authorizations = [];\n foreach ($this->authorizationURLs as $authURL) {\n if (filter_var($authURL, FILTER_VALIDATE_URL)) {\n $auth = new LEAuthorization($this->connector, $this->log, $authURL);\n if ($auth != false) {\n $this->authorizations[] = $auth;\n }\n }\n }\n }",
"public function setCustomizations(?EducationSynchronizationCustomizations $value): void {\n $this->getBackingStore()->set('customizations', $value);\n }",
"public function setOrganizations(?int $value): void {\n $this->getBackingStore()->set('organizations', $value);\n }",
"public function __construct(array $listAuthorizations = array(), $mssg = null)\n {\n $this\n ->setListAuthorizations($listAuthorizations)\n ->setMssg($mssg);\n }",
"public function setList(array $list = null) {\n $this->list = $list;\n }",
"public function setList($list = array())\n {\n if (!is_array($list)) {\n $list = ArrayUtils::iteratorToArray($list);\n }\n\n $this->list = $list;\n }",
"public function getAuthorizations(): array;",
"protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}",
"public function setList(string $a_list) : void\n {\n $list = explode(\",\", $a_list);\n $accounts = array();\n foreach ($list as $l) {\n if (ilObjUser::_lookupId(trim($l)) > 0) {\n $accounts[] = trim($l);\n }\n }\n\n $this->set(\"email_recipient\", implode(\",\", $accounts));\n }",
"public function setAuthorizationElement();",
"public function clearAuthors()\n {\n $this->collAuthors = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function setList($list)\n {\n if (is_string($list)) {\n htmlspecialchars($list);\n $this->_list = $list;\n }\n }",
"public function clearBiblioAuthors()\n {\n $this->collBiblioAuthors = null; // important to set this to NULL since that means it is uninitialized\n }",
"public function setAuditorias(PropelCollection $auditorias, PropelPDO $con = null)\n\t{\n\t\t$this->auditoriasScheduledForDeletion = $this->getAuditorias(new Criteria(), $con)->diff($auditorias);\n\n\t\tforeach ($auditorias as $auditoria) {\n\t\t\t// Fix issue with collection modified by reference\n\t\t\tif ($auditoria->isNew()) {\n\t\t\t\t$auditoria->setUsuario($this);\n\t\t\t}\n\t\t\t$this->addAuditoria($auditoria);\n\t\t}\n\n\t\t$this->collAuditorias = $auditorias;\n\t}",
"public function updateCompleteOwnersList()\n\t{\n\t\t$role = Role::where('name', 'Propietario')->first();\n\n\t\t$arregloUsuarios = $this->usersCompletedByRole($role);\n\n\t\t\n\n\t\ttry{\n\t\t\t$res = $this->client->request('PUT', 'https://api.sendgrid.com/v3/marketing/contacts', [\n\t\t\t\t//'headers' => ['Authorization' => 'Bearer '.env('SENDGRID_API_KEY'), 'Content-Type' => 'application/json'],\n\t\t\t\t'body' => json_encode([\n\t\t\t\t\t\t'list_ids' => [env('SENDGRID_ID_OWNERS')],\n\t\t\t\t\t\t'contacts' => $arregloUsuarios\n\t\t\t\t\t])\n\t\t\t]);\n\t\t}catch( \\Exception $e )\n\t\t{\n\t\t\tdd($e);\n\t\t}\n\t}",
"public function authorList()\n\t{\n\t\t$authors = ee('Member')->getAuthors(ee('Request')->get('search'));\n\n\t\tif (AJAX_REQUEST)\n\t\t{\n\t\t\treturn ee('View/Helpers')->normalizedChoices($authors);\n\t\t}\n\n\t\treturn $authors;\n\t}",
"public function setUnmatchedPeopleByRole(?array $value): void {\n $this->getBackingStore()->set('unmatchedPeopleByRole', $value);\n }",
"public function rebuildAuthorizations()\n {\n $roleRepository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Role');\n\n // Clear\n $this->entityManager->createQuery('DELETE Edweld\\AclBundle\\Entity\\Authorization')->execute();\n $this->entityManager->clear('Edweld\\AclBundle\\Entity\\Authorization');\n\n // Regenerate\n foreach ($roleRepository->findAll() as $role) {\n /** @var Role $role */\n $role->createAuthorizations($this);\n }\n $this->entityManager->flush();\n $this->entityManager->clear();\n }",
"public function updateCompleteCollateralsList()\n\t{\n\t\t$role = Role::where('name', 'Aval')->first();\n\n\t\t$arregloUsuarios = $this->usersCompletedByRole($role);\n\t\t\n\t\tprint_r($arregloUsuarios);die(\"h\");\n\n\t\ttry{\n\t\t\t$res = $this->client->request('PUT', 'https://api.sendgrid.com/v3/marketing/contacts', [\n\t\t\t\t//'headers' => ['Authorization' => 'Bearer '.env('SENDGRID_API_KEY'), 'Content-Type' => 'application/json'],\n\t\t\t\t'body' => json_encode([\n\t\t\t\t\t\t'list_ids' => [env('SENDGRID_ID_COLLATERALS')],\n\t\t\t\t\t\t'contacts' => $arregloUsuarios\n\t\t\t\t\t])\n\t\t\t]);\n\t\t}catch( \\Exception $e )\n\t\t{\n\t\t\tdd($e);\n\t\t}\n\t}",
"public function setUserList(\n array $userList)\n {\n // First of all, let's instantly save their new value to our own\n // internal cache, since our cache supports User objects and doesn't\n // have to do any special transformations...\n $this->_userList = $userList;\n\n // Now sync our internal cache with the LazyJsonMapper object...! :-)\n $this->syncUserList(); // Throws.\n\n // Setters should always return \"$this\" to make them chainable!\n return $this;\n }",
"function setValueList($valueList) {\n if ($valueList !== ($oldValueList = $this->valueList)) {\n $this->valueList = $valueList;\n }\n }",
"public function setAuthors(Collection $authors, ConnectionInterface $con = null)\n {\n $this->clearAuthors();\n $currentAuthors = $this->getAuthors();\n\n $authorsScheduledForDeletion = $currentAuthors->diff($authors);\n\n foreach ($authorsScheduledForDeletion as $toDelete) {\n $this->removeAuthor($toDelete);\n }\n\n foreach ($authors as $author) {\n if (!$currentAuthors->contains($author)) {\n $this->doAddAuthor($author);\n }\n }\n\n $this->collAuthorsPartial = false;\n $this->collAuthors = $authors;\n\n return $this;\n }",
"public function setArray(array $list);",
"public function setWhiteListAccess (Array $list=NULL)\n {\n $this->_white_list = $list;\n }",
"public function setAuthors($authors)\n {\n $this->setValue('authors', $authors);\n }",
"public function setRolesAttribute($value): void\n {\n $this->_roles = $value;\n }",
"public function allAuthorizationsValid()\n {\n if (count($this->authorizations) > 0) {\n foreach ($this->authorizations as $auth) {\n if ($auth->status != 'valid') {\n return false;\n }\n }\n return true;\n }\n return false;\n }",
"public function remove_list_from_table($list){\n\t\t$query = \"DELETE * FROM \" . $this->table . \" WHERE \" . $this->column_name . \"=\";\n\t\t$list = commas_to_array($list);\n\t\t$just_added = array();\n\t\tif($old_list = Database::get_results_as_numerical_array($query, $this->column_name)){\n\t\t\t//var_dump($old_list); echo \"<br>\";\n\t\t\t\n\t\t\tforeach($list as $list_item){\n\t\t\t\t\n\t\t\t\tif(!in_array($list_item, $old_list) &&\n\t\t\t\t !in_array($list_item, $just_added)){\n\t\t\t\t\t$this->add_to_table($list_item);\n\t\t\t\t\t$just_added[] = $list_item;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{ //if there is nothing in the organizations table\n\t\t\tforeach($list as $list_item){\n\t\t\t\tif(!in_array($list_item, $just_added)){\n\t\t\t\t\t$this->add_to_table($list_item);\n\t\t\t\t\t$just_added[] = $list_item;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t}",
"function makeAuthorList($authors) {\n\t\t$alist = \"\n\t\t\t\t<input type='hidden' name='authors' id='authors' value=\\\"\".implode(\",\",$authors).\"\\\" />\n\t\t\t\t<ul class='memberlist_s'>\\n\";\n\t\t$udata = $this->getUserData($authors, array('FirstName','ProfilePicture'));\n\t\tforeach ($udata as $user_id => $u) {\t\t\t\n\t\t\t$alist .= '\n\t\t\t\t<li>\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t<img src=\"'.$u['ProfilePicture']['SmallThumb'].'\" style=\"width:30px;\" />\n\t\t\t\t\t</td><td>\n\t\t\t\t\t<div style=\"padding:2px;\">'.$u['FirstName'].'</div>\n\t\t\t\t\t<div style=\"padding:2px;\"><a href=\"#\" style=\"background:url(/images/famfamfam_mini/action_stop.gif) no-repeat left;padding:2px 2px 2px 18px;\" onclick=\"removeAuthor('.$user_id.'); return false;\">Fjern</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t</li> ';\n\t\t}\n\t\t$alist .= '\n\t\t\t\t</ul>\n\t\t\t\t';\n\t\treturn $alist;\n\t}",
"function SetCategoryList(&$categoryList)\n\t{\n\t\t$map = new CategorySupplierMap();\n\t\t$map->RemoveMapping($this);\n\t\t$this->_categoryList = $categoryList;\n\t}",
"public function setSenderOrAuthors(?array $value): void {\n $this->getBackingStore()->set('senderOrAuthors', $value);\n }",
"function setUserIDRoleList($newVal)\r\n\t{\r\n\t\t$this->UserIDRoleList = $newVal;\r\n\t}",
"public function setOrigins($value)\n {\n return $this->set('Origins', $value);\n }",
"public function setOrigins($value)\n {\n return $this->set('Origins', $value);\n }",
"public function setOrigins($value)\n {\n return $this->set('Origins', $value);\n }",
"function SetWebsiteList(&$list)\n\t{\n\t\t$this->_websiteList = array();\n\t\t$existingWebsiteList = $this->GetWebsiteList();\n\t\tforeach ($existingWebsiteList as $website)\n\t\t{\n\t\t\t$website->supplierId = '';\n\t\t\t$website->Save(false);\n\t\t}\n\t\t$this->_websiteList = $list;\n\t}",
"public function setAuthorized() {}",
"function addDisplayValues($valueList){\n\t\t \n\t\t $vocabTerms = $this->vocabTerms;\n\t\t if(is_array($vocabTerms) && is_array($valueList)){\n\t\t\t\t$newValueList = array();\n\t\t\t\tforeach($valueList as $valArray){\n\t\t\t\t\t foreach($vocabTerms as $term){\n\t\t\t\t\t\t if($valArray[\"value\"] == $term[\"value\"]){\n\t\t\t\t\t\t\t\tif($term[\"displayValue\"] != false){\n\t\t\t\t\t\t\t\t\t $valArray[\"displayValue\"] = $term[\"displayValue\"];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t $newValueList[] = $valArray;\n\t\t\t\t}\n\t\t\t\tunset($valueList);\n\t\t\t\t$valueList = $newValueList;\n\t\t\t\tunset($newValueList);\n\t\t }\n\t\t \n\t\t return $valueList;\n\t }",
"function SetRegionList(&$regionList)\n\t{\n\t\t$map = new RegionSupplierMap();\n\t\t$map->RemoveMapping($this);\n\t\t$this->_regionList = $regionList;\n\t}",
"public function setMatchedPeopleByRole(?array $value): void {\n $this->getBackingStore()->set('matchedPeopleByRole', $value);\n }",
"public function clearAuditorias()\n\t{\n\t\t$this->collAuditorias = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function setUidList($categoryList) {\n\t\t$this->uidList = t3lib_div::intExplode(',', $categoryList, TRUE);\n\t}",
"public function setAttributeList(array $attribute_list): void;",
"public function updateCompleteAgentsList()\n\t{\n\t\t$role = Role::where('name', 'Agente')->first();\n\n\t\t$arregloUsuarios = $this->usersCompletedByRole($role);\n\t\t\n\n\t\ttry{\n\t\t\t$res = $this->client->request('PUT', 'https://api.sendgrid.com/v3/marketing/contacts', [\n\t\t\t\t//'headers' => ['Authorization' => 'Bearer '.env('SENDGRID_API_KEY'), 'Content-Type' => 'application/json'],\n\t\t\t\t'body' => json_encode([\n\t\t\t\t\t\t'list_ids' => [env('SENDGRID_ID_AGENTS')],\n\t\t\t\t\t\t'contacts' => $arregloUsuarios\n\t\t\t\t\t])\n\t\t\t]);\n\t\t}catch( \\Exception $e )\n\t\t{\n\t\t\tdd($e);\n\t\t}\n\t}",
"public function updateCompleteTenantsList()\n\t{\n\t\t$role = Role::where('name', 'Arrendatario')->first();\n\n\t\t$arregloUsuarios = $this->usersCompletedByRole($role);\n\n\t\ttry{\n\t\t\t$res = $this->client->request('PUT', 'https://api.sendgrid.com/v3/marketing/contacts', [\n\t\t\t\t//'headers' => ['Authorization' => 'Bearer '.env('SENDGRID_API_KEY'), 'Content-Type' => 'application/json'],\n\t\t\t\t'body' => json_encode([\n\t\t\t\t\t\t'list_ids' => [env('SENDGRID_ID_TENANTS')],\n\t\t\t\t\t\t'contacts' => $arregloUsuarios\n\t\t\t\t\t])\n\t\t\t]);\n\t\t}catch( \\Exception $e )\n\t\t{\n\t\t\tdd($e);\n\t\t}\n\t}",
"function SetBidList(&$list)\n\t{\n\t\t$this->_bidList = array();\n\t\t$existingBidList = $this->GetBidList();\n\t\tforeach ($existingBidList as $bid)\n\t\t{\n\t\t\t$bid->supplierId = '';\n\t\t\t$bid->Save(false);\n\t\t}\n\t\t$this->_bidList = $list;\n\t}",
"public function RemoveAllCustomizations(RemoveAllCustomizations $parameters)\n {\n return $this->__soapCall('RemoveAllCustomizations', array($parameters));\n }",
"public function setAttrList($attrList) {\n\t$this->attrList = $attrList;\n }",
"public function setListar($value)\n\t{\n\t\t$this->listar = $value;\n\t}",
"public function setExcludeList(?array $value): void {\n $this->getBackingStore()->set('excludeList', $value);\n }",
"public function setTermIds(?array $value): void {\n $this->getBackingStore()->set('termIds', $value);\n }",
"function setUserNameList($newVal)\r\n\t{\r\n\t\t$this->UserNameList = $newVal;\r\n\t}",
"protected function setBacsOriginator(array $data)\n {\n $this->bacsOriginator = BacsOriginator::fromArray($data);\n }",
"protected function setBacsOriginator(array $data)\n {\n $this->bacsOriginator = BacsOriginator::fromArray($data);\n }",
"public function setFilterList($userId, $filterList)\n {\n // remove all existing filters\n $this->_daoFactory->getUserFilterDao()->removeAllFilters($userId);\n\n // and add the filters from the list\n foreach ($filterList as $filter) {\n $this->_daoFactory->getUserFilterDao()->addFilter($userId, $filter);\n } // foreach\n }",
"public function setWebsiteList(?array $value): void {\n $this->getBackingStore()->set('websiteList', $value);\n }",
"public function setOwnerAppIds(?array $value): void {\n $this->getBackingStore()->set('ownerAppIds', $value);\n }",
"public function resetPartialBiblioAuthors($v = true)\n {\n $this->collBiblioAuthorsPartial = $v;\n }",
"public static function setScopeList($list) {\n\t return (self::$scopeList = str_replace(' ','',$list));\n\t}",
"public function setAppsAuthorities($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->setAppsAuthoritiesWithOptions($request, $runtime);\n }",
"public function set_editentries($value) {\n $this->_editentries = $value;\n }",
"public function edit(UserList $list)\n {\n \n }",
"function __clear_multi_author_cache()\n {\n }",
"public function setObjectAliasesList(array $elementList): void\n {\n $this->elementList = $elementList;\n }",
"private function setRights($data) {\n\n if (isset($data['allowed_controllers']['Row'][0])) {\n $list = $data['allowed_controllers']['Row'][0];\n foreach ($list as $key => $value) {\n array_push( $this->rights, $value );\n }\n }\n }",
"public function setListRemove( array $listRemove ): void\n {\n $this->_listRemove = $listRemove;\n }",
"public function setLocalizations(array $localizations)\n {\n $this->localizations = new ArrayIterator();\n\n foreach ($localizations as $ident => $translations) {\n $this->addLocalization($ident, $translations);\n }\n\n return $this;\n }",
"public function setBiblioAuthors(Collection $biblioAuthors, ConnectionInterface $con = null)\n {\n /** @var BiblioAuthor[] $biblioAuthorsToDelete */\n $biblioAuthorsToDelete = $this->getBiblioAuthors(new Criteria(), $con)->diff($biblioAuthors);\n\n\n //since at least one column in the foreign key is at the same time a PK\n //we can not just set a PK to NULL in the lines below. We have to store\n //a backup of all values, so we are able to manipulate these items based on the onDelete value later.\n $this->biblioAuthorsScheduledForDeletion = clone $biblioAuthorsToDelete;\n\n foreach ($biblioAuthorsToDelete as $biblioAuthorRemoved) {\n $biblioAuthorRemoved->setBiblio(null);\n }\n\n $this->collBiblioAuthors = null;\n foreach ($biblioAuthors as $biblioAuthor) {\n $this->addBiblioAuthor($biblioAuthor);\n }\n\n $this->collBiblioAuthors = $biblioAuthors;\n $this->collBiblioAuthorsPartial = false;\n\n return $this;\n }",
"function SetWeddingList(&$list)\n\t{\n\t\t$this->_weddingList = array();\n\t\t$existingWeddingList = $this->GetWeddingList();\n\t\tforeach ($existingWeddingList as $wedding)\n\t\t{\n\t\t\t$wedding->supplierId = '';\n\t\t\t$wedding->Save(false);\n\t\t}\n\t\t$this->_weddingList = $list;\n\t}",
"public function setMembers($list)\n {\n $this->members_objs = array();\n if (!isset($list)) {\n return;\n }\n foreach ($list as $user) {\n $this->members_objs[] = is_array($user) ? User::find($user['unique_id'], $user) : $user;\n }\n }",
"public function Admin_Action_CustomFieldUsedByList() {\n $listIDs = $this->_getPOSTRequest ( 'listid', null );\n if (is_array ( $listIDs )) {\n $output = GetJSON ( $this->_getCustomFieldUsedByList ( $listIDs ) );\n echo $output;\n }\n }",
"public function removeAppsAuthorities($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->removeAppsAuthoritiesWithOptions($request, $runtime);\n }",
"public function setListContracts(array $listContracts = array())\n {\n // validation for constraint: array\n if ('' !== ($listContractsArrayErrorMessage = self::validateListContractsForArrayConstraintsFromSetListContracts($listContracts))) {\n throw new \\InvalidArgumentException($listContractsArrayErrorMessage, __LINE__);\n }\n if (is_null($listContracts) || (is_array($listContracts) && empty($listContracts))) {\n unset($this->listContracts);\n } else {\n $this->listContracts = $listContracts;\n }\n return $this;\n }",
"public function addToListAuthorizations(\\bunge\\StructType\\RespPlateAuthDetail $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\bunge\\StructType\\RespPlateAuthDetail) {\n throw new \\InvalidArgumentException(sprintf('The listAuthorizations property can only contain items of type \\bunge\\StructType\\RespPlateAuthDetail, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->listAuthorizations[] = $item;\n return $this;\n }",
"public function refreshAllowedOrganizations()\n {\n // Privilege overrules organizational settings\n if ($this->hasPrivilege('pr.organization-switch')) {\n $orgs = $this->util->getDbLookup()->getOrganizations();\n } else {\n $org = $this->getBaseOrganization();\n\n $orgs = array($org->getId() => $org->getName()) +\n $org->getAllowedOrganizations();\n }\n // \\MUtil_Echo::track($orgs);\n\n $this->_setVar('__allowedOrgs', $orgs);\n\n // Clean this cache\n $this->_unsetVar('__allowedRespOrgs');\n\n return $this;\n }",
"public function setAppliedBy(?UserIdentity $value): void {\n $this->getBackingStore()->set('appliedBy', $value);\n }",
"public function merge_validater_allow_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_allow_arr[$k] = (bool)$v;\n }\n }",
"public function setAssignees(?array $value): void {\n $this->getBackingStore()->set('assignees', $value);\n }",
"public function setAccountingIDs($value) {\n return $this->setParameter('accounting_ids', $value);\n }",
"public static function delete_data_for_user(approved_contextlist $contextlist) {\n if (empty($contextlist->count())) {\n return;\n }\n\n $userid = $contextlist->get_user()->id;\n\n $cmids = [];\n\n foreach ($contextlist as $context) {\n $cmids[] = $context->instanceid;\n }\n\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_documents');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2011');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2012');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2013');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2014');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2015');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2016');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2017');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2018');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2019');\n self::change_document_owner_to_admin($userid, $cmids, 'local_ousearch_docs_2020');\n }",
"function retrieve_promoter_guest_list_authorizations(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_promoter_guest_list_authorizations($this->promoter->up_id);\n\t\t\n\t}",
"public function removeList(array $list): void\n {\n foreach ($list as $id) {\n $this->remove($id);\n }\n }",
"protected function lstUsersAsCharity_Update() {\n\t\t\tif ($this->lstUsersAsCharity) {\n\t\t\t\t$this->objCharityPartner->UnassociateAllUsersAsCharity();\n\t\t\t\t$objSelectedListItems = $this->lstUsersAsCharity->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objCharityPartner->AssociateUserAsCharity(User::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function merge_validater_value_list($list)\n {\n foreach ($list as $k => $v) {\n $this->_validater_value_arr[$k] = $v;\n }\n }",
"private function _setPolicyList(){\n\t\t/* variable list */\n\t\t$this->_strPolicySchemaName\t= $this->_strPolicySchemaName.\"_\".$this->getCompanyCode();\n\t\t\n\t\t/* get the policy list */\n\t\t$strEventFilterArr \t= array(\n\t\t\t\t\t\t\t\t\t\t'table' \t=> $this->_strPolicySchemaName,\n\t\t\t\t\t\t\t\t\t\t'column' \t=> array('id','name'),\n\t\t\t\t\t\t\t\t\t\t'order'\t\t=> array('name'=>'asc')\n\t\t\t\t\t\t\t\t\t);\n\t\t\n\t\t/* getting record */\n\t\t$strResultArr \t\t= $this->_objDataOperation->getDataFromTable($strEventFilterArr);\n\t\t\n\t\t/* return the policy */\n\t\treturn $strResultArr;\n\t}",
"public function clearAuthorization()\n {\n // So we just get rid of the token.\n $this->clearCrucibleSession();\n }",
"function cap_byline_array_set_terms( $post_id ) {\n global $post;\n // Dont run this on the state-year-report post type\n if ( !is_singular('state-year-report') ) {\n // Get the ACF Byline Array\n $field_data = get_field('byline_array');\n $persons = array();\n // Check to see if this post has any authors if it does not, proceed with auto selection\n // we do this check becuase we don't want to continue to autoselect if they've removed the autoselect author in one off cases.\n // Also we're presuming to autoselect as a function only if no authors are present.\n if ( empty($field_data) ) {\n // Get the author information\n if(is_object($post) && isset($post->post_author)) {\n $author_slug = get_the_author_meta( 'user_login', $post->post_author );\n if(term_exists($author_slug, 'person')) {\n $author_data = get_term_by( 'slug', $author_slug, 'person' );\n $author_id = $author_data->term_id;\n } else {\n $author_data = \"\";\n $author_id = null;\n }\n\n // Check for an author byline override. Basically this is a intern function.\n $default_byline_override = get_user_meta( $post->post_author, '_default_byline', true );\n if(term_exists($default_byline_override, 'person')) {\n $default_byline = get_term_by( 'id', $default_byline_override, 'person' );\n $default_byline_id = $default_byline->term_id;\n } else {\n $default_byline = \"\";\n $default_byline_id = null;\n }\n\n // If a override is present use that first\n if ( !empty($default_byline_override) && false === get_field( 'disable_auto_author_select','options' ) ) {\n $persons[] = $default_byline_id;\n // If a person exists with the slug of the author then auto add it.\n } elseif ( term_exists( $author_slug, 'person' ) && false === get_field( 'disable_auto_author_select','options' ) ) {\n $persons[] = $author_id;\n }\n }\n\n }\n\n // Go through the persons from the field add them to the persons array.\n if(isset($field_data) && is_array($field_data) && count($field_data) > 0) {\n foreach ($field_data as $data) {\n $persons[] = $data;\n }\n }\n\n // Go back and update the field with the new data\n update_field('field_53f38cd042a42', $persons);\n // Set this posts person terms to the persons array\n wp_set_post_terms( $post_id, $persons, 'person', false );\n }\n}",
"protected function modifyAudienceUsersRequest($audience_id, $contactlist_amendment_request)\n {\n // verify the required parameter 'audience_id' is set\n if ($audience_id === null || (is_array($audience_id) && count($audience_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $audience_id when calling modifyAudienceUsers'\n );\n }\n // verify the required parameter 'contactlist_amendment_request' is set\n if ($contactlist_amendment_request === null || (is_array($contactlist_amendment_request) && count($contactlist_amendment_request) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $contactlist_amendment_request when calling modifyAudienceUsers'\n );\n }\n\n $resourcePath = '/2021-04/audiences/{audience-id}/contactlist';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($audience_id !== null) {\n $resourcePath = str_replace(\n '{' . 'audience-id' . '}',\n ObjectSerializer::toPathValue($audience_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n if (isset($contactlist_amendment_request)) {\n $_tempBody = $contactlist_amendment_request;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function setListParticipations($value)\n {\n $this->_fields['ListParticipations']['FieldValue'] = $value;\n return $this;\n }",
"public function setEnableOnBehalfRequestorsToRemoveAccess($val)\n {\n $this->_propDict[\"enableOnBehalfRequestorsToRemoveAccess\"] = $val;\n return $this;\n }",
"public function syncUserList()\n {\n // If no internal cache exists yet, get its value from LazyJsonMapper.\n if ($this->_userList === null) {\n $this->getUserList(); // Builds our \"_userList\" variable. Throws.\n }\n\n // Now, we need to create a new, internal LazyJsonMapper data array for\n // our object. In undefined (unmapped) properties, you are ONLY allowed\n // to store basic data types. Not objects. So we will need to convert\n // all User objects to real array data. Otherwise OTHER calls would fail\n // due to invalid internal data when we try things like `printJson()`.\n $newObjectData = [];\n foreach ($this->_userList as $k => $v) {\n $newObjectData[$k] = is_object($v) && $v instanceof LazyJsonMapper\n ? $v->asArray() // Throws.\n : $v; // Is already a valid value.\n }\n\n // Now give the new object data to LazyJsonMapper, which ensures that it\n // contains all of the same values as our updated cache! This replaces\n // the ENTIRE internal JSON property storage, so be aware of that!\n $this->assignObjectData($newObjectData); // Throws.\n }",
"public function __construct(array $list = array())\n {\n $this->list = array_values($list);\n }",
"public function actionUpdate($list_uid,$subscriber_uid)\n {\n\n $request = Yii::app()->request;\n\n if(!$request->isPutRequest)\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','Only PUT requests allowed for this endpoint.')\n ),400);\n }\n\n $email = $request->getPut('EMAIL');\n if(empty($email))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','Please provide the subscriber email address.')\n ),422);\n }\n\n $validator = new CEmailValidator();\n $validator->allowEmpty = false;\n if(Yii::app()->options->get('system.common.dns_email_check',false))\n {\n $validator->checkMX = CommonHelper::functionExists('checkdnsrr');\n $validator->checkPort\n = CommonHelper::functionExists('dns_get_record')&&CommonHelper::functionExists('fsockopen');\n }\n\n if(!$validator->validateValue($email))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','Please provide a valid email address.')\n ),422);\n }\n\n if(!($list = $this->loadListByUid($list_uid)))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','The subscribers list does not exist.')\n ),404);\n }\n\n $subscriber = ListSubscriber::model()->findByAttributes(array(\n 'subscriber_uid' => $subscriber_uid,\n 'list_id' => $list->list_id,\n ));\n\n if(empty($subscriber))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','The subscriber does not exist in this list.')\n ),409);\n }\n\n $fields = ListField::model()->findAllByAttributes(array(\n 'list_id' => $list->list_id,\n ));\n\n if(empty($fields))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','The subscribers list does not have any custom field defined.')\n ),404);\n }\n\n $errors = array();\n foreach($fields as $field)\n {\n $value = $request->getPut($field->tag);\n if($field->required==ListField::TEXT_YES&&empty($value))\n {\n $errors[$field->tag]\n = Yii::t('api','The field {field} is required by the list but it has not been provided!',array(\n '{field}' => $field->tag\n ));\n }\n\n // note here to remove when we will support multiple values\n if(!empty($value)&&!is_string($value))\n {\n $errors[$field->tag]\n = Yii::t('api','The field {field} contains multiple values, which is not supported right now!',array(\n '{field}' => $field->tag\n ));\n }\n }\n\n if(!empty($errors))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => $errors,\n ),422);\n }\n\n $criteria = new CDbCriteria();\n $criteria->condition = 't.list_id = :lid AND t.email = :email AND t.subscriber_id != :sid';\n $criteria->params = array(\n ':lid' => $list->list_id,\n ':email' => $email,\n ':sid' => $subscriber->subscriber_id,\n );\n $duplicate = ListSubscriber::model()->find($criteria);\n if(!empty($duplicate))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','Another subscriber with this email address already exists in this list.')\n ),409);\n }\n\n $subscriber->email = $email;\n $blacklisted = $subscriber->getIsBlacklisted();\n if(!empty($blacklisted))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','This email address is blacklisted.')\n ),409);\n }\n\n // since 1.3.5.7\n $details = (array)$request->getPut('details',array());\n if(!empty($details))\n {\n if(!empty($details['status'])&&in_array($details['status'],array_keys($subscriber->getStatusesList())))\n {\n $subscriber->status = $details['status'];\n }\n if(!empty($details['ip_address'])&&filter_var($details['ip_address'],FILTER_VALIDATE_IP))\n {\n $subscriber->ip_address = $details['ip_address'];\n }\n if(!empty($details['source'])&&in_array($details['source'],array_keys($subscriber->getSourcesList())))\n {\n $subscriber->source = $details['source'];\n }\n }\n\n if(!$subscriber->save())\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','Unable to save the subscriber!'),\n ),422);\n }\n\n $substr = CommonHelper::functionExists('mb_substr')?'mb_substr':'substr';\n\n foreach($fields as $field)\n {\n\n $valueModel = ListFieldValue::model()->findByAttributes(array(\n 'field_id' => $field->field_id,\n 'subscriber_id' => $subscriber->subscriber_id,\n ));\n\n if(empty($valueModel))\n {\n $valueModel = new ListFieldValue();\n $valueModel->field_id = $field->field_id;\n $valueModel->subscriber_id = $subscriber->subscriber_id;\n }\n\n $valueModel->value = $substr($request->getPut($field->tag),0,255);\n $valueModel->save();\n }\n\n if($logAction = Yii::app()->user->getModel()->asa('logAction'))\n {\n $logAction->subscriberUpdated($subscriber);\n }\n\n return $this->renderJson(array(\n 'status' => 'success',\n ),200);\n }",
"function setCompanyFilter($value) {\n return $this->setAdditionalProperty('company_filter', $value);\n }",
"public function setRoleScopeTagIds(?array $value): void {\n $this->getBackingStore()->set('roleScopeTagIds', $value);\n }",
"public function setRoleScopeTagIds(?array $value): void {\n $this->getBackingStore()->set('roleScopeTagIds', $value);\n }",
"public static function authors(array $data, array $attributes=array()){\r\n //Add research areas\r\n $authOptions = array();\r\n\r\n $authOptions[] = JHTML::_('select.option', '-1', JText::_('JRESEARCH_AUTHORS'));\r\n\r\n foreach($data as $author){\r\n $authOptions[] = JHTML::_('select.option', $author['mid'], $author['member_name']);\r\n }\r\n\r\n return self::htmllist($authOptions, $attributes);\r\n }",
"public function testSetCollectionApproval()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }"
]
| [
"0.6305014",
"0.5662984",
"0.5487227",
"0.53429645",
"0.5220164",
"0.5039823",
"0.50181913",
"0.49757376",
"0.4905262",
"0.48484442",
"0.48207223",
"0.47877666",
"0.46855494",
"0.46450454",
"0.45694113",
"0.45446348",
"0.4538374",
"0.44933408",
"0.44898033",
"0.4480329",
"0.44657183",
"0.4424965",
"0.4418266",
"0.44133902",
"0.44115344",
"0.43718606",
"0.4367852",
"0.43208745",
"0.43118954",
"0.42961362",
"0.42826155",
"0.4281126",
"0.42750415",
"0.42659763",
"0.42085686",
"0.42085686",
"0.42073464",
"0.41991687",
"0.4196834",
"0.4186676",
"0.41770756",
"0.41602817",
"0.415375",
"0.41468397",
"0.41467598",
"0.4130575",
"0.41090462",
"0.4109019",
"0.40984434",
"0.4097257",
"0.40929124",
"0.40826458",
"0.4080751",
"0.40751535",
"0.4067961",
"0.4067961",
"0.40648687",
"0.40466762",
"0.40429762",
"0.40400976",
"0.40376753",
"0.40260744",
"0.40121952",
"0.40084064",
"0.39754066",
"0.39651442",
"0.39618552",
"0.3961322",
"0.39538246",
"0.3953286",
"0.39527005",
"0.3949629",
"0.39463863",
"0.39428568",
"0.3942635",
"0.3938793",
"0.39384633",
"0.3936415",
"0.3927296",
"0.39226392",
"0.39150515",
"0.39096147",
"0.390233",
"0.39010778",
"0.38990054",
"0.38988283",
"0.38922307",
"0.38886115",
"0.3887771",
"0.3886276",
"0.38833785",
"0.3881061",
"0.38771406",
"0.3875178",
"0.38706243",
"0.38619003",
"0.38579205",
"0.38579205",
"0.38565785",
"0.38497382"
]
| 0.7063558 | 0 |
Add item to listAuthorizations value | public function addToListAuthorizations(\bunge\StructType\RespPlateAuthDetail $item)
{
// validation for constraint: itemType
if (!$item instanceof \bunge\StructType\RespPlateAuthDetail) {
throw new \InvalidArgumentException(sprintf('The listAuthorizations property can only contain items of type \bunge\StructType\RespPlateAuthDetail, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
$this->listAuthorizations[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getListAuthorizations()\n {\n return isset($this->listAuthorizations) ? $this->listAuthorizations : null;\n }",
"public function getAuthorizations(): array;",
"private function updateAuthorizations()\n {\n $this->authorizations = [];\n foreach ($this->authorizationURLs as $authURL) {\n if (filter_var($authURL, FILTER_VALIDATE_URL)) {\n $auth = new LEAuthorization($this->connector, $this->log, $authURL);\n if ($auth != false) {\n $this->authorizations[] = $auth;\n }\n }\n }\n }",
"protected function setAuthors() {\r\n\t\t// authors, yes, we can handle more than one per article\r\n\t\t$authorsStg = $this->newsItem->getAuthor();\r\n\t\tif (!empty($authorsStg)) {\r\n\t\t\t$authors = t3lib_div::trimExplode(',', $authorsStg);\r\n\t\t\t$allowedCount = intval($this->settings['news']['semantic']['general']['author']['max']);\r\n\t\t\t$this->authors = (empty($allowedCount)) ? $authors : array_slice($authors, 0, $allowedCount);\r\n\t\t}\r\n\t}",
"function makeAuthorList($authors) {\n\t\t$alist = \"\n\t\t\t\t<input type='hidden' name='authors' id='authors' value=\\\"\".implode(\",\",$authors).\"\\\" />\n\t\t\t\t<ul class='memberlist_s'>\\n\";\n\t\t$udata = $this->getUserData($authors, array('FirstName','ProfilePicture'));\n\t\tforeach ($udata as $user_id => $u) {\t\t\t\n\t\t\t$alist .= '\n\t\t\t\t<li>\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t<img src=\"'.$u['ProfilePicture']['SmallThumb'].'\" style=\"width:30px;\" />\n\t\t\t\t\t</td><td>\n\t\t\t\t\t<div style=\"padding:2px;\">'.$u['FirstName'].'</div>\n\t\t\t\t\t<div style=\"padding:2px;\"><a href=\"#\" style=\"background:url(/images/famfamfam_mini/action_stop.gif) no-repeat left;padding:2px 2px 2px 18px;\" onclick=\"removeAuthor('.$user_id.'); return false;\">Fjern</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t</li> ';\n\t\t}\n\t\t$alist .= '\n\t\t\t\t</ul>\n\t\t\t\t';\n\t\treturn $alist;\n\t}",
"function makeEditableAuthorList($authors) {\t\t\n\t\treturn \"\n\t\t\t<div id='authorlist' class='authorlist'>\n\t\t\t\t\".$this->makeAuthorList($authors).\"\t\t\t\n\t\t\t</div>\n\t\t\n\t\t\";\n\t}",
"function create_author_list( $role ) {\n\n // list editors first\n $args = array(\n 'role' => $role,\n 'orderby' => 'display_name'\n );\n\n // Create the WP_User_Query object\n $wp_user_query = new WP_User_Query($args);\n\n $author_ids = $wp_user_query->get_results();\n\n foreach($author_ids as $author) :\n\n $curauth = get_userdata($author->ID);\n\n if($curauth->user_login !== 'admin') : // if name == admin don't display\n $user_link = get_author_posts_url($curauth->ID);\n $avatar = 'default'; ?>\n\n\n <div class=\"author\" title=\"<?php echo $curauth->display_name; ?>\">\n <a href=\"\n <?php echo get_author_posts_url( get_the_author_meta( 'ID', $curauth->ID ) ); ?>\n \">\n <?php\n // avatar goes here\n $avatar = get_field('author_photo', 'user_' . $curauth->ID );\n echo '<img src=\"';\n echo $avatar['url'];\n echo '\" />';\n ?>\n <p class=\"name\"><?php echo $curauth->display_name; ?></p>\n <p><?php the_author_meta( 'shortbio', $curauth->ID ); ?></p>\n </a>\n </div>\n\n\n <?php endif;\n endforeach;\n\n}",
"public function authorList()\n\t{\n\t\t$authors = ee('Member')->getAuthors(ee('Request')->get('search'));\n\n\t\tif (AJAX_REQUEST)\n\t\t{\n\t\t\treturn ee('View/Helpers')->normalizedChoices($authors);\n\t\t}\n\n\t\treturn $authors;\n\t}",
"final public function addItemOwner() {\n $this->addUserByField('users_id', true);\n }",
"public static function authors(array $data, array $attributes=array()){\r\n //Add research areas\r\n $authOptions = array();\r\n\r\n $authOptions[] = JHTML::_('select.option', '-1', JText::_('JRESEARCH_AUTHORS'));\r\n\r\n foreach($data as $author){\r\n $authOptions[] = JHTML::_('select.option', $author['mid'], $author['member_name']);\r\n }\r\n\r\n return self::htmllist($authOptions, $attributes);\r\n }",
"function get_editable_authors($user_id)\n {\n }",
"function wmb_add_coauthors_box_content( $post ) {\n\tglobal $post, $coauthors_plus, $current_screen;\n\n\t$post_id = $post->ID;\n\n\t$default_user = apply_filters( 'coauthors_default_author', wp_get_current_user() );\n\n\t# $post_id and $post->post_author are always set when a new post is created due to auto draft,\n\t# and the else case below was always able to properly assign users based on wp_posts.post_author,\n\t# but that's not possible with force_guest_authors = true.\n\tif ( ! $post_id || 0 === $post_id || ( ! $post->post_author && ! $coauthors_plus->force_guest_authors ) || ( 'post' === $current_screen->base && 'add' === $current_screen->action ) ) {\n\t\t$coauthors = array();\n\n\t\t# If guest authors is enabled, try to find a guest author attached to this user ID\n\t\tif ( $coauthors_plus->is_guest_authors_enabled() ) {\n\t\t\t$coauthor = $coauthors_plus->guest_authors->get_guest_author_by( 'linked_account', $default_user->user_login );\n\t\t\tif ( $coauthor ) {\n\t\t\t\t$coauthors[] = $coauthor;\n\t\t\t}\n\t\t}\n\n\t\t# If the above block was skipped, or if it failed to find a guest author, use the current\n\t\t# logged in user, so long as force_guest_authors is false. If force_guest_authors = true, we are\n\t\t# OK with having an empty authoring box.\n\t\tif ( ! $coauthors_plus->force_guest_authors && empty( $coauthors ) ) {\n\t\t\tif ( is_array( $default_user ) ) {\n\t\t\t\t$coauthors = $default_user;\n\t\t\t} else {\n\t\t\t\t$coauthors[] = $default_user;\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$coauthors = get_coauthors();\n\t}\n\n\t$count = 0;\n\tif ( ! empty( $coauthors ) ) :\n\t\t?>\n\t\t<div id=\"coauthors-readonly\" class=\"hide-if-js\">\n\t\t\t<ul>\n\t\t\t<?php\n\t\t\tforeach ( $coauthors as $coauthor ) :\n\t\t\t\t$count++;\n\t\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<?php echo get_avatar( $coauthor->user_email, $coauthors_plus->gravatar_size ); ?>\n\t\t\t\t\t<span id=\"<?php echo esc_attr( 'coauthor-readonly-' . $count ); ?>\" class=\"coauthor-tag\">\n\t\t\t\t\t\t<input type=\"text\" name=\"coauthorsinput[]\" readonly=\"readonly\" value=\"<?php echo esc_attr( $coauthor->display_name ); ?>\" />\n\t\t\t\t\t\t<input type=\"text\" name=\"coauthors[]\" value=\"<?php echo esc_attr( $coauthor->user_login ); ?>\" />\n\t\t\t\t\t\t<input type=\"text\" name=\"coauthorsemails[]\" value=\"<?php echo esc_attr( $coauthor->user_email ); ?>\" />\n\t\t\t\t\t\t<input type=\"text\" name=\"coauthorsnicenames[]\" value=\"<?php echo esc_attr( $coauthor->user_nicename ); ?>\" />\n\t\t\t\t\t\t<input type=\"text\" name=\"coauthorsaffiliations[]\" value=\"<?php echo esc_attr( get_post_meta( $post_id, '_co_author_affiliation_' . $coauthor->ID, 1 ) ); ?>\" />\n\t\t\t\t\t</span>\n\t\t\t\t</li>\n\t\t\t\t<?php\n\t\t\tendforeach;\n\t\t\t?>\n\t\t\t</ul>\n\t\t\t<div class=\"clear\"></div>\n\t\t\t<p><?php wp_kses( __( '<strong>Note:</strong> To edit post authors, please enable javascript or use a javascript-capable browser', 'co-authors-plus' ), array( 'strong' => array() ) ); ?></p>\n\t\t</div>\n\t\t<?php\n\tendif;\n\t?>\n\n\t<div id=\"coauthors-edit\" class=\"hide-if-no-js\">\n\t\t<p><?php wp_kses( __( 'Click on an author to change them. Drag to change their order. Click on <strong>Remove</strong> to remove them.', 'co-authors-plus' ), array( 'strong' => array() ) ); ?></p>\n\t</div>\n\n\t<?php wp_nonce_field( 'coauthors-edit', 'coauthors-nonce' ); ?>\n\n\t<?php\n}",
"public function authorsProvider()\n {\n return [[[]]];\n }",
"public function setListAuthorizations(array $listAuthorizations = array())\n {\n // validation for constraint: array\n if ('' !== ($listAuthorizationsArrayErrorMessage = self::validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations($listAuthorizations))) {\n throw new \\InvalidArgumentException($listAuthorizationsArrayErrorMessage, __LINE__);\n }\n if (is_null($listAuthorizations) || (is_array($listAuthorizations) && empty($listAuthorizations))) {\n unset($this->listAuthorizations);\n } else {\n $this->listAuthorizations = $listAuthorizations;\n }\n return $this;\n }",
"function getAuthor() \n\t{\n\t\t$author = array();\n\t\tinclude_once \"./Services/MetaData/classes/class.ilMD.php\";\n\t\t$md =& new ilMD($this->getId(), 0, $this->getType());\n\t\t$md_life =& $md->getLifecycle();\n\t\tif ($md_life)\n\t\t{\n\t\t\t$ids =& $md_life->getContributeIds();\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$md_cont =& $md_life->getContribute($id);\n\t\t\t\tif (strcmp($md_cont->getRole(), \"Author\") == 0)\n\t\t\t\t{\n\t\t\t\t\t$entids =& $md_cont->getEntityIds();\n\t\t\t\t\tforeach ($entids as $entid)\n\t\t\t\t\t{\n\t\t\t\t\t\t$md_ent =& $md_cont->getEntity($entid);\n\t\t\t\t\t\tarray_push($author, $md_ent->getEntity());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn join($author, \",\");\n }",
"public function setAuthorizationElement();",
"public static function authorizable()\n {\n return true;\n }",
"function decorateWithAuthor($article) {\n global $authorArticleTable;\n\n createAuthorArticleTable();\n\n $article->authors = $authorArticleTable[$article->id];\n\n return $article;\n}",
"public function add_author( $data, $post ) {\n\t\tif ( $this->context->site_represents === false ) {\n\t\t\t$data['author'] = [ '@id' => WPSEO_Schema_Utils::get_user_schema_id( $post->post_author, $this->context ) ];\n\t\t}\n\t\treturn $data;\n\t}",
"public function get_authors();",
"public function author()\n {\n $this->renderView('author.twig',['articleList' => $this->articleList]);\n }",
"function add_to_author_profile( $contactmethods ) {\n \n $contactmethods['rss_url'] = 'RSS URL';\n $contactmethods['google_profile'] = 'Google Profile URL';\n $contactmethods['twitter_profile'] = 'Twitter Profile URL';\n $contactmethods['facebook_profile'] = 'Facebook Profile URL';\n $contactmethods['linkedin_profile'] = 'Linkedin Profile URL';\n $contactmethods['github_profile'] = 'github_profile URL';\n \n return $contactmethods;\n }",
"public function wxr_authors_list()\n {\n $db = Typecho_Db::get();\n $dbPrefix = $db->getPrefix();\n\n $user_table = $dbPrefix . 'users';\n $authors = $db->fetchAll($db->query(\"select uid,name,mail from {$user_table} where activated != 0\"));\n $html = '';\n foreach ( $authors as $author ) {\n $html .= \"\\t<wp:author>\";\n $html .= '<wp:author_id>' . $author['uid'] . '</wp:author_id>';\n $html .= '<wp:author_login>' . $author['name'] . '</wp:author_login>';\n $html .= '<wp:author_email>' . $author['mail'] . '</wp:author_email>';\n $html .= '<wp:author_display_name>' . $this->wxr_cdata($author['name']) . '</wp:author_display_name>';\n $html .= '<wp:author_first_name>' . $this->wxr_cdata('') . '</wp:author_first_name>';\n $html .= '<wp:author_last_name>' . $this->wxr_cdata('') . '</wp:author_last_name>';\n $html .= \"</wp:author>\\n\";\n }\n return $html;\n }",
"public function populateAuthors($field)\n\t{\n\t\t$author_options = array();\n\n\t\t// Default author\n\t\t$author = $this->Author;\n\n\t\tif ( ! $author)\n\t\t{\n\t\t\t$field->setItem('field_list_items', $author_options);\n\t\t\treturn;\n\t\t}\n\n\t\t$author_options[$author->getId()] = $author->getMemberName();\n\n\t\tif ($author->getId() != ee()->session->userdata('member_id'))\n\t\t{\n\t\t\t$author_options[ee()->session->userdata('member_id')] =\n\t\t\tee()->session->userdata('screen_name') ?: ee()->session->userdata('username');\n\t\t}\n\n\t\t// First, get member groups who should be in the list\n\t\t$member_groups = ee('Model')->get('MemberGroup')\n\t\t\t->filter('include_in_authorlist', 'y')\n\t\t\t->filter('site_id', ee()->config->item('site_id'))\n\t\t\t->all();\n\n\t\t// Then authors who are individually selected to appear in author list\n\t\t$authors = ee('Model')->get('Member')\n\t\t\t->fields('username', 'screen_name')\n\t\t\t->filter('in_authorlist', 'y');\n\n\t\t// Then grab any members that are part of the member groups we found\n\t\tif ($member_groups->count())\n\t\t{\n\t\t\t$authors->orFilter('group_id', 'IN', $member_groups->pluck('group_id'));\n\t\t}\n\n\t\t$authors->order('screen_name');\n\t\t$authors->order('username');\n\n\t\tforeach ($authors->all() as $author)\n\t\t{\n\t\t\t$author_options[$author->getId()] = $author->getMemberName();\n\t\t}\n\n\t\t$field->setItem('field_list_items', $author_options);\n\t}",
"protected function updateAuthors() {\n\n // Find all content authors.\n $query = \\Drupal::entityQuery('node')\n ->condition('status', 1);\n $nids = $query->execute();\n $nodes = Node::loadMultiple($nids);\n\n // Add a content subscription flag for each owner.\n $flag_service = \\Drupal::service('flag');\n $flag_id = 'subscribe_node';\n $flag = $flag_service->getFlagById($flag_id);\n foreach ($nodes as $node) {\n $account = $node->getOwner();\n // Skip inactive users.\n if ($account->isBlocked()) {\n continue;\n }\n // Skip admin and anonymous users.\n if (in_array($account->id(), [0, 1])) {\n continue;\n }\n // Check if already flagged to avoid exception error.\n $flagging = $flag_service->getFlagging($flag, $node, $account);\n if (!$flagging) {\n $flag_service->flag($flag, $node, $account);\n }\n }\n }",
"public function getAuthors(): AuthorCollection;",
"public function includeAuthors()\n {\n return $this->addInclude('authors');\n }",
"function setAuthor($a) {\n\t\t$this->set(\"author\",$a);\n\t}",
"function da_add_author_page() {\n\t$author_id = get_the_author_meta( 'ID' );\n\t$user_posts = get_author_posts_url( get_the_author_meta( 'ID' ) );\n\t$display_name = get_the_author_meta( 'display_name' );\n\t$darole = get_author_role( $author_id );\n\techo '<div class=\"archive-description\"><h1 class=\"archive-title\">All articles by ' . esc_html( $display_name ) . '</h1></div>';\n}",
"function get_cap_authors($post_id, $disable_link=false, $as_array=false, $return_slugs=true, $byline_field='byline_array')\n{\n $byline_array = get_cap_author_list($post_id, $byline_field);\n return get_byline_output($byline_array, $disable_link, $as_array, $return_slugs);\n}",
"public function add_author_resault()\n\t{\n\t\t$this->add_author_model->addAuthor();\n\t\t$this->load->view('add_author_resault');\n\t}",
"function column_author( $item ) {\r\n\t\t$user = get_user_by( 'id', $item->post_author );\r\n\r\n\t\tif ( isset( $user->data->display_name ) ) {\r\n\t\t\treturn sprintf( '<a href=\"%s\" title=\"' . __( 'Filter by', 'media-library-assistant' ) . ' ' . __( 'Author', 'media-library-assistant' ) . '\">%s</a>', esc_url( add_query_arg( array_merge( array(\r\n\t\t\t\t 'page' => MLACore::ADMIN_PAGE_SLUG,\r\n\t\t\t\t'author' => $item->post_author,\r\n\t\t\t\t'heading_suffix' => urlencode( __( 'Author', 'media-library-assistant' ) . ': ' . $user->data->display_name ) \r\n\t\t\t), self::mla_submenu_arguments( false ) ), 'upload.php' ) ), esc_html( $user->data->display_name ) );\r\n\t\t}\r\n\r\n\t\treturn 'unknown';\r\n\t}",
"public function getAuthorcompany() {}",
"function access_scheme_add_list() {\n drupal_set_title(t('Add an access scheme'), PASS_THROUGH);\n\n $content = array();\n foreach (access_scheme_info() as $type => $info) {\n $content[$type] = array(\n 'title' => $info['label'],\n 'description' => $info['description'],\n 'href' => 'admin/structure/access/add/' . str_replace('_', '-', $type),\n 'localized_options' => array(),\n );\n }\n return theme('admin_block_content', array('content' => $content));\n}",
"public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}",
"public function addAuthor()\n\t{\n\t\t$this->load->view('add_author');\n\t}",
"protected function _syncAuthor() {}",
"function get_the_author_aim()\n {\n }",
"public function addItem(){\r\n //角色或者权限名会在实例化这个model的时候load给该model\r\n $auth = \\Yii::$app->authManager;\r\n //如果添加的是角色\r\n if($this->type == self::T_ROLE){\r\n $item = $auth->createRole($this->name);\r\n $item->description = $this->description?:'创建['.$this->name.']角色';\r\n }else{\r\n $item = $auth->createPermission($this->name);\r\n $item->description = $this->description?:'创建['.$this->name.']权限';\r\n\r\n }\r\n return $auth->add($item);\r\n }",
"function publisher_userIsAuthor($itemObj)\r\n{\r\n global $xoopsUser;\r\n return (is_object($xoopsUser) && is_object($itemObj) && ($xoopsUser->uid() == $itemObj->uid()));\r\n}",
"function emic_cwrc_get_authorities($dataType, $query = \"\") {\n $mappings = array(\n 'Tag Place' => array('collection' => 'islandora:9247', 'type' => t('Place')),\n 'Tag Person' => array('collection' => 'islandora:9239', 'type' => t('Person')),\n 'Tag Event' => array('collection' => 'islandora:9242', 'type' => t('Event')),\n 'Tag Organization' => array('collection' => 'islandora:9236', 'type' => t('Organization')),\n );\n\n\n\n $authorities = cwrc_get_authorities_list($mappings[$dataType], $query);\n if ($authorities) {\n $json = json_encode($authorities);\n echo $json;\n }\n}",
"function retrieve_promoter_guest_list_authorizations(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_promoter_guest_list_authorizations($this->promoter->up_id);\n\t\t\n\t}",
"public static function validateListAuthorizationsForArrayConstraintsFromSetListAuthorizations(array $values = array())\n {\n $message = '';\n $invalidValues = [];\n foreach ($values as $respPlateAuthListAuthorizationsItem) {\n // validation for constraint: itemType\n if (!$respPlateAuthListAuthorizationsItem instanceof \\bunge\\StructType\\RespPlateAuthDetail) {\n $invalidValues[] = is_object($respPlateAuthListAuthorizationsItem) ? get_class($respPlateAuthListAuthorizationsItem) : sprintf('%s(%s)', gettype($respPlateAuthListAuthorizationsItem), var_export($respPlateAuthListAuthorizationsItem, true));\n }\n }\n if (!empty($invalidValues)) {\n $message = sprintf('The listAuthorizations property can only contain items of type \\bunge\\StructType\\RespPlateAuthDetail, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));\n }\n unset($invalidValues);\n return $message;\n }",
"function get_cap_author_list($post_id, $byline_field='byline_array')\n{\n\n if(isset($byline_field) && is_array($byline_field) && !empty($byline_field)) {\n $people = $byline_field;\n } else {\n $people = get_field($byline_field, $post_id);\n }\n\t$byline_array = array();\n\n if (!empty($people)) {\n // let's setup an array to organize these people based on some conditions below\n foreach ($people as $person) {\n $get_byline = get_term_by('id', $person, 'person', 'ARRAY_A');\n\n #var_dump($get_byline);\n\n if(isset($get_byline) && is_array($get_byline) && isset($get_byline['slug']) && !empty($get_byline['slug'])) {\n $person_twitter_handle = get_field('person_twitter_handle', 'person_' . $get_byline[\"term_id\"]);\n\n $inactive = get_field('person_is_inactive', 'person_' . $get_byline[\"term_id\"]);\n\n #var_dump($active);\n #var_dump(get_field('person_is_linked', 'person_' . $get_byline[\"term_id\"]));\n\n if (isset($inactive) && !$inactive && !empty($person_twitter_handle) && is_singular(get_post_type())) {\n $tweeter = \"<a href=\\\"https://twitter.com/intent/user?screen_name=\" .\n $person_twitter_handle .\n \"\\\"><img src=\\\"\" .\n content_url() .\n \"/plugins/cap-byline/bird_blue_16.png\\\" class=\\\"twitter-bird\\\"></a>\";\n } else {\n $tweeter = \"\";\n }\n\n // add a link if person_is_linked is set\n if (isset($inactive) && !$inactive && get_field('person_is_linked', 'person_' . $get_byline[\"term_id\"])) {\n $tout = sprintf('<a href=\"/?person=%s\">%s</a>%s', $get_byline['slug'], $get_byline['name'], $tweeter);\n } else {\n $tout = $get_byline['name'] . $tweeter;\n }\n\n if(has_filter('cap_byline_person_url')) {\n $get_byline[\"output\"] = apply_filters('cap_byline_person_url', $tout, $get_byline['slug'], $get_byline['name'], $tweeter);\n } else {\n $get_byline[\"output\"] = $tout;\n }\n\n $byline_array[$person] = $get_byline;\n }\n }\n }\n\n\n #print \"returning array for $post_id and $byline_field<br>\\n\";\n #var_dump($byline_array);\n #print \"<br>\\n\";\n\n return $byline_array;\n}",
"protected function setAuthorsLinks() {\r\n\t\t$authors = $this->getAuthors();\r\n\t\tif (!empty($authors)) {\r\n\t\t\tforeach ($this->settings['site']['authors'] as $author) {\r\n\t\t\t\tif (in_array(trim($author['name']), $authors) && !empty($author['uri'])) {\r\n\t\t\t\t\t$typolink_conf = array(\r\n\t\t\t\t\t\t\"parameter\" => $author['uri'],\r\n\t\t\t\t\t\t\"forceAbsoluteUrl\" => 1,\r\n\t\t\t\t\t\t\"useCacheHash\" => 0);\r\n\t\t\t\t\t$this->authorsLinks[] = $this->getUri($typolink_conf);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function checkAuthors () {\n\t\tif ( count ( $this->authors) == 0 ) return ;\n\t\n\t\tif ( isset($this->existing_q) ) {\n\t\t\t$this->wd->loadItem ( $this->existing_q ) ;\n\t\t\t$i = $this->wd->getItem ( $this->existing_q ) ;\n\t\t\t$c1 = $i->getClaims ( $this->props['author'] ) ;\n\t\t\t$c2 = $i->getClaims ( $this->props['short author'] ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c1 ) ;\n\t\t\t$this->invalidateExistingAuthors ( $c2 ) ;\n\t\t\t\n\t\t\t// Special case: Single author, one author already in item...\n\t\t\tif ( count($this->authors) == 1 && count($c1)+count($c2) == 1 ) {\n\t\t\t\t$this->authors[1]->hadthat = true ;\n\t\t\t}\n\t\t}\n\t}",
"public function testUpdateAuthor() {\n $this->put('/api/author/3',\n ['first_name' => 'Karim'] )\n ->seeJson(['first_name' => 'Karim']);\n }",
"function exchange_add_user_management_for_editors() {\n\t$role = get_role( 'editor' );\n\t$caps = exchange_get_user_caps();\n\tforeach ( $caps as $cap ) {\n\t\t$role->add_cap( $cap );\n\t}\n}",
"function cap_byline_array_set_terms( $post_id ) {\n global $post;\n // Dont run this on the state-year-report post type\n if ( !is_singular('state-year-report') ) {\n // Get the ACF Byline Array\n $field_data = get_field('byline_array');\n $persons = array();\n // Check to see if this post has any authors if it does not, proceed with auto selection\n // we do this check becuase we don't want to continue to autoselect if they've removed the autoselect author in one off cases.\n // Also we're presuming to autoselect as a function only if no authors are present.\n if ( empty($field_data) ) {\n // Get the author information\n if(is_object($post) && isset($post->post_author)) {\n $author_slug = get_the_author_meta( 'user_login', $post->post_author );\n if(term_exists($author_slug, 'person')) {\n $author_data = get_term_by( 'slug', $author_slug, 'person' );\n $author_id = $author_data->term_id;\n } else {\n $author_data = \"\";\n $author_id = null;\n }\n\n // Check for an author byline override. Basically this is a intern function.\n $default_byline_override = get_user_meta( $post->post_author, '_default_byline', true );\n if(term_exists($default_byline_override, 'person')) {\n $default_byline = get_term_by( 'id', $default_byline_override, 'person' );\n $default_byline_id = $default_byline->term_id;\n } else {\n $default_byline = \"\";\n $default_byline_id = null;\n }\n\n // If a override is present use that first\n if ( !empty($default_byline_override) && false === get_field( 'disable_auto_author_select','options' ) ) {\n $persons[] = $default_byline_id;\n // If a person exists with the slug of the author then auto add it.\n } elseif ( term_exists( $author_slug, 'person' ) && false === get_field( 'disable_auto_author_select','options' ) ) {\n $persons[] = $author_id;\n }\n }\n\n }\n\n // Go through the persons from the field add them to the persons array.\n if(isset($field_data) && is_array($field_data) && count($field_data) > 0) {\n foreach ($field_data as $data) {\n $persons[] = $data;\n }\n }\n\n // Go back and update the field with the new data\n update_field('field_53f38cd042a42', $persons);\n // Set this posts person terms to the persons array\n wp_set_post_terms( $post_id, $persons, 'person', false );\n }\n}",
"public function wdab_add_author_box( $content ) {\n\t\tglobal $post;\n\n\t\twp_enqueue_style( 'profile-style' );\n\n\n\t\t$author = get_user_by( 'id', $post->post_author );\n\n\t\t$display_name = $author->data->display_name;\n\t\t$author_avatar = esc_url( get_avatar_url( $author->ID ) );\n\n\t\t$twitter = get_the_author_meta( 'twitter', $author->ID );\n\t\t$twitter = ( ! empty ( $twitter ) ) ? esc_url( $twitter ) : '#';\n\n\t\t$github = get_the_author_meta( 'github', $author->ID );\n\t\t$github = ( ! empty ( $github ) ) ? esc_url( $github ) : '#';\n\n\t\t$linkedin = get_the_author_meta( 'linkedin', $author->ID );\n\t\t$linkedin = ( ! empty ( $linkedin ) ) ? esc_url( $linkedin ) : '#';\n\n\t\tob_start();\n\n\t\tif ( is_single() ) {\n\t\t\tinclude WDAB_PATH.'/assets/templates/author-template.php';\n\t\t}\n\n\t\t$html = ob_get_clean();\n\n\t\treturn $content . $html;\n\t}",
"public function getAuthors()\n {\n return $this->getValue('authors');\n }",
"private function actionGetAuthors() {\n\t\t$authors = array();\n\t\t$obj = new stdClass();\n\n\t\t$users = get_users( 'exclude=[1]&who=authors' );\n\n\t\tforeach ( $users as $user ) {\n\t\t\t$authors[] = array( 'id' => $user->ID, 'name' => $user->display_name );\n\t\t}\n\n\t\t$obj->success = true;\n\t\t$obj->errorMessage = null;\n\t\t$obj->authors = $authors;\n\n\t\t$this->sendJSON( $obj );\n\t}",
"function the_author_aim()\n {\n }",
"public function getAuthorisationLink()\n {\n\n $authorisationLink = $this->urlAuthorize();\n $authorisationLink .= '?client_id=' . $this->clientId;\n $authorisationLink .= '&response_type=code';\n $authorisationLink .= '&redirect_uri=' . $this->redirectUri;\n $authorisationLink .= '&approval_prompt=' .$this->aprovalPrompt;\n $scopes = str_replace(' ', '',implode(', ', $this->scopes));\n $authorisationLink .= '&scope=' . $scopes;\n\n return $authorisationLink;\n }",
"public function append_to_approved($address)\n\t{\n\t\t$this->approved_array[] = $address;\n\t}",
"public function add( EchoContainmentList $list ) {\n\t\t$this->lists[] = $list;\n\t}",
"function ridizain_list_authors() {\r\n\t$contributor_ids = get_users( array(\r\n\t\t'fields' => 'ID',\r\n\t\t'orderby' => 'post_count',\r\n\t\t'order' => 'DESC',\r\n\t\t'who' => 'authors',\r\n\t) );\r\n\r\n\tforeach ( $contributor_ids as $contributor_id ) :\r\n\t\t$post_count = count_user_posts( $contributor_id );\r\n\r\n\t\t// Move on if user has not published a post (yet).\r\n\t\tif ( ! $post_count ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t?>\r\n\r\n\t<div class=\"contributor\">\r\n\t\t<div class=\"contributor-info\">\r\n\t\t\t<div class=\"contributor-avatar\"><?php echo get_avatar( $contributor_id, 132 ); ?></div>\r\n\t\t\t<div class=\"contributor-summary\">\r\n\t\t\t\t<h2 class=\"contributor-name\"><?php echo get_the_author_meta( 'display_name', $contributor_id ); ?></h2>\r\n\t\t\t\t<p class=\"contributor-bio\">\r\n\t\t\t\t\t<?php echo get_the_author_meta( 'description', $contributor_id ); ?>\r\n\t\t\t\t</p>\r\n\t\t\t\t<a class=\"contributor-posts-link\" href=\"<?php echo esc_url( get_author_posts_url( $contributor_id ) ); ?>\">\r\n\t\t\t\t\t<?php printf( _n( '%d Article', '%d Articles', $post_count, 'ridizain' ), $post_count ); ?>\r\n\t\t\t\t</a>\r\n\t\t\t</div><!-- .contributor-summary -->\r\n\t\t</div><!-- .contributor-info -->\r\n\t</div><!-- .contributor -->\r\n\r\n\t<?php\r\n\tendforeach;\r\n}",
"protected function getAuthors() {\r\n\t\treturn $this->authors;\r\n\t}",
"protected\n function transclude_author_item( $author_item, $post_object )\n {\n $this->debug_print('transcluding author_item');\n preg_match($this->grammar_rule('author_item'), $author_item, $matches);\n $user_object = $this->wp_author($post_object);\n $code = $this->wp_user_field($user_object, $matches);\n $result = $this->transclude_code($code, $post_object);\n return $result;\n }",
"public function add()\n {\n return view('admin.authors.new');\n }",
"protected function setListActions()\n\t{\n\t\t$user = JFactory::getUser();\n\t\tif ($user->authorise('k2.extrafields.manage', 'com_k2'))\n\t\t{\n\t\t\tK2Response::addAction('add', 'K2_ADD', array('data-action' => 'add'));\n\t\t}\n\t}",
"public function updateAuthorship(array &$data, $create = false)\n {\n $auth = Zend_Auth::getInstance()->getStorage()->read();\n\n if ($create) {\n $data['createdBy'] = $auth->id;\n $data['creationAt'] = date('Y-m-d H:i:s', time());\n }\n\n $data['updatedBy'] = $auth->id;\n $data['updatedAt'] = date('Y-m-d H:i:s', time());\n }",
"public function addAccessions( $value){\n return $this->_add(2, $value);\n }",
"public function addAccessions( $value){\n return $this->_add(2, $value);\n }",
"public function add_menu_items () {\n\t\t\n\t\t//add menu in wordpress dashboard\n\n\t\tadd_submenu_page(\n\t\t\t'ltple-settings',\n\t\t\t__( 'Affiliate Commissions', $this->plugin->slug ),\n\t\t\t__( 'Affiliate Commissions', $this->plugin->slug ),\n\t\t\t'edit_pages',\n\t\t\t'edit.php?post_type=affiliate-commission'\n\t\t);\n\t\t\n\t\tadd_users_page( \n\t\t\t'All Affiliates', \n\t\t\t'All Affiliates', \n\t\t\t'edit_pages',\n\t\t\t'users.php?' . $this->parent->_base .'view=affiliates'\n\t\t);\n\t}",
"public function getAuthors();",
"function wp_admin_bar_my_account_item($wp_admin_bar)\n {\n }",
"public function hookDefineAcl($args)\n {\n $args['acl']->addResource('BulkMetadataEditor_Index');\n }",
"public function actionUpdate()\n\t{\n\t\t// Get the authorization item\n\t\t$model = $this->loadModel();\n\t\t$itemName = $model->getName();\n\t\t\n\t\t// Create the authorization item form\n\t\t$formModel = new AuthItemForm('update');\n\n\t\tif( isset($_POST['AuthItemForm'])===true )\n\t\t{\n\t\t\t$formModel->attributes = $_POST['AuthItemForm'];\n\t\t\tif( $formModel->validate()===true )\n\t\t\t{\n\t\t\t\t// Update the item and load it\n\t\t\t\t$this->_authorizer->updateAuthItem($itemName, $formModel->name, $formModel->description, $formModel->bizRule, $formModel->data);\n\t\t\t\t$item = $this->_authorizer->authManager->getAuthItem($formModel->name);\n\t\t\t\t$item = $this->_authorizer->attachAuthItemBehavior($item);\n\n\t\t\t\t// Set a flash message for updating the item\n\t\t\t\tYii::app()->user->setFlash($this->module->flashSuccessKey,\n\t\t\t\t\tRights::t('core', ':name updated.', array(':name'=>$item->getNameText()))\n\t\t\t\t);\n\n\t\t\t\t// Redirect to the correct destination\n\t\t\t\t$this->redirect(Yii::app()->user->getRightsReturnUrl(array('authItem/permissions')));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$type = Rights::getValidChildTypes($model->type);\n\t\t$exclude = array($this->module->superuserName);\n\t\t$childSelectOptions = Rights::getParentAuthItemSelectOptions($model, $type, $exclude);\n\t\t\n\t\tif( $childSelectOptions!==array() )\n\t\t{\n\t\t\t$childFormModel = new AuthChildForm();\n\t\t\n\t\t\t// Child form is submitted and data is valid\n\t\t\tif( isset($_POST['AuthChildForm'])===true )\n\t\t\t{\n\t\t\t\t$childFormModel->attributes = $_POST['AuthChildForm'];\n\t\t\t\tif( $childFormModel->validate()===true )\n\t\t\t\t{\n\t\t\t\t\t// Add the child and load it\n\t\t\t\t\t$this->_authorizer->authManager->addItemChild($itemName, $childFormModel->itemname);\n\t\t\t\t\t$child = $this->_authorizer->authManager->getAuthItem($childFormModel->itemname);\n\t\t\t\t\t$child = $this->_authorizer->attachAuthItemBehavior($child);\n\n\t\t\t\t\t// Set a flash message for adding the child\n\t\t\t\t\tYii::app()->user->setFlash($this->module->flashSuccessKey,\n\t\t\t\t\t\tRights::t('core', 'Child :name added.', array(':name'=>$child->getNameText()))\n\t\t\t\t\t);\n\n\t\t\t\t\t// Reidrect to the same page\n\t\t\t\t\t$this->redirect(array('authItem/update', 'name'=>urlencode($itemName)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$childFormModel = null;\n\t\t}\n\n\t\t// Set the values for the form fields\n\t\t$formModel->name = $model->name;\n\t\t$formModel->description = $model->description;\n\t\t$formModel->type = $model->type;\n\t\t$formModel->bizRule = $model->bizRule!=='NULL' ? $model->bizRule : '';\n\t\t$formModel->data = $model->data!==null ? serialize($model->data) : '';\n\n\t\t$parentDataProvider = new RAuthItemParentDataProvider($model);\n\t\t$childDataProvider = new RAuthItemChildDataProvider($model);\n\n\t\t// Render the view\n\t\t$this->render('update', array(\n\t\t\t'model'=>$model,\n\t\t\t'formModel'=>$formModel,\n\t\t\t'childFormModel'=>$childFormModel,\n\t\t\t'childSelectOptions'=>$childSelectOptions,\n\t\t\t'parentDataProvider'=>$parentDataProvider,\n\t\t\t'childDataProvider'=>$childDataProvider,\n\t\t));\n\t}",
"public function getAuthItem() {\n\t\tif(!isset($this->authorisationItem)) {\n\t\t\t// Auth item is not specified default to ModelName.ActionName\n\t\t\t// e.g. Company.create or Person.update\n\t\t\t$this->authorisationItem = $this->model.'.'.$this->id;\n\t\t}\n\t\treturn $this->authorisationItem;\n\t}",
"public function setAuthor(UserInterface $author);",
"public function setAuthor(UserInterface $author);",
"public function forAuthorizableTypes()\n {\n return $this->forAuthorizableTypes;\n }",
"function get_author_user_ids()\n {\n }",
"private function itemsList()\n {\n /**\n * Defined variables\n */\n $request = $this->getRequest();\n $publicKey = $request->getServer('PHP_AUTH_USER');\n\n $searchCriteriaBuilder = $this->searchCriteria;\n $searchCriteria = $searchCriteriaBuilder->addFilter(\n 'auth_key',\n $publicKey,\n 'eq'\n )->create();\n $authenticationList = $this->customerAuthRepository->getList($searchCriteria);\n $items = $authenticationList->getItems();\n\n return $items;\n }",
"function livraison_autoriser() {}",
"function egsr_author_cap(){\n return Array ( \n 'delete_posts' => true,\n 'delete_published_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'upload_files' => true,\n );\n}",
"public function show()\n {\n return view('authors.add_author');\n }",
"function smamo_rest_post_author() {\n\tif ( function_exists( 'register_rest_field' ) ) {\n\t\tregister_rest_field( 'post',\n\t\t\t'authors',\n\t\t\tarray(\n\t\t\t\t'get_callback' => 'smamo_rest_get_post_author',\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t} elseif ( function_exists( 'register_api_field' ) ) {\n\t\tregister_api_field( 'post',\n\t\t\t'authors',\n\t\t\tarray(\n\t\t\t\t'get_callback' => 'smamo_rest_get_post_author',\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t}\n}",
"function cilien_autoriser(){}",
"private function get_article_author() {\n\n\t\tif ( ! $this->is_json_valid() )\n\t\t\treturn [];\n\n\t\tif ( ! $post = $this->get_current_post() ) {\n\t\t\t$this->invalidate( 'amp' );\n\t\t\treturn [];\n\t\t}\n\n\t\t$author = \\get_userdata( $post->post_author );\n\t\t$name = isset( $author->display_name ) ? $author->display_name : '';\n\n\t\tif ( ! $name ) {\n\t\t\t$this->invalidate( 'amp' );\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t'author' => [\n\t\t\t\t'@type' => 'Person',\n\t\t\t\t'name' => \\esc_attr( $name ),\n\t\t\t],\n\t\t];\n\t}",
"static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }",
"public function author() {\n\t\t\t\n\t\t\t$output = array();\n\n\t\t\t$author = $this->post->post_author;\n\t\t\t\n\t\t\t$output['id'] = $author;\n\t\t\t$output['nicename'] = get_the_author_meta('nickname', $author);\n\t\t\t$output['name'] = get_the_author_meta('user_firstname', $author).' '.get_the_author_meta('user_lastname', $author);\n\t\t\t$output['url'] = get_author_posts_url($author);\n\t\t\t$output['description'] = get_the_author_meta('description', $author);\n\t\t\t\n\t\t\treturn $output;\n\t\t}",
"public function getAuthor() {}",
"public function addAction(\\Vendor\\Guestbook\\Domain\\Model\\Author $author)\n {\n $this->fillInAuthData($author);\n $author->setDisable(1);\n $this->authorRepository->add($author);\n $baseURL = $this->request->getBaseUri();\n $this->persistenceManager->persistAll();\n $emailConfirmationURL = $baseURL . $this->getControllerContext()->getUriBuilder()->reset()->uriFor('activate', array('author' => $author), 'Author', $this->getControllerContext()->getRequest()->getControllerExtensionName());\n\n $this->sendEmail($emailConfirmationURL);\n\n file_put_contents('./debug.txt', print_r(\"\\n-----------------\\n\", true), FILE_APPEND);\n file_put_contents('./debug.txt', print_r($emailConfirmationURL, true), FILE_APPEND);\n\n $this->redirect('list', 'Comment', NULL, NULL);\n }",
"public function getAuthors()\n {\n return $this->authors;\n }",
"public function getAuthorId()\n {\n return $this->_authorId;\n }",
"public function print_author_meta_box( $post ) {\n\t\tglobal $user_ID;\n\n\t\t// Add a nonce field so we can check for it when saving the data.\n\t\twp_nonce_field( 'my_multi_authors_save_authors', 'my_multi_authors_save_authors_nonce' );\n\n\t\t// Get primary author ID.\n\t\t$primary_author_id = empty( $post->post_author ) ? $user_ID : $post->post_author;\n\n\t\t// Get existing authors.\n\t\t$existing_my_multi_authors = get_post_meta( $post->ID, my_multi_author()->multi_author_meta_key, false );\n\n\t\t// Make sure it's an array.\n\t\tif ( ! is_array( $existing_my_multi_authors ) ) {\n\t\t\t$existing_my_multi_authors = implode( ',', $existing_my_multi_authors );\n\t\t}\n\n\t\t?>\n\t\t<p><strong><label for=\"post_author_override\"><?php _e( 'Set the primary author:', 'my-multi-author' ); ?></label></strong></p>\n\t\t<?php\n\n\t\twp_dropdown_users( apply_filters( 'my_multi_author_post_author_dropdown_args', array(\n\t\t\t'id' => 'my-multi-authors-primary',\n\t\t\t'who' => 'authors',\n\t\t\t'name' => 'post_author_override',\n\t\t\t'selected' => $primary_author_id,\n\t\t\t'include_selected' => true,\n\t\t\t'show' => 'display_name_with_login',\n\t\t), $post ));\n\n\t\t?>\n\t\t<p><strong><label><?php _e( 'Define additional authors:', 'my-multi-author' ); ?></label></strong></p>\n\t\t<div id=\"my-multi-authors-select\">\n\t\t\t<?php\n\n\t\t\t$author_index = 0;\n\n\t\t\tdo {\n\n\t\t\t\t// Get selected author.\n\t\t\t\t$selected = isset( $existing_my_multi_authors[ $author_index ] ) ? $existing_my_multi_authors[ $author_index ] : 0;\n\n\t\t\t\t?>\n\t\t\t\t<div class=\"my-multi-authors-author\">\n\t\t\t\t\t<div class=\"my-multi-authors-author-delete\"></div>\n\t\t\t\t\t<div class=\"my-multi-authors-author-select\">\n\t\t\t\t\t\t<label for=\"my_multi_author_authors<?php echo $author_index; ?>\" class=\"my-multi-authors-label screen-reader-text\"><?php _e( 'Define an additional author', 'my-multi-author' ); ?></label>\n\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\twp_dropdown_users( array(\n\t\t\t\t\t\t\t'id' => 'my-multi-authors-autocomplete' . $author_index,\n\t\t\t\t\t\t\t'class' => 'my-multi-authors-autocomplete',\n\t\t\t\t\t\t\t'name' => 'my_multi_authors[]',\n\t\t\t\t\t\t\t'selected' => $selected,\n\t\t\t\t\t\t\t'include_selected' => true,\n\t\t\t\t\t\t\t'show' => 'display_name_with_login',\n\t\t\t\t\t\t\t'show_option_none' => __( 'Select an author', 'my-multi-author' ),\n\t\t\t\t\t\t\t'orderby' => 'display_name',\n\t\t\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\n\t\t\t\t$author_index++;\n\n\t\t\t} while ( $author_index < count( $existing_my_multi_authors ) );\n\n\t\t\t?>\n\t\t</div>\n\t\t<div id=\"my-multi-authors-add-author\" class=\"button\"><?php _e( 'Add author', 'my-multi-author' ); ?></div>\n\t\t<?php\n\t}",
"public function showAdd() {\n\n $viewName = $this->viewFolder . '.addAuthor';\n\n return view($viewName);\n }",
"function get_the_cap_author_facebook_ids() {\n global $post;\n $facebook_ids = array();\n\n $authors = get_cap_authors( $post->ID, true, true, true );\n if ( ! empty( $authors ) && is_array( $authors ) ) {\n foreach ( $authors as $author ) {\n $data = get_term_by( 'slug', $author, 'person', 'ARRAY_A' );\n $id = $data['term_id'];\n $facebook_id = get_field( 'person_facebook_id', 'person_' . $id );\n if ( ! empty( $facebook_id ) ) {\n $facebook_ids[] = esc_attr( $facebook_id );\n }\n }\n }\n\n return $facebook_ids;\n}",
"protected function setAuthors($json, $authors)\n {\n $json['authors'] = [];\n foreach ($authors as $author) {\n list($name, $email) = \\explode(' <', $author);\n\n $config = [\n 'name' => \\trim($name),\n 'email' => \\trim(\\substr($email, 0, -1))\n ];\n\n if ($this->config->hasMetadata($author, 'homepage')) {\n $config['homepage'] = $this->config->getMetadata($author, 'homepage');\n }\n\n $config['role'] = $this->config->getMetadata($author, 'role') ?: 'Developer';\n\n $json['authors'][] = $config;\n }\n\n return $json;\n }",
"static function add_aliases(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::aliases, [\r\n\t\t\t'label' => 'Aliases',\r\n\t\t\t'type' => 'repeater',\r\n\t\t\t'instructions' => '',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '50',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'collapsed' => '',\r\n\t\t\t'min' => '',\r\n\t\t\t'max' => '',\r\n\t\t\t'layout' => 'row',\r\n\t\t\t'button_label' => 'Add alias'\r\n\t\t]);\r\n\t}",
"final public function addAdmin() {\n $eventclass = $this->event;\n $admin_data = $eventclass::getAdminData();\n\n if ($admin_data) {\n if (!isset($admin_data['usertype'])) {\n $admin_data['usertype'] = self::getDefaultUserType();\n }\n $this->addToRecipientsList($admin_data);\n }\n }",
"function vns_subscribe_order_add_access_capabilities() {\n $roles = array( 'administrator','editor' );\n foreach ( $roles as $role ) {\n \n $role = get_role( $role );\n if ( empty( $role ) ) {\n continue;\n }\n \n \n \n \n if(!$role->has_cap( 'vns_subscribe_order_view_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_view_news' );\n }\n \n if(!$role->has_cap( 'vns_subscribe_order_add_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_add_news' );\n }\n \n if(!$role->has_cap( 'vns_subscribe_order_edit_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_edit_news' );\n }\n \n if(!$role->has_cap( 'vns_subscribe_order_delete_news' ) ){\n \n $role->add_cap( 'vns_subscribe_order_delete_news' );\n }\n \n \n \n }\n \n $user = wp_get_current_user();\n $user->get_role_caps();\n \n}",
"public function hookDefineAcl($args)\n {\n $args['acl']->addResource('ZoteroImport_Index');\n }",
"public function customAccess() {\r\n $url = Url::fromUri('internal:/examples/menu-example/custom-access/page');\r\n $link = Link::fromTextAndUrl($this->t('examples/menu-example/custom-access/page'), $url)->toString();\r\n return [\r\n '#markup' => $this->t('A menu item that requires the user to posess a role of \"authenticated\" is at @link', ['@link' => $link]),\r\n ];\r\n }",
"public function add()\n {\n if (!current_user_can('manage_options')) {\n wp_die($this->translator->get('You do not have sufficient permissions to access this page.', true));\n }\n }",
"public function getAuthor();",
"public function getAuthor();",
"public function getAuthor();"
]
| [
"0.6031752",
"0.5996555",
"0.5794737",
"0.53325146",
"0.5305421",
"0.5296226",
"0.5288072",
"0.5244163",
"0.52182245",
"0.5079969",
"0.50637084",
"0.5062864",
"0.5055652",
"0.5050236",
"0.5043012",
"0.49925515",
"0.49918917",
"0.49696502",
"0.49278456",
"0.49217242",
"0.48708752",
"0.48608583",
"0.484816",
"0.4843519",
"0.48225757",
"0.4821766",
"0.48136625",
"0.4806881",
"0.48003295",
"0.4794259",
"0.47925544",
"0.4784866",
"0.47750255",
"0.477356",
"0.47686848",
"0.47585997",
"0.4757331",
"0.47342926",
"0.4728995",
"0.47090614",
"0.46948397",
"0.469304",
"0.46813408",
"0.46628892",
"0.4652204",
"0.4652124",
"0.464909",
"0.46444237",
"0.4643748",
"0.46429294",
"0.46378246",
"0.46370968",
"0.4633797",
"0.46274957",
"0.46234488",
"0.46181157",
"0.46061394",
"0.45874837",
"0.45837283",
"0.45788336",
"0.45663726",
"0.45632055",
"0.4559241",
"0.4559241",
"0.45587668",
"0.4556459",
"0.45557275",
"0.4550985",
"0.45500734",
"0.45491517",
"0.45409808",
"0.45409808",
"0.4537575",
"0.4531743",
"0.4519535",
"0.4518702",
"0.45185724",
"0.45150056",
"0.45144424",
"0.4506649",
"0.44933504",
"0.44866",
"0.44844693",
"0.44831222",
"0.44829875",
"0.44827226",
"0.44806287",
"0.44806",
"0.4477328",
"0.44756332",
"0.4473732",
"0.447116",
"0.4469364",
"0.44684577",
"0.44648933",
"0.44594654",
"0.44527936",
"0.44526044",
"0.44526044",
"0.44526044"
]
| 0.58987355 | 2 |
Get mssg value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getMssg()
{
return isset($this->mssg) ? $this->mssg : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPropertyValue() {\n\t\t$propertyValue = parent::getPropertyValue();\n\t\tif ($propertyValue === NULL)\n\t\t\treturn FALSE;\n\t\treturn $propertyValue;\n\t}",
"protected function getPropertyValue() {}",
"public function getValue()\n {\n if (array_key_exists(\"value\", $this->_propDict)) {\n return $this->_propDict[\"value\"];\n } else {\n return null;\n }\n }",
"public function getValue()\n {\n if (array_key_exists(\"value\", $this->_propDict)) {\n return $this->_propDict[\"value\"];\n } else {\n return null;\n }\n }",
"public function hasValue()\n {\n return $this->property_value->isNotEmpty();\n }",
"public function getValue()\n {\n return isset($this->value) ? $this->value : null;\n }",
"public function getValue()\n\t{\n\t\treturn null;\n\t}",
"public function value()\r\n\t{\r\n\t\tif ($this->isFetched() && $this->isValid())\r\n\t\t{\r\n\t\t\treturn $this->normalizedValue;\r\n\t\t}\t\r\n\t\treturn null;\r\n\t}",
"public function getProperty(): ?string;",
"public function __get($name){\n\t\treturn ( !empty($this->properties[$name]) ? $this->properties[$name] : null );\n\t}",
"public function getValue()\n {\n return null;\n }",
"function __get($value) {\n return false;\n }",
"public function getPropertyValue()\n\t{\n\t\t$property = $this->property;\n\t\treturn (isset($this->object) && ($property instanceof Reflection\\Reflection_Property))\n\t\t\t? $property->getValue($this->object)\n\t\t\t: null;\n\t}",
"protected function getPropertyValue(/**\n * If a confirmation page is set and a fileupload was done before\n * there is no incoming data if the process action is called.\n * The data is only in the session at this time.\n * This results in a negative validation (if a validation is set).\n * Therefore, look first in the session.\n */\n\\TYPO3\\CMS\\Form\\Domain\\Model\\ValidationElement $validationElement, /**\n * If a confirmation page is set and a fileupload was done before\n * there is no incoming data if the process action is called.\n * The data is only in the session at this time.\n * This results in a negative validation (if a validation is set).\n * Therefore, look first in the session.\n */\n$propertyName) {}",
"public function get()\n {\n \n return $this->value;\n \n }",
"public function get()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getSettingValue()\n {\n if (array_key_exists(\"settingValue\", $this->_propDict)) {\n return $this->_propDict[\"settingValue\"];\n } else {\n return null;\n }\n }",
"function get_prop_value($prop_name)\n{\n\treturn (empty($prop_name)) ? DEFAULT_MISSING_PROP : $prop_name;\n}",
"public function getProperty(): ?string {\n $val = $this->getBackingStore()->get('property');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'property'\");\n }",
"public function hasValue()\n {\n return $this->Value !== null ? true : false;\n }",
"public function get()\n {\n return $this->value;\n }",
"public function get()\n {\n return $this->value;\n }",
"public function get()\n {\n return $this->value;\n }",
"public function get()\n {\n return $this->value;\n }",
"function getValue() {\n\t\treturn $this->sValue;\n\t}",
"public function value() { return $this->_m_value; }",
"public function getValue()\n {\n return isset($this->value) ? $this->value : '';\n }",
"public function getValue()\n {\n return isset($this->value) ? $this->value : '';\n }",
"public function get_value()\n {\n }",
"public function get_value()\n {\n }",
"public function get_value()\n {\n return $this->value;\n }",
"public function getValidDefaultValue(): mixed;",
"public function get_value() {\n\t\treturn $this->_value;\n\t}",
"function __get($property)\n {\n return $this->value;\n }",
"function getValue(){\r\n\t\treturn $this->value;\r\n\t}",
"public function checkValue()\r\n\t{\r\n\t\treturn $this->_v('checkValue', 'xsdfsdfdsfdsfsf');\r\n\t}",
"public function get($s){\n if(property_exists($this,$s)){\n return $this->$s;\n }else{\n return 'no such value';\n }\n }",
"public function getValue(){\n return $this->_value;\n }",
"public function get()\n {\n $this->set();\n \n return $this->value;\n }",
"public function get_value()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getValue(): mixed\n {\n return $this->field?->getValue();\n }",
"public function get_value() {\n return $this->value;\n }",
"public function getValue(){\n \treturn $this->value;\n }",
"public function __get($propertyName)\r\n\t{\r\n\t\t$value = $this->getOption($propertyName);\r\n\r\n\t\tif (is_null($value))\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\treturn parent::__get($propertyName);\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e)\r\n\t\t\t{\r\n\t\t\t\t/**\r\n\t\t\t\t * This is temporary for testing. In the future we'll\r\n\t\t\t\t * catch the exceptions and just return null.\r\n\t\t\t\t */\r\n//\t\t\t\techo \"CONFIG ERROR: Unknown Property '$propertyName'\\n\";\r\n//\t\t\t\techo \"CONFIG ERROR: {$e->getMessage()} \\n\";\r\n//\t\t\t\techo $e->getTraceAsString();\r\n\t\t\t\treturn NULL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $value;\r\n\t\t}\r\n\t}",
"public function getProperty();",
"public function getValue(): ?string;",
"function getDefaultValue() {\n return $this->getProperty('default_value');\n }",
"public function value(): ?string;",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"public function GetValue() {\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n {\n\treturn $this->value;\n }",
"public function textPropertyVal()\n {\n return $this->textPropertyVal;\n }",
"public function getValue()\n {\n if (!$this->isExplicitlySet) {\n return $this->defaultValue;\n } else {\n return $this->value;\n }\n }",
"public function hasNullValue(){\n return $this->_has(1);\n }",
"public function getValue() {\n\t\treturn $this -> value;\n\t}",
"public function getValue(): mixed\n {\n return $this->value;\n }",
"public function __get( $property ) {\n\t\tif (!isset($this->$property) || $this->$property==\"\") {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->$property;\n\t}",
"public function getValue(){\n return $this->value;\n }",
"public function getValue(){\n return $this->value;\n }",
"public function __get($value);",
"function getValue() {\n return $this->value;\n }",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getCleanValue()\n {\n return null;\n }",
"public function __get($name)\r\n\t{\r\n\t\treturn array_key_exists($name, $this->Properties) ? $this->Properties[$name] : null;\r\n\t}",
"protected function obtainValue($value) {\n return (strlen($value) > 0) ? $value : null; // if it is empty\n }",
"public function __get ( $property ) {\n return isset( $this->{$property} ) ? $this->{$property} : NULL;\n }",
"public function __get($name)\n {\n if (array_key_exists($name, $this->_properties)) {\n return $this->_properties[$name];\n }\n return false;\n }",
"public function getValue(): mixed;",
"public function getValue(): mixed;",
"public function __get( $property ) {\n\t\t\tif ( property_exists( $this, $property ) ) {\n\t\t\t\treturn $this->$property;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t$this->slplus->database->has_extended_data() &&\n\t\t\t\tisset( $this->exdata[ $property ] )\n\t\t\t) {\n\t\t\t\treturn $this->exdata[ $property ];\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->temporary[ $property ] ) ) {\n\t\t\t\treturn $this->temporary[ $property ];\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}",
"public function getValue()\n {\n return $this->_value;\n }",
"public function getValue()\n {\n return $this->_value;\n }",
"public function getValue()\n {\n return $this->_value;\n }",
"public function get($Properity_Name = '')\n {\n\tif (isset($this->_Properties[$Properity_Name]['value']))\n\t{\n\t return $this->_Properties[$Properity_Name]['value'];\n\t}\n\telse\n\t{\n\t return null;\n\t}\n }",
"function get($property) {\n if (!empty($this->{$property})) {\n return $this->{$property};\n }\n else {\n return false;\n }\n }",
"public function getValue()\n {\n\t\treturn $this->value;\n\t}",
"public function __get($property) {\n\t\t$returnValue = NULL;\n\n\t\tif (array_key_exists($property, $this->_valueArray)) {\n\t\t\t$returnValue = $this->_valueArray[$property];\n\t\t} else\n\t\tif (array_key_exists($property, $this->_allowedColumns)) {\n\t\t\t$returnValue = NULL;\n\t\t} else {\n\t\t\tthrow new L8M_Exception('Property does not exist: ' . $property);\n\t\t}\n\n\t\treturn $returnValue;\n\t}",
"protected function getValue() {\r\n return $this->_value;\r\n }",
"public function getValue()\r\n {\r\n return $this->value;\r\n }",
"public function getMixed(): ?bool\n {\n return $this->mixedAttr;\n }",
"public function getMixed(): ?bool\n {\n return $this->mixedAttr;\n }",
"public function __get($name)\n\t{\n\t\treturn (isset($this->properties[$name])) ? $this->properties[$name] : null;\n\t}",
"public function __get($name)\n\t{\n\t\treturn isset($this->values[$name]) ? $this->values[$name] : null;\n\t}",
"public function getValue()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'value'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'value'];\n\t\t}\n\n\t\treturn '';\n\t}",
"public function __get($key)\n {\n // First, check if its in the properties index.\n // This is so we can override the global setting.\n if ($meta = $this->getMeta($key)) {\n return $meta->value;\n }\n $meta = $this->getGlobal($key);\n return $meta ? $meta->value : null;\n\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->_value;\n }",
"public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}"
]
| [
"0.66500866",
"0.6335093",
"0.6078155",
"0.6078155",
"0.5838239",
"0.5802643",
"0.5750298",
"0.5702968",
"0.5702557",
"0.5662298",
"0.5660233",
"0.5612713",
"0.5601152",
"0.5597498",
"0.5575667",
"0.5574532",
"0.5570968",
"0.5561654",
"0.55206823",
"0.55153906",
"0.5497961",
"0.5497961",
"0.5497961",
"0.5497961",
"0.548573",
"0.54499793",
"0.54481137",
"0.54481137",
"0.5432488",
"0.5432488",
"0.54249597",
"0.54172045",
"0.5412356",
"0.5411367",
"0.5408417",
"0.5407558",
"0.5405674",
"0.54050046",
"0.5403759",
"0.5391325",
"0.53805614",
"0.53783166",
"0.5372942",
"0.53643453",
"0.5358131",
"0.5358111",
"0.53517264",
"0.5351604",
"0.534466",
"0.534466",
"0.5326552",
"0.5321821",
"0.5308603",
"0.5306941",
"0.5297275",
"0.5287536",
"0.52848274",
"0.52825564",
"0.52755296",
"0.52755296",
"0.52644575",
"0.5260328",
"0.5258734",
"0.5258734",
"0.52584213",
"0.525751",
"0.5252814",
"0.5248762",
"0.5242289",
"0.52393854",
"0.52393854",
"0.5231771",
"0.52202785",
"0.52202785",
"0.52202785",
"0.5219219",
"0.52175534",
"0.5215056",
"0.51928884",
"0.5187581",
"0.51872",
"0.51862186",
"0.51862186",
"0.5185049",
"0.51845104",
"0.51774424",
"0.51769054",
"0.51764774",
"0.51764774",
"0.51764774",
"0.51710755",
"0.5159296",
"0.51476914",
"0.51476914",
"0.51476914",
"0.51476914",
"0.51476914",
"0.51476914",
"0.51476914",
"0.51476914"
]
| 0.58572584 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.